[ossim] 12/25: Imported Upstream version 1.8.16

Francesco Lovergine frankie at moszumanska.debian.org
Wed Mar 5 13:54:30 UTC 2014


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

frankie pushed a commit to branch master
in repository ossim.

commit 4a56037588c9cc1108c4b860771e41d6bc04e882
Author: Francesco Paolo Lovergine <frankie at debian.org>
Date:   Tue Mar 4 16:46:11 2014 +0100

    Imported Upstream version 1.8.16
---
 CMakeLists.txt                                     |  179 +-
 Doxyfile                                           |   96 +-
 etc/templates/applanix_ecef.geom                   |   80 +
 etc/templates/applanix_utm.geom                    |   88 +
 etc/templates/geographic_projection_template.geom  |   10 +-
 etc/templates/nitf-site-configuration.kwl          |  329 +
 etc/templates/orthoigen3.kwl                       |   10 +-
 etc/templates/orthoigen4.kwl                       |   10 +-
 etc/templates/ossim-batch-test-template.kwl        |  188 +
 etc/templates/ossim_preferences_template           |   98 +-
 include/ossim/base/ossimAdjSolutionAttributes.h    |   87 +
 include/ossim/base/ossimAdjustmentExecutive.h      |  180 +
 include/ossim/base/ossimApplicationUsage.h         |    5 +-
 include/ossim/base/ossimArgumentParser.h           |   12 +-
 include/ossim/base/ossimByteStreamBuffer.h         |   66 +
 include/ossim/base/ossimCallback1.h                |   81 +
 include/ossim/base/ossimCallback1wRet.h            |   81 +
 include/ossim/base/ossimCallback2wRet.h            |   82 +
 include/ossim/base/ossimColumnVector3d.h           |   24 +-
 include/ossim/base/ossimCommon.h                   |   93 +-
 include/ossim/base/ossimConnectableContainer.h     |  102 +-
 include/ossim/base/ossimConnectableObject.h        |  312 +-
 .../ossim/base/ossimConnectableObjectListener.h    |   39 +-
 include/ossim/base/ossimConstants.h                |  123 +-
 include/ossim/base/ossimContainerEvent.h           |   18 +-
 include/ossim/base/ossimContainerProperty.h        |    4 +-
 include/ossim/base/ossimCsvFile.h                  |    2 +-
 include/ossim/base/ossimDataObject.h               |    4 +-
 include/ossim/base/ossimDate.h                     |    4 +-
 include/ossim/base/ossimDatum.h                    |   38 +-
 include/ossim/base/ossimDatumFactory.h             |   12 +-
 include/ossim/base/ossimDatumFactoryInterface.h    |    1 +
 include/ossim/base/ossimDblGrid.h                  |   13 +-
 include/ossim/base/ossimDms.h                      |    6 +-
 include/ossim/base/ossimDpt.h                      |    4 +-
 include/ossim/base/ossimDrect.h                    |   70 +-
 include/ossim/base/ossimEcefPoint.h                |   28 +-
 include/ossim/base/ossimEcefVector.h               |   16 +-
 include/ossim/base/ossimEllipsoid.h                |   34 +-
 include/ossim/base/ossimEllipsoidFactory.h         |   13 +-
 include/ossim/base/ossimEndian.h                   |   51 +-
 include/ossim/base/ossimEpsgDatumFactory.h         |    9 +-
 include/ossim/base/ossimErrorStatusInterface.h     |    5 +-
 include/ossim/base/ossimFactoryListInterface.h     |    7 +-
 include/ossim/base/ossimFilename.h                 |   27 +-
 include/ossim/base/ossimGeodeticEvaluator.h        |   75 +
 include/ossim/base/ossimGeoid.h                    |    2 +-
 include/ossim/base/ossimGpt.h                      |   29 +-
 include/ossim/base/ossimGrect.h                    |   50 +-
 include/ossim/base/ossimGzStream.h                 |    2 +-
 include/ossim/base/ossimHistogram.h                |    9 +-
 include/ossim/base/ossimHttpRequest.h              |   58 +
 include/ossim/base/ossimHttpResponse.h             |   81 +
 include/ossim/base/ossimId.h                       |    6 +-
 include/ossim/base/ossimIpt.h                      |    3 +-
 include/ossim/base/ossimIrect.h                    |   36 +-
 include/ossim/base/ossimKeywordlist.h              |  111 +-
 include/ossim/base/ossimLagrangeInterpolator.h     |   46 +
 include/ossim/base/ossimLookUpTable.h              |    6 +-
 include/ossim/base/ossimLsrPoint.h                 |   14 +-
 include/ossim/base/ossimMatrix4x4.h                |   33 +-
 include/ossim/base/ossimNBandLutDataObject.h       |   28 +-
 include/ossim/base/ossimNadconGridDatum.h          |    2 +
 include/ossim/base/ossimNadconNarDatum.h           |    2 +-
 include/ossim/base/ossimNadconNasDatum.h           |    2 +-
 include/ossim/base/ossimNotify.h                   |   15 +-
 include/ossim/base/ossimObject.h                   |    7 +-
 include/ossim/base/ossimObservationSet.h           |   98 +
 include/ossim/base/ossimPointObservation.h         |  152 +
 include/ossim/base/ossimPolynom.h                  |   84 +
 include/ossim/base/ossimPreferences.h              |    3 +-
 include/ossim/base/ossimProperty.h                 |   16 +-
 include/ossim/base/ossimRectilinearDataObject.h    |    5 +-
 include/ossim/base/ossimRefreshEvent.h             |   66 +-
 include/ossim/base/ossimSevenParamDatum.h          |    5 +-
 include/ossim/base/ossimString.h                   |  724 ++-
 include/ossim/base/ossimThinPlateSpline.h          |    1 -
 include/ossim/base/ossimThreeParamDatum.h          |    6 +-
 include/ossim/base/ossimUrl.h                      |   42 +
 include/ossim/base/ossimVisitor.h                  |  147 +-
 include/ossim/base/ossimWLSBundleSolution.h        |   53 +
 include/ossim/base/ossimWebRequest.h               |   26 +
 include/ossim/base/ossimWebRequestFactoryBase.h    |   19 +
 .../ossim/base/ossimWebRequestFactoryRegistry.h    |   49 +
 include/ossim/base/ossimWebResponse.h              |   27 +
 include/ossim/base/ossimWgs72Datum.h               |    2 +-
 include/ossim/base/ossimWgs84Datum.h               |    5 +-
 include/ossim/base/ossimXmlDocument.h              |   17 +-
 include/ossim/base/ossimXmlString.h                |    6 +-
 .../ossim/elevation/ossimDtedElevationDatabase.h   |   56 +-
 include/ossim/elevation/ossimDtedHandler.h         |   62 +-
 include/ossim/elevation/ossimElevCellHandler.h     |    7 +-
 include/ossim/elevation/ossimElevManager.h         |   32 +-
 include/ossim/elevation/ossimElevSource.h          |   16 +-
 .../ossim/elevation/ossimElevationAccuracyInfo.h   |   61 +
 include/ossim/elevation/ossimElevationDatabase.h   |  271 +-
 .../elevation/ossimElevationDatabaseRegistry.h     |    7 +-
 .../ossimGeneralRasterElevationDatabase.h          |   26 +-
 include/ossim/elevation/ossimHgtRef.h              |   12 +-
 .../ossim/elevation/ossimImageElevationDatabase.h  |  208 +
 .../ossim/elevation/ossimImageElevationHandler.h   |  129 +
 .../ossim/elevation/ossimSrtmElevationDatabase.h   |   16 +-
 .../ossim/elevation/ossimTiledElevationDatabase.h  |  213 +
 include/ossim/font/ossimFreeTypeFont.h             |    4 +-
 include/ossim/imaging/ossimAppFixedTileCache.h     |    5 +-
 include/ossim/imaging/ossimBandSelector.h          |   59 +-
 include/ossim/imaging/ossimBandSeparateHandler.h   |   97 +
 include/ossim/imaging/ossimBitMaskTileSource.h     |  133 +
 include/ossim/imaging/ossimBitMaskWriter.h         |  133 +
 include/ossim/imaging/ossimCacheTileSource.h       |   14 +-
 .../ossim/imaging/ossimClosestToCenterCombiner.h   |    4 +-
 include/ossim/imaging/ossimConvolutionSource.h     |    4 +-
 include/ossim/imaging/ossimDespeckleFilter.h       |   48 +
 .../ossim/imaging/ossimDtedElevationImageSource.h  |  226 -
 include/ossim/imaging/ossimEnviTileSource.h        |  101 +
 include/ossim/imaging/ossimGeneralRasterInfo.h     |  358 +-
 .../ossim/imaging/ossimGeneralRasterTileSource.h   |   77 +-
 include/ossim/imaging/ossimGeneralRasterWriter.h   |   48 +-
 .../ossim/imaging/ossimGeoAnnotationPolyObject.h   |   15 +-
 include/ossim/imaging/ossimGeoPolyCutter.h         |    3 +-
 include/ossim/imaging/ossimHistogramRemapper.h     |   17 +-
 include/ossim/imaging/ossimHsiRemapper.h           |   10 +-
 include/ossim/imaging/ossimImageCacheBase.h        |  337 ++
 include/ossim/imaging/ossimImageCacheTileSource.h  |  153 +
 include/ossim/imaging/ossimImageChain.h            |  108 +-
 include/ossim/imaging/ossimImageData.h             |  100 +-
 include/ossim/imaging/ossimImageFileWriter.h       |   18 +-
 include/ossim/imaging/ossimImageGeometry.h         |  184 +-
 include/ossim/imaging/ossimImageGeometryRegistry.h |   15 +-
 include/ossim/imaging/ossimImageHandler.h          |  162 +-
 include/ossim/imaging/ossimImageHandlerFactory.h   |   25 +-
 .../ossim/imaging/ossimImageHandlerFactoryBase.h   |   25 +-
 include/ossim/imaging/ossimImageHandlerRegistry.h  |   83 +-
 include/ossim/imaging/ossimImageMetaData.h         |   88 +-
 include/ossim/imaging/ossimImageRenderer.h         |   60 +-
 include/ossim/imaging/ossimImageSource.h           |   68 +-
 include/ossim/imaging/ossimImageSourceSequencer.h  |   18 +-
 .../ossim/imaging/ossimImageToPlaneNormalFilter.h  |    6 +-
 .../imaging/ossimImageWriterFactoryRegistry.h      |   25 +-
 include/ossim/imaging/ossimJpegMemDest.h           |   36 +
 include/ossim/imaging/ossimJpegTileSource.h        |   17 +-
 include/ossim/imaging/ossimMaskFilter.h            |  141 +-
 include/ossim/imaging/ossimMaskTileSource.h        |  157 -
 include/ossim/imaging/ossimMaskedImageHandler.h    |  179 -
 include/ossim/imaging/ossimMemoryImageSource.h     |    8 +-
 include/ossim/imaging/ossimNitfTileSource.h        |   35 +-
 include/ossim/imaging/ossimNitfWriterBase.h        |   32 +-
 include/ossim/imaging/ossimOverviewBuilderBase.h   |   88 +-
 .../imaging/ossimOverviewBuilderFactoryRegistry.h  |   27 +-
 include/ossim/imaging/ossimOverviewSequencer.h     |   94 +-
 include/ossim/imaging/ossimPdfWriter.h             |  554 ++
 include/ossim/imaging/ossimPixelFlipper.h          |  192 +-
 include/ossim/imaging/ossimPolyCutter.h            |    7 +-
 include/ossim/imaging/ossimQbTileFilesHandler.h    |  135 +-
 include/ossim/imaging/ossimRgbToGreyFilter.h       |    4 +-
 include/ossim/imaging/ossimSFIMFusion.h            |    3 +-
 include/ossim/imaging/ossimSingleImageChain.h      |   60 +-
 include/ossim/imaging/ossimSubImageTileSource.h    |    4 +-
 include/ossim/imaging/ossimTiffOverviewBuilder.h   |   40 +-
 include/ossim/imaging/ossimTiffTileSource.h        |   74 +-
 include/ossim/imaging/ossimTiffWriter.h            |    3 +-
 ...TileFilesHandler.h => ossimTiledImageHandler.h} |   77 +-
 include/ossim/imaging/ossimTiling.h                |    8 +-
 include/ossim/imaging/ossimTilingPoly.h            |   96 +
 include/ossim/imaging/ossimTilingRect.h            |   67 +
 include/ossim/imaging/ossimTwoColorView.h          |   75 +-
 include/ossim/imaging/ossimUsgsDemTileSource.h     |    7 +-
 .../ossim/imaging/ossimVpfAnnotationFeatureInfo.h  |    4 +-
 include/ossim/init/ossimInit.h                     |   23 +-
 include/ossim/kbool/graph.h                        |    2 +-
 include/ossim/kbool/graphlst.h                     |    2 +-
 include/ossim/kbool/lpoint.h                       |    2 +-
 include/ossim/parallel/ossimIgen.h                 |    7 +-
 include/ossim/parallel/ossimImageChainMtAdaptor.h  |  122 +
 .../ossim/parallel/ossimImageHandlerMtAdaptor.h    |  101 +
 include/ossim/parallel/ossimJob.h                  |  266 +
 include/ossim/parallel/ossimJobMultiThreadQueue.h  |   27 +
 include/ossim/parallel/ossimJobQueue.h             |   58 +
 include/ossim/parallel/ossimJobThreadQueue.h       |   48 +
 include/ossim/parallel/ossimMtDebug.h              |   44 +
 include/ossim/parallel/ossimMultiThreadSequencer.h |  142 +
 include/ossim/parallel/ossimOrthoIgen.h            |   72 +-
 include/ossim/plugin/ossimDynamicLibrary.h         |   21 +-
 include/ossim/plugin/ossimPluginLibrary.h          |    6 +-
 include/ossim/projection/ossimAlphaSensor.h        |   97 +
 include/ossim/projection/ossimAlphaSensorHRI.h     |   50 +
 include/ossim/projection/ossimAlphaSensorHSI.h     |   52 +
 include/ossim/projection/ossimApplanixEcefModel.h  |   13 +-
 include/ossim/projection/ossimBuckeyeSensor.h      |  276 +-
 .../ossim/projection/ossimEpsgProjectionDatabase.h |   59 +-
 .../ossim/projection/ossimEquDistCylProjection.h   |   22 +-
 include/ossim/projection/ossimIkonosRpcModel.h     |    2 +-
 .../projection/ossimImageViewAffineTransform.h     |   11 +-
 .../projection/ossimImageViewProjectionTransform.h |   17 +-
 include/ossim/projection/ossimIpodSensor.h         |  110 +
 include/ossim/projection/ossimLlxyProjection.h     |    8 +-
 include/ossim/projection/ossimMapProjection.h      |   36 +-
 include/ossim/projection/ossimMgrs.h               |    6 +-
 include/ossim/projection/ossimPpjFrameSensor.h     |   76 +
 include/ossim/projection/ossimProjection.h         |    7 +-
 include/ossim/projection/ossimQuickbirdRpcModel.h  |    2 +-
 include/ossim/projection/ossimRS1SarModel.h        |  156 +
 include/ossim/projection/ossimSensorModel.h        |   11 +-
 include/ossim/projection/ossimSensorModelTuple.h   |    3 +-
 include/ossim/projection/ossimSonomaSensor.h       |    1 +
 .../ossimSpaceObliqueMercatorProjection.h          |    4 +-
 include/ossim/projection/ossimUtm.h                |   10 +-
 .../ossim/projection/ossimWktProjectionFactory.h   |   71 +
 .../support_data/ossimAlphaSensorSupportData.h     |   89 +
 include/ossim/support_data/ossimApplanixEOFile.h   |   15 +-
 include/ossim/support_data/ossimAuxFileHandler.h   |  453 +-
 include/ossim/support_data/ossimCeosData.h         | 1054 ++++
 include/ossim/support_data/ossimDoqq.h             |   42 +-
 include/ossim/support_data/ossimEnviHeader.h       |  143 +-
 include/ossim/support_data/ossimEnviInfo.h         |   54 +
 include/ossim/support_data/ossimFgdcTxtDoc.h       |  129 +
 include/ossim/support_data/ossimGeoTiff.h          |   15 +-
 include/ossim/support_data/ossimInfoFactory.h      |    5 +-
 .../ossim/support_data/ossimInfoFactoryInterface.h |   35 +-
 .../ossim/support_data/ossimInfoFactoryRegistry.h  |   19 +-
 include/ossim/support_data/ossimJp2Info.h          |   63 +
 include/ossim/support_data/ossimJpipMessage.h      |   36 +
 .../ossim/support_data/ossimJpipMessageDecoder.h   |   51 +
 .../ossim/support_data/ossimJpipMessageHeader.h    |  234 +
 include/ossim/support_data/ossimNitfAcftbTag.h     |    9 -
 include/ossim/support_data/ossimNitfAimidbTag.h    |   11 +-
 include/ossim/support_data/ossimNitfBlockaTag.h    |   10 +-
 include/ossim/support_data/ossimNitfCsccgaTag.h    |  145 +
 include/ossim/support_data/ossimNitfCscrnaTag.h    |   11 +-
 include/ossim/support_data/ossimNitfCsdidaTag.h    |   11 +-
 include/ossim/support_data/ossimNitfCsexraTag.h    |   11 +-
 include/ossim/support_data/ossimNitfCsproaTag.h    |   49 +
 .../ossim/support_data/ossimNitfEmbeddedRpfDes.h   |   11 +-
 include/ossim/support_data/ossimNitfEngrdaTag.h    |   11 +-
 include/ossim/support_data/ossimNitfExoptaTag.h    |  174 +
 include/ossim/support_data/ossimNitfFile.h         |    4 +-
 .../ossim/support_data/ossimNitfFileHeaderV2_1.h   |   23 +-
 .../ossim/support_data/ossimNitfFileHeaderV2_X.h   |   18 +-
 .../support_data/ossimNitfGeoPositioningTag.h      |    8 +-
 include/ossim/support_data/ossimNitfHistoaTag.h    |  713 +++
 include/ossim/support_data/ossimNitfIchipbTag.h    |   10 +-
 .../ossim/support_data/ossimNitfImageHeaderV2_1.h  |   16 +-
 .../ossim/support_data/ossimNitfImageHeaderV2_X.h  |   25 +
 include/ossim/support_data/ossimNitfJ2klraTag.h    |    3 -
 .../support_data/ossimNitfLocalCartographicTag.h   |    4 +-
 .../support_data/ossimNitfLocalGeographicTag.h     |    5 +-
 include/ossim/support_data/ossimNitfMstgtaTag.h    |   11 +-
 include/ossim/support_data/ossimNitfPiaimcTag.h    |    8 +-
 .../support_data/ossimNitfProjectionParameterTag.h |    4 +-
 .../ossim/support_data/ossimNitfRegisteredTag.h    |   67 +-
 include/ossim/support_data/ossimNitfRpcATag.h      |    7 +-
 include/ossim/support_data/ossimNitfRpcBTag.h      |    7 +-
 include/ossim/support_data/ossimNitfRpcBase.h      |    7 +-
 include/ossim/support_data/ossimNitfSensraTag.h    |    6 +-
 include/ossim/support_data/ossimNitfStdidcTag.h    |    8 +-
 include/ossim/support_data/ossimNitfUnknownTag.h   |   32 +-
 include/ossim/support_data/ossimNitfUse00aTag.h    |    6 +-
 include/ossim/support_data/ossimNmeaMessage.h      |   86 +
 .../ossim/support_data/ossimNmeaMessageSequencer.h |   27 +
 .../ossim/support_data/ossimPpjFrameSensorFile.h   |   68 +
 .../ossim/support_data/ossimQuickbirdMetaData.h    |   39 +-
 include/ossim/support_data/ossimQuickbirdTile.h    |    6 +-
 .../ossim/support_data/ossimRpfComponentIdLut.h    |   51 +
 include/ossim/support_data/ossimRpfFrame.h         |   21 +-
 include/ossim/support_data/ossimRpfHeader.h        |   12 +-
 .../support_data/ossimRpfReplaceUpdateRecord.h     |  117 +
 .../ossimRpfReplaceUpdateSectionSubheader.h        |  101 +
 .../support_data/ossimRpfReplaceUpdateTable.h      |   68 +
 include/ossim/support_data/ossimRpfTocEntry.h      |   11 +-
 include/ossim/support_data/ossimSrcRecord.h        |   21 +-
 include/ossim/support_data/ossimTiffInfo.h         |  198 +-
 include/ossim/support_data/ossimWavelength.h       |  106 +
 include/ossim/support_data/ossimXmpInfo.h          |  120 +
 include/ossim/util/ossimBatchTest.h                |  150 +
 .../util/{ossimElevUtil.h => ossimChipperUtil.h}   |  246 +-
 include/ossim/util/ossimFileWalker.h               |  227 +
 include/ossim/util/ossimImageUtil.h                |  399 ++
 include/ossim/util/ossimInfo.h                     |  239 +-
 include/ossim/vec/ossimVpfFeatureClassSchema.h     |    4 +-
 include/ossim/video/ossimVideoGeometry.h           |   72 +
 include/ossim/video/ossimVideoHandler.h            |   87 +
 include/ossim/video/ossimVideoImageHandler.h       |   77 +
 include/ossim/video/ossimVideoImageSource.h        |   78 +
 include/ossim/video/ossimVideoSource.h             |  102 +
 include/ossim/vpfutil/vpfdisp.h                    |    2 +-
 include/ossim/vpfutil/vpfdraw.h                    |   18 +-
 include/ossim/vpfutil/vpfio.h                      |   10 +-
 include/ossim/vpfutil/vpfprim.h                    |   60 +-
 include/ossim/vpfutil/vpfrelat.h                   |    6 +-
 include/ossim/vpfutil/vpftable.h                   |   66 +-
 include/ossim/vpfutil/vpftidx.h                    |   31 +-
 jars/ant-contrib.jar                               |  Bin 195848 -> 0 bytes
 jars/cpptasks.jar                                  |  Bin 365190 -> 0 bytes
 projects/vs/README.txt                             |   12 -
 .../apps/adrg_header_dump/adrg_header_dump.vcproj  |  184 -
 .../vs/apps/applanix2ogeom/applanix2ogeom.vcproj   |  184 -
 projects/vs/apps/band_merge/band_merge.vcproj      |  184 -
 projects/vs/apps/bilsplitter/bilsplitter.vcproj    |  184 -
 projects/vs/apps/bmvstager/bmvstager.vcproj        |  204 -
 projects/vs/apps/btoa/btoa.vcproj                  |  265 -
 projects/vs/apps/chgkwval/chgkwval.vcproj          |  184 -
 projects/vs/apps/cibcadrg/cibcadrg.vcproj          |  183 -
 projects/vs/apps/cibcadrg_ovr/cibcadrg_ovr.vcproj  |  183 -
 .../vs/apps/cibcadrg_split/cibcadrg_split.vcproj   |  183 -
 projects/vs/apps/cmm/cmm.vcproj                    |  184 -
 .../apps/computeSrtmStats/computeSrtmStats.vcproj  |  184 -
 projects/vs/apps/correl/correl.vcproj              |  184 -
 projects/vs/apps/create_cg/create_cg.vcproj        |  184 -
 projects/vs/apps/create_histo/create_histo.vcproj  |  184 -
 projects/vs/apps/datums/datums.vcproj              |  184 -
 projects/vs/apps/deg2rad/deg2rad.vcproj            |  184 -
 projects/vs/apps/deminfo/deminfo.vcproj            |  184 -
 projects/vs/apps/dtedChecker/dtedChecker.vcproj    |  183 -
 projects/vs/apps/dtedInfo/dtedInfo.vcproj          |  184 -
 projects/vs/apps/dtedList/dtedList.vcproj          |  184 -
 projects/vs/apps/dumpnitf/dumpnitf.vcproj          |  184 -
 projects/vs/apps/dumpocg/dumpocg.vcproj            |  184 -
 projects/vs/apps/ecg2ocg/ecg2ocg.vcproj            |  184 -
 .../apps/extract_vertices/extract_vertices.vcproj  |  184 -
 projects/vs/apps/factory_dump/factory_dump.vcproj  |  184 -
 projects/vs/apps/foo/foo.vcproj                    |  184 -
 projects/vs/apps/ft2mtrs/ft2mtrs.vcproj            |  184 -
 projects/vs/apps/icp/icp.vcproj                    |  185 -
 projects/vs/apps/igen/igen.vcproj                  |  184 -
 projects/vs/apps/image_info/image_info.vcproj      |  184 -
 projects/vs/apps/imagebounds/imagebounds.vcproj    |  183 -
 projects/vs/apps/img2md/img2md.vcproj              |  184 -
 projects/vs/apps/img2rr/img2rr.vcproj              |  185 -
 projects/vs/apps/modopt/modopt.vcproj              |  183 -
 projects/vs/apps/mosaic/mosaic.vcproj              |  183 -
 projects/vs/apps/mtrs2ft/mtrs2ft.vcproj            |  183 -
 projects/vs/apps/mtrsPerDeg/mtrsPerDeg.vcproj      |  183 -
 projects/vs/apps/ogeom2ogeom/ogeom2ogeom.vcproj    |  183 -
 projects/vs/apps/orthoigen/orthoigen.vcproj        |  183 -
 projects/vs/apps/ossim-info/ossim-info.vcproj      |  264 -
 projects/vs/apps/ossim_height/ossim_height.vcproj  |  183 -
 .../vs/apps/ossim_shapeidx/ossim_shapeidx.vcproj   |  184 -
 projects/vs/apps/pasta/pasta.vcproj                |  183 -
 projects/vs/apps/pathFinder/pathFinder.vcproj      |  251 -
 projects/vs/apps/pixelflip/pixelflip.vcproj        |  183 -
 projects/vs/apps/prune/prune.vcproj                |  183 -
 projects/vs/apps/rad2deg/rad2deg.vcproj            |  183 -
 projects/vs/apps/rejout/rejout.vcproj              |  183 -
 projects/vs/apps/roadFind/roadFind.vcproj          |  235 -
 projects/vs/apps/rpc2ogeom/rpc2ogeom.vcproj        |  184 -
 projects/vs/apps/senint/senint.vcproj              |  183 -
 projects/vs/apps/shpbuilder/shpbuilder.vcproj      |  184 -
 projects/vs/apps/shpcutter/shpcutter.vcproj        |  184 -
 projects/vs/apps/shpdump/shpdump.vcproj            |  184 -
 .../vs/apps/space_imaging/space_imaging.vcproj     |  183 -
 projects/vs/apps/swapbytes/swapbytes.vcproj        |  183 -
 projects/vs/apps/tfw2ogeom/tfw2ogeom.vcproj        |  183 -
 projects/vs/apps/toc_dump/toc_dump.vcproj          |  183 -
 projects/vs/apps/toc_render/toc_render.vcproj      |  183 -
 projects/vs/apps/utm2geo/utm2geo.vcproj            |  183 -
 projects/vs/apps/vec2ras/vec2ras.vcproj            |  183 -
 projects/vs/apps/vector2kwl/vector2kwl.vcproj      |  183 -
 projects/vs/ossim/ossim.vcproj                     | 6399 --------------------
 .../vs/ossim_gdalplugin/ossim_gdalplugin.vcproj    |  326 -
 projects/vs/ossim_pngplugin/ossim_pngplugin.vcproj |  218 -
 projects/vs/package_setup/package_setup.vcproj     |  149 -
 projects/vs/package_setup/page_setup_dummy.cpp     |    1 -
 projects/vs/solution.sln                           |  Bin 87302 -> 0 bytes
 projects/vs/updatesolution/README.txt              |   41 -
 .../vs/updatesolution/templates/appTemplate.vcproj |  179 -
 .../vs/updatesolution/templates/dllTemplate.vcproj |  183 -
 .../templates/pluginGdalTemplate.vcproj            |  181 -
 .../templates/pluginPNGTemplate.vcproj             |  181 -
 .../updatesolution/templates/staticTemplate.vcproj |  165 -
 .../updatesolution/Form1.Designer.cs               |  155 -
 projects/vs/updatesolution/updatesolution/Form1.cs |  671 --
 .../vs/updatesolution/updatesolution/Form1.resx    |  128 -
 .../vs/updatesolution/updatesolution/Program.cs    |   20 -
 .../updatesolution/updatesolution/ProjectInfo.cs   |   64 -
 .../updatesolution/Properties/AssemblyInfo.cs      |   33 -
 .../Properties/Resources.Designer.cs               |   63 -
 .../updatesolution/Properties/Resources.resx       |  117 -
 .../updatesolution/Properties/Settings.Designer.cs |   26 -
 .../updatesolution/Properties/Settings.settings    |    7 -
 .../updatesolution/updatesolution.csproj           |   98 -
 .../updatesolution/updatesolution.sln              |   20 -
 .../updatesolution/updatesolution.suo              |  Bin 12800 -> 0 bytes
 share/ossim/ossim_state_plane_readme.txt           |    2 +-
 share/ossim/ossim_state_plane_spcs.csv             |  506 +-
 share/ossim/ossim_wkt_pcs.csv                      | 6350 +++++++++----------
 .../ossim-applanix2ogeom/ossim-applanix2ogeom.cpp  |    4 +-
 src/apps/ossim-band-merge/ossim-band-merge.cpp     |    7 +-
 src/apps/ossim-batch-test/CMakeLists.txt           |    2 +
 src/apps/ossim-batch-test/ossim-batch-test.cpp     |   55 +
 src/apps/ossim-btoa/ossim-btoa.cpp                 |  233 +-
 src/apps/ossim-chipper/CMakeLists.txt              |    2 +
 .../ossim-chipper.cpp}                             |   42 +-
 src/apps/ossim-create-bitmask/CMakeLists.txt       |    2 +
 .../ossim-create-bitmask/ossim-create-bitmask.cpp  |  308 +
 src/apps/ossim-create-cg/ossim-create-cg.cpp       |    6 +-
 src/apps/ossim-create-histo/ossim-create-histo.cpp |    7 +
 src/apps/ossim-dem/ossim-dem.cpp                   |   42 +-
 src/apps/ossim-icp/ossim-icp.cpp                   |  535 +-
 src/apps/ossim-igen/ossim-igen.cpp                 |   38 +-
 src/apps/ossim-image-compare/CMakeLists.txt        |    2 +
 .../ossim-image-compare/ossim-image-compare.cpp    |  154 +
 src/apps/ossim-img2rr/ossim-img2rr.cpp             | 1501 ++---
 src/apps/ossim-mosaic/ossim-mosaic.cpp             |  293 +-
 src/apps/ossim-ogeom2ogeom/ossim-ogeom2ogeom.cpp   |    3 +-
 src/apps/ossim-orthoigen/ossim-orthoigen.cpp       |   41 +-
 src/apps/ossim-pixelflip/ossim-pixelflip.cpp       |   18 +-
 src/apps/ossim-preproc/CMakeLists.txt              |    2 +
 src/apps/ossim-preproc/ossim-preproc.cpp           |   86 +
 src/apps/ossim-rpf/ossim-rpf.cpp                   |   10 +
 src/apps/ossim-src2src/CMakeLists.txt              |    2 +
 src/apps/ossim-src2src/ossim-src2src.cpp           |  522 ++
 src/apps/ossim-ws-cmp/ossim-ws-cmp.cpp             |    4 +-
 src/ossim/CMakeLists.txt                           |   25 +-
 src/ossim/base/ossimAdjSolutionAttributes.cpp      |   74 +
 .../base/ossimAdjustableParameterInterface.cpp     |    6 +-
 src/ossim/base/ossimAdjustmentExecutive.cpp        |  782 +++
 src/ossim/base/ossimApplicationUsage.cpp           |   12 +-
 src/ossim/base/ossimArgumentParser.cpp             |   14 +-
 src/ossim/base/ossimBaseObjectFactory.cpp          |    7 +-
 src/ossim/base/ossimBooleanProperty.cpp            |    4 +-
 src/ossim/base/ossimByteStreamBuffer.cpp           |  355 ++
 src/ossim/base/ossimCommon.cpp                     |  102 +-
 src/ossim/base/ossimConnectableContainer.cpp       |   76 +-
 src/ossim/base/ossimConnectableObject.cpp          |  534 +-
 src/ossim/base/ossimConnectableObjectListener.cpp  |   86 +-
 src/ossim/base/ossimContainerEvent.cpp             |   23 +-
 src/ossim/base/ossimContainerProperty.cpp          |   30 +-
 src/ossim/base/ossimDataObject.cpp                 |   35 +-
 src/ossim/base/ossimDatum.cpp                      |   87 +-
 src/ossim/base/ossimDatumFactory.cpp               |   41 +-
 src/ossim/base/ossimDblGrid.cpp                    |   35 +-
 src/ossim/base/ossimDirectory.cpp                  |   16 +-
 src/ossim/base/ossimDms.cpp                        |    8 +-
 src/ossim/base/ossimDpt.cpp                        |    9 +-
 src/ossim/base/ossimDrect.cpp                      |  183 +-
 src/ossim/base/ossimEllipsoid.cpp                  |   43 +-
 src/ossim/base/ossimEllipsoidFactory.cpp           |  224 +-
 src/ossim/base/ossimEndian.cpp                     |    4 +-
 src/ossim/base/ossimEpsgDatumFactory.cpp           |  169 +-
 src/ossim/base/ossimErrorStatusInterface.cpp       |    7 +-
 src/ossim/base/ossimFilename.cpp                   |  209 +-
 src/ossim/base/ossimGeodeticEvaluator.cpp          |  341 ++
 src/ossim/base/ossimGeoidManager.cpp               |    6 +-
 src/ossim/base/ossimGpt.cpp                        |  117 +-
 src/ossim/base/ossimGzStream.cpp                   |    2 +-
 src/ossim/base/ossimHistogram.cpp                  |  213 +-
 src/ossim/base/ossimHttpRequest.cpp                |   30 +
 src/ossim/base/ossimHttpResponse.cpp               |   29 +
 src/ossim/base/ossimImageTypeLut.cpp               |    8 +-
 src/ossim/base/ossimIpt.cpp                        |   10 +-
 src/ossim/base/ossimIrect.cpp                      |   62 +-
 src/ossim/base/ossimKeywordlist.cpp                |  672 +-
 src/ossim/base/ossimLagrangeInterpolator.cpp       |  191 +
 src/ossim/base/ossimLookUpTable.cpp                |   30 +-
 src/ossim/base/ossimMultiBandHistogram.cpp         |    8 +-
 src/ossim/base/ossimMultiResLevelHistogram.cpp     |    9 +-
 src/ossim/base/ossimNBandLutDataObject.cpp         |   50 +-
 src/ossim/base/ossimNadconGridDatum.cpp            |    1 +
 src/ossim/base/ossimNadconGridFile.cpp             |    2 +-
 src/ossim/base/ossimNadconNarDatum.cpp             |    1 +
 src/ossim/base/ossimNadconNasDatum.cpp             |    1 +
 src/ossim/base/ossimNotify.cpp                     |    3 +-
 src/ossim/base/ossimObject.cpp                     |   17 +-
 src/ossim/base/ossimObservationSet.cpp             |  228 +
 src/ossim/base/ossimPointObservation.cpp           |  232 +
 src/ossim/base/ossimPolygon.cpp                    |   68 +-
 src/ossim/base/ossimProperty.cpp                   |   36 +-
 src/ossim/base/ossimRectilinearDataObject.cpp      |   54 +-
 src/ossim/base/ossimRefreshEvent.cpp               |   15 +-
 src/ossim/base/ossimScalarTypeLut.cpp              |  155 +-
 src/ossim/base/ossimSevenParamDatum.cpp            |   24 +-
 src/ossim/base/ossimString.cpp                     |  205 +-
 src/ossim/base/ossimStringListProperty.cpp         |    4 +-
 src/ossim/base/ossimThreeParamDatum.cpp            |   19 +-
 src/ossim/base/ossimUrl.cpp                        |  109 +
 src/ossim/base/ossimVisitor.cpp                    |  254 +-
 src/ossim/base/ossimWLSBundleSolution.cpp          |  494 ++
 src/ossim/base/ossimWebRequest.cpp                 |    3 +
 src/ossim/base/ossimWebRequestFactoryBase.cpp      |   17 +
 src/ossim/base/ossimWebRequestFactoryRegistry.cpp  |   51 +
 src/ossim/base/ossimWebResponse.cpp                |   24 +
 src/ossim/base/ossimWgs72Datum.cpp                 |    6 +-
 src/ossim/base/ossimWgs84Datum.cpp                 |    3 +-
 src/ossim/base/ossimXmlAttribute.cpp               |   14 +-
 src/ossim/base/ossimXmlDocument.cpp                |   38 +-
 src/ossim/base/ossimXmlNode.cpp                    |  125 +-
 src/ossim/base/ossimXmlString.cpp                  |   46 +-
 src/ossim/elevation/ossimDtedElevationDatabase.cpp |   37 +-
 src/ossim/elevation/ossimDtedHandler.cpp           |  319 +-
 src/ossim/elevation/ossimElevCellHandler.cpp       |   15 +-
 src/ossim/elevation/ossimElevManager.cpp           |  144 +-
 src/ossim/elevation/ossimElevSource.cpp            |    6 +-
 src/ossim/elevation/ossimElevationDatabase.cpp     |   37 +-
 .../elevation/ossimElevationDatabaseFactory.cpp    |   29 +-
 .../elevation/ossimGeneralRasterElevHandler.cpp    |    7 +-
 src/ossim/elevation/ossimHgtRef.cpp                |  161 +-
 .../elevation/ossimImageElevationDatabase.cpp      |  449 ++
 src/ossim/elevation/ossimImageElevationHandler.cpp |  246 +
 src/ossim/elevation/ossimSrtmElevationDatabase.cpp |   35 +
 src/ossim/elevation/ossimSrtmHandler.cpp           |    9 +-
 .../elevation/ossimTiledElevationDatabase.cpp      |  683 +++
 src/ossim/font/ossimFreeTypeFont.cpp               |   14 +-
 src/ossim/imaging/ossimAdrgTileSource.cpp          |   12 +-
 src/ossim/imaging/ossimAppFixedTileCache.cpp       |    9 +-
 src/ossim/imaging/ossimAtCorrGridRemapper.cpp      |    3 +-
 src/ossim/imaging/ossimBandClipFilter.cpp          |    3 +-
 src/ossim/imaging/ossimBandSelector.cpp            |  247 +-
 src/ossim/imaging/ossimBandSeparateHandler.cpp     |  283 +
 src/ossim/imaging/ossimBitMaskTileSource.cpp       |  385 ++
 src/ossim/imaging/ossimBitMaskWriter.cpp           |  481 ++
 src/ossim/imaging/ossimBlendMosaic.cpp             |  226 +-
 src/ossim/imaging/ossimBumpShadeTileSource.cpp     |   24 +-
 src/ossim/imaging/ossimCacheTileSource.cpp         |  200 +-
 src/ossim/imaging/ossimCibCadrgTileSource.cpp      |   15 +-
 src/ossim/imaging/ossimColorNormalizedFusion.cpp   |    5 +-
 src/ossim/imaging/ossimDespeckleFilter.cpp         |  236 +
 src/ossim/imaging/ossimDoqqTileSource.cpp          |    7 +-
 .../imaging/ossimDtedElevationImageSource.cpp      |  716 ---
 src/ossim/imaging/ossimDtedTileSource.cpp          |   91 +-
 src/ossim/imaging/ossimERSFileWriter.cpp           |    3 +-
 src/ossim/imaging/ossimERSTileSource.cpp           |   10 +-
 src/ossim/imaging/ossimEdgeFilter.cpp              |    7 +-
 src/ossim/imaging/ossimElevImageSource.cpp         |    6 +-
 src/ossim/imaging/ossimEnviHeaderFileWriter.cpp    |    3 +-
 src/ossim/imaging/ossimEnviTileSource.cpp          |  282 +
 src/ossim/imaging/ossimFgdcFileWriter.cpp          |    7 +-
 src/ossim/imaging/ossimFilterResampler.cpp         |   44 +-
 src/ossim/imaging/ossimGeneralRasterInfo.cpp       | 1338 ++--
 src/ossim/imaging/ossimGeneralRasterTileSource.cpp | 1580 +++--
 src/ossim/imaging/ossimGeneralRasterWriter.cpp     |  268 +-
 src/ossim/imaging/ossimGeoAnnotationPolyObject.cpp |   15 +-
 src/ossim/imaging/ossimGeoAnnotationSource.cpp     |   11 +-
 src/ossim/imaging/ossimGeoPolyCutter.cpp           |    8 +-
 src/ossim/imaging/ossimGeomFileWriter.cpp          |   23 +-
 src/ossim/imaging/ossimGridRemapSource.cpp         |   11 +-
 src/ossim/imaging/ossimHistogramMatchFilter.cpp    |   26 +-
 src/ossim/imaging/ossimHistogramRemapper.cpp       |  228 +-
 src/ossim/imaging/ossimHistogramWriter.cpp         |   20 +-
 src/ossim/imaging/ossimHsiRemapper.cpp             |  469 +-
 src/ossim/imaging/ossimIgenGenerator.cpp           |    4 +-
 src/ossim/imaging/ossimImageCacheBase.cpp          |  661 ++
 src/ossim/imaging/ossimImageCacheTileSource.cpp    |  437 ++
 src/ossim/imaging/ossimImageChain.cpp              |  762 ++-
 src/ossim/imaging/ossimImageCombiner.cpp           |    4 +-
 src/ossim/imaging/ossimImageData.cpp               |  863 ++-
 src/ossim/imaging/ossimImageDataFactory.cpp        |   81 +-
 src/ossim/imaging/ossimImageDataHelper.cpp         |   10 +-
 src/ossim/imaging/ossimImageFileWriter.cpp         |  141 +-
 src/ossim/imaging/ossimImageGaussianFilter.cpp     |    6 +-
 src/ossim/imaging/ossimImageGeometry.cpp           |  878 ++-
 src/ossim/imaging/ossimImageGeometryFactory.cpp    |    2 +-
 src/ossim/imaging/ossimImageGeometryRegistry.cpp   |   38 +-
 src/ossim/imaging/ossimImageHandler.cpp            |  318 +-
 src/ossim/imaging/ossimImageHandlerFactory.cpp     |  293 +-
 src/ossim/imaging/ossimImageHandlerFactoryBase.cpp |    8 +-
 src/ossim/imaging/ossimImageHandlerRegistry.cpp    |  109 +-
 src/ossim/imaging/ossimImageHistogramSource.cpp    |   51 +-
 src/ossim/imaging/ossimImageMetaData.cpp           |  482 +-
 src/ossim/imaging/ossimImageRenderer.cpp           |  951 ++-
 src/ossim/imaging/ossimImageSource.cpp             |   40 +-
 src/ossim/imaging/ossimImageSourceSequencer.cpp    |  156 +-
 src/ossim/imaging/ossimImageStatisticsSource.cpp   |   74 +-
 .../imaging/ossimImageToPlaneNormalFilter.cpp      |   39 +-
 src/ossim/imaging/ossimImageWriterFactory.cpp      |  146 +-
 .../imaging/ossimImageWriterFactoryRegistry.cpp    |   26 +-
 src/ossim/imaging/ossimJpegMemDest.cpp             |   76 +
 src/ossim/imaging/ossimJpegTileSource.cpp          |   91 +-
 src/ossim/imaging/ossimJpegWriter.cpp              |    5 +-
 src/ossim/imaging/ossimLandsatTileSource.cpp       |    4 +-
 .../imaging/ossimLandsatTopoCorrectionFilter.cpp   |   23 +-
 src/ossim/imaging/ossimMapCompositionSource.cpp    |    3 +-
 src/ossim/imaging/ossimMaskFilter.cpp              |  311 +-
 src/ossim/imaging/ossimMaskTileSource.cpp          |  475 --
 src/ossim/imaging/ossimMaskedImageHandler.cpp      |  352 --
 src/ossim/imaging/ossimMeanMedianFilter.cpp        |   11 +-
 src/ossim/imaging/ossimMemoryImageSource.cpp       |   52 +-
 src/ossim/imaging/ossimNBandToIndexFilter.cpp      |   16 +-
 src/ossim/imaging/ossimNitf20Writer.cpp            |   52 +-
 src/ossim/imaging/ossimNitfTileSource.cpp          |  411 +-
 src/ossim/imaging/ossimNitfWriter.cpp              |   25 +-
 src/ossim/imaging/ossimNitfWriterBase.cpp          |   22 +-
 src/ossim/imaging/ossimNullPixelFlip.cpp           |    2 +
 src/ossim/imaging/ossimOrthoImageMosaic.cpp        |    4 +-
 src/ossim/imaging/ossimOverviewBuilderBase.cpp     |  112 +-
 .../ossimOverviewBuilderFactoryRegistry.cpp        |   23 +-
 src/ossim/imaging/ossimOverviewSequencer.cpp       |  491 +-
 src/ossim/imaging/ossimPdfWriter.cpp               | 1875 ++++++
 src/ossim/imaging/ossimPixelFlipper.cpp            |  949 ++-
 src/ossim/imaging/ossimPolyCutter.cpp              |   25 +-
 src/ossim/imaging/ossimQbTileFilesHandler.cpp      |  622 +-
 src/ossim/imaging/ossimQuickbirdNitfTileSource.cpp |    3 +-
 src/ossim/imaging/ossimQuickbirdTiffTileSource.cpp |  153 +-
 src/ossim/imaging/ossimRLevelFilter.cpp            |    6 +-
 src/ossim/imaging/ossimReadmeFileWriter.cpp        |    8 +-
 src/ossim/imaging/ossimRectangleCutFilter.cpp      |    4 +-
 src/ossim/imaging/ossimResampler.cpp               |    4 +-
 src/ossim/imaging/ossimRgbImage.cpp                |   26 +-
 src/ossim/imaging/ossimRgbToGreyFilter.cpp         |   12 +-
 src/ossim/imaging/ossimRpfCacheTileSource.cpp      |   10 +-
 src/ossim/imaging/ossimSFIMFusion.cpp              |   89 +-
 src/ossim/imaging/ossimScalarRemapper.cpp          |   29 +-
 src/ossim/imaging/ossimScaleFilter.cpp             |    3 +-
 src/ossim/imaging/ossimSingleImageChain.cpp        |   34 +-
 src/ossim/imaging/ossimSrtmTileSource.cpp          |   10 +-
 src/ossim/imaging/ossimTableRemapper.cpp           |   71 +-
 src/ossim/imaging/ossimTiffOverviewBuilder.cpp     |  978 ++-
 src/ossim/imaging/ossimTiffTileSource.cpp          |  989 ++-
 src/ossim/imaging/ossimTiffWriter.cpp              |  232 +-
 ...FilesHandler.cpp => ossimTiledImageHandler.cpp} |  428 +-
 src/ossim/imaging/ossimTiling.cpp                  |   55 +-
 src/ossim/imaging/ossimTilingPoly.cpp              |  369 ++
 src/ossim/imaging/ossimTilingRect.cpp              |  886 +++
 .../imaging/ossimTopographicCorrectionFilter.cpp   |   26 +-
 src/ossim/imaging/ossimTwoColorView.cpp            |  703 +--
 src/ossim/imaging/ossimUsgsDemTileSource.cpp       |   40 +-
 src/ossim/imaging/ossimVertexExtractor.cpp         |  515 +-
 .../imaging/ossimVpfAnnotationFeatureInfo.cpp      |  304 +-
 src/ossim/imaging/ossimWorldFileWriter.cpp         |    4 +-
 src/ossim/init/ossimInit.cpp                       |  109 +-
 src/ossim/kbool/node.cpp                           |   10 +-
 src/ossim/parallel/ossimIgen.cpp                   |  253 +-
 src/ossim/parallel/ossimImageChainMtAdaptor.cpp    |  458 ++
 src/ossim/parallel/ossimImageHandlerMtAdaptor.cpp  |  364 ++
 src/ossim/parallel/ossimJob.cpp                    |   60 +
 src/ossim/parallel/ossimJobMultiThreadQueue.cpp    |  101 +
 src/ossim/parallel/ossimJobQueue.cpp               |  299 +
 src/ossim/parallel/ossimJobThreadQueue.cpp         |  240 +
 src/ossim/parallel/ossimMultiThreadSequencer.cpp   |  441 ++
 src/ossim/parallel/ossimOrthoIgen.cpp              | 1841 ++++--
 src/ossim/plugin/ossimDynamicLibrary.cpp           |    5 +-
 src/ossim/plugin/ossimPluginLibrary.cpp            |    4 +-
 src/ossim/plugin/ossimSharedPluginRegistry.cpp     |    6 +-
 src/ossim/projection/ossimAlphaSensor.cpp          |  710 +++
 src/ossim/projection/ossimAlphaSensorHRI.cpp       |  252 +
 src/ossim/projection/ossimAlphaSensorHSI.cpp       |  257 +
 src/ossim/projection/ossimApplanixEcefModel.cpp    |   78 +-
 src/ossim/projection/ossimApplanixUtmModel.cpp     |   79 +-
 src/ossim/projection/ossimBilinearProjection.cpp   |   10 +-
 src/ossim/projection/ossimBuckeyeSensor.cpp        | 1023 ++--
 src/ossim/projection/ossimCoarseGridModel.cpp      |   13 +-
 .../projection/ossimEpsgProjectionDatabase.cpp     |  558 +-
 .../projection/ossimEpsgProjectionFactory.cpp      |   37 +-
 src/ossim/projection/ossimEquDistCylProjection.cpp |  219 +-
 src/ossim/projection/ossimIkonosRpcModel.cpp       |   13 +-
 src/ossim/projection/ossimImageProjectionModel.cpp |    4 +-
 .../projection/ossimImageViewAffineTransform.cpp   |  160 +-
 .../ossimImageViewProjectionTransform.cpp          |  209 +-
 ...simSkyBoxLearSensor.cpp => ossimIpodSensor.cpp} |  196 +-
 .../ossimLambertConformalConicProjection.cpp       |    5 +-
 src/ossim/projection/ossimLlxyProjection.cpp       |   12 +-
 src/ossim/projection/ossimMapProjection.cpp        |  324 +-
 src/ossim/projection/ossimMgrs.c                   |    4 +-
 .../projection/ossimNitfProjectionFactory.cpp      |  435 +-
 src/ossim/projection/ossimPpjFrameSensor.cpp       |  475 ++
 .../projection/ossimProjectionFactoryRegistry.cpp  |   18 +-
 src/ossim/projection/ossimQuickbirdRpcModel.cpp    |   13 +-
 src/ossim/projection/ossimRS1SarModel.cpp          | 1083 ++++
 src/ossim/projection/ossimRpcModel.cpp             |   80 +-
 src/ossim/projection/ossimSensorModel.cpp          |   47 +-
 src/ossim/projection/ossimSensorModelFactory.cpp   |  124 +-
 src/ossim/projection/ossimSensorModelTuple.cpp     |  263 +-
 src/ossim/projection/ossimSkyBoxLearSensor.cpp     |    2 +-
 src/ossim/projection/ossimSonomaSensor.cpp         |   59 +-
 src/ossim/projection/ossimSpot5Model.cpp           |    6 +-
 src/ossim/projection/ossimUtmProjection.cpp        |   17 +-
 src/ossim/projection/ossimWarpProjection.cpp       |   12 +-
 src/ossim/projection/ossimWktProjectionFactory.cpp |  188 +
 .../support_data/ossimAlphaSensorSupportData.cpp   |  691 +++
 src/ossim/support_data/ossimApplanixEOFile.cpp     |   27 +-
 src/ossim/support_data/ossimAuxFileHandler.cpp     | 2275 +++----
 src/ossim/support_data/ossimCeosData.cpp           | 1379 +++++
 src/ossim/support_data/ossimDoqq.cpp               |  220 +-
 src/ossim/support_data/ossimDtedRecord.cpp         |    4 +-
 src/ossim/support_data/ossimEnviHeader.cpp         | 1035 ++--
 src/ossim/support_data/ossimEnviInfo.cpp           |   78 +
 src/ossim/support_data/ossimFgdcTxtDoc.cpp         |  306 +
 src/ossim/support_data/ossimFgdcXmlDoc.cpp         |    2 +-
 src/ossim/support_data/ossimGeoTiff.cpp            |  195 +-
 src/ossim/support_data/ossimInfoBase.cpp           |    3 +-
 src/ossim/support_data/ossimInfoFactory.cpp        |   49 +-
 .../support_data/ossimInfoFactoryRegistry.cpp      |   45 +-
 src/ossim/support_data/ossimJp2Info.cpp            |  211 +
 src/ossim/support_data/ossimJpipMessage.cpp        |   35 +
 src/ossim/support_data/ossimJpipMessageDecoder.cpp |  171 +
 src/ossim/support_data/ossimNitfAcftbTag.cpp       |   18 +-
 src/ossim/support_data/ossimNitfAimidbTag.cpp      |   18 +-
 src/ossim/support_data/ossimNitfBlockaTag.cpp      |   19 +-
 src/ossim/support_data/ossimNitfCsccgaTag.cpp      |   86 +
 src/ossim/support_data/ossimNitfCscrnaTag.cpp      |   18 +-
 src/ossim/support_data/ossimNitfCsdidaTag.cpp      |   22 +-
 src/ossim/support_data/ossimNitfCsexraTag.cpp      |   18 +-
 src/ossim/support_data/ossimNitfCsproaTag.cpp      |   94 +
 src/ossim/support_data/ossimNitfEmbeddedRpfDes.cpp |    3 +-
 src/ossim/support_data/ossimNitfEngrdaTag.cpp      |   43 +-
 src/ossim/support_data/ossimNitfExoptaTag.cpp      |  139 +
 src/ossim/support_data/ossimNitfFile.cpp           |   65 +-
 src/ossim/support_data/ossimNitfFileHeaderV2_1.cpp |  160 +-
 src/ossim/support_data/ossimNitfFileHeaderV2_X.cpp |  145 +-
 .../support_data/ossimNitfGeoPositioningTag.cpp    |   20 +-
 src/ossim/support_data/ossimNitfHistoaTag.cpp      |  470 ++
 src/ossim/support_data/ossimNitfIchipbTag.cpp      |   19 +-
 .../support_data/ossimNitfImageHeaderV2_0.cpp      |   10 +-
 .../support_data/ossimNitfImageHeaderV2_1.cpp      |  102 +-
 .../support_data/ossimNitfImageHeaderV2_X.cpp      |  221 +-
 src/ossim/support_data/ossimNitfJ2klraTag.cpp      |   22 +-
 .../support_data/ossimNitfLocalCartographicTag.cpp |   15 +-
 .../support_data/ossimNitfLocalGeographicTag.cpp   |   13 +-
 src/ossim/support_data/ossimNitfMstgtaTag.cpp      |   18 +-
 src/ossim/support_data/ossimNitfPiaimcTag.cpp      |   19 +-
 .../ossimNitfProjectionParameterTag.cpp            |   17 +-
 src/ossim/support_data/ossimNitfRegisteredTag.cpp  |   50 +-
 .../support_data/ossimNitfRegisteredTagFactory.cpp |   28 +-
 src/ossim/support_data/ossimNitfRpcATag.cpp        |   10 +-
 src/ossim/support_data/ossimNitfRpcBTag.cpp        |   10 +-
 src/ossim/support_data/ossimNitfRpcBase.cpp        |   15 +-
 src/ossim/support_data/ossimNitfSensraTag.cpp      |   19 +-
 src/ossim/support_data/ossimNitfStdidcTag.cpp      |   19 +-
 src/ossim/support_data/ossimNitfTagInformation.cpp |   37 +-
 src/ossim/support_data/ossimNitfTextHeaderV2_1.cpp |    2 +-
 src/ossim/support_data/ossimNitfUnknownTag.cpp     |   73 +-
 src/ossim/support_data/ossimNitfUse00aTag.cpp      |   19 +-
 .../support_data/ossimNitfVqCompressionHeader.cpp  |    6 +-
 src/ossim/support_data/ossimNmeaMessage.cpp        |   98 +
 .../support_data/ossimNmeaMessageSequencer.cpp     |   85 +
 src/ossim/support_data/ossimPpjFrameSensorFile.cpp |  293 +
 src/ossim/support_data/ossimQuickbirdMetaData.cpp  |  161 +-
 src/ossim/support_data/ossimQuickbirdTile.cpp      |   20 +-
 src/ossim/support_data/ossimRpfComponentIdLut.cpp  |  152 +
 src/ossim/support_data/ossimRpfFrame.cpp           |   98 +-
 src/ossim/support_data/ossimRpfFrameFileReader.cpp |   10 +-
 src/ossim/support_data/ossimRpfHeader.cpp          |   14 +-
 src/ossim/support_data/ossimRpfLocationSection.cpp |   12 +-
 .../support_data/ossimRpfReplaceUpdateRecord.cpp   |  135 +
 .../ossimRpfReplaceUpdateSectionSubheader.cpp      |  163 +
 .../support_data/ossimRpfReplaceUpdateTable.cpp    |   62 +
 src/ossim/support_data/ossimRpfToc.cpp             |   15 +-
 src/ossim/support_data/ossimRpfTocEntry.cpp        |   43 +-
 .../support_data/ossimSpotDimapSupportData.cpp     |  261 +-
 src/ossim/support_data/ossimSrcRecord.cpp          |    3 +-
 src/ossim/support_data/ossimSrtmSupportData.cpp    |  117 +-
 src/ossim/support_data/ossimTiffInfo.cpp           |  805 ++-
 src/ossim/support_data/ossimTiffWorld.cpp          |   15 +-
 src/ossim/support_data/ossimWavelength.cpp         |  204 +
 src/ossim/support_data/ossimXmpInfo.cpp            |  644 ++
 src/ossim/util/ossimBatchTest.cpp                  | 1268 ++++
 src/ossim/util/ossimChipperUtil.cpp                | 3861 ++++++++++++
 src/ossim/util/ossimElevUtil.cpp                   | 2676 --------
 src/ossim/util/ossimFileWalker.cpp                 |  504 ++
 src/ossim/util/ossimImageUtil.cpp                  | 1511 +++++
 src/ossim/util/ossimInfo.cpp                       |  802 ++-
 src/ossim/util/ossimRpfUtil.cpp                    |   15 +-
 src/ossim/vec/ossimVpfBoundingRecordTable.cpp      |   10 +-
 src/ossim/vec/ossimVpfDatabase.cpp                 |    7 +-
 src/ossim/vec/ossimVpfFeatureClassSchema.cpp       |    6 +-
 src/ossim/vec/ossimVpfTable.cpp                    |   14 +-
 src/ossim/version-config.cpp                       |    1 -
 src/ossim/video/ossimVideoGeometry.cpp             |   19 +
 src/ossim/video/ossimVideoHandler.cpp              |   43 +
 src/ossim/video/ossimVideoImageHandler.cpp         |  127 +
 src/ossim/video/ossimVideoImageSource.cpp          |  212 +
 src/ossim/video/ossimVideoSource.cpp               |  184 +
 src/ossim/vpfutil/vpfclip.c                        |    6 +-
 src/ossim/vpfutil/vpfcntnt.c                       |    8 +-
 src/ossim/vpfutil/vpfdict.c                        |    2 +-
 src/ossim/vpfutil/vpfdisp.c                        |    6 +-
 src/ossim/vpfutil/vpfdraw.c                        |   76 +-
 src/ossim/vpfutil/vpfmisc.c                        |    4 +-
 src/ossim/vpfutil/vpfnear.c                        |   10 +-
 src/ossim/vpfutil/vpfprim.c                        |   52 +-
 src/ossim/vpfutil/vpfptply.c                       |   22 +-
 src/ossim/vpfutil/vpfquery.c                       |   28 +-
 src/ossim/vpfutil/vpfread.c                        |  160 +-
 src/ossim/vpfutil/vpfrelat.c                       |   30 +-
 src/ossim/vpfutil/vpfselec.c                       |   36 +-
 src/ossim/vpfutil/vpfspx.c                         |   30 +-
 src/ossim/vpfutil/vpftable.c                       |   54 +-
 src/ossim/vpfutil/vpftidx.c                        |  102 +-
 src/ossim/vpfutil/vpfwrite.c                       |   80 +-
 src/test/CMakeLists.txt                            |   24 +-
 src/test/ossim-batch-test.cpp                      |  574 --
 src/test/ossim-byte-stream-buffer-test.cpp         |   94 +
 src/test/ossim-date-test.cpp                       |    2 +-
 src/test/ossim-datum-shift.cpp                     |   16 +-
 src/test/ossim-directory-test.cpp                  |   80 +
 src/test/ossim-duration-test.cpp                   |    2 +-
 src/test/ossim-elevation-manager-test.cpp          |    2 +-
 ...{ossim-xml-test.cpp => ossim-envi-hdr-test.cpp} |   30 +-
 src/test/ossim-epsg-factory-test.cpp               |  115 +
 src/test/ossim-fgdc-txt-doc-test.cpp               |   73 +
 src/test/ossim-filename-test.cpp                   |   46 +-
 src/test/ossim-foo.cpp                             |   13 +-
 src/test/ossim-get-pixel-test.cpp                  |  149 +-
 src/test/ossim-gpt-test.cpp                        |    2 +-
 src/test/ossim-gsd-test.cpp                        |    2 +-
 src/test/ossim-histo-compare.cpp                   |  229 +
 src/test/ossim-image-chain-test.cpp                |   80 +
 src/test/ossim-image-elevation-test.cpp            |   98 +
 src/test/ossim-image-geometry-test.cpp             |   17 +-
 src/test/ossim-image-handler-test.cpp              |    4 +-
 src/test/ossim-image-writer-test.cpp               |    2 +-
 src/test/ossim-info-test.cpp                       |   71 +
 src/test/ossim-jobqueue-test.cpp                   |   77 +
 src/test/ossim-loadtile-test.cpp                   |  115 +
 src/test/ossim-lsr-space-test.cpp                  |    2 +-
 src/test/ossim-mask-filter-test.cpp                |    9 +-
 src/test/ossim-notify-test.cpp                     |   15 +-
 src/test/ossim-pixel-flipper-test.cpp              |  144 +
 src/test/ossim-point-test.cpp                      |    6 +-
 src/test/ossim-projection-factory-test.cpp         |    2 +-
 src/test/ossim-projection-test.cpp                 |   75 +
 src/test/ossim-read-write-consistency-test.cpp     |  116 +
 src/test/ossim-ref-ptr-test.cpp                    |   90 +
 src/test/ossim-remap-table-test.cpp                |    2 +-
 src/test/ossim-single-image-chain-test.cpp         |   76 +-
 .../ossim-single-image-chain-threaded-test.cpp     |  101 +
 src/test/ossim-string-test.cpp                     |   86 +-
 src/test/ossim-test.cpp                            |    2 +-
 src/test/ossim-threaded-chain-test.cpp             |  221 +
 src/test/ossim-threaded-polyarea2d-test.cpp        |  110 +
 src/test/ossim-tiff-info-test.cpp                  |    2 +-
 src/test/ossim-tiled-elevation-test.cpp            |  207 +
 src/test/ossim-visitor-test.cpp                    |   21 +-
 src/test/ossim-wavelength-test.cpp                 |  127 +
 src/test/ossim-xml-test.cpp                        |    2 +-
 xcode/ossim/ossim.xcodeproj/project.pbxproj        |   15 +-
 825 files changed, 76947 insertions(+), 49100 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2b8fbb0..05989be 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,10 @@
 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)
+
 IF(NOT APPLE)
   cmake_minimum_required(VERSION 2.6)
 ELSE(NOT APPLE)
@@ -12,9 +16,6 @@ SET(CMAKE_MODULE_PATH "${${PROJECT_NAME}_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE
 INCLUDE(OssimVersion)
 INCLUDE(OssimCommonVariables)
 
-
-SET(OSSIM_SVN_REVISION_NUMBER "?")
-
 # 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)
 
@@ -38,32 +39,121 @@ 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)
 
-find_package(OpenThreads)
-find_package(TIFF)
-find_package(JPEG)
-find_package(GEOTIFF)
-find_package(ZLIB)
+# Set our include paths:
+include_directories( ${PROJECT_SOURCE_DIR}/include )
+include_directories( ${PROJECT_BINARY_DIR}/include )
 
-IF(BUILD_OSSIM_FREETYPE_SUPPORT)
-find_package(Freetype)
-ENDIF(BUILD_OSSIM_FREETYPE_SUPPORT)
+# Stores list of libs to link with. Initialized throughout.
+set( ossimDependentLibs )
 
-IF(BUILD_OSSIM_MPI_SUPPORT)
-find_package(MPI)
-ENDIF(BUILD_OSSIM_MPI_SUPPORT)
-
-
-INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)
-INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include)
-INCLUDE_DIRECTORIES(${OPENTHREADS_INCLUDE_DIR})
-INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR})
-INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR})
-INCLUDE_DIRECTORIES(${GEOTIFF_INCLUDE_DIR})
+#---
+# 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( WARNING "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 )
+
+# 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 found in OssimUtilities.cmake #######
+#---
+# Call the OSSIM macros in OssimUtilities.cmake
+#---
 TODAYS_DATE(OSSIM_BUILD_DATE)
-GET_SVN_REVISION(OSSIM_SVN_REVISION_NUMBER)
+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
@@ -71,49 +161,12 @@ GET_SVN_REVISION(OSSIM_SVN_REVISION_NUMBER)
 set(OSSIM_VERSION_NUMBER "\"${OSSIM_VERSION}\"")
 set(OSSIM_BUILD_DATE "\"${OSSIM_BUILD_DATE}\"")
 
-set(OSSIM_HAS_FREETYPE 0)
-set(OSSIM_HAS_LIBZ     0)
-set(OSSIM_HAS_MPI      0)
-set(OSSIM_HAS_GEOTIFF  0)
+# 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)
 
-IF(GEOTIFF_FOUND)
-   set(OSSIM_HAS_GEOTIFF 1)
-ENDIF(GEOTIFF_FOUND)
-
-IF(MPI_FOUND)
-   set(OSSIM_HAS_MPI 1)
-   INCLUDE_DIRECTORIES(${MPI_INCLUDE_PATH})
-ELSE(MPI_FOUND)
-   set(MPI_LIBRARIES "")
-   set(MPI_LIBRARY "")
-ENDIF(MPI_FOUND)
-
-IF(FREETYPE_FOUND)
-   set(OSSIM_HAS_FREETYPE 1)
-   INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIRS})
-ELSE(FREETYPE_FOUND)
-   set(FREETYPE_LIBRARY "")
-   set(FREETYPE_LIBRARIES "")
-ENDIF(FREETYPE_FOUND)
-
-IF(ZLIB_FOUND)
-   set(OSSIM_HAS_LIBZ 1)
-ELSE(ZLIB_FOUND)
-   set(ZLIB_LIBRARY "")
-ENDIF(ZLIB_FOUND)
-
-IF(UNIX)
-    FIND_LIBRARY(DL_LIBRARY dl)
-    IF(NOT DL_LIBRARY)
-        SET(DL_LIBRARY "") # change from NOTFOUND to empty when passed to linker
-    ENDIF()
-ENDIF(UNIX)
-
 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}")
@@ -149,6 +202,7 @@ INSTALL(FILES ${ossim_projection_codes_csv} DESTINATION share/ossim/projection C
 
 ###################### OUTPUT GENERAL VARIABLE SETTINGS #######################
 
+MESSAGE( STATUS "OSSIM_SVN_REVISION_NUMBER       = ${OSSIM_SVN_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}" )
@@ -170,6 +224,7 @@ 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}" )
diff --git a/Doxyfile b/Doxyfile
index 509351b..2ce2856 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -25,13 +25,13 @@ 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 Image Map"
+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.6"
+PROJECT_NUMBER         = "Version 1.8.14"
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
 # base path where the generated documentation will be put.
@@ -387,12 +387,6 @@ HIDE_SCOPE_NAMES       = NO
 
 SHOW_INCLUDE_FILES     = YES
 
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
-# will list include files with double quotes in the documentation
-# rather than with sharp brackets.
-
-FORCE_LOCAL_INCLUDES   = NO
-
 # If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
 # is inserted in the documentation for inline members.
 
@@ -582,7 +576,8 @@ WARN_LOGFILE           =
 # with spaces.
 
 INPUT                  = include \
-                         src
+                         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
@@ -819,31 +814,6 @@ HTML_TIMESTAMP         = NO
 
 HTML_STYLESHEET        =
 
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
-# Doxygen will adjust the colors in the stylesheet and background images
-# according to this color. Hue is specified as an angle on a colorwheel,
-# see http://en.wikipedia.org/wiki/Hue for more information.
-# For instance the value 0 represents red, 60 is yellow, 120 is green,
-# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
-# The allowed range is 0 to 359.
-
-HTML_COLORSTYLE_HUE    = 220
-
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
-# the colors in the HTML output. For a value of 0 the output will use
-# grayscales only. A value of 255 will produce the most vivid colors.
-
-HTML_COLORSTYLE_SAT    = 100
-
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
-# the luminance component of the colors in the HTML output. Values below
-# 100 gradually make the output lighter, whereas values above 100 make
-# the output darker. The value divided by 100 is the actual gamma applied,
-# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
-# and 100 does not change the gamma.
-
-HTML_COLORSTYLE_GAMMA  = 80
-
 # 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.
@@ -891,16 +861,6 @@ DOCSET_FEEDNAME        = "Doxygen generated docs"
 
 DOCSET_BUNDLE_ID       = org.doxygen.Project
 
-# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
-# the documentation publisher. This should be a reverse domain-name style
-# string, e.g. com.mycompany.MyDocSet.documentation.
-
-DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
-
-# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
-
-DOCSET_PUBLISHER_NAME  = Publisher
-
 # 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)
@@ -998,23 +958,6 @@ QHP_SECT_FILTER_ATTRS  =
 
 QHG_LOCATION           =
 
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
-#  will be generated, which together with the HTML files, form an Eclipse help
-# plugin. To install this plugin and make it available under the help contents
-# menu in Eclipse, the contents of the directory containing the HTML and XML
-# files needs to be copied into the plugins directory of eclipse. The name of
-# the directory within the plugins directory should be the same as
-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
-# the help appears.
-
-GENERATE_ECLIPSEHELP   = NO
-
-# A unique identifier for the eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have
-# this name.
-
-ECLIPSE_DOC_ID         = org.doxygen.Project
-
 # 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.
@@ -1047,11 +990,6 @@ USE_INLINE_TREES       = NO
 
 TREEVIEW_WIDTH         = 250
 
-# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
-# links to external symbols imported via tag files in a separate window.
-
-EXT_LINKS_IN_WINDOW    = NO
-
 # 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
@@ -1060,14 +998,6 @@ EXT_LINKS_IN_WINDOW    = NO
 
 FORMULA_FONTSIZE       = 10
 
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are
-# not supported properly for IE 6.0, but are supported on all modern browsers.
-# Note that when changing this option you need to delete any form_*.png files
-# in the HTML output before the changes have effect.
-
-FORMULA_TRANSPARENT    = YES
-
 # 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
@@ -1078,16 +1008,6 @@ FORMULA_TRANSPARENT    = YES
 
 SEARCHENGINE           = NO
 
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a PHP enabled web server instead of at the web client
-# using Javascript. Doxygen will generate the search PHP script and index
-# file to put on the web server. The advantage of the server
-# based approach is that it scales better to large projects and allows
-# full text search. The disadvances is that it is more difficult to setup
-# and does not have live searching capabilities.
-
-SERVER_BASED_SEARCH    = NO
-
 #---------------------------------------------------------------------------
 # configuration options related to the LaTeX output
 #---------------------------------------------------------------------------
@@ -1472,14 +1392,6 @@ HIDE_UNDOC_RELATIONS   = YES
 
 HAVE_DOT               = NO
 
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
-# allowed to run in parallel. When set to 0 (the default) doxygen will
-# base this on the number of processors available in the system. You can set it
-# explicitly to a value larger than 0 to get control over the balance
-# between CPU load and processing speed.
-
-DOT_NUM_THREADS        = 0
-
 # 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
diff --git a/etc/templates/applanix_ecef.geom b/etc/templates/applanix_ecef.geom
new file mode 100644
index 0000000..bb467c5
--- /dev/null
+++ b/etc/templates/applanix_ecef.geom
@@ -0,0 +1,80 @@
+adjustment_0.adj_param_0.center:  0
+adjustment_0.adj_param_0.description:  x_offset
+adjustment_0.adj_param_0.lock_flag:  0
+adjustment_0.adj_param_0.parameter:  0
+adjustment_0.adj_param_0.sigma:  20
+adjustment_0.adj_param_0.units:  unknown
+adjustment_0.adj_param_1.center:  0
+adjustment_0.adj_param_1.description:  y_offset
+adjustment_0.adj_param_1.lock_flag:  0
+adjustment_0.adj_param_1.parameter:  0
+adjustment_0.adj_param_1.sigma:  20
+adjustment_0.adj_param_1.units:  unknown
+adjustment_0.adj_param_2.center:  0
+adjustment_0.adj_param_2.description:  roll
+adjustment_0.adj_param_2.lock_flag:  0
+adjustment_0.adj_param_2.parameter:  0
+adjustment_0.adj_param_2.sigma:  0.1
+adjustment_0.adj_param_2.units:  degrees
+adjustment_0.adj_param_3.center:  0
+adjustment_0.adj_param_3.description:  pitch
+adjustment_0.adj_param_3.lock_flag:  0
+adjustment_0.adj_param_3.parameter:  0
+adjustment_0.adj_param_3.sigma:  0.1
+adjustment_0.adj_param_3.units:  degrees
+adjustment_0.adj_param_4.center:  0
+adjustment_0.adj_param_4.description:  heading
+adjustment_0.adj_param_4.lock_flag:  0
+adjustment_0.adj_param_4.parameter:  0
+adjustment_0.adj_param_4.sigma:  0.1
+adjustment_0.adj_param_4.units:  degrees
+adjustment_0.adj_param_5.center:  0
+adjustment_0.adj_param_5.description:  altitude
+adjustment_0.adj_param_5.lock_flag:  0
+adjustment_0.adj_param_5.parameter:  0
+adjustment_0.adj_param_5.sigma:  50
+adjustment_0.adj_param_5.units:  meters
+adjustment_0.description:  Initial adjustment
+adjustment_0.dirty_flag:  0
+adjustment_0.number_of_params:  6
+ce90_absolute:  0
+ce90_relative:  0
+current_adjustment:  0
+distortion.center:  0 0
+distortion.convergence_threshold:  1e-05
+distortion.dxdy:  0 0
+distortion.k0:  -8.15376945750675e-05
+distortion.k1:  -2.42434410095351e-05
+distortion.k2:  8.00435916479222e-09
+distortion.k3:  -2.14573540516252e-12
+distortion.max_iterations:  10
+distortion.type:  ossimMeanRadialLensDistortion
+ecef_platform_position:  -2411870.743 -4730740.965 3524595.274
+focal_length:  55.03
+heading:  359.58758
+image_id:  18056119
+ll_lat:  33.7477612884564
+ll_lon:  -117.018615975095
+lr_lat:  33.747827074449
+lr_lon:  -117.008698045221
+meters_per_pixel_x:  0.22801581544858
+meters_per_pixel_y:  0.228853673582399
+number_lines:  0
+number_of_adjustments:  1
+number_samples:  0
+pitch:  0.22249
+pixel_size:  0.009 0.009
+principal_point:  -0.31 0.012
+rect:  0 0 4076 4091
+ref_point_hgt:  0
+ref_point_lat:  33.7519054685536
+ref_point_line:  2046
+ref_point_lon:  -117.013823189972
+ref_point_samp:  2038.5
+roll:  -0.20272
+sensor:  sn0056
+type:  ossimApplanixEcefModel
+ul_lat:  33.7560906534809
+ul_lon:  -117.018696546959
+ur_lat:  33.7561457715824
+ur_lon:  -117.008758099403
diff --git a/etc/templates/applanix_utm.geom b/etc/templates/applanix_utm.geom
new file mode 100644
index 0000000..1aa7ef3
--- /dev/null
+++ b/etc/templates/applanix_utm.geom
@@ -0,0 +1,88 @@
+adjustment_0.adj_param_0.center:  0
+adjustment_0.adj_param_0.description:  x_offset
+adjustment_0.adj_param_0.lock_flag:  0
+adjustment_0.adj_param_0.parameter:  0
+adjustment_0.adj_param_0.sigma:  20
+adjustment_0.adj_param_0.units:  unknown
+adjustment_0.adj_param_1.center:  0
+adjustment_0.adj_param_1.description:  y_offset
+adjustment_0.adj_param_1.lock_flag:  0
+adjustment_0.adj_param_1.parameter:  0
+adjustment_0.adj_param_1.sigma:  20
+adjustment_0.adj_param_1.units:  unknown
+adjustment_0.adj_param_2.center:  0
+adjustment_0.adj_param_2.description:  orientation x
+adjustment_0.adj_param_2.lock_flag:  0
+adjustment_0.adj_param_2.parameter:  0
+adjustment_0.adj_param_2.sigma:  0.1
+adjustment_0.adj_param_2.units:  degrees
+adjustment_0.adj_param_3.center:  0
+adjustment_0.adj_param_3.description:  orientation y
+adjustment_0.adj_param_3.lock_flag:  0
+adjustment_0.adj_param_3.parameter:  0
+adjustment_0.adj_param_3.sigma:  0.1
+adjustment_0.adj_param_3.units:  degrees
+adjustment_0.adj_param_4.center:  0
+adjustment_0.adj_param_4.description:  orientation z
+adjustment_0.adj_param_4.lock_flag:  0
+adjustment_0.adj_param_4.parameter:  0
+adjustment_0.adj_param_4.sigma:  0.1
+adjustment_0.adj_param_4.units:  degrees
+adjustment_0.adj_param_5.center:  0
+adjustment_0.adj_param_5.description:  Altitude delta
+adjustment_0.adj_param_5.lock_flag:  0
+adjustment_0.adj_param_5.parameter:  0
+adjustment_0.adj_param_5.sigma:  50
+adjustment_0.adj_param_5.units:  meters
+adjustment_0.description:  Initial adjustment
+adjustment_0.dirty_flag:  0
+adjustment_0.number_of_params:  6
+bore_sight_tx:  3.6833
+bore_sight_ty:  6.5434
+bore_sight_tz:  6.9228
+ce90_absolute:  0
+ce90_relative:  0
+current_adjustment:  0
+distortion.center:  0 0
+distortion.convergence_threshold:  1e-05
+distortion.dxdy:  0.009 0.009
+distortion.k0:  -5.59893114002531e-06
+distortion.k1:  -2.14024096930352e-05
+distortion.k2:  7.34713092724834e-09
+distortion.k3:  -1.43179963509284e-12
+distortion.max_iterations:  10
+distortion.type:  ossimMeanRadialLensDistortion
+ecef_platform_position:  200749.951142946 -4390836.55526938 4609039.95503231
+focal_length:  60.145
+image_id:  17657707
+kappa:  89.58606
+latlonh_platform_position:  46.5511126036199 -87.3822481456446 1997.734 WGE
+ll_lat:  46.5451618607428
+ll_lon:  -87.3759435599062
+lr_lat:  46.558800630385
+lr_lon:  -87.3756710886
+meters_per_pixel_x:  0.276990977674318
+meters_per_pixel_y:  0.276990977674318
+number_lines:  0
+number_of_adjustments:  1
+number_samples:  0
+omega:  2.4356
+phi:  2.26026
+pixel_size:  0.009 0.009
+principal_point:  -0.207 -0.09
+rect:  0 0 5435 4091
+ref_point_hgt:  150.323262125254
+ref_point_lat:  46.5518736869718
+ref_point_line:  2046
+ref_point_lon:  -87.3832408365867
+ref_point_samp:  2718
+sensor:  sn0085D
+shift_values:  -0.504388 0.81088 -1.116507
+type:  ossimApplanixUtmModel
+ul_lat:  46.545161976167
+ul_lon:  -87.3905473288102
+ur_lat:  46.5589668385809
+ur_lon:  -87.3909614233877
+utm_hemisphere:  N
+utm_platform_position:  470696.886 5155353.811 1997.734 WGE
+utm_zone:  16
diff --git a/etc/templates/geographic_projection_template.geom b/etc/templates/geographic_projection_template.geom
index 3952510..33fb545 100644
--- a/etc/templates/geographic_projection_template.geom
+++ b/etc/templates/geographic_projection_template.geom
@@ -1,5 +1,5 @@
 //---------------------------------------------------------------------
-// $Id: geographic_projection_template.geom 9465 2006-08-28 18:53:59Z dburken $
+// $Id: geographic_projection_template.geom 20209 2011-11-04 15:21:37Z dburken $
 //
 // Description:
 // This is a keyword list with minimum set of key words to make an
@@ -11,17 +11,15 @@
 // decimal_degrees_per_pixel_lon =
 // decimal_degrees_per_pixel_lat * cos(fabs(origin_latitude))
 //---------------------------------------------------------------------
-central_meridian:  -89.875153888888889
+central_meridian:  0.0
 datum:  WGE
 ellipse_code:  WE
 ellipse_name:  WGS 84
 false_easting_northing:  ( 0.000000000000000, 0.000000000000000 )
 false_easting_northing_units:  meters
-major_axis:  6378137.000000000000000
-minor_axis:  6356752.314199999906123
-origin_latitude:  41.764721222222221
+origin_latitude:  0.0
 pixel_scale_units:  degrees
-pixel_scale_xy:  ( 0.006790544118047, 0.005064973575493 )
+pixel_scale_xy:  ( 0.066666667, 0.066666667 )
 
 // point(tie center of pixel) or area (tie upper left corner of pixel).
 pixel_type:  point
diff --git a/etc/templates/nitf-site-configuration.kwl b/etc/templates/nitf-site-configuration.kwl
new file mode 100644
index 0000000..b995323
--- /dev/null
+++ b/etc/templates/nitf-site-configuration.kwl
@@ -0,0 +1,329 @@
+// ---
+// File: nitf-site-configuration.kwl
+// Edit as required.  Use "//" at beginning of line to comment out.  Leave
+// things you're not setting commented out.  
+// 
+// Reference:  MIL-STD-2500C
+// http://www.gwg.nga.mil/ntb/baseline/docs/2500c/2500C.pdf
+// ---
+// $Id: nitf-site-configuration.kwl 20196 2011-11-01 17:48:10Z dburken $
+
+//---
+// NOTES:
+// Basic Character Set (BCS)
+// Basic Character Set-Alphanumeric (BCS-A)
+// Basic Character Set-Numeric Integer (BCS-N integer)
+// Basic Character Set – Numeric Positive Integer (BCS-N positive integer)
+// BCS Space. BCS (and consequently ECS) code 0x20
+//---
+
+// ---
+// Field: OSTAID
+// 10 BCS-A
+// Originating Station ID. This field shall contain the identification code or
+// name of the originating organization, system, station, or product.
+// format: 10 ascii characters.
+// ---
+// nitf.file.OSTAID: McLean
+
+// ---
+// Field: FDT
+// 14 BCS-N integer CCYYMMDDhhmmss 
+// This field shall contain the time (UTC) (Zulu) of the file’s origination 
+// in the format CCYYMMDDhhmmss, where CC is the century (00 to 99), YY is the
+// last two digits of the year (00 to 99), MM is the month (01 to 12), DD is 
+// the day (01 to 31), hh is the hour (00 to 23), mm is the minute (00 to 59),
+// and ss is the second (00 to 59). UTC is assumed to be the time zone 
+// designator to express the time of day.
+// Field is set by nitf writer.
+// ---
+// nitf.file.FDT:
+
+// ---
+// Field: FTITLE
+// 80 ECS-A
+// This field shall contain the title of the file or shall be filled with ECS 
+// spaces (0x20).
+// ---
+// nitf.file.FTITLE: 
+
+// ---
+// Field: FSCLAS
+// 1 ECS-A
+// T      Top secret
+// S      Secret
+// C      Confidential
+// R      Restricted
+// U      Unclassified
+// ---
+// nitf.file.FSCLAS: U
+
+// ---
+// Field: FSCLSY
+// File Security Classification System. This field shall contain valid values 
+// indicating the national or multinational security system used to classify 
+// the file. Country Codes per FIPS PUB 10-4 shall be used to indicate 
+// national security systems. If this field is all ECS spaces (0x20), it shall
+// imply that no security classification system applies to the file.
+// ---
+// nitf.file.FSCLSY:
+
+// ---
+// Field: FSCODE
+// 11 BCS-A
+// File Codewords. This field shall contain a valid indicator of the security 
+// compartments associated with the file. Values include one or more of the 
+// digraphs found table A-4. Multiple entries shall be separated by a single 
+// ECS space (0x20): The selection of a relevant set of codewords is 
+// application specific. If this field is all ECS spaces (0x20), it shall 
+// imply that no codewords apply to the file.
+// ---
+// nitf.file.FSCODE:
+
+// ---
+// Field: FSCTLH
+// 2 ECS-A
+// File Codewords. This field shall contain a valid indicator of the security 
+// compartments associated with the file. Values include one or more of the 
+// digraphs found table A-4. Multiple entries shall be separated by a single 
+// ECS space (0x20): The selection of a relevant set of codewords is 
+// application specific. If this field is all ECS spaces (0x20), it shall 
+// imply that no codewords apply to the file.
+// ---
+// nitf.file.FSCTLH:
+
+// ---
+// Field: FSREL
+// 20 ECS-A
+// File Releasing Instructions. This field shall contain a valid list of 
+// country and/or multilateral entity codes to which countries and/or 
+// multilateral entities the file is authorized for release. Valid items in 
+// the list are one or more country codes as found in FIPS PUB 10-4 separated 
+// by a single ECS space (0x20). If this field is all ECS spaces (0x20), it 
+// shall imply that no file release instructions apply.
+// ---
+// nitf.file.FSREL:
+
+// ---
+// Field: FSDCTP
+// 2 ECS-A DD, DE, GD, GE, O, X  (Default is ECS spaces  (0x20)) 
+// File Declassification Type. This field shall contain a valid indicator of 
+// the type of security declassification or downgrading instructions which 
+// apply to the file. Valid values are 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), and X (= exempt from automatic
+// declassification). If this field is all ECS spaces (0x20), it shall imply 
+// that no file security declassification or downgrading instructions apply.
+// ---
+// nitf.file.FSDCTP: 
+
+// ---
+// Field: FSDCDT
+// 8 ECS-A CCYYMMDD (Default is ECS spaces (0x20)) 
+// File Declassification Date. This field shall indicate the date on which a 
+// file is to be declassified if the value in File Declassification Type is 
+// DD. If this field is all ECS spaces (0x20), it shall imply that no file 
+// declassification date applies.
+// ---
+// nitf.file.FSDCDT:
+
+// ---
+// Field: FSDCXM
+// 4 ECS-A X1 to X8, X251 to X259, (Default is ECS spaces (0x20)) 
+// File Declassification Exemption. This field shall indicate the reason the 
+// file is exempt from automatic declassification if the value in File 
+// Declassification Type is X. Valid values are X1 to X8 and X251 to X259. 
+// X1 to X8 correspond to the declassification exemptions found in DOD 
+// 5200.1-R, paragraphs 4-202b(1) to (8) for material exempt from the 10-year
+// rule. X251 to X259 correspond to the declassification exemptions found in 
+// DOD 5200.1-R, paragraphs 4-301a(1) to (9) for permanently valuable material
+// exempt from the 25-year declassification system. If this field is all ESC 
+// spaces (0x20), it shall imply that a file declassification exemption does 
+// not apply.
+// ---
+// nitf.file.FSDCXM:
+
+// ---
+// Field: FSDG
+// 1 ECS-A S, C, R (Default is ECS space (0x20)) 
+// File Downgrade. This field shall indicate the classification level to which
+// a file is to be downgraded if the values in File Declassification Type are 
+// GD or GE. Valid values are S (=Secret), C (=Confidential), R (=Restricted).
+// If this field contains an ECS space (0x20), it shall imply that file 
+// security downgrading does not apply.
+// ---
+// nitf.file.FSDG:
+
+// ---
+// Field: FSDGDT
+// 8 ECS-A CCYYMMDD (Default is ECS spaces (0x20)) 
+// File Downgrade Date. This field shall indicate the date on which a file is 
+// to be downgraded if the value in File Declassification Type is GD. If this 
+// field is all ECS spaces (0x20), it shall imply that a file security
+// downgrading date does not apply.
+// ---
+// nitf.file.FSDGDT:
+
+// ---
+// Field: FSCLTX
+// 43 ECS-A (Default is ECS spaces (0x20)) 
+// File Classification Text . This field shall be used to provide additional 
+// information about file classification to include identification of a 
+// declassification or downgrading event if the values in File 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 ECS spaces (0x20), it shall imply that
+// additional information about file classification does not apply.
+// ---
+// nitf.file.FSCLTX:
+
+// ---
+// Field: FSCATP
+// 1 ECS-A (Default is ECS space (0x20)) 
+// File Classification Authority Type. This field shall indicate the type of 
+// authority used to classify the file. Valid values are O (= original 
+// classification authority), D (= derivative from a single source), and M (=
+// derivative from multiple sources). If this field contains an ECS space 
+// (0x20), it shall imply that file classification authority type does not 
+// apply.
+// ---
+// nitf.file.FSCATP:
+
+// ---
+// Field: FSCAUT
+// 40 ECS-A  (Default is ECS spaces (0x20)) 
+// File Classification Authority. This field shall identify the classification
+// authority for the file dependent upon the value in File Classification 
+// Authority Type. Values are user defined free text which should contain the
+// following information: orig inal classification authority name and position
+// or personal identifier if the value in File Classification Authority Type 
+// is O; title of the document or security classification guide used to 
+// classify the file if the value in File Classification Authority Type is D; 
+// and Derive-Multiple if the file classification was derived from multiple 
+// sources and the value of the FSCATP field is M. In the latter case, the 
+// file 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 File Classification Text if desired. If this field is all 
+// ECS spaces (0x20), it shall imply that no file classification authority 
+// applies.
+// ---
+// nitf.file.FSCAUT:
+
+// ---
+// Field: FSCRSN 
+// 1 ECS-A A to G (Default is ECS space (0x20)) 
+// File Classification Reason. This field shall contain values indicating the 
+// reason for classifying the file. Valid values are A to G. These correspond 
+// to the reasons for original classification per E.O. 12958, Section 1.5.(a) 
+// to (g). If this field contains an ECS space (0x20), it shall imply that no 
+// file classification reason applies.
+// ---
+// nitf.file.FSCRSN:
+
+// ---
+// Field: FSSRDT
+// 8 ECS-A CCYYMMDD (Default is ECS spaces (0x20)) 
+// File Security Source Date. This field shall indicate the date of the 
+// source used to derive the classification of the file. In the case of 
+// multiple sources, the date of the most recent source shall be used. If 
+// this field is all ECS
+// spaces (0x20), it shall imply that a file security source date does not 
+// apply.
+// ---
+// nitf.file.FSSRDT:
+
+
+// ---
+// Field: FSCTLN
+// 15 ECS-A (Default is ECS spaces (0x20)) 
+// File Security Control Number. This field shall contain a valid security 
+// control number associated with the file. The format of the security control
+// number shall be in accordance with the regulations governing the 
+// appropriate security channel(s). If this field is all ECS spaces (0x20), 
+// it shall imply that no file security control number applies.
+// ---
+// nitf.file.FSCTLN:
+
+// ---
+// Field: FSCOP
+// 00000 to 99999
+// File copy number:
+// This field shall contain the copy number of the file. If this field is
+// all BCS zeros (0x30), it shall imply that there is no tracking of
+// numbered filecopies.
+// ---
+// nitf.file.FSCOP: 00000
+
+// ---
+// Field: FSCPYS
+// 00000 to 99999
+// File Number of Copies
+// This field shall contain the total number of copies of the file. If this
+// field is all BCS zeros (0x30), it shall imply that there is no tracking of
+// numbered file copies. 
+// ---
+// nitf.file.FSCPYS: 00000
+
+// ---
+// Field: ENCRYP
+// 1 BCS-N positive integer (Default is BCS zero (0x30)) 0 = Not Encrypted 
+// Encryption. This field shall contain the value BCS zero  (0x30) until such 
+// time as this specification is updated to define the use of other values. 
+// ---
+// nitf.file.ENCRYP:
+
+// ---
+// Field: FBKGC
+// 3 Unsigned binary integer (0x00 to 0xFF, 0x00 to 0xFF, 0x00 to 0xFF) 
+// File Background Color. This field shall contain the three color components 
+// of the file background in the order Red, Green, Blue. Where (0x00, 0x00, 
+// 0x00) is black and (0xFF, 0xFF, 0xFF) is white. 
+// ---
+// nitf.file.FBKGC:
+
+// ---
+// Field: ONAME
+// 24 ECS-A (Default is ECS spaces (0x20)) 
+// Originator’s Name . This field shall contain a valid name for the operator 
+// who originated the file. If the field is all ECS spaces (0x20), it shall 
+// represent that no operator is assigned responsibility for origination. 
+// ---
+// nitf.file.ONAME:
+
+// ---
+// Field: OPHONE
+// 18 ECS-A (Default is ECS spaces (0x20)) 
+// Originator’s Phone Number. This field shall contain a valid phone number 
+// for the operator who originated the file. If the field is all ECS spaces 
+// (0x20), it shall represent that no phone number is available for the 
+// operator assigned responsibility for origination. 
+// ---
+// nitf.file.OPHONE:
+
+// ---
+// Field: IDATIM
+// 14 BCS-N 
+// CCYYMMDDhhmmss 
+// Image Date and Time. This field shall contain the time (UTC) of the image
+// acquisition in the format CCYYMMDDhhmmss, where CC is the century (00
+// to 99), YY is the last two digits of the year (00 to 99), MM is the month
+// (01 to 12), DD is the day (01 to 31), hh is the hour (00 to 23), mm is the
+// minute (00 to 59), ss is the second (00 to 59). UTC (Zulu) is assumed to
+// be the time zone designator to express the time of day. Populate the
+// unknown date/time two character subfield with two hyphen-minus characters
+// hexadecimal code "2D") indicating the portion of the date or time that is
+// unknown.
+// ---
+// nitf.image.IDATIM: --------------
+
+// ---
+// Field: ISCLAS
+// T      Top secret
+// S      Secret
+// C      Confidential
+// R      Restricted
+// U      Unclassified
+// ---
+// nitf.image.ISCLAS: U
+
diff --git a/etc/templates/orthoigen3.kwl b/etc/templates/orthoigen3.kwl
index f03d173..2aef87d 100644
--- a/etc/templates/orthoigen3.kwl
+++ b/etc/templates/orthoigen3.kwl
@@ -2,17 +2,17 @@
 // theTile mask here is only for show.   The output file added to the orthoigen 
 // is used as the mask for generating named tile files.
 //
-// This example shows a 10 meter per pixel in a 10 kilometer tile.  Note:
-// when tiling is enabled any meter pixel overrides are ignored and is computed
-// based on the tiling parameters.
+// Note:  When tiling is enabled any meter pixel overrides are ignored and is 
+// computed based on the tiling parameters.
 //
 
 igen.slave_tile_buffers: 10
-
+ 
+// Ten km tiles with 100 with pixel size of 10 meters:
 igen.tiling.type: ossimTiling
 igen.tiling.tiling_distance: 10000 10000
 igen.tiling.tiling_distance_type: meters
-igen.tiling.delta: 100 100
+igen.tiling.delta: 10 10
 igen.tiling.delta_type: per_pixel
 igen.tiling.tile_name_mask: tile_%r%_%c%
 igen.tiling.padding_size_in_pixels: 0 0
diff --git a/etc/templates/orthoigen4.kwl b/etc/templates/orthoigen4.kwl
index 02c4e5f..19a4174 100644
--- a/etc/templates/orthoigen4.kwl
+++ b/etc/templates/orthoigen4.kwl
@@ -2,13 +2,16 @@
 // theTile mask here is only for show.   The output file added to the orthoigen 
 // is used as the mask for generating named tile files.
 //
-// This example shows a 10 meter per pixel in a 10 kilometer tile.  Note:
-// when tiling is enabled any meter pixel overrides are ignored and is computed
-// based on the tiling parameters.
+// Note: When tiling is enabled any meter pixel overrides are ignored and is
+// computed based on the tiling parameters.
 //
 
 igen.slave_tile_buffers: 10
 
+// ---
+// One degree tiles with pixel size of 1.0/1024.0 or 
+// 0.000976562 degrees per pixel
+// ---
 igen.tiling.type: ossimTiling
 igen.tiling.tiling_distance: 1 1
 igen.tiling.tiling_distance_type: degrees
@@ -18,7 +21,6 @@ igen.tiling.tile_name_mask: tile_%r%_%c%
 igen.tiling.padding_size_in_pixels: 0 0
 
 
-
 object1.description:
 object1.enabled:  1
 object1.id:  1
diff --git a/etc/templates/ossim-batch-test-template.kwl b/etc/templates/ossim-batch-test-template.kwl
new file mode 100644
index 0000000..dbf857d
--- /dev/null
+++ b/etc/templates/ossim-batch-test-template.kwl
@@ -0,0 +1,188 @@
+// ---
+// File: orthoigen-test.kwl
+// Generated by command: ossim-batch-test -w orthoigen-test.kwl
+// Description: ossim-batch-test 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:
+// 1) Use forward slash, slash(c++ comment) at beginning of line for comments.
+// 2) For environment variables use $(YOUR_VARIABLE).  They will be expanded at
+//    run time if valid.
+// 3) Clean, preprocess, run, and accept test sections can be switched on or off
+//    at run time.  These override config file flags.  Optional arguments are:
+//    --clean-test
+//    --preprocess-test
+//    --run-test
+//    --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.
+// ---
+
+// Where you want the log files to go:
+log_directory: $(OSSIM_TEST)/logs/osgeo
+
+// ---
+// Begin test1:
+// ---
+test1.name: test1
+test1.description: Test height for the center of the image for test2 and test3.
+
+// Controls/turns on/off whole test (all sections):
+test1.enabled: 1
+
+// Individual control flags:
+test1.run_clean_commands: 0
+test1.run_preprocessing_commands: 0
+test1.run_expected_results_commands: 0
+test1.run_test_commands: 1
+test1.run_postprocessing_commands: 1
+
+// Temp file to catch diff output.
+test1.temp_file: /tmp/tmp.txt
+
+// Clean up commands.
+test1.clean_command0: rm -rf $(OSSIM_TEST)/exp/orthoigen-test/test1
+test1.clean_command1: rm -rf $(OSSIM_TEST)/out/orthoigen-test/test1
+
+// Pre-process commands:
+test1.preprocess_command0: mkdir -p $(OSSIM_TEST)/exp/orthoigen-test/test1
+test1.preprocess_command1: mkdir -p $(OSSIM_TEST)/out/orthoigen-test/test1
+test1.preprocess_command1: mkdir -p $(OSSIM_TEST)/logs/osgeo
+
+// Commands to generate expected results:
+
+// Since test2 and test3 are dependent on elevation test the center of the image.
+test1.expected_results_command0: ossim-info --height -42.8508 147.2537 > $(OSSIM_TEST)/exp/orthoigen-test/test1/height.txt
+
+// The actual commands to test:
+
+test1.test_command0: ossim-info --height -42.8508 147.2537 > $(OSSIM_TEST)/out/orthoigen-test/test1/height.txt
+
+// Post process commands for diffs and stuff:
+
+test1.postprocess_command0: diff -w $(OSSIM_TEST)/exp/orthoigen-test/test1/height.txt $(OSSIM_TEST)/out/orthoigen-test/test1/height.txt
+ 
+// ---
+// End test1:
+// ---
+
+// ---
+// Begin test2:
+// ---
+
+test2.name: test2
+test2.description: Test geometry for GeoEye NITF with RPC model.
+
+// Controls/turns on/off whole test (all sections):
+test2.enabled: 1
+
+// Individual control flags:
+test2.run_clean_commands: 0
+test2.run_preprocessing_commands: 0
+test2.run_expected_results_commands: 0
+test2.run_test_commands: 1
+test2.run_postprocessing_commands: 1
+
+// Temp file to catch diff output.
+test2.temp_file: /tmp/tmp.txt
+
+// Clean up commands.
+test2.clean_command0: rm -rf $(OSSIM_TEST)/exp/orthoigen-test/test2
+test2.clean_command1: rm -rf $(OSSIM_TEST)/out/orthoigen-test/test2
+
+// Pre-process commands:
+test2.preprocess_command0: mkdir -p $(OSSIM_TEST)/exp/orthoigen-test/test2
+test2.preprocess_command1: mkdir -p $(OSSIM_TEST)/out/orthoigen-test/test2
+test2.preprocess_command1: mkdir -p $(OSSIM_TEST)/logs/osgeo
+
+// Commands to generate expected results:
+test2.expected_results_command0: ossim-info -d -i -p $(OSSIM_TEST)/source/GeoEye/GE1_Hobart_GeoStereo_NITF-NCD/5V090205M0001912264B220000100072M_001508507.ntf > $(OSSIM_TEST)/exp/orthoigen-test/test2/info.txt
+
+// The actual commands to test:
+test2.test_command0: ossim-info -d -i -p $(OSSIM_TEST)/source/GeoEye/GE1_Hobart_GeoStereo_NITF-NCD/5V090205M0001912264B220000100072M_001508507.ntf > $(OSSIM_TEST)/out/orthoigen-test/test2/info.txt
+
+// Post process commands for diffs and stuff:
+test2.postprocess_command0: diff -w $(OSSIM_TEST)/exp/orthoigen-test/test2/info.txt $(OSSIM_TEST)/out/orthoigen-test/test2/info.txt
+
+// ---
+// End test2:
+// ---
+
+// ---
+// Begin test3:
+// ---
+test3.name: test3
+test3.description: Test orthorectification of a GeoEye NITF with RPC model.
+
+// Controls/turns on/off whole test (all sections):
+test3.enabled: 1
+
+// Individual control flags:
+test3.run_clean_commands: 0
+test3.run_preprocessing_commands: 0
+test3.run_expected_results_commands: 0
+test3.run_test_commands: 1
+test3.run_postprocessing_commands: 1
+
+// Temp file to catch diff output.
+test3.temp_file: /tmp/tmp.txt
+
+// Clean up commands.
+test3.clean_command0: rm -rf $(OSSIM_TEST)/exp/orthoigen-test/test3
+test3.clean_command1: rm -rf $(OSSIM_TEST)/out/orthoigen-test/test3
+
+// Pre-process commands:
+test3.preprocess_command0: mkdir -p $(OSSIM_TEST)/exp/orthoigen-test/test3
+test3.preprocess_command1: mkdir -p $(OSSIM_TEST)/out/orthoigen-test/test3
+test3.preprocess_command1: mkdir -p $(OSSIM_TEST)/logs/osgeo
+
+// Commands to generate expected results:
+
+// Put the output in the "out" directory as the "exp" may be under svn for small things:
+
+// Ortho:
+test3.expected_results_command0: ossim-orthoigen -t 1024 --geo-scaled -42.85 --resample-type bilinear $(OSSIM_TEST)/source/GeoEye/GE1_Hobart_GeoStereo_NITF-NCD/5V090205M0001912264B220000100072M_001508507.ntf $(OSSIM_TEST)/out/orthoigen-test/test3/t1.tif
+
+// Histogram:
+test3.expected_results_command1: ossim-img2rr -r --create-histogram $(OSSIM_TEST)/out/orthoigen-test/test3/t1.tif
+
+// Geometry:
+test3.expected_results_command2: ossim-info -d -i -p $(OSSIM_TEST)/out/orthoigen-test/test3/t1.tif > $(OSSIM_TEST)/out/orthoigen-test/test3/t1-info.txt
+
+// Copy to exp directory which is under svn control:
+test3.expected_results_command3: cp $(OSSIM_TEST)/out/orthoigen-test/test3/t1.his $(OSSIM_TEST)/exp/orthoigen-test/test3/t1.his
+
+test3.expected_results_command4: cp $(OSSIM_TEST)/out/orthoigen-test/test3/t1-info.txt $(OSSIM_TEST)/exp/orthoigen-test/test3/t1-info.txt
+
+// The actual commands to test:
+// Ortho:
+test3.test_command0: ossim-orthoigen -t 1024 --geo-scaled -42.85 --resample-type bilinear $(OSSIM_TEST)/source/GeoEye/GE1_Hobart_GeoStereo_NITF-NCD/5V090205M0001912264B220000100072M_001508507.ntf $(OSSIM_TEST)/out/orthoigen-test/test3/t2.tif
+
+// Histogram:
+test3.test_command1: ossim-img2rr -r --create-histogram $(OSSIM_TEST)/out/orthoigen-test/test3/t2.tif
+
+// Geometry:
+test3.test_command2: ossim-info -d -i -p $(OSSIM_TEST)/out/orthoigen-test/test3/t2.tif > $(OSSIM_TEST)/out/orthoigen-test/test3/t2-info.txt
+
+// Post process commands for diffs and stuff:
+
+// Histogram:
+test3.postprocess_command0: diff -w $(OSSIM_TEST)/out/orthoigen-test/test3/t1.his $(OSSIM_TEST)/out/orthoigen-test/test3/t2.his
+
+// Geometry:
+test3.postprocess_command1: diff -w $(OSSIM_TEST)/out/orthoigen-test/test3/t1-info.txt $(OSSIM_TEST)/out/orthoigen-test/test3/t2-info.txt
+
+// ---
+// End test3:
+// ---
+
diff --git a/etc/templates/ossim_preferences_template b/etc/templates/ossim_preferences_template
index 1dfccb1..0ca61fc 100644
--- a/etc/templates/ossim_preferences_template
+++ b/etc/templates/ossim_preferences_template
@@ -1,5 +1,5 @@
 // ------------------------------------------------------------------------
-// $Id: ossim_preferences_template 18970 2011-02-25 19:47:27Z gpotts $
+// $Id: ossim_preferences_template 21742 2012-09-14 19:00:24Z dburken $
 // 
 // Description:  ossim_preferences_template
 // 
@@ -23,7 +23,7 @@
 // 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 an ossim preferences
+// Note that system environment variables found in this ossim preferences
 // file in the format "$(env_var_name)" will be expanded in place.
 // 
 // ------------------------------------------------------------------------
@@ -47,6 +47,7 @@
 // NOTES:
 // The elevation_source keyword replaces the deprecated keywords:
 // dted_directory
+// image_directory
 // srtm_directory
 // dted_cell
 // 
@@ -76,7 +77,12 @@
 //elevation_manager.elevation_source3.max_open_cells: 50 
 //elevation_manager.elevation_source3.memory_map_cells: false
 
-
+//elevation_manager.elevation_source1.connection_string: $(OSSIM_DATA)/elevation/srtm/3arc
+//elevation_manager.elevation_source1.type: image_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
 
 
 // Identity geoid is 0 everywhere, so MSL = Ellipsoid. Useful when DEM provides posts 
@@ -127,14 +133,19 @@ elevation_manager.enabled:  true
 // datum_grids: $(OSSIM_DATA)/ossim/elevation/nadcon-grids
 
 // ---
-// For state plane projection factory.  Note do not add harn if you do not
-// have the harn datum 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_file1: $(OSSIM_DATA)/ossim/share/ossim_epsg_projections-v7_4.csv
-epsg_database_file2: $(OSSIM_DATA)/ossim/share/ossim_harn_state_plane_epsg.csv
-epsg_database_file3: $(OSSIM_DATA)/ossim/share/ossim_state_plane_spcs.csv
-epsg_database_file4: $(OSSIM_DATA)/ossim/share/ossim_wkt_pcs.csv
-epsg_database_file5: $(OSSIM_DATA)/ossim/share/ossim_harn_state_plane_esri.csv
+epsg_database_file1: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_epsg_projections-v7_4.csv
+epsg_database_file2: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_harn_state_plane_epsg.csv
+epsg_database_file3: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_state_plane_spcs.csv
+epsg_database_file4: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_harn_state_plane_esri.csv
+
+// Database file for WKT-based projection factory:
+wkt_database_file: $(OSSIM_DATA)/ossim/share/ossim/ossim_wkt_pcs.csv
 
 // ---
 // deprecated for new geoid_ngs_directory keyword
@@ -164,11 +175,9 @@ epsg_database_file5: $(OSSIM_DATA)/ossim/share/ossim_harn_state_plane_esri.csv
 geoid_ngs_directory: $(OSSIM_DATA)/ear1/geoid/geoid99
 geoid_ngs_directory.byte_order: big_endian
 
-// -- 
-
 // ---
 // Generic support has been added to each NGS geoid grid. You can download
-// ngs grids for 1999, 2003, ... and should should work.
+// ngs grids for 1999, 2003, ... and should work.
 // byte order can be big_endian or little_endian
 //geoid_ngs_directory1: $(OSSIM_DATA)/ear1/geoidngs99
 //geoid_ngs_directory1.byte_order: little_endian
@@ -225,12 +234,14 @@ geoid_egm_96_grid: $(OSSIM_DATA)/ele1/geoid/geoid96/egm96.grd
 // plugin.file4: $(OSSIM_DATA)/ossim/plugins/libossim_plugin.so
 // plugin.file5: $(OSSIM_DATA)/ossim/plugins/libossimreg_plugin.so
 // plugin.file6: $(OSSIM_DATA)/ossim/plugins/libossimcontrib_plugin.so
-// plugin.file7: $(OSSIM_DATA)/ossim/plugins/libossimgdal_plugin.so
+// plugin.file7: $(OSSIM_DATA)/ossim/plugins/libossimkmlsuperoverlay_plugin.so
+// plugin.file8: $(OSSIM_DATA)/ossim/plugins/libossimlas_plugin.so
+// plugin.file9: $(OSSIM_DATA)/ossim/plugins/libossimgdal_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: ���..libossimkakadu_plugin
+// plugin0.file: <path to>/libossimkakadu_plugin
 // plugin0.options: """
 //                  read_factory.location: front
 //                  writer_factory.location: back
@@ -257,7 +268,7 @@ cache_size:
 // 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 ammount
+// 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 
@@ -269,13 +280,32 @@ cache_size:
 // 
 // Uncomment one below.
 // ---
+overview_stop_dimension: 8
+// overview_stop_dimension: 16
 // overview_stop_dimension: 32
-overview_stop_dimension: 64
+// 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
@@ -394,6 +424,11 @@ pqe_normalized_rgb_ellipse_color: 0.004 1.0 0.004
 // ---
 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
@@ -401,3 +436,32 @@ 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/include/ossim/base/ossimAdjSolutionAttributes.h b/include/ossim/base/ossimAdjSolutionAttributes.h
new file mode 100755
index 0000000..efd47ac
--- /dev/null
+++ b/include/ossim/base/ossimAdjSolutionAttributes.h
@@ -0,0 +1,87 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Hicks
+//
+// Description: Helper interface class for ossimAdjustmentExecutive
+//              and ossimWLSBundleSolution.
+//----------------------------------------------------------------------------
+#ifndef ossimAdjSolutionAttributes_HEADER
+#define ossimAdjSolutionAttributes_HEADER
+
+#include <ossim/base/ossimString.h>
+#include <ossim/matrix/newmat.h>
+#include <ossim/matrix/newmatap.h>
+#include <ossim/matrix/newmatio.h>
+#include <iostream>
+#include <map>
+#include <cmath>
+
+
+typedef std::multimap<int, int> ObjImgMap_t;
+typedef ObjImgMap_t::iterator ObjImgMapIter_t;
+typedef std::map<int, int> ImgNumparMap_t;
+typedef ImgNumparMap_t::iterator ImgNumparMapIter_t;
+typedef std::pair<ObjImgMapIter_t, ObjImgMapIter_t> ObjImgMapIterPair_t;
+
+
+class ossimAdjSolutionAttributes
+{
+public:
+   ossimAdjSolutionAttributes
+         (const int& numObjObs, const int& numImages, const int& numMeas, const int& rank);
+
+   ~ossimAdjSolutionAttributes();
+
+   // Access traits
+   inline int numObjObs() const { return theNumObjObs; }
+   inline int numImages() const { return theNumImages; }
+   inline int fullRank()  const { return theFullRank; }
+
+
+   friend class ossimWLSBundleSolution;
+   friend class ossimAdjustmentExecutive;
+
+
+protected:
+   // Traits
+   int theNumObjObs;
+   int theNumImages;
+   int theFullRank;
+   int theNumMeasurements;
+
+   // Stacked observation evaluation matrices
+   NEWMAT::Matrix theMeasResiduals;          // theNumMeasurements X 2
+   NEWMAT::Matrix theObjPartials;            // theNumObjObs*3 X 2
+   NEWMAT::Matrix theParPartials;            // theNumImages*(npar/image) X 2
+
+   // Stacked a priori covariance matrices
+   NEWMAT::Matrix theImagePtCov;             // theNumMeasurements*2 X 2
+   NEWMAT::Matrix theObjectPtCov;            // theNumObjObs*3 X 3
+
+   // Full parameter covariance matrix
+   //  TODO....  This is not stacked because npar/image may vary.  However, it's
+   //            not treated as a full matrix in the solution due to
+   //            current use of simple partitioning, assuming no correlation.
+   NEWMAT::Matrix theAdjParCov;              // theNumImages*(npar/image) X theNumImages*(npar/image)
+
+   // Correction vectors
+   NEWMAT::ColumnVector theLastCorrections;  // theFullRank X 1
+   NEWMAT::ColumnVector theTotalCorrections; // theFullRank X 1
+
+   // A posteriori full covariance matrix
+   NEWMAT::UpperTriangularMatrix theFullCovMatrix;
+
+   // Map obj vs. images (measurements)
+   ObjImgMap_t theObjImgXref;
+
+   // Map images vs. number of adj parameters
+   ImgNumparMap_t theImgNumparXref;
+
+   // Output operator
+   friend std::ostream& operator << (std::ostream&, ossimAdjSolutionAttributes&);
+
+};
+#endif // ossimAdjSolutionAttributes_HEADER
+
diff --git a/include/ossim/base/ossimAdjustmentExecutive.h b/include/ossim/base/ossimAdjustmentExecutive.h
new file mode 100644
index 0000000..017b706
--- /dev/null
+++ b/include/ossim/base/ossimAdjustmentExecutive.h
@@ -0,0 +1,180 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Hicks
+// test
+//
+// Description: Executive class for adjustment operations.
+//----------------------------------------------------------------------------
+#ifndef ossimAdjustmentExecutive_HEADER
+#define ossimAdjustmentExecutive_HEADER
+
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimObservationSet.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/matrix/newmat.h>
+#include <ossim/matrix/newmatap.h>
+#include <ossim/matrix/newmatio.h>
+
+#include <ctime>
+#include <vector>
+#include <iostream>
+
+class ossimWLSBundleSolution;
+class ossimAdjSolutionAttributes;
+
+
+class OSSIM_DLL ossimAdjustmentExecutive : public ossimObject
+{
+public:
+
+   /**
+    * @brief constructor
+    */
+   ossimAdjustmentExecutive(std::ostream& report);
+   
+   /** @brief ossimObservationSet constructor
+    *
+    * @param obsSet     tiepoint observation set.
+    */
+   ossimAdjustmentExecutive(ossimObservationSet& obsSet, std::ostream& report);
+   
+
+   /** @brief destructor */
+   ~ossimAdjustmentExecutive();
+   
+   /**
+    * @brief initialize adjustment solution
+    *
+    * @param obsSet     tiepoint observation set.
+    *
+    * @return true on success, false on error.
+    */
+   bool initializeSolution(ossimObservationSet& obsSet);
+
+   /**
+    * @brief run adjustment solution
+    *
+    * @return true on success, false on error.
+    */
+   bool runSolution();
+
+   /**
+    * @brief summarize solution
+    */
+   void summarizeSolution() const;
+
+
+   /**
+    * @brief compute mean and RMS error of residuals
+    *
+    * @param res   image residual matrix.
+    *
+    * @return true on success, false on error.
+    */
+   bool computeResidualStatistics(NEWMAT::Matrix& res);
+
+
+   /**
+    * @brief compute SEUW
+    *
+    * @return   standard error of unit weight.
+    */
+   double computeSEUW();
+   
+   /**
+    * @brief Print parameter correction method.
+    */
+   std::ostream& printParameterCorrectionSummary(std::ostream& out) const;
+   
+   /**
+    * @brief Print observation correction method.
+    */
+   std::ostream& printObservationCorrectionSummary(std::ostream& out) const;
+   
+   /**
+    * @brief Print residuals method.
+    */
+   std::ostream& printResidualSummary(std::ostream& out) const;
+
+
+   inline bool isValid() const { return theExecValid; }
+
+
+   // Generate time stamp
+   inline ossimString timeStamp()const
+   {
+      char timeString[22];
+      time_t now = time(NULL);
+      strftime(timeString, 22, "%a %m.%d.%y %H:%M:%S", localtime(&now));
+      string timeStamp(timeString);
+      return timeStamp;
+   }
+
+protected:
+   bool theExecValid;
+
+   // Observation set
+   ossimObservationSet* theObsSet;
+
+   // Optimizer
+   ossimWLSBundleSolution* theSol;
+
+   // Attribute interface
+   ossimAdjSolutionAttributes* theSolAttributes;
+
+   // Status parameters
+   double theConvCriteria;
+   int    theMaxIter;
+   bool   theMaxIterExceeded;
+   bool   theSolDiverged;
+   bool   theSolConverged;
+
+   // Traits
+   int theNumObsInSet;
+   int theNumImages;
+   int theNumParams;
+   int theNumMeasurements;
+   int theRankN;
+
+   // Solution arrays
+   NEWMAT::Matrix theMeasResiduals; // theNumMeasurements X 2
+   NEWMAT::Matrix theObjPartials;   // theNumObjObs*3 X 2
+   NEWMAT::Matrix theParPartials;   // theNumImages*(npar/image) X 2
+
+   // Statistics
+   double theXrms;
+   double theYrms;
+   double theXmean;
+   double theYmean;
+   std::vector<double> theSEUW;
+
+   // Adjustable parameter info
+   std::vector<double> theParInitialValues;
+   std::vector<double> theParInitialStdDev;
+   std::vector<ossimString> theParDesc;
+   std::vector<int> theImgs;
+
+   // Observation info
+   std::vector<double> theObsInitialValues;
+   std::vector<double> theObsInitialStdDev;
+   
+   std::ostream& theRep;
+                                  
+   
+   /**
+    * @brief Update adjustable parameters.
+    */
+   bool updateParameters();
+   
+   /**
+    * @brief Update observatin.
+    */
+   bool updateObservations();
+
+};
+
+#endif // #ifndef ossimAdjustmentExecutive_HEADER
diff --git a/include/ossim/base/ossimApplicationUsage.h b/include/ossim/base/ossimApplicationUsage.h
index 4827384..1d3a8cd 100644
--- a/include/ossim/base/ossimApplicationUsage.h
+++ b/include/ossim/base/ossimApplicationUsage.h
@@ -4,7 +4,7 @@
 // OSSIM.
 //
 //-------------------------------------------------------------------------
-// $Id: ossimApplicationUsage.h 9094 2006-06-13 19:12:40Z dburken $
+// $Id: ossimApplicationUsage.h 19692 2011-05-31 16:55:47Z dburken $
 #ifndef ossimApplicationUsage_HEADER
 #define ossimApplicationUsage_HEADER 1
 
@@ -22,8 +22,7 @@ class OSSIMDLLEXPORT ossimApplicationUsage
 
         ossimApplicationUsage(const ossimString& commandLineUsage);
 
-        typedef std::map<ossimString,ossimString> UsageMap;
-        
+        typedef std::map<ossimString,ossimString,ossimStringLtstr> UsageMap;
 
         void setApplicationName(const ossimString& name);
         const ossimString& getApplicationName() const;
diff --git a/include/ossim/base/ossimArgumentParser.h b/include/ossim/base/ossimArgumentParser.h
index f716f41..40a755b 100644
--- a/include/ossim/base/ossimArgumentParser.h
+++ b/include/ossim/base/ossimArgumentParser.h
@@ -4,10 +4,11 @@
 // OSSIM.
 //
 //-------------------------------------------------------------------------
-// $Id: ossimArgumentParser.h 17815 2010-08-03 13:23:14Z dburken $
+// $Id: ossimArgumentParser.h 19900 2011-08-04 14:19:57Z dburken $
 #ifndef ossimArgumentParser_HEADER
 #define ossimArgumentParser_HEADER 1
 #include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
 #include <map>
 #include <string>
 #include <iosfwd>
@@ -64,6 +65,12 @@ public:
          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);
       
@@ -89,6 +96,9 @@ 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; }
diff --git a/include/ossim/base/ossimByteStreamBuffer.h b/include/ossim/base/ossimByteStreamBuffer.h
new file mode 100644
index 0000000..ffb3e76
--- /dev/null
+++ b/include/ossim/base/ossimByteStreamBuffer.h
@@ -0,0 +1,66 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// File: ossim-foo.cpp
+//
+// Author:  Garrett Potts
+//
+// Description: This is a basic_streambuf that can be used for binary in memory streams
+//
+//
+// $Id$
+//----------------------------------------------------------------------------
+#ifndef ossimByteStreamBuffer_HEADER
+#define ossimByteStreamBuffer_HEADER
+#include <ossim/base/ossimConstants.h>
+#include <cstdio> /* for EOF */
+#include <streambuf>
+#include <iosfwd>
+#include <ios>
+
+//using namespace std;
+class OSSIM_DLL ossimByteStreamBuffer : public std::basic_streambuf<char, std::char_traits<char> >
+{
+public:
+   ossimByteStreamBuffer();
+    
+   ossimByteStreamBuffer(char_type* buf, ossim_int64 bufSize, bool shared=true);
+    
+   ossimByteStreamBuffer(const ossimByteStreamBuffer& src);
+   virtual ~ossimByteStreamBuffer();
+   virtual std::streambuf* setbuf ( char_type * s, std::streamsize n );
+   void clear();
+   // added so we can set a buffer and make it shared
+   std::streambuf* setBuf(char* buf, std::streamsize bufSize, bool shared);
+   virtual int overflow( int c = EOF);
+   /**
+    * Returns a pointer to the buffer
+    */
+   char_type* buffer();
+   const char_type* buffer()const;
+    
+   /**
+    * The buffer is no longer managed by this stream buffer and is removed.
+    */
+   char_type* takeBuffer();
+   ossim_uint64 bufferSize()const;
+    
+protected:
+   virtual int_type pbackfail(int_type __c  = traits_type::eof());
+   virtual pos_type seekoff(off_type offset, std::ios_base::seekdir dir,
+                            std::ios_base::openmode __mode = std::ios_base::in | std::ios_base::out);
+   virtual pos_type seekpos(pos_type pos, std::ios_base::openmode __mode = std::ios_base::in | std::ios_base::out);
+   virtual std::streamsize xsgetn(char_type* __s, std::streamsize __n);
+   virtual std::streamsize xsputn(const char_type* __s, std::streamsize __n);
+    
+    
+   void deleteBuffer();
+   void extendBuffer(ossim_uint64 bytes);
+
+   char_type* m_buffer;
+   ossim_int64 m_bufferSize;
+   bool m_sharedBuffer;
+};
+
+#endif
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/include/ossim/base/ossimColumnVector3d.h b/include/ossim/base/ossimColumnVector3d.h
index ab72bff..52bde06 100644
--- a/include/ossim/base/ossimColumnVector3d.h
+++ b/include/ossim/base/ossimColumnVector3d.h
@@ -8,7 +8,7 @@
 //              coordinate.
 //
 //*******************************************************************
-//  $Id: ossimColumnVector3d.h 9532 2006-09-11 11:20:05Z dburken $
+//  $Id: ossimColumnVector3d.h 20074 2011-09-08 16:16:27Z gpotts $
 #ifndef ossimColumnVector3d_HEADER
 #define ossimColumnVector3d_HEADER
 #include <ossim/base/ossimConstants.h>
@@ -40,11 +40,27 @@ public:
       }
 
    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.data[0];
-         data[1] = rhs.data[1];
-         data[2] = rhs.data[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)
    {
diff --git a/include/ossim/base/ossimCommon.h b/include/ossim/base/ossimCommon.h
index 4c2df41..9d5a756 100644
--- a/include/ossim/base/ossimCommon.h
+++ b/include/ossim/base/ossimCommon.h
@@ -10,9 +10,9 @@
 // Description: Common file for utility functions.
 //
 //*************************************************************************
-// $Id: ossimCommon.h 19008 2011-03-04 13:57:55Z gpotts $
+// $Id: ossimCommon.h 22197 2013-03-12 02:00:55Z dburken $
 #ifndef ossimCommon_HEADER
-#define ossimCommon_HEADER
+#define ossimCommon_HEADER 1
 
 
 // XXX nullify these for now, but eventually replace with a #include 
@@ -21,6 +21,9 @@
 #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>
@@ -29,8 +32,6 @@
 #include <iostream>
 #include <algorithm>
 #include <iterator>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimString.h>
 class ossimIpt;
 class ossimDpt;
 class ossimGpt;
@@ -486,7 +487,7 @@ namespace ossim
       if(!valuesList.empty())
       {
          ossim_uint32 idx = 0;
-         ossim_uint32 size = (valuesList.size()-1);
+         ossim_uint32 size = (ossim_uint32) (valuesList.size()-1);
          for(idx = 0; idx < size; ++idx)
          {
             out << valuesList[idx] << ",";
@@ -496,6 +497,7 @@ namespace ossim
       
       result = "("+out.str()+")";
    }
+   
    /**
     * This will output a vector of values inst a string
     *
@@ -507,7 +509,7 @@ namespace ossim
     */ 
    template <>
    OSSIM_DLL void toSimpleStringList(ossimString& result,
-                           const std::vector<ossim_uint8>& valuesList);
+                                     const std::vector<ossim_uint8>& valuesList);
    
    /**
     * Generic function to extract a list of values into a vector of string where
@@ -517,45 +519,85 @@ namespace ossim
     *
     * Parenthesis are required
     */ 
-   bool extractSimpleValues(std::vector<ossimString>& values, const ossimString& stringOfPoints);
+   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)
     */
-   bool toSimpleVector(std::vector<ossim_uint32>& result,
-                       const ossimString& stringOfPoints);
+  OSSIM_DLL bool toSimpleVector(std::vector<ossim_uint32>& result,
+                                const ossimString& stringOfPoints);
    /**
     *  Takes input format of the form:
     *  (value1,value2,...,valueN)
     */
-   bool toSimpleVector(std::vector<ossim_int32>& result,
-                       const ossimString& stringOfPoints);
+  OSSIM_DLL bool toSimpleVector(std::vector<ossim_int32>& result,
+                                const ossimString& stringOfPoints);
    /**
     *  Takes input format of the form:
     *  (value1,value2,...,valueN)
     */
-   bool toSimpleVector(std::vector<ossim_uint16>& result,
-                       const ossimString& stringOfPoints);
+   OSSIM_DLL bool toSimpleVector(std::vector<ossim_uint16>& result,
+                                 const ossimString& stringOfPoints);
    /**
     *  Takes input format of the form:
     *  (value1,value2,...,valueN)
     */
-   bool toSimpleVector(std::vector<ossim_int16>& result,
-                       const ossimString& stringOfPoints);
+  OSSIM_DLL bool toSimpleVector(std::vector<ossim_int16>& result,
+                                const ossimString& stringOfPoints);
    /**
     *  Takes input format of the form:
     *  (value1,value2,...,valueN)
     */
-   bool toSimpleVector(std::vector<ossim_uint8>& result,
-                       const ossimString& stringOfPoints);
+   OSSIM_DLL bool toSimpleVector(std::vector<ossim_uint8>& result,
+                                 const ossimString& stringOfPoints);
    /**
     *  Takes input format of the form:
     *  (value1,value2,...,valueN)
     */
-   bool toSimpleVector(std::vector<ossim_int8>& result,
-                       const ossimString& stringOfPoints);
+   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
@@ -566,6 +608,17 @@ namespace ossim
 	// 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();
+
 }
 
-#endif /* #ifndef COMMON_H */
+#endif /* #ifndef ossimCommon_HEADER */
diff --git a/include/ossim/base/ossimConnectableContainer.h b/include/ossim/base/ossimConnectableContainer.h
index 526303e..edbf334 100644
--- a/include/ossim/base/ossimConnectableContainer.h
+++ b/include/ossim/base/ossimConnectableContainer.h
@@ -6,7 +6,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimConnectableContainer.h 19484 2011-05-03 16:28:27Z gpotts $
+// $Id: ossimConnectableContainer.h 20316 2011-12-02 15:56:38Z oscarkramer $
 
 #ifndef ossimConnectableContainer_HEADER
 #define ossimConnectableContainer_HEADER
@@ -47,44 +47,75 @@ public:
 
    
    /*!
-    * Will find all objects of the past in type.  Use the RTTI type info.
-    * An optional recurse flag will say if there is another container then
-    * recurse it to find the type you are looking for else it just looks
-    * within its immediate children.
-    * 
-    * Example: passing STATIC_TYPE_INFO(ossimImageRenderer) as an argument will
-    *          look for all ossimImageRenderer's and return the list.
+    * 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 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>
+    *    ossimConnectableTypeIdVisitor visitor(typeId, false, ossimVisitor::VISIT_CHILDREN);
+    *    connectableObject->accept(visitor);
+    *    ossimConnectableCollectionVisitor::List& collection = visitor.getObjects();
+    * </pre>
     */
-   virtual ossimConnectableObject::ConnectableObjectList findAllObjectsOfType(const RTTItypeid& typeInfo,
-                                                            bool recurse=true);
-   virtual ossimConnectableObject::ConnectableObjectList findAllObjectsOfType(const ossimString& className,
-                                                            bool recurse=true);
+   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject::ConnectableObjectList findAllObjectsOfType(const ossimString& className,
+                                                            bool recurse=true));
 
    /*!
-    * Will find the firt object of the past in type.  Use the RTTI type info.
-    * An optional recurse flag will say if there is another container then
-    * recurse it to find the type you are looking for else it just looks
-    * within its immediate children.
-    * 
-    * Example: passing STATIC_TYPE_INFO(ossimImageRenderer) as an argument will
-    *          look for the first ossimImageRenderer and return that object.
+    * 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);
+    *    connectableObject->accept(visitor);
+    *    ossimRefPtr<ossimConnectableObject> obj = visitor.getObject();
+    * </pre>
     */
-   virtual ossimConnectableObject* findFirstObjectOfType(const RTTItypeid& typeInfo,
-                                                 bool recurse=true);
+   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findFirstObjectOfType(const RTTItypeid& typeInfo,
+                                                 bool recurse=true));
    
-   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>
+    *    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));
 
    /*!
-    * will search for the object given an id.  If recurse is true it will
-    * recurse
-    * to other containers.
-    */ 
-   ossimConnectableObject* findObject(const ossimId& id,
-                                     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(id, ossimVisitor::VISIT_CHILDREN);
+    *    connectableObject->accept(visitor);
+    *    ossimRefPtr<ossimConnectableObject> obj = visitor.object();
+    * </pre>
+    */
+   OSSIM_DEPRECATE_METHOD(ossimConnectableObject* findObject(const ossimId& id,
+                                     bool recurse=true));
 
-   ossimConnectableObject* findObject(const ossimConnectableObject* obj,
-                                     bool recurse=true);
+   /**
+    * Please use the new ossimVisitor design pattern to visit objects in the container.
+    */
+   OSSIM_DEPRECATE_METHOD(ossimConnectableObject* findObject(const ossimConnectableObject* obj,
+                                     bool recurse=true));
 
    /*!
     * Will cycle through all sources setting their ids. the idLast wlil be
@@ -141,6 +172,15 @@ public:
 //    void propagateEventToInputs(ossimEvent& event,
 //                                ossimConnectableObject* start);
      
+   /*!
+    *  Inserts all of this object's children and inputs into the container provided. Since this is
+    *  itself a container, this method will consolidate this with the argument container. 
+    *  Consequently, this object will not be represented in the argument container but its children
+    *  will be. Ownership of children will pass to the argument container.
+    *  @return Returns TRUE if successful.
+    */
+   virtual bool fillContainer(ossimConnectableContainer& container);
+
 protected:
    virtual ~ossimConnectableContainer();
    ossimConnectableContainer(const ossimConnectableContainer& rhs);
diff --git a/include/ossim/base/ossimConnectableObject.h b/include/ossim/base/ossimConnectableObject.h
index d235a4b..21a496c 100644
--- a/include/ossim/base/ossimConnectableObject.h
+++ b/include/ossim/base/ossimConnectableObject.h
@@ -11,12 +11,11 @@
 // all connectable objects.
 //
 //*************************************************************************
-// $Id: ossimConnectableObject.h 19484 2011-05-03 16:28:27Z gpotts $
+// $Id: ossimConnectableObject.h 21852 2012-10-21 20:16:04Z dburken $
 
 #ifndef ossimConnectableObject_HEADER
-#define ossimConnectableObject_HEADER
+#define ossimConnectableObject_HEADER 1
 
-#include <vector>
 #include <ossim/base/ossimConstants.h>
 #include <ossim/base/ossimObject.h>
 #include <ossim/base/ossimId.h>
@@ -24,9 +23,10 @@
 #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,
@@ -55,17 +55,17 @@ public:
     * All connectable objects will have id's.  This allows us to
     * set the id of this object.
     */
-   void setId(const ossimId& id){theId = id;}
+   void setId(const ossimId& id);
 
    /**
     * Will allow us to get this object's id.
     */
-   const ossimId& getId()const{return theId;}
+   const ossimId& getId()const;
    
    /**
     * Fetches the current owner, most likely a container but not limited to one.
     */
-   const ossimObject* getOwner() const { return theOwner; }
+   const ossimObject* getOwner() const;
 
    /**
     * Permits changing the object's owner.
@@ -83,38 +83,77 @@ public:
     * want both checked then pass
     * CONNECTABLE_DIRECTION_INPUT | CONNECTABLE_DIRECTION_OUTPUT
     */
-   virtual bool isConnected(ossimConnectableObjectDirectionType direction = CONNECTABLE_DIRECTION_INPUT)const;
+   virtual bool isConnected(
+      ossimConnectableObjectDirectionType direction = CONNECTABLE_DIRECTION_INPUT)const;
 
 
-   /**
-    *
-    * Searches the input list and the output list for the
-    * passed in id.  Returns NULL if it wasn't found.
+   /*!
+    * 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));
+   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findConnectableObject(
+                             const ossimId& id));
 
-   /**
-    * Will search for a given object of the passed in RTTI type.
+   /*!
+    * 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));
-
-   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findObjectOfType(const ossimString& obj,
-                                                    ossimConnectableObjectDirectionType directionType,
-                                                    bool recurse = true));
+   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findObjectOfType(
+                             RTTItypeid typeId,
+                             ossimConnectableObjectDirectionType directionType,
+                             bool recurse = true));
 
-   /**
-    * @param className Class name of object to look for.
-    * 
-    * @return object of the passed in RTTI type or NULL if not found.
+   /*!
+    * 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
     *
-    * @note This method does NOT traverse beyond any objects the do not have
-    * a fixed input of one connection.
+    * <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));
+                             const ossimString& className));
    
    /**
     * Return a valid index of the input list if the passed in object
@@ -141,31 +180,33 @@ public:
    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.
-    * 
+    * 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;
+   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.
-    * 
+    * 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;
+   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;
+   virtual bool canConnectMyInputTo(
+      ossim_int32 myInputIndex, const ossimConnectableObject* object)const=0;
    
    /**
     * default implementation is to allow anyone to connect to us.
@@ -187,10 +228,11 @@ public:
     * 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);
-  
+   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);
@@ -213,10 +255,11 @@ public:
     * 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);
-  
+   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).
@@ -298,18 +341,12 @@ public:
    /**
     * Returns the number of input objects.
     */
-   virtual ossim_uint32 getNumberOfInputs()const
-      {
-         return (ossim_uint32)theInputObjectList.size();
-      }
+   virtual ossim_uint32 getNumberOfInputs()const;
 
    /**
     * Return the number of output objects
     */
-   virtual ossim_uint32 getNumberOfOutputs()const
-      {
-         return (ossim_uint32)theOutputObjectList.size();
-      }
+   virtual ossim_uint32 getNumberOfOutputs()const;
    
    /**
     * returns the object at the specified index.
@@ -347,15 +384,10 @@ public:
     */
    virtual void setNumberOfInputs(ossim_int32 numberOfInputs);
 
-   virtual bool getInputListIsFixedFlag()const
-      {
-         return theInputListIsFixedFlag;
-      }
+   virtual bool getInputListIsFixedFlag()const;
+   
+   virtual bool getOutputListIsFixedFlag()const;
 
-   virtual bool getOutputListIsFixedFlag()const
-      {
-         return theOutputListIsFixedFlag;
-      }
    /**
     * Will set the number of outputs.  This will expand the list if the
     * number of outputs is larger than the current number of outputs.
@@ -364,106 +396,96 @@ public:
     */
    virtual void setNumberOfOutputs(ossim_int32 numberOfInputs);
    
-   const ConnectableObjectList& getInputList()const
-      {
-         return theInputObjectList;
-      }
-   const ConnectableObjectList& getOutputList()const
-      {
-         return theOutputObjectList;
-      }
-   ConnectableObjectList& getInputList()
-      {
-         return theInputObjectList;
-      }
-   ConnectableObjectList& getOutputList()
-      {
-         return theOutputObjectList;
-      }
+   const ConnectableObjectList& getInputList()const;
 
-   /*!
-    * These methods are now deprecated.  You can achieve the same thing by using the new visitor design pattern 
-    * <pre>
-    *    ossimConnectableTypeNameVisitor visitor("<put type name here>", false, ossimConnectableVisitor::VISIT_CHILDREN);
-    *    connectableObject->accept(visitor);
-    *    ossimConnectableCollectionVisitor::List& collection = visitor.getObjects();
-    * </pre>
-    */
-    OSSIM_DEPRECATE_METHOD(virtual void findAllObjectsOfType(ConnectableObjectList& result, const RTTItypeid& typeInfo, bool recurse=true) );
+   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 
+    * 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>
-    *    ossimConnectableTypeNameVisitor visitor("<put type name here>", false, ossimConnectableVisitor::VISIT_CHILDREN);
+    *    ossimTypeNameVisitor visitor("<put type name here>",
+    *    false, ossimVisitor::VISIT_CHILDREN);
     *    connectableObject->accept(visitor);
-    *    ossimConnectableCollectionVisitor::List& collection = visitor.getObjects();
+    *    ossimCollectionVisitor::List& collection = visitor.getObjects();
     * </pre>
     */
-   OSSIM_DEPRECATE_METHOD(virtual void findAllObjectsOfType(ConnectableObjectList& result,
-                                     const ossimString& className,
-                                     bool recurse=true));
-   
+    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 
+    * 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>
-    *    ossimConnectableTypeIdVisitor visitor(<put type id here>, false, ossimConnectableVisitor::VISIT_CHILDREN | ossimConnectableVisitor::VISIT_INPUTS);
+    *    ossimTypeNameVisitor visitor("<put type name here>", false,
+    *    ossimVisitor::VISIT_CHILDREN);
     *    connectableObject->accept(visitor);
-    *    ossimConnectableCollectionVisitor::List& collection = visitor.getObjects();
+    *    ossimCollectionVisitor::List& collection = visitor.getObjects();
     * </pre>
     */
-   OSSIM_DEPRECATE_METHOD(virtual void findAllInputsOfType(
-      ConnectableObjectList& result,
-      const RTTItypeid& typeInfo,
-      bool propagateToInputs=true,
-      bool recurseChildren=false));
+   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 
+    * 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>
-    *    ossimConnectableTypeNameVisitor visitor("<put type name here>", false, ossimConnectableVisitor::VISIT_CHILDREN | ossimConnectableVisitor::VISIT_INPUTS);
+    *    ossimTypeIdVisitor visitor(<put type id here>, false,
+    *    ossimVisitor::VISIT_CHILDREN | ossimVisitor::VISIT_INPUTS);
     *    connectableObject->accept(visitor);
-    *    ossimConnectableCollectionVisitor::List& collection = visitor.getObjects();
+    *    ossimCollectionVisitor::List& collection = visitor.getObjects();
     * </pre>
     */
    OSSIM_DEPRECATE_METHOD(virtual void findAllInputsOfType(
       ConnectableObjectList& result,
-      const ossimString& className,
+      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 
-    * <pre>
-    *    ossimConnectableTypeNameVisitor visitor("<put type name here>", false, ossimConnectableVisitor::VISIT_CHILDREN | ossimConnectableVisitor::VISIT_INPUTS);
-    *    connectableObject->accept(visitor);
-    *    ossimConnectableCollectionVisitor::List& collection = visitor.getObjects();
-    * </pre>
-    */
-   OSSIM_DEPRECATE_METHOD(virtual void findAllOutputsOfType(
-      ConnectableObjectList& result,
-      const ossimString& className,
-      bool propagateToOutputs=true,
-      bool recurseChildren=false));
-   
-   /*!
-    * These methods are now deprecated.  You can achieve the same thing by using the new visitor design pattern 
+    * 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>
-    *    ossimConnectableTypeIdVisitor visitor(<put type id here>, false, ossimConnectableVisitor::VISIT_CHILDREN | ossimConnectableVisitor::VISIT_INPUTS);
+    *    ossimTypeNameVisitor visitor("<put type name here>",
+    *    false, ossimVisitor::VISIT_CHILDREN | ossimVisitor::VISIT_INPUTS);
     *    connectableObject->accept(visitor);
-    *    ossimConnectableCollectionVisitor::List& collection = visitor.getObjects();
+    *    ossimCollectionVisitor::List& collection = visitor.getObjects();
     * </pre>
     */
-   OSSIM_DEPRECATE_METHOD(virtual void findAllOutputsOfType(
-      ConnectableObjectList& result,
-      const RTTItypeid& typeInfo,
-      bool propagateToOutputs=true,
-      bool recurseChildren=false));
    
+   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 ------------------- */
@@ -502,6 +524,13 @@ public:
                                              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.
@@ -530,15 +559,16 @@ public:
     */     
    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;
@@ -557,15 +587,15 @@ protected:
    /**
     * Holds a list of input objects.
     */
-   ConnectableObjectList     theInputObjectList;
+   ConnectableObjectList theInputObjectList;
    
    /**
     * Holds a list of output objects.
     */
-   ConnectableObjectList     theOutputObjectList;
+   ConnectableObjectList theOutputObjectList;
 
 private:
 TYPE_DATA
 };
 
-#endif
+#endif /* #ifndef ossimConnectableObject_HEADER */
diff --git a/include/ossim/base/ossimConnectableObjectListener.h b/include/ossim/base/ossimConnectableObjectListener.h
index c473b8b..40ea207 100644
--- a/include/ossim/base/ossimConnectableObjectListener.h
+++ b/include/ossim/base/ossimConnectableObjectListener.h
@@ -7,7 +7,7 @@
 //
 //
 //*************************************************************************
-// $Id: ossimConnectableObjectListener.h 9968 2006-11-29 14:01:53Z gpotts $
+// $Id: ossimConnectableObjectListener.h 19962 2011-08-16 18:10:52Z gpotts $
 #ifndef ossimConnectableObjectListener_HEADER
 #define ossimConnectableObjectListener_HEADER
 
@@ -23,39 +23,42 @@ class OSSIMDLLEXPORT ossimConnectableObjectListener : public ossimListener
 public:
    ossimConnectableObjectListener():ossimListener(){}
    virtual ~ossimConnectableObjectListener(){}
-
+   
    virtual void processEvent(ossimEvent& event);
-
+   
    virtual void objectDestructingEvent(ossimObjectDestructingEvent& /*event*/)
-      {}
+   {}
    virtual void connectionEvent(ossimConnectionEvent& /* event */)
-      {}
+   {}
    virtual void disconnectInputEvent(ossimConnectionEvent& /* event */)
-      {}
+   {}
    virtual void disconnectOutputEvent(ossimConnectionEvent& /* event */)
-      {}
+   {}
    virtual void connectInputEvent(ossimConnectionEvent& /* event */)
-      {}
+   {}
    virtual void connectOutputEvent(ossimConnectionEvent& /* event */)
-      {}
-
+   {}
+   
    virtual void propertyEvent(ossimPropertyEvent& /* event */)
-      {}
-
+   {}
+   
    /*!
     * 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 
     */
    virtual void addObjectEvent(ossimContainerEvent& /* event */)
-      {}
-
+   {}
+   
    virtual void removeObjectEvent(ossimContainerEvent& /* event */)
-      {}
-
+   {}
+   
+   virtual void containerEvent(ossimContainerEvent& /* event */)
+   {}
+   
    virtual void refreshEvent(ossimRefreshEvent& /* event */)
-      {}
-TYPE_DATA
+   {}
+   TYPE_DATA
 };
 
 #endif
diff --git a/include/ossim/base/ossimConstants.h b/include/ossim/base/ossimConstants.h
index 4b10ec8..ee6c327 100644
--- a/include/ossim/base/ossimConstants.h
+++ b/include/ossim/base/ossimConstants.h
@@ -7,10 +7,10 @@
  * Description: Common file for global constants.
  *
  **************************************************************************
- * $Id: ossimConstants.h 19483 2011-05-03 16:23:36Z gpotts $
+ * $Id: ossimConstants.h 22221 2013-04-11 15:30:08Z dburken $
  */
 #ifndef ossimConstants_HEADER
-#define ossimConstants_HEADER
+#define ossimConstants_HEADER 1
 
 #ifdef __cplusplus
 extern "C" {
@@ -291,25 +291,27 @@ enum ossimScalarType
    OSSIM_SINT16            =  4, /**< 16 bit signed integer         */
    OSSIM_UINT32            =  5, /**< 32 bit unsigned integer       */
    OSSIM_SINT32            =  6, /**< 32 bit signed integer         */
-   OSSIM_FLOAT32           =  7, /**< 32 bit floating point         */
-   OSSIM_FLOAT64           =  8, /**< 64 bit floating point         */
-   OSSIM_CINT16            =  9, /**< 16 bit complex integer        */
-   OSSIM_CINT32            = 10, /**< 32 bit complex integer        */
-   OSSIM_CFLOAT32          = 11, /**< 32 bit complex floating point */
-   OSSIM_CFLOAT64          = 12, /**< 64 bit complex floating point */
+   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_UCHAR             = 1,  /**< 8 bit unsigned iteger */
+   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_USHORT11          = 13, /**< 16 bit unsigned integer (11 bits used) */
-   OSSIM_FLOAT             = 7,  /**< 32 bit floating point */
-   OSSIM_NORMALIZED_FLOAT  = 18, /**< normalized floating point  32 bit */
-   OSSIM_DOUBLE            = 8,  /**< double 64 bit    */
-   OSSIM_NORMALIZED_DOUBLE = 20  /**< Normalized double 64 bit */
+   OSSIM_SSHORT16          = 4,  /**< 16 bit signed integer  */
+   OSSIM_FLOAT             = 9,  /**< 32 bit floating point  */
+   OSSIM_DOUBLE            = 10, /**< 64 bit floating point  */
 };
 
 /*
@@ -382,9 +384,7 @@ enum ossimUnitType
    OSSIM_KILOMETERS      = 16
 };
 
-/*
- Definitions for data object status.
-*/
+/** Definitions for data object status. */
 enum ossimDataObjectStatus
 {
    OSSIM_STATUS_UNKNOWN = 0,
@@ -405,7 +405,8 @@ enum ossimImageType
    OSSIM_GENERAL_RASTER_BIP       = 5,
    OSSIM_GENERAL_RASTER_BIL       = 6,
    OSSIM_GENERAL_RASTER_BSQ       = 7,
-   OSSIM_JPEG                     = 8
+   OSSIM_JPEG                     = 8,
+   OSSIM_PDF                      = 9
 };
 
 /** Definitions for metadata type identification. */
@@ -426,6 +427,20 @@ enum ossimByteOrder
    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
@@ -476,53 +491,61 @@ enum ossimByteOrder
 //---
 #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_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_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_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_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_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_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_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_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_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_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_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_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)
 
@@ -530,4 +553,4 @@ enum ossimByteOrder
 }
 #endif
 
-#endif
+#endif /* #ifndef ossimConstants_HEADER */
diff --git a/include/ossim/base/ossimContainerEvent.h b/include/ossim/base/ossimContainerEvent.h
index c78bfc7..d7485c3 100644
--- a/include/ossim/base/ossimContainerEvent.h
+++ b/include/ossim/base/ossimContainerEvent.h
@@ -7,24 +7,28 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimContainerEvent.h 9094 2006-06-13 19:12:40Z dburken $
+// $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 theEvent was sent to.
-                       ossimObject* obj2, // the object associated 
+   ossimContainerEvent(ossimObject* obj1,// the object firing the event.
                        long id);
 
-   ossimObject* getAssociatedObject();
-   const ossimObject* getAssociatedObject()const;
-   void setAssociatedObject(ossimObject* obj);
+   void setObjectList(ossimObject* obj);
+   void setObjectList(ObjectList& objects);
+   ObjectList& getObjectList(){return m_objectList;}
+   const ObjectList& getObjectList()const{return m_objectList;}
    
 protected:
    
@@ -33,7 +37,7 @@ protected:
     * if this was an add then it s the object added to the
     * container.
     */
-   ossimObject* theAssociatedObject;
+      ObjectList m_objectList;
 
 TYPE_DATA
 };
diff --git a/include/ossim/base/ossimContainerProperty.h b/include/ossim/base/ossimContainerProperty.h
index 09f1ecf..68a372c 100644
--- a/include/ossim/base/ossimContainerProperty.h
+++ b/include/ossim/base/ossimContainerProperty.h
@@ -5,7 +5,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimContainerProperty.h 18405 2010-11-10 20:44:58Z gpotts $
+// $Id: ossimContainerProperty.h 19917 2011-08-09 11:12:24Z gpotts $
 #ifndef ossimContainerProperty_HEADER
 #define ossimContainerProperty_HEADER
 #include <vector>
@@ -48,7 +48,9 @@ public:
       std::vector<ossimRefPtr<ossimProperty> >& children) const;
    
    virtual ossimRefPtr<ossimXmlNode> toXml()const;
+   virtual void setReadOnlyFlag(bool flag);
 
+   virtual void accept(ossimVisitor& visitor);
 protected:
    std::vector<ossimRefPtr<ossimProperty> > theChildPropertyList;
 
diff --git a/include/ossim/base/ossimCsvFile.h b/include/ossim/base/ossimCsvFile.h
index 1c753ce..c457c17 100644
--- a/include/ossim/base/ossimCsvFile.h
+++ b/include/ossim/base/ossimCsvFile.h
@@ -16,7 +16,7 @@ public:
    class OSSIM_DLL Record : public ossimReferenced
       {
       public:
-         typedef std::map<ossimString, ossimString> FieldMapType;
+         typedef std::map<ossimString, ossimString, ossimStringLtstr> FieldMapType;
          typedef std::vector<ossimString> FieldValueListType;
                   
          Record(ossimCsvFile* csvFile);
diff --git a/include/ossim/base/ossimDataObject.h b/include/ossim/base/ossimDataObject.h
index b1cd629..047c545 100644
--- a/include/ossim/base/ossimDataObject.h
+++ b/include/ossim/base/ossimDataObject.h
@@ -8,7 +8,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimDataObject.h 15798 2009-10-23 19:15:20Z gpotts $
+// $Id: ossimDataObject.h 19931 2011-08-10 11:53:25Z gpotts $
 
 #ifndef ossimDataObject_HEADER
 #define ossimDataObject_HEADER
@@ -109,6 +109,8 @@ public:
    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:
 
diff --git a/include/ossim/base/ossimDate.h b/include/ossim/base/ossimDate.h
index f4fa7ff..b96f6a9 100644
--- a/include/ossim/base/ossimDate.h
+++ b/include/ossim/base/ossimDate.h
@@ -7,7 +7,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimDate.h 18554 2010-12-13 19:48:14Z dburken $
+// $Id: ossimDate.h 19704 2011-05-31 22:20:40Z dburken $
 #ifndef ossimDate_HEADER
 #define ossimDate_HEADER
 #include <ctime>
@@ -18,7 +18,7 @@
 class OSSIM_DLL ossimLocalTm : public std::tm
 {
 public:
-   friend OSSIM_DLL std::ostream& operator<< (std::ostream& out, const ossimLocalTm& src);
+   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,
diff --git a/include/ossim/base/ossimDatum.h b/include/ossim/base/ossimDatum.h
index 88c20fe..e2d6214 100644
--- a/include/ossim/base/ossimDatum.h
+++ b/include/ossim/base/ossimDatum.h
@@ -10,15 +10,16 @@
 // for Geotrans datum.  For more thorough description of each function
 // look at the datum.h file.
 //*******************************************************************
-//  $Id: ossimDatum.h 18693 2011-01-17 18:49:15Z dburken $
+//  $Id: ossimDatum.h 19793 2011-06-30 13:26:56Z gpotts $
 #ifndef ossimDatum_HEADER
 #define ossimDatum_HEADER
 #include <ossim/base/ossimConstants.h>
 #include <ossim/base/ossimString.h>
 #include <ossim/base/ossimGpt.h>
 #include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimObject.h>
 
-class OSSIMDLLEXPORT ossimDatum
+class OSSIMDLLEXPORT ossimDatum : public ossimObject
 {
    friend class ossimDatumFactory;
 
@@ -82,33 +83,13 @@ public:
               (longitude <= theEastLongitude));
    }
 
-   bool operator==(const ossimDatum& rhs)const
-   {
-      return ( (theCode == rhs.theCode)&&
-               (theName == rhs.theName)&&
-               (*theEllipsoid == *rhs.theEllipsoid)&&
-               (theSigmaX == rhs.theSigmaX)&&
-               (theSigmaY == rhs.theSigmaY)&&
-               (theSigmaZ == rhs.theSigmaZ)&&
-               (theWestLongitude == rhs.theWestLongitude)&&
-               (theEastLongitude == rhs.theEastLongitude)&&
-               (theSouthLatitude == rhs.theSouthLatitude)&&
-               (theNorthLatitude == rhs.theNorthLatitude));
-   }
+   bool operator==(const ossimDatum& rhs) const;
 
    bool operator!=(const ossimDatum& rhs)const
    {
-      return ( (theCode != rhs.theCode)||
-               (theName != rhs.theName)||
-               (*theEllipsoid != *rhs.theEllipsoid)||
-               (theSigmaX != rhs.theSigmaX)||
-               (theSigmaY != rhs.theSigmaY)||
-               (theSigmaZ != rhs.theSigmaZ)||
-               (theWestLongitude != rhs.theWestLongitude)||
-               (theEastLongitude != rhs.theEastLongitude)||
-               (theSouthLatitude != rhs.theSouthLatitude)||
-               (theNorthLatitude != rhs.theNorthLatitude));
+      return (!(*this == rhs));
    }
+   virtual bool isEqualTo(const ossimObject& obj, ossimCompareType compareType=OSSIM_COMPARE_FULL)const;
 
 protected:
    //! Only friend ossimDatumFactory is permitted to delete
@@ -147,7 +128,8 @@ protected:
          return ((lat < 89.75) && (lat > -89.75));
       }
 
-private:
+   
+protected:
    ossimString           theCode;
    ossim_uint32          theEpsgCode;
    ossimString           theName;
@@ -160,7 +142,9 @@ private:
    ossim_float64        theWestLongitude;
    ossim_float64        theEastLongitude;
    ossim_float64        theSouthLatitude;
-   ossim_float64        theNorthLatitude;   
+   ossim_float64        theNorthLatitude; 
+   
+TYPE_DATA;
 };
 
 #endif
diff --git a/include/ossim/base/ossimDatumFactory.h b/include/ossim/base/ossimDatumFactory.h
index 596c4f6..1d08163 100644
--- a/include/ossim/base/ossimDatumFactory.h
+++ b/include/ossim/base/ossimDatumFactory.h
@@ -9,15 +9,17 @@
 // This is the DatumFactory class.  You give it a code and it will
 // construct a Datum class.  It returns NULL if no code was found.
 //*******************************************************************
-//  $Id: ossimDatumFactory.h 17815 2010-08-03 13:23:14Z dburken $
+//  $Id: ossimDatumFactory.h 19682 2011-05-31 14:21:20Z dburken $
 
 #ifndef ossimDatumFactory_HEADER
-#define ossimDatumFactory_HEADER
-#include <vector>
-#include <map>
+#define ossimDatumFactory_HEADER 1
 
 #include <ossim/base/ossimDatumFactoryInterface.h>
 #include <ossim/base/ossimEllipsoidFactory.h>
+#include <map>
+#include <string>
+#include <vector>
+
 class ossimFilename;
 class ossimDatum;
 class ossimWgs84Datum;
@@ -53,7 +55,7 @@ protected:
    static ossimDatumFactory*       theInstance;
    const ossimDatum*               theWgs84Datum;
    const ossimDatum*               theWgs72Datum;
-   std::map<ossimString, const ossimDatum*> theDatumTable;
+   std::map<std::string, const ossimDatum*> theDatumTable;
    
 
    ossimDatumFactory()
diff --git a/include/ossim/base/ossimDatumFactoryInterface.h b/include/ossim/base/ossimDatumFactoryInterface.h
index 6463a03..ad689f5 100644
--- a/include/ossim/base/ossimDatumFactoryInterface.h
+++ b/include/ossim/base/ossimDatumFactoryInterface.h
@@ -13,6 +13,7 @@
 #define ossimDatumFactoryInterface_HEADER
 
 #include <ossim/base/ossimConstants.h> /* for OSSIM_DLL macro */
+#include <vector>
 
 // Forward class declarations:
 class ossimString;
diff --git a/include/ossim/base/ossimDblGrid.h b/include/ossim/base/ossimDblGrid.h
index a0a1270..64e51c0 100644
--- a/include/ossim/base/ossimDblGrid.h
+++ b/include/ossim/base/ossimDblGrid.h
@@ -1,7 +1,7 @@
 //*****************************************************************************
-// FILE: ossimDblGrid.h
+//                                   O S S I M
 //
-// Copyright (C) 2001 ImageLinks, Inc.
+// FILE: ossimDblGrid.h
 //
 // License:  See top level LICENSE.txt file.
 //
@@ -24,7 +24,7 @@
 //   spacing are specified to the constructor.
 //
 //*****************************************************************************
-//  $Id: ossimDblGrid.h 18693 2011-01-17 18:49:15Z dburken $
+//  $Id: ossimDblGrid.h 20044 2011-09-06 15:02:43Z oscarkramer $
 
 #ifndef ossimDblGrid_HEADER
 #define ossimDblGrid_HEADER
@@ -85,11 +85,10 @@ public:
                            const ossimDpt&    spacing,
                            double null_value = OSSIM_DEFAULT_NULL_PIX_DOUBLE);
    /*!
-   * Enables extrapolation functionality. If extrapolation is enabled, then calls to operator() will
-   * handle points outside of the grid. The grid must be initialized before calling this method
-   * since it checks if enough nodes are available for extrapolation.
+   * Enables/disables extrapolation functionality. If extrapolation is enabled, then calls to 
+   * operator() will handle points outside of the grid. 
    */
-   void enableExtrapolation();
+   void enableExtrapolation(bool arg=true) { theExtrapIsEnabled = arg;}
 
    void deallocate();
    /*!
diff --git a/include/ossim/base/ossimDms.h b/include/ossim/base/ossimDms.h
index 4b5b8e2..f044fa4 100644
--- a/include/ossim/base/ossimDms.h
+++ b/include/ossim/base/ossimDms.h
@@ -8,7 +8,7 @@
 //
 // Contains class definition for Degrees Minutes Seconds (ossimDms)
 //*******************************************************************
-//  $Id: ossimDms.h 15249 2009-08-25 13:12:11Z gpotts $
+//  $Id: ossimDms.h 19682 2011-05-31 14:21:20Z dburken $
 #ifndef ossimDms_HEADER
 #define ossimDms_HEADER
 // #include <iostream>
@@ -132,8 +132,8 @@ private:
                                 bool lat_flag)const;
    
    void calc_mins_or_secs(double *dd,
-                          ossimString::const_iterator &formatIter,
-                          ossimString &result)const;
+                          std::string::const_iterator& formatIter,
+                          std::string& result)const;
    /**
     * integer function calc_mins_or_secs				*
     *	calculates minutes from degrees, seconds from minutes,	
diff --git a/include/ossim/base/ossimDpt.h b/include/ossim/base/ossimDpt.h
index c50d005..66a92a0 100644
--- a/include/ossim/base/ossimDpt.h
+++ b/include/ossim/base/ossimDpt.h
@@ -10,7 +10,7 @@
 // Used to represent an double point containing an x and y data member.
 // 
 //*******************************************************************
-//  $Id: ossimDpt.h 17815 2010-08-03 13:23:14Z dburken $
+//  $Id: ossimDpt.h 19793 2011-06-30 13:26:56Z gpotts $
 #ifndef ossimDpt_HEADER
 #define ossimDpt_HEADER
 
@@ -143,7 +143,7 @@ public:
     */
    friend OSSIMDLLEXPORT std::istream& operator>>(std::istream& is,
                                                   ossimDpt& pt);
-   
+   bool isEqualTo(const ossimDpt& rhs, ossimCompareType compareType=OSSIM_COMPARE_FULL)const;
    //***
    // Public data members:
    //***
diff --git a/include/ossim/base/ossimDrect.h b/include/ossim/base/ossimDrect.h
index 18a91c7..b67251c 100644
--- a/include/ossim/base/ossimDrect.h
+++ b/include/ossim/base/ossimDrect.h
@@ -13,7 +13,7 @@
 // Container class for four double points representing a rectangle.
 // 
 //*******************************************************************
-//  $Id: ossimDrect.h 19180 2011-03-22 17:36:33Z oscarkramer $
+//  $Id: ossimDrect.h 22197 2013-03-12 02:00:55Z dburken $
 
 #ifndef ossimDrect_HEADER
 #define ossimDrect_HEADER
@@ -44,6 +44,7 @@
 //***
 class ossimIrect;
 class ossimPolygon;
+class ossimKeywordlist;
 
 //*******************************************************************
 // CLASS:  ossimDrect
@@ -127,30 +128,31 @@ public:
               const double&   size_y,
               ossimCoordSysOrientMode mode=OSSIM_LEFT_HANDED);
 
-   const ossimDrect& operator=  (const ossimDrect& rect);
-   const ossimDrect& operator=  (const ossimIrect& rect);
-   bool         operator!= (const ossimDrect& rect) const;
-   bool         operator== (const ossimDrect& rect) const;
-    friend ossimDrect operator*(double scalar, const ossimDrect& rect)
-      {
-         ossimDpt ul(rect.theUlCorner.x*scalar,
-                     rect.theUlCorner.y*scalar);
+   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;
 
-         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);
-         }
+   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),
+                           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)
       {
@@ -416,65 +418,65 @@ public:
     * Sets the upper left corner to "pt".  Adjusts the remaining corners
     * accordingly.
     */
-   void set_ul(const ossimDpt& pt);
+   inline void set_ul(const ossimDpt& pt);
 
    /*!
     * Sets the upper right corner to "pt".  Adjusts the remaining corners
     * accordingly.
     */
-   void set_ur(const ossimDpt& pt);
+   inline void set_ur(const ossimDpt& pt);
 
    /*!
     * Sets the lower right corner to "pt".  Adjusts the remaining corners
     * accordingly.
     */
-   void set_lr(const ossimDpt& pt);
+   inline void set_lr(const ossimDpt& pt);
 
    /*!
     * Sets the lower left corner to "pt".  Adjusts the remaining corners
     * accordingly.
     */
-   void set_ll(const ossimDpt& pt);
+   inline void set_ll(const ossimDpt& pt);
 
    /*!
     * Sets the upper left x.  Adjusts the remaining corners accordingly.
     */
-   void set_ulx(ossim_float64 x);
+   inline void set_ulx(ossim_float64 x);
 
    /*!
     * Sets the upper left y.  Adjusts the remaining corners accordingly.
     */
-   void set_uly(ossim_float64 y);
+   inline void set_uly(ossim_float64 y);
 
    /*!
     * Sets the upper right x.  Adjusts the remaining corners accordingly.
     */
-   void set_urx(ossim_float64 x);
+   inline void set_urx(ossim_float64 x);
 
    /*!
     * Sets the upper right y.  Adjusts the remaining corners accordingly.
     */
-   void set_ury(ossim_float64 y);
+   inline void set_ury(ossim_float64 y);
 
    /*!
     * Sets the lower right x.  Adjusts the remaining corners accordingly.
     */
-   void set_lrx(ossim_float64 x);
+   inline void set_lrx(ossim_float64 x);
 
    /*!
     * Sets the lower right y.  Adjusts the remaining corners accordingly.
     */
-   void set_lry(ossim_float64 y);
+   inline void set_lry(ossim_float64 y);
 
    /*!
     * Sets the lower left x.  Adjusts the remaining corners accordingly.
     */
-   void set_llx(ossim_float64 x);
+   inline void set_llx(ossim_float64 x);
 
    /*!
     * Sets the lower left y.  Adjusts the remaining corners accordingly.
     */
-   void set_lly(ossim_float64 y);
+   inline void set_lly(ossim_float64 y);
 
    /*!
     * METHOD: initBoundingRect(points)
@@ -562,6 +564,12 @@ public:
     * @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.
     */
diff --git a/include/ossim/base/ossimEcefPoint.h b/include/ossim/base/ossimEcefPoint.h
index 25fbb1c..070f526 100644
--- a/include/ossim/base/ossimEcefPoint.h
+++ b/include/ossim/base/ossimEcefPoint.h
@@ -13,7 +13,7 @@
 //              Initial coding.
 //<
 //*****************************************************************************
-//  $Id: ossimEcefPoint.h 11860 2007-10-15 19:59:10Z dburken $
+//  $Id: ossimEcefPoint.h 20043 2011-09-06 15:00:55Z oscarkramer $
 
 #ifndef ossimEcefPoint_HEADER
 #define ossimEcefPoint_HEADER
@@ -22,10 +22,12 @@
 #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
 //
@@ -52,6 +54,9 @@ public:
    ossimEcefPoint(const ossimColumnVector3d& assign_this)
       : theData(assign_this) {}
 
+   ossimEcefPoint(const NEWMAT::ColumnVector& assign_this)
+      : theData(assign_this) {}
+
    ossimEcefPoint(const ossimDpt3d& pt);
    
    void makeNan()
@@ -151,6 +156,27 @@ public:
     */
    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: 
     */
diff --git a/include/ossim/base/ossimEcefVector.h b/include/ossim/base/ossimEcefVector.h
index 83f29cf..ee928ee 100644
--- a/include/ossim/base/ossimEcefVector.h
+++ b/include/ossim/base/ossimEcefVector.h
@@ -16,7 +16,7 @@
 //              Initial coding.
 //<
 //*****************************************************************************
-//  $Id: ossimEcefVector.h 11398 2007-07-26 13:29:58Z dburken $
+//  $Id: ossimEcefVector.h 20043 2011-09-06 15:00:55Z oscarkramer $
 
 #ifndef ossimEcefVector_HEADER
 #define ossimEcefVector_HEADER
@@ -26,6 +26,7 @@
 #include <ossim/base/ossimColumnVector3d.h>
 #include <ossim/base/ossimEcefPoint.h>
 #include <ossim/base/ossimString.h>
+#include <ossim/matrix/newmat.h>
 
 class ossimGpt;
 
@@ -45,6 +46,9 @@ public:
    ossimEcefVector(const ossimEcefVector& copy_this)
       : theData (copy_this.theData) {}
 
+   ossimEcefVector(const NEWMAT::ColumnVector& assign_this)
+      : theData (assign_this) {}
+
    ossimEcefVector(const ossimEcefPoint& from,
                    const ossimEcefPoint& to)
       : theData (to.data() - from.data()) {}
@@ -148,6 +152,16 @@ public:
     */
    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;
+   }
+
    /*!
     * Debug Dump: 
     */
diff --git a/include/ossim/base/ossimEllipsoid.h b/include/ossim/base/ossimEllipsoid.h
index 8318c2c..3e94063 100644
--- a/include/ossim/base/ossimEllipsoid.h
+++ b/include/ossim/base/ossimEllipsoid.h
@@ -14,11 +14,12 @@
 //  $ID$
 
 #ifndef ossimEllipsoid_HEADER
-#define ossimEllipsoid_HEADER
+#define ossimEllipsoid_HEADER 1
 
 #include <cmath> /* std::sqrt */
 
 #include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
 #include <ossim/base/ossimString.h>
 #include <ossim/matrix/newmat.h>
 
@@ -27,6 +28,7 @@ class ossimEcefPoint;
 class ossimEcefVector;
 class ossimMatrix4x4;
 class ossimKeywordlist;
+class ossimDpt;
 
 /*!****************************************************************************
  *
@@ -44,12 +46,13 @@ public:
    ossimEllipsoid(const ossimString &name,
                   const ossimString &code,
                   const double &major_axis,
-                  const double &minor_axis);
+                  const double &minor_axis,
+                  ossim_uint32 epsg_code=0);
    ossimEllipsoid(const double &major_axis,
                   const double &minor_axis);
    ossimEllipsoid();
    
-   ~ossimEllipsoid(){};
+   virtual ~ossimEllipsoid(){};
 
    /*!
     * ACCESS METHOD...
@@ -132,6 +135,12 @@ public:
     */
    double geodeticRadius(const double& latitude) const;
    
+   /*!
+    * 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:
+    */
+   void geodeticRadii(const double& latitude, ossimDpt& radii) const;
+
    void latLonHeightToXYZ(double lat, double lon, double height,
                           double &x, double &y, double &z)const;
    void XYZToLatLonHeight(double x, double y, double z,
@@ -170,6 +179,9 @@ public:
 
    const ossimEllipsoid& operator=(const ossimEllipsoid& copy_me);
 
+   virtual bool isEqualTo(const ossimEllipsoid& rhs,
+                          ossimCompareType compareType=OSSIM_COMPARE_FULL)const;
+
 protected:
    void computeFlattening()
    {
@@ -186,6 +198,18 @@ protected:
    double    theB_squared;
    double    theEccentricitySquared;
 
-};
+}; // class OSSIMDLLEXPORT ossimEllipsoid
 
-#endif
+inline bool ossimEllipsoid::isEqualTo(const ossimEllipsoid& rhs,
+                                      ossimCompareType /* compareType */)const
+{
+   return ((theName == rhs.theName)&&
+           (theCode == rhs.theCode)&&
+           (theEpsgCode ==rhs.theEpsgCode)&&
+           ossim::almostEqual(theA, rhs.theA)&&
+           ossim::almostEqual(theB, rhs.theB)&&
+           ossim::almostEqual(theFlattening, rhs.theFlattening)&&
+           ossim::almostEqual(theEccentricitySquared, rhs.theEccentricitySquared));
+}
+
+#endif /* #ifndef ossimEllipsoid_HEADER */
diff --git a/include/ossim/base/ossimEllipsoidFactory.h b/include/ossim/base/ossimEllipsoidFactory.h
index 289c58d..f9a49de 100644
--- a/include/ossim/base/ossimEllipsoidFactory.h
+++ b/include/ossim/base/ossimEllipsoidFactory.h
@@ -1,5 +1,4 @@
 //*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
 //
 // License:  See top level LICENSE.txt file.
 //
@@ -9,15 +8,17 @@
 //
 // Thie file contains the ossimEllipsoidFactory.
 //*******************************************************************
-//  $Id: ossimEllipsoidFactory.h 17815 2010-08-03 13:23:14Z dburken $
+//  $Id: ossimEllipsoidFactory.h 19682 2011-05-31 14:21:20Z dburken $
 
 #ifndef ossimEllipsoidFactory_HEADER
 #define ossimEllipsoidFactory_HEADER
-#include <map>
+
 #include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimString.h>
+#include <map>
+#include <string>
 
 class ossimEllipsoid;
+class ossimString;
 class ossimWgs84Ellipsoid;
 class ossimWgs72Ellipsoid;
 
@@ -36,8 +37,8 @@ public:
    static ossimEllipsoidFactory* instance();
    
 private:
-   typedef std::map<ossimString, ossimEllipsoid*> TableType;
-   typedef std::map<ossim_uint32, ossimString> EpsgTableType;
+   typedef std::map<std::string, ossimEllipsoid*> TableType;
+   typedef std::map<ossim_uint32, std::string> EpsgTableType;
 
    static ossimEllipsoidFactory*     theInstance;
    ossimEllipsoid*       theWgs84Ellipsoid;
diff --git a/include/ossim/base/ossimEndian.h b/include/ossim/base/ossimEndian.h
index 8709d4e..ae7d455 100644
--- a/include/ossim/base/ossimEndian.h
+++ b/include/ossim/base/ossimEndian.h
@@ -23,47 +23,46 @@ public:
    /*!
     *  Swap bytes methods that work on a single pixel.
     */
-   void swap(ossim_sint8    &/*data*/){}
-   void swap(ossim_uint8    &/*data*/){}
-   void swap(ossim_int16   &data) const;
-   void swap(ossim_uint16  &data) const;
-   void swap(ossim_int32   &data) const;
-   void swap(ossim_uint32  &data) const;
-   void swap(ossim_uint64  &data) const;
-   void swap(ossim_sint64  &data) const;
-   void swap(ossim_float32 &data) const;
-   void swap(ossim_float64 &data) const;
+   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.
     */
-   void swap(ossimScalarType scalar, void* data, ossim_uint32 size) const;
+   inline void swap(ossimScalarType scalar, void* data, ossim_uint32 size) const;
    // only here to allow template based swaps to compile correctly
    //
-   void swap(ossim_sint8* data, ossim_uint32 size)const;
-   void swap(ossim_uint8* data, ossim_uint32 size)const;
-
+   inline void swap(ossim_sint8* data, ossim_uint32 size)const;
+   inline void swap(ossim_uint8* data, ossim_uint32 size)const;
    
-   void swap(ossim_int16* data, ossim_uint32 size) const;
-   void swap(ossim_uint16* 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;
 
-   void swap(ossim_int32* data, ossim_uint32 size) const;
-   void swap(ossim_uint32* 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;
 
 //#ifdef HAS_LONG_LONG
-   void swap(ossim_int64* data, ossim_uint32 size) const;
-   void swap(ossim_uint64* 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;
 //#endif
 
-   void swap(ossim_float32* data, ossim_uint32 size) const;
-   void swap(ossim_float64* 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;
 
-   void swapTwoBytes(void* data, ossim_uint32 size) const;
-   void swapFourBytes(void* data, ossim_uint32 size) const;
-   void swapEightBytes(void* data, ossim_uint32 size) const;
-   ossimByteOrder getSystemEndianType() 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:
 
diff --git a/include/ossim/base/ossimEpsgDatumFactory.h b/include/ossim/base/ossimEpsgDatumFactory.h
index 242b5ff..9d3f58c 100644
--- a/include/ossim/base/ossimEpsgDatumFactory.h
+++ b/include/ossim/base/ossimEpsgDatumFactory.h
@@ -9,12 +9,11 @@
 //  $Id$
 
 #ifndef ossimEpsgDatumFactory_HEADER
-#define ossimEpsgDatumFactory_HEADER
-
-#include <vector>
-#include <map>
+#define ossimEpsgDatumFactory_HEADER 1
 
 #include <ossim/base/ossimDatumFactoryInterface.h>
+#include <map>
+#include <string>
 
 class ossimDatum;
 class ossimString;
@@ -64,7 +63,7 @@ protected:
 
    //! Presently implemented as a mapping from EPSG code to OSSIM/Geotrans alpha-codes found in 
    //! ossimDatumFactory. Eventually should be independent (and deprecate) ossimDatumFactory.
-   std::map<ossim_uint32, ossimString> m_epsgToAlphaMap;
+   std::map<ossim_uint32, std::string> m_epsgToAlphaMap;
    
    static ossimEpsgDatumFactory* m_instance;
 };
diff --git a/include/ossim/base/ossimErrorStatusInterface.h b/include/ossim/base/ossimErrorStatusInterface.h
index 57d5581..0fffc29 100644
--- a/include/ossim/base/ossimErrorStatusInterface.h
+++ b/include/ossim/base/ossimErrorStatusInterface.h
@@ -10,7 +10,7 @@
 // Contains class declaration for common error interfaces.
 //
 //*************************************************************************
-// $Id: ossimErrorStatusInterface.h 9094 2006-06-13 19:12:40Z dburken $
+// $Id: ossimErrorStatusInterface.h 22149 2013-02-11 21:36:10Z dburken $
 
 #ifndef ossimErrorStatusInterface_HEADER
 #define ossimErrorStatusInterface_HEADER
@@ -48,6 +48,9 @@ public:
    /*! Clears theErrorStatus by setting to ossimErrorCodes::OSSIM_OK or 0. */
    virtual void  clearErrorStatus() const;
 
+   /*! @return true if theErrorStatus != ossimErrorCodes::OSSIM_OK. */
+   bool hasError() const;
+
    /**
     * Outputs theErrorStatus as an ossimErrorCode and an ossimString.
     * 
diff --git a/include/ossim/base/ossimFactoryListInterface.h b/include/ossim/base/ossimFactoryListInterface.h
index 4924c03..f96001c 100644
--- a/include/ossim/base/ossimFactoryListInterface.h
+++ b/include/ossim/base/ossimFactoryListInterface.h
@@ -14,6 +14,9 @@
 #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.  
@@ -190,7 +193,7 @@ class ossimFactoryListInterface
 template <class T, class NativeType>
 void ossimFactoryListInterface<T, NativeType>::getAllTypeNamesFromRegistry(std::vector<ossimString>& typeList)const
 {
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
+   //OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
    ossim_uint32 idx = 0;
    for(; idx<m_factoryList.size(); ++idx)
    {
@@ -200,7 +203,7 @@ void ossimFactoryListInterface<T, NativeType>::getAllTypeNamesFromRegistry(std::
 template <class T, class NativeType>
 ossimObject* ossimFactoryListInterface<T, NativeType>::createObjectFromRegistry(const ossimString& typeName)const
 {
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
+   //OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
    ossimObject* result = 0;
    ossim_uint32 idx = 0;
    for(;((idx<m_factoryList.size())&&!result); ++idx)
diff --git a/include/ossim/base/ossimFilename.h b/include/ossim/base/ossimFilename.h
index 010b098..5e6065b 100644
--- a/include/ossim/base/ossimFilename.h
+++ b/include/ossim/base/ossimFilename.h
@@ -9,7 +9,7 @@
 // Description: This class provides manipulation of filenames.
 //
 //*************************************************************************
-// $Id: ossimFilename.h 17597 2010-06-19 15:33:01Z dburken $
+// $Id: ossimFilename.h 20192 2011-10-25 17:27:25Z dburken $
 
 #ifndef ossimFilename_HEADER
 #define ossimFilename_HEADER
@@ -33,6 +33,7 @@ public:
    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);
@@ -43,11 +44,14 @@ public:
    
    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;
@@ -178,9 +182,12 @@ public:
                         int perm=0775)const;
 
    /*!
-    * Removes pathname from filesystem if supported by platform.
-    * Return true on success, false on error.
-    * If supported will set errno and output equivalent string if one occurs.
+    * @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);
 
@@ -203,7 +210,12 @@ public:
 
    /**
     * @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;
@@ -244,4 +256,9 @@ protected:
 
 };
 
+// inline std::ostream& operator<<(std::ostream& os, const ossimFilename& f)
+// {
+//   return os << f.string().c_str();
+// }
+
 #endif
diff --git a/include/ossim/base/ossimGeodeticEvaluator.h b/include/ossim/base/ossimGeodeticEvaluator.h
new file mode 100755
index 0000000..f5d571c
--- /dev/null
+++ b/include/ossim/base/ossimGeodeticEvaluator.h
@@ -0,0 +1,75 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Hicks
+//
+// Description: GeodeticEvaluator class.
+//----------------------------------------------------------------------------
+#ifndef ossimGeodeticEvaluator_HEADER
+#define ossimGeodeticEvaluator_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimGpt.h>
+
+
+class OSSIM_DLL ossimGeodeticEvaluator
+{
+public:
+
+   /**
+    * @brief constructor.
+    *    Defaults to WGS-84
+    */
+   ossimGeodeticEvaluator(const ossimEllipsoid& ell = ossimEllipsoid());
+
+   /**
+    * @brief virtual destructor.
+    */
+   ~ossimGeodeticEvaluator();
+   
+
+   /**
+    * @brief Evaluate direct problem.
+    * @brief Given: Point 1 position, azimuth & distance to point 2.
+    * @brief Find:  Point 2 position, azimuth from point 2 to point 1.
+    *
+    * @param  p1 Point 1.
+    * @param az1 Azimuth from point 1 to point 2.
+    * @param   d Distance between points 1 & 2.
+    * @param  p2 Point 2.
+    * @param az2 Azimuth from point 2 to point 1.
+    */
+   bool direct(
+      const ossimGpt& p1, const double& az1, const double& d, ossimGpt& p2, double& az2);
+   
+
+   /**
+    * @brief Evaluate Vincenty inverse problem.
+    * @brief Given: Point 1 & point 2 positions.
+    * @brief Find:  Distance and azimuths between points.
+    *
+    * @param   p1 Point 1.
+    * @param   p2 Point 2.
+    * @param    d Distance between points 1 & 2.
+    * @param az12 Azimuth from point 1 to point 2.
+    * @param az21 Azimuth from point 2 to point 1.
+    */
+   bool inverse(
+      const ossimGpt& p1, const ossimGpt& p2, double& d, double& az12, double& az21);
+
+protected:
+   double m_A;
+   double m_B;
+   double m_F;
+   double m_A2;
+   double m_B2;
+   double m_Ecc2;
+   double m_2ndEcc2;
+
+private:
+
+};
+
+#endif // #ifndef ossimGeodeticEvaluator_HEADER
diff --git a/include/ossim/base/ossimGeoid.h b/include/ossim/base/ossimGeoid.h
index b52cf5a..31386a7 100644
--- a/include/ossim/base/ossimGeoid.h
+++ b/include/ossim/base/ossimGeoid.h
@@ -50,7 +50,7 @@ class OSSIM_DLL ossimIdentityGeoid : public ossimGeoid
 public:
    virtual ossimString getShortName()const
    {
-      return "identity";
+      return ossimString("identity");
    }
    virtual bool open(const ossimFilename& /*dir*/, ossimByteOrder)
    {
diff --git a/include/ossim/base/ossimGpt.h b/include/ossim/base/ossimGpt.h
index e34cd14..f3a6ce3 100644
--- a/include/ossim/base/ossimGpt.h
+++ b/include/ossim/base/ossimGpt.h
@@ -13,16 +13,16 @@
 // Height is relative to the ellipsoid in meters.
 //
 //*******************************************************************
-//  $Id: ossimGpt.h 19071 2011-03-13 16:02:06Z dburken $
+//  $Id: ossimGpt.h 19900 2011-08-04 14:19:57Z dburken $
 
 #ifndef ossimGpt_HEADER
 #define ossimGpt_HEADER 1
 
-#include <iosfwd>
 #include <ossim/base/ossimConstants.h>
 #include <ossim/base/ossimDpt.h>
 #include <ossim/base/ossimDatumFactory.h>
 #include <ossim/base/ossimString.h>
+#include <iosfwd>
 
 class  ossimDatum;
 class  ossimEcefPoint;
@@ -54,23 +54,17 @@ public:
             const ossimDatum* aDatum=ossimDatumFactory::instance()->wgs84());
 
    /**
-    * latr().  Returns the latitude in radian measure.  Since
-    * our internal format is radians we do not have to do any
-    * conversions.
+    * latr().  Returns the latitude in radian measure.  
     */
    double latr()const{return lat*RAD_PER_DEG;}
 
    /**
-    * Returns the latitude in radian measure.  Since
-    * our internal format is radians we do not have to do any
-    * conversions.
+    * Returns the latitude in radian measure.  
     */
    void latr(double radianValue){lat = radianValue*DEG_PER_RAD;}
 
    /**
-    * Returns the longitude in radian measure.  Since
-    * our internal format is radians we do not have to do any
-    * conversions.
+    * Returns the longitude in radian measure.  
     */
    double lonr()const{return lon*RAD_PER_DEG;}
 
@@ -205,13 +199,7 @@ public:
    void changeDatum(const ossimDatum *datum);
 
    const ossimGpt& operator = (const ossimGpt &aPt);
-   bool operator ==(const ossimGpt& gpt)const
-      {
-         return ( ossim::almostEqual(lat, gpt.lat)&&
-                  ossim::almostEqual(lon, gpt.lon)&&
-                  ossim::almostEqual(hgt, gpt.hgt)&&
-                  (theDatum == gpt.theDatum));
-      }
+   bool operator ==(const ossimGpt& gpt)const;
 
    bool operator != (const ossimGpt& gpt) const { return !(*this == gpt); }
    
@@ -220,7 +208,7 @@ public:
     * Converts the lon data member to a value between -180 and +180:
     */
    void  limitLonTo180()
-   { if (lon < -180.0) lon += 360.0; else if (lon > 180.0) lon -= 360.0; }
+   { if (lon <= -180.0) lon += 360.0; else if (lon > 180.0) lon -= 360.0; }
 
    /**
     * @brief Wrap method to maintain longitude between -180 and +180 and latitude between
@@ -264,6 +252,7 @@ public:
    
    ossimString toDmsString()const;
 
+   bool isEqualTo(const ossimGpt& rhs, ossimCompareType compareType=OSSIM_COMPARE_FULL)const;
    ossim_float64 lat; //> latitude in degrees measure
    ossim_float64 lon; //> longitude in degrees measure
 
@@ -291,7 +280,7 @@ inline const ossimGpt& ossimGpt::operator=(const ossimGpt& aPt)
       lat = aPt.lat;
       lon = aPt.lon;
       hgt = aPt.hgt;
-      
+
       if(aPt.datum())
       {
          theDatum = aPt.datum();
diff --git a/include/ossim/base/ossimGrect.h b/include/ossim/base/ossimGrect.h
index f574750..45a1fb2 100644
--- a/include/ossim/base/ossimGrect.h
+++ b/include/ossim/base/ossimGrect.h
@@ -8,20 +8,22 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimGrect.h 18481 2010-12-01 21:12:28Z dburken $
+// $Id: ossimGrect.h 22197 2013-03-12 02:00:55Z dburken $
 #ifndef ossimGrect_HEADER
-#define ossimGrect_HEADER
-#include <vector>
-#include <iostream>
+#define ossimGrect_HEADER 1
 
+#include <ossim/base/ossimConstants.h>
 #include <ossim/base/ossimDatumFactory.h>
 #include <ossim/base/ossimGpt.h>
 #include <ossim/base/ossimCommon.h>
 
-class OSSIMDLLEXPORT ossimGrect
+#include <vector>
+#include <iostream>
+
+class OSSIM_DLL ossimGrect
 {
 public:
-   friend std::ostream& operator<<(std::ostream& os, const ossimGrect& rect);
+   friend OSSIM_DLL std::ostream& operator<<(std::ostream& os, const ossimGrect& rect);
 
    /**
     * Will default to 0,0,0,0.
@@ -105,35 +107,35 @@ public:
          return *this;
       }
 
-   ossimGpt midPoint()const;
+   inline ossimGpt midPoint()const;
    
    /**
     * Returns the height of a rectangle.
     */
-   ossim_float64 height() const;
+   inline ossim_float64 height() const;
 
    /**
     * Returns the width of a rectangle.
     */
-   ossim_float64 width()  const;
+   inline ossim_float64 width()  const;
    
-   const ossimGpt& ul()const;
-   const ossimGpt& ur()const;
-   const ossimGpt& ll()const;
-   const ossimGpt& lr()const;
+   inline const ossimGpt& ul()const;
+   inline const ossimGpt& ur()const;
+   inline const ossimGpt& ll()const;
+   inline const ossimGpt& lr()const;
    
-   ossimGpt& ul();
-   ossimGpt& ur();
-   ossimGpt& ll();
-   ossimGpt& lr();
+   inline ossimGpt& ul();
+   inline ossimGpt& ur();
+   inline ossimGpt& ll();
+   inline ossimGpt& lr();
 	
-   void makeNan();
+   inline void makeNan();
    
-   bool isLonLatNan()const;
+   inline bool isLonLatNan()const;
 	
-   bool hasNans()const;
+   inline bool hasNans()const;
    
-   bool isNan()const;
+   inline bool isNan()const;
    
    /*!
     * Returns true if "this" rectangle is contained completely within the
@@ -147,9 +149,9 @@ public:
     */
    bool intersects(const ossimGrect& rect) const;
 
-   ossimGrect clipToRect(const ossimGrect& rect)const;
+   inline ossimGrect clipToRect(const ossimGrect& rect)const;
 
-   ossimGrect combine(const ossimGrect& rect)const;
+   inline ossimGrect combine(const ossimGrect& rect)const;
 
    /**
     * METHOD: pointWithin(ossimGpt)
@@ -161,7 +163,7 @@ public:
     * @note Height is not considered and there is no datum shift applied if
     * gpt is of a different datum than this datum.
     */
-   bool pointWithin(const ossimGpt& gpt) const; //inline below
+   inline bool pointWithin(const ossimGpt& gpt) const; //inline below
 
    ossimGrect stretchToEvenBoundary(double latSpacingInDegrees,
                                     double lonSpacingInDegrees)const;
diff --git a/include/ossim/base/ossimGzStream.h b/include/ossim/base/ossimGzStream.h
index 3f6909f..82bbd1b 100644
--- a/include/ossim/base/ossimGzStream.h
+++ b/include/ossim/base/ossimGzStream.h
@@ -19,7 +19,7 @@
 //
 // File          : gzstream.h
 // Revision      : $Revision: 13050 $
-// Revision_date : $Date: 2008-06-19 20:07:35 +0200(gio, 19 giu 2008) $
+// Revision_date : $Date: 2008-06-19 14:07:35 -0400 (Thu, 19 Jun 2008) $
 // Author(s)     : Deepak Bandyopadhyay, Lutz Kettner
 // 
 // Standard streambuf implementation following Nicolai Josuttis, "The 
diff --git a/include/ossim/base/ossimHistogram.h b/include/ossim/base/ossimHistogram.h
index 71e4241..4247ac6 100644
--- a/include/ossim/base/ossimHistogram.h
+++ b/include/ossim/base/ossimHistogram.h
@@ -15,7 +15,7 @@
 // frequency counts for each of these buckets.
 //
 //********************************************************************
-// $Id: ossimHistogram.h 11724 2007-09-13 19:28:07Z gpotts $
+// $Id: ossimHistogram.h 19799 2011-06-30 18:41:26Z gpotts $
 //
 
 #ifndef ossimHistogram_HEADER
@@ -33,6 +33,7 @@ class OSSIMDLLEXPORT ossimHistogram : public ossimObject
 
   protected:
 
+   
    virtual void deleteAll();
    
     float * vals;            // histogram x array
@@ -75,6 +76,11 @@ class OSSIMDLLEXPORT ossimHistogram : public ossimObject
    };
    
   public:
+   enum FillAlgorithmType
+   {
+      HISTOGRAM_FILL_DEFAULT    = 0,
+      HISTOGRAM_FILL_THIN_PLATE = 1
+   };
 // Constructors
     ossimHistogram();
     ossimHistogram(int xres, float min, float max);
@@ -84,6 +90,7 @@ class OSSIMDLLEXPORT ossimHistogram : public ossimObject
 
     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
diff --git a/include/ossim/base/ossimHttpRequest.h b/include/ossim/base/ossimHttpRequest.h
new file mode 100644
index 0000000..298f185
--- /dev/null
+++ b/include/ossim/base/ossimHttpRequest.h
@@ -0,0 +1,58 @@
+#ifndef ossimHttpRequest_HEADER
+#define ossimHttpRequest_HEADER
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimWebRequest.h>
+#include <ossim/base/ossimHttpResponse.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimRefPtr.h>
+
+class OSSIM_DLL ossimHttpRequest :public ossimWebRequest
+{
+public:
+   enum HttpMethodType
+   {
+      HTTP_METHOD_UNKNOWN = 0,
+      HTTP_METHOD_GET     = 1,
+      HTTP_METHOD_POST    = 2
+      // later we will add support for post
+   };
+   ossimHttpRequest()
+   :m_methodType(HTTP_METHOD_UNKNOWN)
+   {
+   }
+   bool set(const ossimUrl& url, 
+                         const ossimKeywordlist& headerOptions, 
+                         HttpMethodType methodType=HTTP_METHOD_GET)
+   {
+      bool result = setUrl(url);
+      m_headerOptions = headerOptions;
+      m_methodType    = methodType;
+      
+      return result;
+   }
+   virtual ~ossimHttpRequest()
+   {
+   }
+   void setHeaderOptions(const ossimKeywordlist& options)
+   {
+      m_headerOptions = options;
+   }
+   void addHeaderOption(const ossimString& name, const ossimString& value)
+   {
+      m_headerOptions.add(name, value);
+   }
+   void clearHeaderOptions(){m_headerOptions.clear();}
+   ossimKeywordlist& getHeaderOptions(){return m_headerOptions;}
+   const ossimKeywordlist& getHeaderOptions()const{return m_headerOptions;}
+   
+   
+   virtual ossimString getLastError()const{return m_lastError;}
+   
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+   
+protected:
+   ossimKeywordlist m_headerOptions;
+   HttpMethodType   m_methodType;
+   TYPE_DATA;
+};
+#endif
diff --git a/include/ossim/base/ossimHttpResponse.h b/include/ossim/base/ossimHttpResponse.h
new file mode 100644
index 0000000..1cad97e
--- /dev/null
+++ b/include/ossim/base/ossimHttpResponse.h
@@ -0,0 +1,81 @@
+//----------------------------------------------------------------------------
+//
+// 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/include/ossim/base/ossimId.h b/include/ossim/base/ossimId.h
index 9da435f..1eca2fa 100644
--- a/include/ossim/base/ossimId.h
+++ b/include/ossim/base/ossimId.h
@@ -6,7 +6,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimId.h 13014 2008-06-10 16:03:09Z dburken $
+// $Id: ossimId.h 20314 2011-12-01 21:46:37Z oscarkramer $
 #ifndef ossimId_HEADER
 #define ossimId_HEADER
 
@@ -37,11 +37,11 @@ public:
       return (theId != rhs.theId);
    }
   
-   bool operator == (ossim_int64 rhs)
+   bool operator == (ossim_int64 rhs) const
    {
      return (theId == rhs);
    }
-   bool operator != (ossim_int64 rhs)
+   bool operator != (ossim_int64 rhs) const
    {
      return (theId != rhs);
    }
diff --git a/include/ossim/base/ossimIpt.h b/include/ossim/base/ossimIpt.h
index 096221f..e48c5f6 100644
--- a/include/ossim/base/ossimIpt.h
+++ b/include/ossim/base/ossimIpt.h
@@ -10,7 +10,7 @@
 // Used to represent an interger point containing an x and y data member.
 // 
 //*******************************************************************
-//  $Id: ossimIpt.h 14789 2009-06-29 16:48:14Z dburken $
+//  $Id: ossimIpt.h 19793 2011-06-30 13:26:56Z gpotts $
 
 #ifndef ossimIpt_HEADER
 #define ossimIpt_HEADER
@@ -106,6 +106,7 @@ public:
    friend OSSIMDLLEXPORT std::istream& operator>>(std::istream& is,
                                                   ossimIpt& pt);
    
+   bool isEqualTo(const ossimIpt& rhs, ossimCompareType compareType=OSSIM_COMPARE_FULL)const;
    /*!
     * METHOD: length()
     * Returns the RSS of the components.
diff --git a/include/ossim/base/ossimIrect.h b/include/ossim/base/ossimIrect.h
index 5b4685c..518ef50 100644
--- a/include/ossim/base/ossimIrect.h
+++ b/include/ossim/base/ossimIrect.h
@@ -10,7 +10,7 @@
 // Container class for four integer points representing a rectangle.
 //
 //*******************************************************************
-//  $Id: ossimIrect.h 19180 2011-03-22 17:36:33Z oscarkramer $
+//  $Id: ossimIrect.h 22197 2013-03-12 02:00:55Z dburken $
 
 #ifndef ossimIrect_HEADER
 #define ossimIrect_HEADER 1
@@ -122,10 +122,10 @@ public:
    /** destructor */
    ~ossimIrect();
    
-   const ossimIrect& operator=  (const ossimIrect& rect);
-   const ossimIrect& operator=  (const ossimDrect& rect);
-   bool         operator!= (const ossimIrect& rect) const;
-   bool         operator== (const ossimIrect& rect) const;
+   inline const ossimIrect& operator=  (const ossimIrect& rect);
+   const ossimIrect&        operator=  (const ossimDrect& rect);
+   inline bool              operator!= (const ossimIrect& rect) const;
+   inline bool              operator== (const ossimIrect& rect) const;
 
    friend ossimIrect operator*(double scalar, const ossimIrect& rect)
       {
@@ -402,71 +402,71 @@ public:
     * Sets the upper left corner to "pt".  Adjusts the remaining corners
     * accordingly.
     */
-   void set_ul(const ossimIpt& pt);
+   inline void set_ul(const ossimIpt& pt);
 
    /*!
     * Sets the upper right corner to "pt".  Adjusts the remaining corners
     * accordingly.
     */
-   void set_ur(const ossimIpt& pt);
+   inline void set_ur(const ossimIpt& pt);
 
    /*!
     * Sets the lower right corner to "pt".  Adjusts the remaining corners
     * accordingly.
     */
-   void set_lr(const ossimIpt& pt);
+   inline void set_lr(const ossimIpt& pt);
 
    /*!
     * Sets the lower left corner to "pt".  Adjusts the remaining corners
     * accordingly.
     */
-   void set_ll(const ossimIpt& pt);
+   inline void set_ll(const ossimIpt& pt);
 
    /*!
     * Sets the upper left x.  Adjusts the remaining corners accordingly.
     */
-   void set_ulx(ossim_int32 x);
+   inline void set_ulx(ossim_int32 x);
 
    /*!
     * Sets the upper left y.  Adjusts the remaining corners accordingly.
     */
-   void set_uly(ossim_int32 y);
+   inline void set_uly(ossim_int32 y);
 
    /*!
     * Sets the upper right x.  Adjusts the remaining corners accordingly.
     */
-   void set_urx(ossim_int32 x);
+   inline void set_urx(ossim_int32 x);
 
    /*!
     * Sets the upper right y.  Adjusts the remaining corners accordingly.
     */
-   void set_ury(ossim_int32 y);
+   inline void set_ury(ossim_int32 y);
 
    /*!
     * Sets the lower right x.  Adjusts the remaining corners accordingly.
     */
-   void set_lrx(ossim_int32 x);
+   inline void set_lrx(ossim_int32 x);
 
    /*!
     * Sets the lower right y.  Adjusts the remaining corners accordingly.
     */
-   void set_lry(ossim_int32 y);
+   inline void set_lry(ossim_int32 y);
 
    /*!
     * Sets the lower left x.  Adjusts the remaining corners accordingly.
     */
-   void set_llx(ossim_int32 x);
+   inline void set_llx(ossim_int32 x);
 
    /*!
     * Sets the lower left y.  Adjusts the remaining corners accordingly.
     */
-   void set_lly(ossim_int32 y);
+   inline void set_lly(ossim_int32 y);
 
    /*!
     * Returns true if "pt" falls within rectangle.  Fall on an edge is also
     * considered to be within.
     */
-   bool pointWithin(const ossimIpt& pt) const;
+   inline bool pointWithin(const ossimIpt& pt) const;
 
    /*!
     * Returns true if any portion of an input rectangle "rect" intersects
diff --git a/include/ossim/base/ossimKeywordlist.h b/include/ossim/base/ossimKeywordlist.h
index 1eeeab1..317850a 100644
--- a/include/ossim/base/ossimKeywordlist.h
+++ b/include/ossim/base/ossimKeywordlist.h
@@ -1,5 +1,4 @@
 //*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
 //
 // License:  See top level LICENSE.txt file.
 //
@@ -8,20 +7,20 @@
 // Description: This class provides capabilities for keywordlists.
 //
 //********************************************************************
-// $Id: ossimKeywordlist.h 19180 2011-03-22 17:36:33Z oscarkramer $
+// $Id: ossimKeywordlist.h 21527 2012-08-26 16:50:49Z dburken $
 
 #ifndef ossimKeywordlist_HEADER
-#define ossimKeywordlist_HEADER
-
-#include <map>
-#include <iosfwd>
-#include <vector>
+#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 = ':';
 
@@ -33,7 +32,7 @@ class OSSIM_DLL ossimKeywordlist : public ossimErrorStatusInterface,
 {
 public:
 
-   typedef std::map<ossimString, ossimString> KeywordMap;
+   typedef std::map<std::string, std::string> KeywordMap;
 
    ossimKeywordlist(const ossimKeywordlist& src);
    ossimKeywordlist(char delimiter = DEFAULT_DELIMITER,
@@ -51,6 +50,8 @@ public:
 
    ~ossimKeywordlist();
 
+   static const std::string NULL_KW;
+
    /*!
     *  Reads file and adds keywords to the KeywordMap.
     *  Returns true if file was parsed, false on error.
@@ -61,7 +62,7 @@ public:
     *  Reads file and adds keywords to the KeywordMap.
     *  Returns true if file was parsed, false on error.
     */
-   bool addFile(const ossimFilename& file);
+   bool addFile(const ossimFilename& file); 
 
    /*!
     *  Method to change default delimiter.  Handy when parsing
@@ -86,7 +87,62 @@ public:
             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
@@ -95,8 +151,7 @@ public:
    void add(const ossimKeywordlist& kwl,
             const char* prefix=0,
             bool stripPrefix=true);
-
-   // Methods to add keywords to list.
+  
    void add(const char*   key,
             const char*   value,
             bool          overwrite = true);
@@ -247,11 +302,29 @@ public:
             bool          overwrite    = true,
             int           precision    = 15);
 
-   /*!
-    *  find methods
+   /**
+    * @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 a null string if the key was not found.
+    *  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;
@@ -265,13 +338,12 @@ public:
    ossim_uint32 numberOf(const char* str) const;
 
    /*!
-    *  Searches the map for the number of keys containing the prefix
-    *  and the string.
-    *
+    *  Searches the map for the number of keys containing the prefix+key.
+    *  
     *  Given the keyword list contains:
     *
-    *  source1.type: foo
-    *  source2.type: you
+    *  source.type1: foo
+    *  source.type2: you
     *
     *  This:
     *
@@ -425,6 +497,7 @@ protected:
    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);
 
diff --git a/include/ossim/base/ossimLagrangeInterpolator.h b/include/ossim/base/ossimLagrangeInterpolator.h
new file mode 100644
index 0000000..9929fee
--- /dev/null
+++ b/include/ossim/base/ossimLagrangeInterpolator.h
@@ -0,0 +1,46 @@
+//**************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer, GeoEye Inc.
+//
+// DESCRIPTION: Contains Lagrange Interpolator class
+// 
+//  $Id$
+//**************************************************************************************************
+#ifndef LagrangeInterp_HEADER
+#define LagrangeInterp_HEADER
+
+#include <iostream>
+#include <vector>
+#include <ossim/matrix/newmat.h>
+#include <ossim/base/ossimReferenced.h>
+
+//******************************************************************************
+// CLASS:  ossimLagrangeInterpolator
+//******************************************************************************
+class ossimLagrangeInterpolator : public ossimReferenced
+{
+   friend std::ostream& operator<<(std::ostream&, const ossimLagrangeInterpolator&);
+   friend std::istream& operator>>(std::istream&, ossimLagrangeInterpolator&);
+   
+public:
+   ossimLagrangeInterpolator() : theNumElements(0) {}
+   ossimLagrangeInterpolator(std::istream&);
+   ossimLagrangeInterpolator(const std::vector<double>& t_array, 
+                             const std::vector<NEWMAT::ColumnVector>&  data_array);
+   ~ossimLagrangeInterpolator();
+   
+   void addData(const double& t, const NEWMAT::ColumnVector& data);
+
+   bool interpolate(const double& t, NEWMAT::ColumnVector& result) const;
+   
+private:
+   std::vector<double> theTeeArray;
+   std::vector<NEWMAT::ColumnVector> theDataArray;
+   std::vector<double> theNormalizer;
+   ossim_uint32 theNumElements;
+};
+
+#endif
diff --git a/include/ossim/base/ossimLookUpTable.h b/include/ossim/base/ossimLookUpTable.h
index 2a8400f..1b3d904 100644
--- a/include/ossim/base/ossimLookUpTable.h
+++ b/include/ossim/base/ossimLookUpTable.h
@@ -11,7 +11,7 @@
 //
 // Contains class declaration for LookUpTable. 
 //*******************************************************************
-//  $Id: ossimLookUpTable.h 14789 2009-06-29 16:48:14Z dburken $
+//  $Id: ossimLookUpTable.h 19448 2011-04-26 15:15:07Z dburken $
 
 #ifndef ossimLookUpTable_HEADER
 #define ossimLookUpTable_HEADER
@@ -103,14 +103,14 @@ protected:
    class ossimKeyValueMap
    {
    public:
+      void init (ossim_int32 key, const ossimString& value) { theKey=key; theValue=value; }
       ossim_int32  theKey;
       ossimString theValue;
    };
 
    std::vector<ossimKeyValueMap>  theTable;
    
-private:
-   ossimLookUpTable(){} // disallow...
+   ossimLookUpTable(){}
 };
 
 #endif
diff --git a/include/ossim/base/ossimLsrPoint.h b/include/ossim/base/ossimLsrPoint.h
index b515f18..919f226 100644
--- a/include/ossim/base/ossimLsrPoint.h
+++ b/include/ossim/base/ossimLsrPoint.h
@@ -14,7 +14,7 @@
 //              Initial coding.
 //<
 //*****************************************************************************
-//  $Id: ossimLsrPoint.h 12790 2008-05-05 13:41:33Z dburken $
+//  $Id: ossimLsrPoint.h 22197 2013-03-12 02:00:55Z dburken $
 
 #ifndef ossimLsrPoint_HEADER
 #define ossimLsrPoint_HEADER
@@ -64,11 +64,11 @@ public:
    /*!
     * OPERATORS:
     */
-   const ossimLsrPoint& operator= (const ossimLsrPoint&);       //inline below
-   ossimLsrVector       operator- (const ossimLsrPoint&)  const;
-   ossimLsrPoint        operator+ (const ossimLsrVector&) const;
-   bool                 operator==(const ossimLsrPoint&)  const;//inline below
-   bool                 operator!=(const ossimLsrPoint&)  const;//inline below
+   inline const ossimLsrPoint& operator= (const ossimLsrPoint&); //inline below
+   ossimLsrVector operator- (const ossimLsrPoint&)  const;
+   ossimLsrPoint  operator+ (const ossimLsrVector&) const;
+   inline bool    operator==(const ossimLsrPoint&)  const;//inline below
+   inline bool    operator!=(const ossimLsrPoint&)  const;//inline below
 
    /*!
     * CASTING OPERATOR:
@@ -111,7 +111,7 @@ public:
    /*!
     * Debug Dump: 
     */
-   void print(ostream& stream = ossimNotify(ossimNotifyLevel_INFO)) const;
+   inline void print(ostream& stream = ossimNotify(ossimNotifyLevel_INFO)) const;
 
    friend ostream& operator<< (ostream& os , const ossimLsrPoint& instance)
       { instance.print(os); return os; }
diff --git a/include/ossim/base/ossimMatrix4x4.h b/include/ossim/base/ossimMatrix4x4.h
index 5f2b193..85a4080 100644
--- a/include/ossim/base/ossimMatrix4x4.h
+++ b/include/ossim/base/ossimMatrix4x4.h
@@ -7,7 +7,7 @@
 // Description:
 //
 //*******************************************************************
-//  $Id: ossimMatrix4x4.h 11856 2007-10-12 15:21:17Z gpotts $
+//  $Id: ossimMatrix4x4.h 19824 2011-07-15 16:01:34Z dburken $
 
 #ifndef ossimMatrix4x4_HEADER
 #define ossimMatrix4x4_HEADER
@@ -246,6 +246,9 @@ class OSSIM_DLL ossimMatrix4x4
     */ 
    ossimColumnVector3d getEigenValues()const;
 
+   bool isEqualTo(const ossimMatrix4x4& rhs,
+                  ossimCompareType compareType=OSSIM_COMPARE_FULL)const;
+
    void setZero();
    void setIdentity();
    static NEWMAT::Matrix createIdentity();
@@ -272,7 +275,29 @@ class OSSIM_DLL ossimMatrix4x4
   NEWMAT::Matrix& getData(){return theData;}
 
 private:
-  NEWMAT::Matrix theData; 
-};
+  NEWMAT::Matrix theData;
+  
+}; // class OSSIM_DLL ossimMatrix4x4
+
+inline bool ossimMatrix4x4::isEqualTo(const ossimMatrix4x4& rhs,
+                                      ossimCompareType /* compareType */)const
+{
+   return (ossim::almostEqual(theData[0][0], rhs.theData[0][0])&&
+           ossim::almostEqual(theData[0][1], rhs.theData[0][1])&&
+           ossim::almostEqual(theData[0][2], rhs.theData[0][2])&&
+           ossim::almostEqual(theData[0][3], rhs.theData[0][3])&&
+           ossim::almostEqual(theData[1][0], rhs.theData[1][0])&&
+           ossim::almostEqual(theData[1][1], rhs.theData[1][1])&&
+           ossim::almostEqual(theData[1][2], rhs.theData[1][2])&&
+           ossim::almostEqual(theData[1][3], rhs.theData[1][3])&&
+           ossim::almostEqual(theData[2][0], rhs.theData[2][0])&&
+           ossim::almostEqual(theData[2][1], rhs.theData[2][1])&&
+           ossim::almostEqual(theData[2][2], rhs.theData[2][2])&&
+           ossim::almostEqual(theData[2][3], rhs.theData[2][3])&&
+           ossim::almostEqual(theData[3][0], rhs.theData[3][0])&&
+           ossim::almostEqual(theData[3][1], rhs.theData[3][1])&&
+           ossim::almostEqual(theData[3][2], rhs.theData[3][2])&&
+           ossim::almostEqual(theData[3][3], rhs.theData[3][3]));
+}
 
-#endif
+#endif /* #ifndef ossimMatrix4x4_HEADER */
diff --git a/include/ossim/base/ossimNBandLutDataObject.h b/include/ossim/base/ossimNBandLutDataObject.h
index 10a7f8f..be9aa66 100644
--- a/include/ossim/base/ossimNBandLutDataObject.h
+++ b/include/ossim/base/ossimNBandLutDataObject.h
@@ -6,9 +6,10 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimNBandLutDataObject.h 17815 2010-08-03 13:23:14Z dburken $
+// $Id: ossimNBandLutDataObject.h 19732 2011-06-06 22:24:54Z dburken $
 #ifndef ossimNBandLutDataObject_HEADER
-#define ossimNBandLutDataObject_HEADER
+#define ossimNBandLutDataObject_HEADER 1
+
 #include <ossim/base/ossimObject.h>
 #include <ossim/base/ossimFilename.h>
 #include <iostream>
@@ -355,6 +356,14 @@ public:
                   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.
     *
@@ -387,7 +396,20 @@ public:
     *        of bands for the lut.
     * @return Returns the nearest index to the passed in value.  
     */ 
-   ossim_uint32 findIndex(ossim_int32* values)const;
+   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 
diff --git a/include/ossim/base/ossimNadconGridDatum.h b/include/ossim/base/ossimNadconGridDatum.h
index ee3ab4d..6db9ec0 100644
--- a/include/ossim/base/ossimNadconGridDatum.h
+++ b/include/ossim/base/ossimNadconGridDatum.h
@@ -39,6 +39,8 @@ protected:
   ossimFilename theDatumDirectory;
   
   void checkGrid(const ossimDpt& latLon)const;
+   
+   TYPE_DATA;   
 };
 
 #endif
diff --git a/include/ossim/base/ossimNadconNarDatum.h b/include/ossim/base/ossimNadconNarDatum.h
index c58c0f0..46706c2 100644
--- a/include/ossim/base/ossimNadconNarDatum.h
+++ b/include/ossim/base/ossimNadconNarDatum.h
@@ -15,7 +15,7 @@ public:
    //utility functions to shift to and from the standard coordinates.
    //Users should use the shift instead!!!
    //
-
+   TYPE_DATA;
 };
 
 #endif
diff --git a/include/ossim/base/ossimNadconNasDatum.h b/include/ossim/base/ossimNadconNasDatum.h
index 7eb614d..508a133 100644
--- a/include/ossim/base/ossimNadconNasDatum.h
+++ b/include/ossim/base/ossimNadconNasDatum.h
@@ -13,7 +13,7 @@ public:
    // point with this datum.
    //
    virtual ossimGpt shift(const ossimGpt    &aPt)const;
-
+   TYPE_DATA;
 };
 
 #endif
diff --git a/include/ossim/base/ossimNotify.h b/include/ossim/base/ossimNotify.h
index 4112520..30a8a46 100644
--- a/include/ossim/base/ossimNotify.h
+++ b/include/ossim/base/ossimNotify.h
@@ -7,17 +7,16 @@
 //
 // Contains class declaration for ossimNotify
 //-------------------------------------------------------------------
-//  $Id: ossimNotify.h 17195 2010-04-23 17:32:18Z dburken $
+//  $Id: ossimNotify.h 21458 2012-08-07 20:40:35Z dburken $
 #ifndef ossimNotify_HEADER
-#define ossimNotify_HEADER
-#include <iostream>
-#include <fstream>
+#define ossimNotify_HEADER 1
+
 #include <ossim/base/ossimErrorCodes.h>
 #include <ossim/base/ossimConstants.h>
 #include <ossim/base/ossimFilename.h>
+#include <iostream>
+#include <fstream>
 
-extern "C"
-{
 /**
   * Notification level enumeration.  This specifies the
   * level of the mesage being written.
@@ -104,5 +103,5 @@ OSSIMDLLEXPORT void  ossimSetError( const char *className,
  */
 OSSIMDLLEXPORT void  ossimSetInfo( const char *className,
                                    const char *fmtString=0, ...);
-}
-#endif
+
+#endif /* #ifndef ossimNotify_HEADER */
diff --git a/include/ossim/base/ossimObject.h b/include/ossim/base/ossimObject.h
index 95b3e1f..7200942 100644
--- a/include/ossim/base/ossimObject.h
+++ b/include/ossim/base/ossimObject.h
@@ -8,17 +8,19 @@
 // Description: Base class for ossim objects.
 //
 //*************************************************************************
-// $Id: ossimObject.h 15798 2009-10-23 19:15:20Z gpotts $
+// $Id: ossimObject.h 19852 2011-07-21 15:26:12Z gpotts $
 
 #ifndef ossimObject_HEADER
 #define ossimObject_HEADER
 
 #include <iosfwd>
 #include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimConstants.h>
 #include <ossim/base/ossimRtti.h>
 
 class ossimKeywordlist;
 class ossimString;
+class ossimVisitor;
 
 class OSSIMDLLEXPORT ossimObject : public ossimReferenced
 {
@@ -77,6 +79,9 @@ public:
     */
    friend OSSIMDLLEXPORT std::ostream& operator<<(std::ostream& out,
                                                   const ossimObject& obj);
+   
+   virtual bool isEqualTo(const ossimObject& obj, ossimCompareType compareType = OSSIM_COMPARE_FULL)const;
+   virtual void accept(ossimVisitor& visitor);
 
  protected:
 TYPE_DATA
diff --git a/include/ossim/base/ossimObservationSet.h b/include/ossim/base/ossimObservationSet.h
new file mode 100644
index 0000000..b2a51c3
--- /dev/null
+++ b/include/ossim/base/ossimObservationSet.h
@@ -0,0 +1,98 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Hicks
+//
+// Description: Storage class for observations.
+//----------------------------------------------------------------------------
+#ifndef ossimObservationSet_HEADER
+#define ossimObservationSet_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimPointObservation.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/matrix/newmat.h>
+#include <ossim/matrix/newmatio.h>
+#include <iostream>
+#include <vector>
+
+class OSSIM_DLL ossimObservationSet : public ossimObject
+{
+public:
+   ossimObservationSet();
+
+   ~ossimObservationSet();
+  
+   inline ossim_uint32 numImages()const { return (ossim_uint32)theImageHandlers.size(); }
+   inline ossim_uint32    numObs()const { return (ossim_uint32)theObs.size(); }
+   inline ossim_uint32 numAdjPar()const { return (ossim_uint32)theNumAdjPar; }
+   inline ossim_uint32   numMeas()const { return (ossim_uint32)theNumMeas; }
+
+   // observation accessor
+   inline ossimRefPtr<ossimPointObservation> observ(const int& i)const{ return theObs[i]; }
+
+   // image accessor
+   ossimImageGeometry* getImageGeom(const int index);
+   void setImageGeom(const int index, ossimImageGeometry* geom);
+
+   // image index accessor
+   inline int imIndex(const int& i)const { return theImageIndex[i]; }
+
+   // adjustable parameter count accessor
+   inline int adjParCount(const int& i)const { return theNumAdjParams[i]; }
+
+   // Image file access
+   inline ossimFilename imageFile(const int index)const { return theImageFiles[index]; }
+
+   /**
+    * standard evaluation
+    *   [1] measResiduals:  [x,y] residuals (numMeas X 2)
+    *   [2] objPartials:    object point partial derivatives (numMeas*3 X 2)
+    *   [3] parPartials:    image parameter partial derivatives (numParams X 2)
+    */
+   bool evaluate(NEWMAT::Matrix& measResiduals,
+                 NEWMAT::Matrix& objPartials,
+                 NEWMAT::Matrix& parPartials);
+
+   /**
+    * operations
+    */
+   bool addObservation(ossimRefPtr<ossimPointObservation> obs);
+
+   /**
+    * text output : header + tab separated tie points
+    */
+   std::ostream& print(std::ostream& os) const;
+
+protected:
+   int theNumAdjPar;
+   int theNumMeas;
+   int theNumPartials;
+
+   // member observations
+   std::vector< ossimRefPtr<ossimPointObservation> > theObs;
+
+   // measurement -> image index
+   std::vector<int> theImageIndex;
+
+   // image files
+   std::vector<ossimFilename> theImageFiles;
+
+   // image adjustable parameter count
+   std::vector<int> theNumAdjParams;
+
+   std::vector< ossimRefPtr<ossimImageHandler> > theImageHandlers;
+
+   // groups (TODO in future integration of correlated parameters)
+   //   Note: Currently, each image is assumed to be independent, which can result
+   //     in redundant parameters.  For example, images from a single flight line
+   //     clearly share a common focal length and, most likely, a common position
+   //     bias.  Implementation of this enhancement will require a mechanism for
+   //     defining inter-image parametric relationships.
+   //std::vector<????????*> theGroups;
+};
+
+#endif // #ifndef ossimObservationSet_HEADER
diff --git a/include/ossim/base/ossimPointObservation.h b/include/ossim/base/ossimPointObservation.h
new file mode 100644
index 0000000..0bd34e2
--- /dev/null
+++ b/include/ossim/base/ossimPointObservation.h
@@ -0,0 +1,152 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Hicks
+//
+// Description: Class container for multi-ray point observation.
+//----------------------------------------------------------------------------
+#ifndef ossimPointObservation_HEADER
+#define ossimPointObservation_HEADER
+
+#include <iostream>
+#include <vector>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimColumnVector3d.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+
+
+class OSSIM_DLL ossimPointObservation : public ossimObject
+{
+public:
+
+   ossimPointObservation();
+
+   ossimPointObservation(const ossimString& anID);
+
+   ossimPointObservation(const ossimGpt& aPt,
+                         const ossimString& anID,
+                         const ossimColumnVector3d& latLonHgtSigmas);
+         
+   ossimPointObservation(const ossimPointObservation& tpt);
+
+   ~ossimPointObservation();
+
+   void reset();
+
+   inline ossimGpt& Gpt() { return thePt; }
+   inline ossimString ID()const { return theID; }
+   inline void setID(const std::string& anID) { theID=anID; }
+   inline unsigned int numImages()const { return (unsigned int)theImageFiles.size(); }
+   inline unsigned int   numMeas()const { return (unsigned int)theMeas.size(); }
+
+   // Image geometry access
+   ossimImageGeometry* getImageGeom(const int index);
+   void setImageGeom(const int index, ossimImageGeometry* imgGeom);
+
+   // Image file access
+   inline ossimFilename imageFile(const int index)const { return theImageFiles[index]; }
+
+   // Measurement addition
+   void addMeasurement(const ossimDpt& meas,
+                       const ossimFilename& imgFile,
+                       const ossimDpt& measSigma = ossimDpt(1.0,1.0));
+   void addMeasurement(const double& x,
+                       const double& y,
+                       const std::string& imgFile,
+                       const ossimDpt& measSigma = ossimDpt(1.0,1.0));
+
+   // Measurement access
+   void getResiduals(const int index, NEWMAT::Matrix& resid);
+
+   void getMeasCov(const int index, NEWMAT::Matrix& cov)const;
+   void getObsCov(NEWMAT::Matrix& cov)const;
+
+   void getMeasurement(const int index, NEWMAT::Matrix& meas)const;
+   inline ossimDpt getMeasurement(const int index)const { return theMeas[index]; }
+
+   inline int numPars(const int index)const { return theNumPars[index]; }
+
+
+   // Partial derivative access
+   void getParameterPartials(const int index, NEWMAT::Matrix& parPartials);
+   void  getObjSpacePartials(const int index, NEWMAT::Matrix& objPartials);
+
+
+   const ossimPointObservation& operator=(const ossimPointObservation&);
+
+   inline void setGroundPoint(const double& lat,
+                              const double& lon,
+                              const double& hgt)
+   {
+      thePt.latd(lat);
+      thePt.lond(lon);
+      thePt.height(hgt);
+   }
+
+   inline void setGroundSigmas(const double& latSig,
+                               const double& lonSig,
+                               const double& hgtSig)
+   {
+      theObsSigmas[0] = latSig;
+      theObsSigmas[1] = lonSig;
+      theObsSigmas[2] = hgtSig;
+   }
+
+   inline void            setGroundPoint(const ossimGpt& mPt) { thePt = mPt; }
+   inline const ossimGpt& getGroundPoint()const               { return thePt; }
+   inline       ossimGpt& refGroundPoint()                    { return thePt; }
+
+   // Note: Member variable "theScore" is currently unused.  Eventually, it is
+   //       intended as a figure-of-merit representation.
+   inline void          setScore(const double& s) { theScore = s; }
+   inline const double& getScore()const           { return theScore; }
+   inline       double& refScore()                { return theScore; }
+
+   void makeNan() 
+   {
+      thePt.makeNan();
+      theScore=ossim::nan();
+   }
+   
+   bool hasNans()const
+   {
+      return (thePt.hasNans() || (ossim::isnan(theScore)));
+   }
+   
+   bool isNan()const
+   {
+      return (thePt.isNan() && (ossim::isnan(theScore)));
+   }
+   std::ostream& print(std::ostream& os) const;
+
+   friend OSSIMDLLEXPORT std::ostream& operator<<(std::ostream& os,
+                                                  const ossimPointObservation& pt);
+   /**
+    * Method to input the formatted string of the "operator<<".
+    *
+    * Expected format:  ( ( ossimGpt ), ( ossimDpt ), 0.50000000000000 )
+    *                     --*this---- , ----tie-----, ---score--------
+    */
+   friend OSSIMDLLEXPORT std::istream& operator>>(std::istream& is,
+                                                  ossimPointObservation& pt);
+
+protected:
+   ossimGpt thePt;
+   ossimString theID;
+   double theObsSigmas[3];
+   double theScore;
+
+   std::vector<ossimDpt> theMeas;
+   std::vector<ossimDpt> theMeasSigmas;
+   std::vector<ossimFilename> theImageFiles;
+   std::vector<int> theNumPars;
+   std::vector< ossimRefPtr<ossimImageHandler> > theImageHandlers;
+};
+
+#endif // #ifndef ossimPointObservation_HEADER
diff --git a/include/ossim/base/ossimPolynom.h b/include/ossim/base/ossimPolynom.h
index 0482d0c..09f9552 100644
--- a/include/ossim/base/ossimPolynom.h
+++ b/include/ossim/base/ossimPolynom.h
@@ -690,6 +690,90 @@ LMSfit(const EXPT_SET&                expset,
    return true;
 }
 
+
+/**
+ * Standard least squares
+ * Modified version of LMSfit that uses standard NEWMAT inverse as
+ *  alternative to SVD solution.
+ */
+bool
+SLSfit(const EXPT_SET&                expset,
+       const std::vector< VAR_TUPLE > obs_input,
+       const std::vector< T >         obs_output,
+       T*                             prms = NULL)
+{
+   //init
+   nullify();
+
+   //check size
+   int nobs = (int)obs_input.size();
+   if (nobs != (int)obs_output.size())
+   {
+      std::cerr<<"ossimPolynom::LMSfit ERROR observation input/output must have the same size"<<std::endl;
+      return false;
+   }
+   if (nobs<=0)
+   {
+      std::cerr<<"ossimPolynom::LMSfit ERROR observation count is zero"<<std::endl;
+      return false;
+   }
+   int ncoeff = (int)expset.size();  
+   if (ncoeff<=0)
+   {
+      std::cerr<<"ossimPolynom::LMSfit ERROR exponent count is zero"<<std::endl;
+      return false;
+   }
+   
+   // M : monom matrix
+   // k : polynomial coefficients
+   // v : output_obs
+   NEWMAT::Matrix M(nobs, ncoeff);
+   double elt;
+   int p;
+   typename EXPT_SET::const_iterator cit;
+   typename std::vector< VAR_TUPLE >::const_iterator oit;
+   int i,j;
+   for (cit=expset.begin(), j=1; cit != expset.end() ; ++cit, ++j) //loop on exponent tuples
+   {
+      for(oit=obs_input.begin(), i=1; oit!=obs_input.end();++oit, ++i) //loop on observations
+      {
+         elt=1.0;
+         for(int d=0;d<DIM;++d)
+         {
+            p = (*cit)[d];
+            if (p != 0)
+            {
+               elt *= std::pow( (*oit)[d], p );
+            }
+         }
+         M(i,j) = elt;
+      }
+   }
+
+   NEWMAT::ColumnVector v(nobs);
+   for(int o=0;o<nobs;++o)
+   {
+      v(o+1) = obs_output[o];
+   }
+
+   //perform solution
+   NEWMAT::ColumnVector bfit = (M.t()*M).i()*M.t()*v;
+
+   //compute RMS (optional, if rms non null)
+   if (prms!=NULL)
+   {
+      NEWMAT::ColumnVector delta = M*bfit - v;
+      *prms = std::sqrt( delta.SumSquare() / nobs);
+   }
+
+   //init polynom
+   for (cit=expset.begin(), j=1; cit != expset.end() ; ++cit, ++j) //loop on exponent tuples
+   {
+      setMonom(*cit, bfit(j));
+   }
+   return true;
+}
+
 protected:
    /**
     * protected data members
diff --git a/include/ossim/base/ossimPreferences.h b/include/ossim/base/ossimPreferences.h
index 64f6905..dcf4143 100644
--- a/include/ossim/base/ossimPreferences.h
+++ b/include/ossim/base/ossimPreferences.h
@@ -28,6 +28,8 @@
 class OSSIMDLLEXPORT ossimPreferences
 {
 public:
+   // This is only here so we can swig wrap this.  The destructor should never be called directly.
+   ~ossimPreferences();
    /*!
     * METHOD: instance()
     * The static singleton instance of this object is accessed via this method:
@@ -97,7 +99,6 @@ protected:
    ossimPreferences();
    ossimPreferences(const ossimPreferences&) {}
 
-   ~ossimPreferences();
    void operator = (const ossimPreferences&) const {}
 
    static ossimPreferences* theInstance;
diff --git a/include/ossim/base/ossimProperty.h b/include/ossim/base/ossimProperty.h
index c82be9c..5f47bf9 100644
--- a/include/ossim/base/ossimProperty.h
+++ b/include/ossim/base/ossimProperty.h
@@ -5,7 +5,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimProperty.h 18405 2010-11-10 20:44:58Z gpotts $
+// $Id: ossimProperty.h 19917 2011-08-09 11:12:24Z gpotts $
 #ifndef ossimProperty_HEADER
 #define ossimProperty_HEADER
 #include <ossim/base/ossimObject.h>
@@ -25,7 +25,9 @@ public:
    {
       ossimPropertyChangeType_NOTSPECIFIED   = 0,
       ossimPropertyChangeType_CACHE_REFRESH  = 1,
-      ossimPropertyChangeType_FULL_REFRESH   = 2
+      ossimPropertyChangeType_FULL_REFRESH   = 2,
+      ossimPropertyChangeType_AFFECTS_OTHERS = 4, // used to identify if this property modification affects the values of other properties once set
+      ossimPropertyChangeType_ALL = (ossimPropertyChangeType_CACHE_REFRESH|ossimPropertyChangeType_FULL_REFRESH|ossimPropertyChangeType_AFFECTS_OTHERS)
    };
    ossimProperty(const ossimString& name=ossimString(""));
    ossimProperty(const ossimProperty& rhs);
@@ -42,9 +44,9 @@ public:
 
    virtual const ossimContainerProperty* asContainer()const;
    virtual ossimContainerProperty* asContainer();
-   
+   bool isChangeTypeSet(int type)const;
    void clearChangeType();
-   void setChangeType(ossimPropertyChangeType type);
+   void setChangeType(int type, bool on=true);
    void setFullRefreshBit();
    void setCacheRefreshBit();
    
@@ -52,8 +54,9 @@ public:
    bool isFullRefresh()const;
    bool isCacheRefresh()const;
    bool isChangeTypeSpecified()const;
-
-   void setReadOnlyFlag(bool flag);
+   bool affectsOthers()const;
+   
+   virtual void setReadOnlyFlag(bool flag);
    bool getReadOnlyFlag()const;
    bool isReadOnly()const;
 
@@ -69,6 +72,7 @@ public:
    virtual ossimRefPtr<ossimXmlNode> toXml()const;
    
    virtual void saveState(ossimKeywordlist& kwl, const ossimString& prefix = "")const;
+   virtual void accept(ossimVisitor& visitor);
    
 protected:
    virtual ~ossimProperty();
diff --git a/include/ossim/base/ossimRectilinearDataObject.h b/include/ossim/base/ossimRectilinearDataObject.h
index 9f77bf7..da3fb0c 100644
--- a/include/ossim/base/ossimRectilinearDataObject.h
+++ b/include/ossim/base/ossimRectilinearDataObject.h
@@ -7,7 +7,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimRectilinearDataObject.h 16052 2009-12-08 22:20:40Z dburken $
+// $Id: ossimRectilinearDataObject.h 19931 2011-08-10 11:53:25Z gpotts $
 #ifndef ossimRectilinearDataObject_HEADER
 #define ossimRectilinearDataObject_HEADER
 #include <ossim/base/ossimDataObject.h>
@@ -135,6 +135,9 @@ public:
    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;
diff --git a/include/ossim/base/ossimRefreshEvent.h b/include/ossim/base/ossimRefreshEvent.h
index 51aea4f..cd14b86 100644
--- a/include/ossim/base/ossimRefreshEvent.h
+++ b/include/ossim/base/ossimRefreshEvent.h
@@ -7,28 +7,70 @@
 //
 //
 //*************************************************************************
-// $Id: ossimRefreshEvent.h 9968 2006-11-29 14:01:53Z gpotts $
+// $Id: ossimRefreshEvent.h 19819 2011-07-14 17:28:48Z gpotts $
 #ifndef ossimRefreshEvent_HEADER
 #define ossimRefreshEvent_HEADER
 #include <ossim/base/ossimEvent.h>
+#include <ossim/base/ossimDpt.h>
 
 class OSSIMDLLEXPORT ossimRefreshEvent : public ossimEvent
 {
 public:
+   enum RefreshType
+   {
+      REFRESH_NONE      = 0,
+      REFRESH_POSITION  = 1,
+      REFRESH_PIXELS    = 2,
+      REFRESH_GEOMETRY  = 4,
+      REFRESH_ALL       = (REFRESH_POSITION|REFRESH_PIXELS|REFRESH_GEOMETRY)
+   };
+   enum PositionAnchor
+   {
+      ANCHOR_UPPER_LEFT = 1,
+      ANCHOR_CENTER     = 2
+   };
+   ossimRefreshEvent(ossimObject* object=0)  // the object associated with the event if any
+   :ossimEvent(object, OSSIM_EVENT_REFRESH_ID),
+    m_refreshType(static_cast<RefreshType>(REFRESH_PIXELS|REFRESH_GEOMETRY)),
+    m_anchor(ANCHOR_CENTER)
+   {m_position.makeNan();}
+   ossimRefreshEvent(RefreshType refreshType, ossimObject* object=0)
+   :ossimEvent(object, OSSIM_EVENT_REFRESH_ID),
+    m_refreshType(refreshType),
+    m_anchor(ANCHOR_CENTER)
 
-   ossimRefreshEvent(ossimObject* object=NULL)  // the object associated with the event if any
-      :ossimEvent(object, OSSIM_EVENT_REFRESH_ID)
-      {}
-   ossimRefreshEvent(const ossimRefreshEvent& rhs)
-      :ossimEvent(rhs)
-      {
-      }
+   {
+      m_position.makeNan();
+   }
+   ossimRefreshEvent(const ossimRefreshEvent& src)
+   :ossimEvent(src),
+    m_refreshType(src.m_refreshType),
+    m_position(src.m_position),
+    m_anchor(src.m_anchor)
+   {
+   }
    virtual ossimObject* dup()const
-      {
-         return new ossimRefreshEvent(*this);
-      }
+   {
+      return new ossimRefreshEvent(*this);
+   }
  
-TYPE_DATA
+   void setRefreshType(int refreshType, bool on=true);
+   RefreshType getRefreshType()const{return m_refreshType;}
+   
+   void setPosition(const ossimDpt& position)
+   {
+      m_position = position;
+      if(!m_position.hasNans())setRefreshType(REFRESH_POSITION);
+   }
+   
+   const ossimDpt& getPosition()const{return m_position;}
+   
+                     
+protected:
+   RefreshType m_refreshType;
+   ossimDpt    m_position;
+   PositionAnchor m_anchor;
+   TYPE_DATA
 };
 
 #endif
diff --git a/include/ossim/base/ossimSevenParamDatum.h b/include/ossim/base/ossimSevenParamDatum.h
index e1b9047..eb9c05b 100644
--- a/include/ossim/base/ossimSevenParamDatum.h
+++ b/include/ossim/base/ossimSevenParamDatum.h
@@ -9,7 +9,7 @@
 // SevenParamDatum. This is a base class for all
 // seven param datums.
 //*******************************************************************
-//  $Id: ossimSevenParamDatum.h 14789 2009-06-29 16:48:14Z dburken $
+//  $Id: ossimSevenParamDatum.h 19795 2011-06-30 15:04:48Z gpotts $
 
 #ifndef ossimSevenParamDatum_HEADER
 #define ossimSevenParamDatum_HEADER
@@ -82,6 +82,7 @@ public:
    virtual ossim_float64 param5()const{return theParam5;}
    virtual ossim_float64 param6()const{return theParam6;}
    virtual ossim_float64 param7()const{return theParam7;}
+   virtual bool isEqualTo(const ossimObject& obj, ossimCompareType compareType=OSSIM_COMPARE_FULL)const;
    
 private:
    ossim_float64 theParam1;
@@ -91,6 +92,8 @@ private:
    ossim_float64 theParam5;
    ossim_float64 theParam6;
    ossim_float64 theParam7;
+   
+   TYPE_DATA;
 };
 
 #endif
diff --git a/include/ossim/base/ossimString.h b/include/ossim/base/ossimString.h
index e4a6a9f..1c4ee82 100644
--- a/include/ossim/base/ossimString.h
+++ b/include/ossim/base/ossimString.h
@@ -5,54 +5,95 @@
 // 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 17999 2010-08-30 18:00:08Z gpotts $
+// $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 <ossim/base/ossimConstants.h>
+#include <iostream>
 
 
-class OSSIM_DLL ossimString : public std::string
+class OSSIM_DLL ossimString
 {
 public:
 
-   /** default constructor */
-   ossimString():std::string(){}
+   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() {}
 
-   /** constructor that takes a std::string */
-   ossimString(const std::string& s):std::string(s){}
+   /** @brief constructor that takes a std::string */
+   ossimString(const std::string& s):m_str(s) {}
 
    /**
-    * constructor that takes char*
+    * @brief constructor that takes char*
     * NOTE: std::string construtor throws exception given null pointer;
     * hence, the null check.
     */
-   ossimString(const char *aString):std::string( aString?aString:"" ){}
+   ossimString(const char *aString):m_str( aString?aString:"" ){}
 
-   /** copy constructor */   
-   ossimString(const ossimString& aString):std::string(aString.c_str()){}
+   /** @brief copy constructor */
+   ossimString(const ossimString& aString):m_str(aString.m_str){}
 
-   /** constructor - constructs with n copies of c */
-   ossimString(size_type n, char c):std::string(n,c){}
+   /** @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){}
 
-   /** constructor - constructs with 1 c. */
-   ossimString(char aChar):std::string(1, aChar){}
-   
    template <class Iter>
-	   ossimString(Iter startIter, Iter endIter):std::string(startIter, endIter){}
+   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 );
 
-   bool contains(const ossimString& aString) const {return find(aString)!=npos;}
-   bool contains(const char*   aString) const {return find(aString)!=npos;}
+   /** @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)
    {
-      std::string::operator=(s);
+      m_str = s;
       return *this;
    }
 
@@ -60,67 +101,124 @@ public:
    {
       if (s) // std::string::operator= throws exception given null pointer.
       {
-         std::string::operator=(s);
+         m_str = s;
       }
       else
       {
-         std::string::operator=("");
+         m_str = "";
       }
       return *this;
    }
 
    const ossimString& operator=(char c)
    {
-      std::string::operator=(c);
+      m_str = c;
       return *this;
    }
 
-   const ossimString& operator =(const ossimString& s)
+   const ossimString& operator=(const ossimString& s)
    {
-      std::string::operator =(s.c_str());
+      if ( this != &s )
+      {
+         m_str = s.m_str;
+      }
       return *this;
    }
 
-   const ossimString& operator +=(const ossimString& s)
-      {
-         append(s.c_str());
-         return *this;
-      }
-   const ossimString& operator +=(const char* s)
-      {
-         append(ossimString(s).c_str());
-         return *this;
-      }
-   const ossimString& operator +=(char c)
-      {
-         append(ossimString(c).c_str());
-         return *this;
-      }
-   ossimString operator +(const ossimString& s)const
-      {
-         ossimString returnS(*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;
+   }
 
-         returnS.append(s.c_str());
+   const ossimString& operator+=(const char* s)
+   {
+      if ( s ) m_str.append(s);
+      return *this;
+   }
 
-         return returnS;
-      }
-   ossimString operator +(const char* s)const
-      {
-         ossimString returnS(*this);
+   const ossimString& operator+=(char c)
+   {
+      m_str.append(1, c);
+      return *this;
+   }
 
-         returnS.append(ossimString(s).c_str());
+   const ossimString& append(const ossimString& s);
 
-         return returnS;
-      }
-   ossimString operator +(char c)const
-      {
-         ossimString returnS(*this);
+   const ossimString& append(const std::string& s);
 
-         returnS.append(ossimString(c).c_str());
+   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);
 
-         return returnS;
-      }
-   
    /**
     *  @brief  Test if this ossimString is equal to another ossimString.
     *  @param rhs ossimString to compare.
@@ -128,9 +226,9 @@ public:
     */
    bool operator==(const ossimString& rhs) const
    {
-      return (std::string::compare(rhs.c_str()) == 0);
+      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.
@@ -142,7 +240,7 @@ public:
       bool result = false;
       if (rhs)
       {
-         result = (std::string::compare(std::string(rhs)) == 0);
+         result = (m_str.compare(std::string(rhs)) == 0);
       }
       return result;
    }
@@ -154,9 +252,9 @@ public:
     */
    bool operator!=(const ossimString& rhs) const
    {
-      return !(std::string::compare(rhs.c_str()) == 0);
+      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.
@@ -168,25 +266,35 @@ public:
       bool result = true;
       if (rhs)
       {
-         result = !(std::string::compare(std::string(rhs)) == 0);
+         result = !(m_str.compare(std::string(rhs)) == 0);
       }
       return result;
    }
-   
-   //---
-   // operator[] removed.  std::string::operator[] works given a
-   // std::string::size_type for an index.
-   // //
-   // char& operator[](int i)
-   //    {
-   //       return *( const_cast<char*>(c_str())+i);
-   //    }
-   // const char& operator[](int i)const
-   //    {
-   //       return *(c_str()+i);
-   //    }
-   //---
-   
+
+   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:
@@ -200,15 +308,15 @@ public:
    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;
+    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;
+                                  const ossimString &replacementValue,
+                                  bool replaceAll=false)const;
 
    /**
     *  Substitutes searchKey string with replacementValue and returns a
@@ -216,51 +324,211 @@ public:
     *  "replaceAll" is true.  (like substitute only works on "this")
     */
    ossimString& gsub(const ossimString &searchKey,
-                     const ossimString &replacementValue,
-                     bool replaceAll=false);
+                             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 
+    * 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;
 
-   operator const char*()const{return c_str();}
-   const char* chars()const{return c_str();}
+   /**
+    * @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)
@@ -301,7 +569,7 @@ public:
    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;
@@ -337,19 +605,19 @@ public:
     * @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. 
+    * @param fixed If true setiosflags(std::ios::fixed) will be called.
     */
    static ossimString toString(ossim_float64 aValue,
                                ossim_int32 precision = 15,
@@ -359,10 +627,17 @@ public:
                                    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)const;
+              const ossimString& separatorList,
+              bool skipBlankFields=false)const;
 
-   std::vector<ossimString> split(const ossimString& separatorList)const;
+   std::vector<ossimString> split(const ossimString& separatorList,
+                                  bool skipBlankFields=false)const;
 
    const ossimString& join(const std::vector<ossimString>& stringList,
                            const ossimString& separator);
@@ -405,9 +680,256 @@ public:
 
    /**
     * If OSSIM_ID_ENABLED returns the OSSIM_ID which currently is the
-    * expanded cvs $Id: ossimString.h 17999 2010-08-30 18:00:08Z gpotts $ macro; else, an empty string.
+    * 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/include/ossim/base/ossimThinPlateSpline.h b/include/ossim/base/ossimThinPlateSpline.h
index 0f77994..7ef3e60 100644
--- a/include/ossim/base/ossimThinPlateSpline.h
+++ b/include/ossim/base/ossimThinPlateSpline.h
@@ -59,7 +59,6 @@ public:
       rhs.resize(_nof_vars);
       coef.resize(_nof_vars);
       growPoints();
-      std::cout << "rhs size = " << rhs.size() << " elements == " << rhs[0].size() << std::endl;
       for ( int v = 0; v < _nof_vars; v++ )
          for ( int i = 0; i < 3; i++ )
             //            rhs[i][v] = 0.0;
diff --git a/include/ossim/base/ossimThreeParamDatum.h b/include/ossim/base/ossimThreeParamDatum.h
index 3ff3731..c6bce4b 100644
--- a/include/ossim/base/ossimThreeParamDatum.h
+++ b/include/ossim/base/ossimThreeParamDatum.h
@@ -9,7 +9,7 @@
 // ossimThreeParamDatum. This is a base class for all
 // three param datums.
 //*******************************************************************
-//  $Id: ossimThreeParamDatum.h 13560 2008-09-10 11:42:57Z gpotts $
+//  $Id: ossimThreeParamDatum.h 19795 2011-06-30 15:04:48Z gpotts $
 
 #ifndef ossimThreeParamDatum_HEADER
 #define ossimThreeParamDatum_HEADER
@@ -70,11 +70,15 @@ public:
    virtual ossim_float64 param6()const{return 0.0;}
    virtual ossim_float64 param7()const{return 1.0;}
 
+   virtual bool isEqualTo(const ossimObject& obj, ossimCompareType compareType=OSSIM_COMPARE_FULL)const;
+
 protected:
    
    ossim_float64 theParam1;
    ossim_float64 theParam2;
    ossim_float64 theParam3;
+
+   TYPE_DATA;
 };
 
 
diff --git a/include/ossim/base/ossimUrl.h b/include/ossim/base/ossimUrl.h
new file mode 100644
index 0000000..a536eca
--- /dev/null
+++ b/include/ossim/base/ossimUrl.h
@@ -0,0 +1,42 @@
+#ifndef ossimUrl_HEADER
+#define ossimUrl_HEADER
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimKeywordlist.h>
+
+class OSSIM_DLL ossimUrl
+{
+public:
+    ossimUrl();
+    ossimUrl(const ossimString& url);
+    ossimUrl(const ossimString& protocol,
+             const ossimString& ip,
+             const ossimString& port,
+             const ossimString& path,
+             const ossimString& params);
+    const ossimString& getProtocol()const{return m_protocol;}
+    const ossimString& getIp()const{return m_ip;}
+    const ossimString& getPort()const{return m_port;}
+    const ossimString& getPath()const{return m_path;}
+    const ossimString& getParams()const{return m_params;}
+    
+    void setProtocol(const ossimString& protocol){m_protocol = protocol;}
+    void setIp(const ossimString& ip);
+    void setPort(const ossimString& port){m_port = port;}
+    void setPath(const ossimString& path){m_path = path;}
+    void setParams(const ossimString& params){m_params = params;}
+    
+    void setParams(const ossimKeywordlist& kwl);
+    
+    void setFieldsFromUrl(const ossimString& url);
+    ossimString toString()const;
+    
+protected:
+    ossimString m_protocol;
+    ossimString m_ip;
+    ossimString m_port;
+    ossimString m_path;
+    ossimString m_params;
+};
+
+#endif
diff --git a/include/ossim/base/ossimVisitor.h b/include/ossim/base/ossimVisitor.h
index dba9841..9af759c 100644
--- a/include/ossim/base/ossimVisitor.h
+++ b/include/ossim/base/ossimVisitor.h
@@ -1,19 +1,26 @@
+// $Id: ossimVisitor.h 22158 2013-02-20 12:29:10Z gpotts $
+
 #ifndef ossimVisitor_HEADER
-#define ossimVisitor_HEADER
+#define ossimVisitor_HEADER 1
 #include <ossim/base/ossimObject.h>
 #include <ossim/base/ossimString.h>
 #include <ossim/base/ossimId.h>
+#include <ossim/base/ossimEvent.h>
+#include <ossim/base/ossimRefPtr.h>
 #include <set>
 #include <vector>
 
 class ossimConnectableObject;
 
 
-class OSSIM_DLL ossimVisitor
+class OSSIM_DLL ossimVisitor : public ossimReferenced
 {
 public:
-   typedef std::set<ossimConnectableObject*>    Collection;
-   typedef std::vector<ossimConnectableObject*> List;
+   typedef std::set<ossimRefPtr<ossimObject> >    MarkCollectionRef;
+   typedef std::set<ossimRefPtr<ossimObject> >    CollectionRef;
+   typedef std::vector<ossimRefPtr<ossimObject> > ListRef;
+   typedef std::set<ossimObject*>                 Collection;
+   typedef std::vector<ossimObject* >             List;
    /**
     * Enumeration type can be a mask and will traverse a graph of connectables based on the values.
     */
@@ -29,47 +36,82 @@ public:
    ossimVisitor(int visitorType = VISIT_NONE);
    ossimVisitor(const ossimVisitor& src);
    virtual void reset();
-   virtual ossimVisitor* dup()const=0;
+   virtual ossimRefPtr<ossimVisitor> dup()const=0;
+   virtual void visit(ossimObject* obj);
    virtual void visit(ossimConnectableObject* obj);
    VisitorType getVisitorType()const;
-   void setVisitorType(int vType);
+   void setVisitorType(int vType, bool on=true);
    void turnOffVisitorType(int vType);
-   bool hasVisited(ossimConnectableObject* obj)const;
+   bool hasVisited(ossimObject* obj)const;
    bool stopTraversal()const;
 protected:
-   VisitorType  m_visitorType;
-   Collection   m_markNode;
-   mutable bool m_stopTraversalFlag;
+   VisitorType            m_visitorType;
+   mutable Collection     m_markNode;
+   mutable bool           m_stopTraversalFlag;
 };
 
 class OSSIM_DLL ossimCollectionVisitor : public ossimVisitor
 {
 public:
-   
    ossimCollectionVisitor(int visitorType =(VISIT_INPUTS|VISIT_CHILDREN));
    ossimCollectionVisitor(const ossimCollectionVisitor& src);
-   List& getObjects();
-   const List& getObjects()const;
+   ListRef& getObjects();
+   const ListRef& getObjects()const;
+   ossimObject* getObject(ossim_uint32 idx = 0);
+   const ossimObject* getObject(ossim_uint32 idx = 0)const;
+
+   // Inlined to force template instantiation.
+   template <class T> T* getObjectAs(ossim_uint32 idx=0)
+   {
+      if(idx < m_collection.size())
+      {
+         return dynamic_cast<T*>(m_collection[idx].get());
+      }
+      return 0;
+   }
+
+   // Inlined to force template instantiation.
+   template<class T> const T* getObjectAs(ossim_uint32 idx=0)const
+   {
+      if(idx < m_collection.size())
+      {
+         return dynamic_cast<const T*>(m_collection[idx].get());
+      }
+      return 0;
+   }
+
    virtual void reset();
  
 protected:
-   List m_collection; 
+   ListRef m_collection; 
    
 };
 
 class OSSIM_DLL ossimIdVisitor : public ossimVisitor
 {
 public:
-   ossimIdVisitor(const ossimId& id = ossimId(), int visitorType =(VISIT_INPUTS|VISIT_CHILDREN));
+   /** 
+    * @brief Default constructor
+    * Constructs with id of 0 and vistor type of VISIT_INPUTS|VISIT_CHILDREN.
+    */
+   ossimIdVisitor();
+
+   ossimIdVisitor(int visitorType);
+   ossimIdVisitor(const ossimId& id, int visitorType =(VISIT_INPUTS|VISIT_CHILDREN));
    ossimIdVisitor(const ossimIdVisitor& src);
-   virtual ossimVisitor* dup()const;
+
+   virtual ossimRefPtr<ossimVisitor> dup()const;
    virtual void visit(ossimConnectableObject* obj);
+
+   /** @brief Resets m_object to 0, calls ossimVisitor::reset(). */
    virtual void reset();
-   ossimConnectableObject* connectableObject();
-   const ossimConnectableObject* connectableObject()const;
    
+   ossimConnectableObject* getObject();
+   const ossimConnectableObject* getObject()const;
+   void setId(const ossimId& id);
+   const ossimId& getId()const;
 protected:
-   ossimConnectableObject* m_connectableObject;
+   ossimConnectableObject* m_object;
    ossimId m_id;
 };
 
@@ -79,9 +121,22 @@ public:
    ossimTypeNameVisitor(int visitorType =(VISIT_INPUTS|VISIT_CHILDREN));
    ossimTypeNameVisitor(const ossimString& typeName, bool firstofTypeFlag=false, int visitorType =(VISIT_INPUTS|VISIT_CHILDREN));
    ossimTypeNameVisitor(const ossimTypeNameVisitor& src);
-   virtual ossimVisitor* dup()const;
-   virtual void visit(ossimConnectableObject* obj);
+   virtual ossimRefPtr<ossimVisitor> dup()const;
+   virtual void visit(ossimObject* obj);
+   void setTypeName(const ossimString& typeName);
+   const ossimString& getTypeName()const;
+
+   /**
+    * @brief Set the m_firstOfTypeFlag.
+    *
+    * @param flag If flag is true, ossimTypeNameVisitor::visit will stop traversing if it
+    * finds an object of m_typeName.
+    */
+   void setFirstOfTypeFlag(bool flag);
 
+   /** @return m_firstOfTypeFlag */
+   bool getFirstOfTypeFlag() const;
+   
 protected:
    ossimString m_typeName;
    bool        m_firstOfTypeFlag;
@@ -93,13 +148,57 @@ public:
    ossimTypeIdVisitor(int visitorType =(VISIT_INPUTS|VISIT_CHILDREN));
    ossimTypeIdVisitor(const RTTItypeid& typeId, bool firstofTypeFlag=false, int visitorType =(VISIT_INPUTS|VISIT_CHILDREN));
    ossimTypeIdVisitor(const ossimTypeIdVisitor& src);
-   virtual ossimVisitor* dup()const;
-   virtual void visit(ossimConnectableObject* obj);
+   virtual ossimRefPtr<ossimVisitor> dup()const;
+   virtual void visit(ossimObject* obj);
    void setTypeId(const RTTItypeid& typeId);
-   
+   const RTTItypeid& getTypeId()const;
 protected:
    RTTItypeid m_typeId;
    bool        m_firstOfTypeFlag;
 };
 
+class OSSIM_DLL ossimEventVisitor : public ossimVisitor
+{
+public:
+   ossimEventVisitor(ossimEvent* evt,
+                      int visitorType =(VISIT_OUTPUTS|VISIT_CHILDREN));
+   ossimEventVisitor(const ossimEventVisitor& src);
+   virtual ossimRefPtr<ossimVisitor> dup()const;
+   virtual void visit(ossimObject* obj);
+   
+protected:
+   ossimRefPtr<ossimEvent> m_event;
+  
+};
+
+/**
+ * @class ossimViewInterfaceVisitor
+ *
+ * Visitor to update view and then propagate property event to outputs.
+ */
+class OSSIM_DLL ossimViewInterfaceVisitor : public ossimVisitor
+{
+public:
+   ossimViewInterfaceVisitor(ossimObject* view,
+                             int visitorType =(VISIT_OUTPUTS|VISIT_CHILDREN));
+   ossimViewInterfaceVisitor(const ossimViewInterfaceVisitor& src);
+   virtual ossimRefPtr<ossimVisitor> dup()const;
+
+   /**
+    * @brief Calls ossimViewInterface::setView if obj cast to
+    * ossimViewInterface*.  On success a property event is sent to
+    * output side so that things like ossimCombiner can reinitialize if
+    * needed.
+    *
+    * @param obj Object to visit.
+    */
+   virtual void visit(ossimObject* obj);
+   
+
+   ossimObject* getView();
+   const ossimObject* getView()const;
+protected:
+   ossimRefPtr<ossimObject> m_view;
+};
+
 #endif
diff --git a/include/ossim/base/ossimWLSBundleSolution.h b/include/ossim/base/ossimWLSBundleSolution.h
new file mode 100644
index 0000000..7ce5a89
--- /dev/null
+++ b/include/ossim/base/ossimWLSBundleSolution.h
@@ -0,0 +1,53 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Hicks
+// test
+//
+// Description: Weighted least squares bundle adjustment solution.
+//----------------------------------------------------------------------------
+#ifndef ossimWLSBundleSolution_HEADER
+#define ossimWLSBundleSolution_HEADER
+
+#include <ossim/matrix/newmat.h>
+#include <ossim/matrix/newmatap.h>
+#include <ossim/matrix/newmatio.h>
+#include <vector>
+
+class ossimAdjSolutionAttributes;
+
+
+class OSSIM_DLL ossimWLSBundleSolution
+{
+public:
+
+   /**
+    * @brief Constructor
+    */
+   ossimWLSBundleSolution();
+   
+   /**
+    * @brief Run solution
+    */
+   bool run(ossimAdjSolutionAttributes* solAttributes);
+   
+   /**
+    * @brief Destructor
+    */
+   ~ossimWLSBundleSolution();
+
+
+protected:
+   bool theSolValid;
+
+   // Internal solution methods
+   bool solveSystem(double* d, double* c, double* delta, int jb);
+   bool recurFwd(double* d, double* c, std::vector<double>& rc, std::vector<int>& nz, int jb);
+   bool recurBack(double* d, int jb);
+   void trimv(double* pc, double* h, int pcIndex, int hIndex, int mr, std::vector<double>& sum);
+   void moveAndNegate(std::vector<double>& from, double* to, int indexFrom, int indexTo, int nElements);
+
+};
+
+#endif // #ifndef ossimWLSBundleSolution_HEADER
diff --git a/include/ossim/base/ossimWebRequest.h b/include/ossim/base/ossimWebRequest.h
new file mode 100644
index 0000000..f51dc2a
--- /dev/null
+++ b/include/ossim/base/ossimWebRequest.h
@@ -0,0 +1,26 @@
+#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/include/ossim/base/ossimWebRequestFactoryBase.h b/include/ossim/base/ossimWebRequestFactoryBase.h
new file mode 100644
index 0000000..755a609
--- /dev/null
+++ b/include/ossim/base/ossimWebRequestFactoryBase.h
@@ -0,0 +1,19 @@
+#ifndef ossimWebRequestFactoryBase_HEADER
+#define ossimWebRequestFactoryBase_HEADER
+#include <ossim/base/ossimBaseObjectFactory.h>
+#include <ossim/base/ossimHttpRequest.h>
+#include <ossim/base/ossimKeywordlist.h>
+/**
+ * We will for now hard code to be ossimHttpRequest but later
+ * we will refactor and add a base ossimWebRequest so we can handle
+ * other schema definitions such as ftp, scp, smtp, ... etc.
+ */
+class OSSIM_DLL ossimWebRequestFactoryBase : public ossimBaseObjectFactory
+{
+public:
+   virtual ossimWebRequest* create(const ossimUrl& /*url*/)
+   {
+      return 0;
+   }
+};
+#endif
diff --git a/include/ossim/base/ossimWebRequestFactoryRegistry.h b/include/ossim/base/ossimWebRequestFactoryRegistry.h
new file mode 100644
index 0000000..a100883
--- /dev/null
+++ b/include/ossim/base/ossimWebRequestFactoryRegistry.h
@@ -0,0 +1,49 @@
+#ifndef ossimWebFactoryRegistry_HEADER
+#define ossimWebFactoryRegistry_HEADER
+#include <ossim/base/ossimFactoryListInterface.h>
+#include <ossim/base/ossimWebRequestFactoryBase.h>
+#include <ossim/base/ossimWebRequest.h>
+
+
+/**
+ * This will later be changed fro ossimHttpRequest to ossimWebRequest so we have 
+ * a base class for general schema access such as ftp, sftp,smtp, ... etc and not
+ * just restricted to http and https schema definitions.
+ */
+class OSSIM_DLL ossimWebRequestFactoryRegistry : public ossimWebRequestFactoryBase,
+public ossimFactoryListInterface<ossimWebRequestFactoryBase, ossimWebRequest>
+
+{
+public:
+   static ossimWebRequestFactoryRegistry* instance();
+ 
+   virtual ossimWebRequest* create(const ossimUrl& url);
+   virtual ossimHttpRequest* createHttp(const ossimUrl& url);
+   
+   /*!
+    * 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;
+   /*!
+    * 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:
+   ossimWebRequestFactoryRegistry();
+   static ossimWebRequestFactoryRegistry* m_instance;
+};
+#endif
diff --git a/include/ossim/base/ossimWebResponse.h b/include/ossim/base/ossimWebResponse.h
new file mode 100644
index 0000000..b620f76
--- /dev/null
+++ b/include/ossim/base/ossimWebResponse.h
@@ -0,0 +1,27 @@
+#ifndef ossimWebResponse_HEADER
+#define ossimWebResponse_HEADER
+#include <ossim/base/ossimObject.h>
+#include <iostream>
+#include <vector>
+
+class OSSIM_DLL ossimWebResponse : public ossimObject
+{
+public:
+   typedef std::vector<char> ByteBuffer;
+   ossimWebResponse():ossimObject(){}
+   
+   /**
+    * This might have to change in the future if we start doing other protocols 
+    * such as ftp scp, ... etc.
+    *
+    * We currently will return the main input stream that can be used to read the 
+    * bytes returned from the request.  If you need access to say a header stream 
+    * from an http protocol then you can dynamic_cast to an ossimHttpResponse.
+    */
+   virtual std::istream* getInputStream()=0;
+
+   void copyAllDataFromInputStream(ByteBuffer& buffer);
+   
+TYPE_DATA;
+};
+#endif
diff --git a/include/ossim/base/ossimWgs72Datum.h b/include/ossim/base/ossimWgs72Datum.h
index e68cbcd..dba3746 100644
--- a/include/ossim/base/ossimWgs72Datum.h
+++ b/include/ossim/base/ossimWgs72Datum.h
@@ -25,7 +25,7 @@ public:
    virtual ossimGpt    shiftToWgs84(const ossimGpt &aPt)const;
    virtual ossimGpt    shiftFromWgs84(const ossimGpt &aPt)const;
 
-   
+   TYPE_DATA;   
 };
 
 #endif
diff --git a/include/ossim/base/ossimWgs84Datum.h b/include/ossim/base/ossimWgs84Datum.h
index cd7720d..9d5827a 100644
--- a/include/ossim/base/ossimWgs84Datum.h
+++ b/include/ossim/base/ossimWgs84Datum.h
@@ -10,7 +10,7 @@
 // instance of a Wgs84Ellipsoid and set the initial defaults for
 // that are specific to a ossimWgs84Datum
 //*******************************************************************
-//  $Id: ossimWgs84Datum.h 9968 2006-11-29 14:01:53Z gpotts $
+//  $Id: ossimWgs84Datum.h 19795 2011-06-30 15:04:48Z gpotts $
 
 #ifndef ossimWgs84Datum_HEADER
 #define ossimWgs84Datum_HEADER
@@ -28,7 +28,8 @@ public:
    virtual ossimGpt    shiftFromWgs84(const ossimGpt&aPt)const;
 
 protected:
-   
+ 
+   TYPE_DATA;
 };
 
 #endif
diff --git a/include/ossim/base/ossimXmlDocument.h b/include/ossim/base/ossimXmlDocument.h
index 998e193..bcbbba1 100644
--- a/include/ossim/base/ossimXmlDocument.h
+++ b/include/ossim/base/ossimXmlDocument.h
@@ -10,20 +10,19 @@
 // parsing and accessing of an XML document file.
 // 
 //*****************************************************************************
-// $Id: ossimXmlDocument.h 16817 2010-03-07 17:25:44Z dburken $
+// $Id: ossimXmlDocument.h 21579 2012-08-31 14:24:11Z dburken $
 #ifndef ossimXmlDocument_HEADER
-#define ossimXmlDocument_HEADER
+#define ossimXmlDocument_HEADER 1
 
-#include <vector>
 #include <ossim/base/ossimObject.h>
 #include <ossim/base/ossimErrorStatusInterface.h>
-#include <ossim/base/ossimRefPtr.h>
 #include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimXmlNode.h>
+#include <vector>
 
-class ossimXmlNode;
-
-class OSSIMDLLEXPORT ossimXmlDocument : public ossimObject,
-                                     public ossimErrorStatusInterface
+class OSSIMDLLEXPORT ossimXmlDocument :
+   public ossimObject, public ossimErrorStatusInterface
 {
 public:
    ossimXmlDocument(const ossimFilename& xmlFileName="");
@@ -57,7 +56,7 @@ private:
    ossimRefPtr<ossimXmlNode>  theRootNode;
    ossimString                theXmlHeader;
    ossimFilename              theFilename;
-
+   bool                       theStrictCheckFlag;
    bool readHeader(std::istream& in);
 TYPE_DATA
 };
diff --git a/include/ossim/base/ossimXmlString.h b/include/ossim/base/ossimXmlString.h
index 134fd41..8105f99 100644
--- a/include/ossim/base/ossimXmlString.h
+++ b/include/ossim/base/ossimXmlString.h
@@ -6,7 +6,7 @@
 // Description: This class provides manipulation of filenames.
 //
 //*************************************************************************
-// $Id: ossimXmlString.h 9968 2006-11-29 14:01:53Z gpotts $
+// $Id: ossimXmlString.h 22328 2013-07-25 17:17:52Z gpotts $
 
 #ifndef ossimXmlString_HEADER
 #define ossimXmlString_HEADER
@@ -58,7 +58,9 @@ public:
       {
          return assign(ossimString(s));
       }
-
+   static ossimString wrapCDataIfNeeded(const ossimString& input);
+   static ossimString wrapCData(const ossimString& input);
+   static bool containsSpecialXmlCharacters(const ossimString& value);
    const ossimXmlString& assign(const ossimString& s);
 };
 
diff --git a/include/ossim/elevation/ossimDtedElevationDatabase.h b/include/ossim/elevation/ossimDtedElevationDatabase.h
index 79a73aa..3c85efd 100644
--- a/include/ossim/elevation/ossimDtedElevationDatabase.h
+++ b/include/ossim/elevation/ossimDtedElevationDatabase.h
@@ -35,21 +35,7 @@ public:
       return filename.exists();
    }
    
-   /**
-    * METHODS: accuracyLE90(), accuracyCE90()
-    * Returns the vertical and horizontal accuracy (90% confidence) in the
-    * region of gpt:
-    */
-   virtual double getAccuracyLE90(const ossimGpt& /* gpt */) const
-   {
-      std::cout << "ossimDtedDatabase::getAccuracyLE90 \n";
-      return 0.0;
-   }
-   virtual double getAccuracyCE90(const ossimGpt& /* gpt */) const
-   {
-      std::cout << "ossimDtedDatabase::getAccuracyCE90 \n";
-      return 0.0;
-   }
+   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
@@ -71,7 +57,9 @@ public:
    
 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
@@ -81,42 +69,6 @@ protected:
       file = ossimFilename(m_connectionString).dirCat(relativeFile);
    }
    virtual ossimRefPtr<ossimElevCellHandler> createCell(const ossimGpt& gpt);
-#if 0
-   ossimRefPtr<ossimElevCellHandler> getOrCreateHandler(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
-      {
-         ossimFilename f;
-         createFullPath(f, gpt);
-         if(f.exists())
-         {
-            ossimRefPtr<ossimDtedHandler> h = new ossimDtedHandler(f, m_memoryMapCellsFlag);
-            if (!(h->getErrorStatus()))
-            {
-               m_cacheMap.insert(std::make_pair(id, new CellInfo(createId(gpt), h.get())));
-               result = h.get();
-            }
-         }
-         if(m_cacheMap.size() > m_maxOpenCells)
-         {
-            flushCacheToMinOpenCells();
-         }
-      }
-      m_cacheMapMutex.unlock();
-      
-      return result;
-   }
-#endif
 TYPE_DATA
 };
 #endif
diff --git a/include/ossim/elevation/ossimDtedHandler.h b/include/ossim/elevation/ossimDtedHandler.h
index 108949d..13f469b 100644
--- a/include/ossim/elevation/ossimDtedHandler.h
+++ b/include/ossim/elevation/ossimDtedHandler.h
@@ -16,7 +16,7 @@
 //              Derived from ossimElevCellHandler.
 //<
 //*****************************************************************************
-// $Id: ossimDtedHandler.h 16120 2009-12-17 19:49:52Z gpotts $
+// $Id: ossimDtedHandler.h 21210 2012-07-03 13:11:20Z gpotts $
 
 #ifndef ossimDtedHandler_HEADER
 #define ossimDtedHandler_HEADER
@@ -37,6 +37,13 @@
 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()
    {
       
@@ -81,6 +88,7 @@ public:
 
    virtual bool isOpen()const;
    
+   virtual bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const;
    
    const ossimDtedVol& vol()const
    {
@@ -103,8 +111,46 @@ public:
       return m_acc;
    }
 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];
+   };
+
+
    virtual ~ossimDtedHandler();
-  // Disallow operator= and copy constrution...
+  // Disallow operator= and copy construction...
    const ossimDtedHandler& operator=(const ossimDtedHandler& rhs);
    ossimDtedHandler(const ossimDtedHandler&);
 
@@ -118,9 +164,15 @@ protected:
    void gatherStatistics();
 
    ossim_sint16 convertSignedMagnitude(ossim_uint16& s) const;
-   virtual double getHeightAboveMSLFile(const ossimGpt&);
-   virtual double getHeightAboveMSLMemory(const ossimGpt&);
-   
+   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;
    
diff --git a/include/ossim/elevation/ossimElevCellHandler.h b/include/ossim/elevation/ossimElevCellHandler.h
index d9a430f..7d6e251 100644
--- a/include/ossim/elevation/ossimElevCellHandler.h
+++ b/include/ossim/elevation/ossimElevCellHandler.h
@@ -13,7 +13,7 @@
 //              Initial coding.
 //<
 //*****************************************************************************
-// $Id: ossimElevCellHandler.h 16143 2009-12-19 03:09:01Z okramer $
+// $Id: ossimElevCellHandler.h 21210 2012-07-03 13:11:20Z gpotts $
 
 
 #ifndef ossimElevCellHandler_HEADER
@@ -72,12 +72,13 @@ public:
     */
    virtual bool pointHasCoverage(const ossimGpt&) const;
 
+   virtual bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const;
    /**
     * METHODS: accuracyLE90(), accuracyCE90()
     * Returns the vertical and horizontal accuracy (90% confidence):
     */
-   virtual double getAccuracyLE90(const ossimGpt&) const;
-   virtual double getAccuracyCE90(const ossimGpt&) const;
+ // virtual double getAccuracyLE90(const ossimGpt&) const;
+ //  virtual double getAccuracyCE90(const ossimGpt&) const;
 
    bool canConnectMyInputTo(ossim_int32 inputIndex,
                             const ossimConnectableObject* object)const;
diff --git a/include/ossim/elevation/ossimElevManager.h b/include/ossim/elevation/ossimElevManager.h
index 49b81ee..013fc20 100644
--- a/include/ossim/elevation/ossimElevManager.h
+++ b/include/ossim/elevation/ossimElevManager.h
@@ -21,6 +21,7 @@
 #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>
@@ -28,6 +29,21 @@ class OSSIM_DLL ossimElevManager : public ossimElevSource
 {
 public: 
    typedef std::vector<ossimRefPtr<ossimElevationDatabase> > ElevationDatabaseListType;
+   
+   class OSSIM_DLL ConnectionStringVisitor : public ossimVisitor
+   {
+   public:
+      ConnectionStringVisitor(const ossimString& value):m_connectionString(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();
    
    /**
@@ -38,16 +54,8 @@ public:
    
    virtual double getHeightAboveEllipsoid(const ossimGpt& gpt);
    virtual double getHeightAboveMSL(const ossimGpt& gpt);
-   virtual double getAccuracyLE90(const ossimGpt& /*gpt*/) const
-   {
-      std::cout << "ossimElevManager::getAccuracyLE90(): NOT IMPLEMENTED!!!\n";
-      return 0.0;
-   }
-   virtual double getAccuracyCE90(const ossimGpt& /*gpt*/) const
-   {
-      return 0.0;
-      std::cout << "ossimElevManager::getAccuracyLE90(): NOT IMPLEMENTED!!!\n";
-   }
+
+
    virtual bool pointHasCoverage(const ossimGpt& /*gpt*/) const
    {
       std::cout << "ossimElevManager::pointHasCoverage(): NOT IMPLEMENTED!!!\n";
@@ -58,6 +66,8 @@ public:
       std::cout << "ossimElevManager::pointHasCoverage(): NOT IMPLEMENTED AND SHOULD NOT BE USED AT THIS LEVEL!!!\n";
       return 1.0;
    }
+   virtual bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const;
+  
    ossim_uint32 getNumberOfElevationDatabases()const
    {
       return (ossim_uint32)m_elevationDatabaseList.size();
@@ -111,6 +121,8 @@ public:
    virtual bool loadState(const ossimKeywordlist& kwl,
                           const char* prefix=0);
    
+   virtual void accept(ossimVisitor& visitor);
+   
 protected:
    ossimElevManager();
    void loadStandardElevationPaths();
diff --git a/include/ossim/elevation/ossimElevSource.h b/include/ossim/elevation/ossimElevSource.h
index 97dcf7f..2882d2f 100644
--- a/include/ossim/elevation/ossimElevSource.h
+++ b/include/ossim/elevation/ossimElevSource.h
@@ -10,7 +10,7 @@
 //   all objects providing height information given horizontal ground position.
 //
 //*****************************************************************************
-// $Id: ossimElevSource.h 16104 2009-12-17 18:09:59Z gpotts $
+// $Id: ossimElevSource.h 21380 2012-07-25 13:18:31Z gpotts $
 
 #ifndef ossimElevSource_HEADER
 #define ossimElevSource_HEADER
@@ -20,7 +20,7 @@
 #include <ossim/base/ossimGrect.h>
 #include <ossim/base/ossimFilename.h>
 #include <ossim/base/ossimGeoid.h>
-
+#include <ossim/elevation/ossimElevationAccuracyInfo.h>
 class ossimEcefRay;
 class ossimKeywordlist;
 
@@ -32,7 +32,6 @@ class OSSIM_DLL ossimElevSource : public ossimSource
 {
 public:
 
-
    virtual const ossimElevSource& operator = (const ossimElevSource& src);
    /**
     * Height access methods:
@@ -58,7 +57,7 @@ public:
     *
     *  Returns true if good intersection found.
     */
-   bool intersectRay(const ossimEcefRay& ray, ossimGpt& gpt);
+   bool intersectRay(const ossimEcefRay& ray, ossimGpt& gpt, double defaultElevValue = 0.0);
    
    /**
     * Access methods for the bounding elevations:
@@ -84,13 +83,18 @@ public:
     */
    virtual double getMeanSpacingMeters() const = 0;
 
+
+   virtual bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const =0;
+
+
+
    /**
     * METHODS: accuracyLE90(), accuracyCE90()
     * Returns the vertical and horizontal accuracy (90% confidence) in the
     * region of gpt:
     */
-   virtual double getAccuracyLE90(const ossimGpt& gpt) const = 0;
-   virtual double getAccuracyCE90(const ossimGpt& gpt) const = 0;
+   //virtual double getAccuracyLE90(const ossimGpt& gpt) const = 0;
+   //virtual double getAccuracyCE90(const ossimGpt& gpt) const = 0;
 
 
    /**
diff --git a/include/ossim/elevation/ossimElevationAccuracyInfo.h b/include/ossim/elevation/ossimElevationAccuracyInfo.h
new file mode 100644
index 0000000..48de61d
--- /dev/null
+++ b/include/ossim/elevation/ossimElevationAccuracyInfo.h
@@ -0,0 +1,61 @@
+#ifndef ossimElevationAccuracyInfo_HEADER
+#define ossimElevationAccuracyInfo_HEADER 1
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimString.h>
+
+
+class OSSIM_DLL ossimElevationAccuracyInfo: public ossimReferenced
+{
+public:
+    ossimElevationAccuracyInfo():
+        m_confidenceLevel(0.9),
+        m_relativeCE(ossim::nan()),
+        m_absoluteCE(ossim::nan()),
+        m_relativeLE(ossim::nan()),
+        m_absoluteLE(ossim::nan()),
+        m_surfaceName("None")
+    {}
+
+    void makeNan()
+    {
+     m_relativeCE = ossim::nan();
+     m_absoluteCE = ossim::nan();
+     m_relativeLE = ossim::nan();
+     m_absoluteLE = ossim::nan();
+    }
+    double getConfidenceLevel()const{return m_confidenceLevel;}
+
+    bool hasValidRelativeError()const
+    { 
+        return ((!ossim::isnan(m_relativeCE)) && 
+                (!ossim::isnan(m_relativeLE)));
+    }
+    bool hasValidAbsoluteError()const{
+        return ((!ossim::isnan(m_absoluteCE)) && 
+                (!ossim::isnan(m_absoluteLE)));
+    }
+    double getRelativeCE()const{return m_relativeCE;}
+    void setRelativeCE(double value){m_relativeCE = value;}
+
+    double getAbsoluteCE()const{return m_absoluteCE;}
+    void setAbsoluteCE(double value){m_absoluteCE = value;}
+
+    double getRelativeLE()const{return m_relativeLE;}
+    void setRelativeLE(double value){m_relativeLE = value;}
+
+    double getAbsoluteLE()const{return m_absoluteLE;}
+    void setAbsoluteLE(double value){m_absoluteLE = value;}
+    
+    const ossimString& getSurfaceName()const{return m_surfaceName;}
+    void setSurfaceName(const ossimString& value){m_surfaceName = value;}
+
+    double m_confidenceLevel;
+    double m_relativeCE;
+    double m_absoluteCE;
+    double m_relativeLE;
+    double m_absoluteLE;
+    ossimString m_surfaceName;
+};
+
+#endif
diff --git a/include/ossim/elevation/ossimElevationDatabase.h b/include/ossim/elevation/ossimElevationDatabase.h
index 6ea3ca6..706ebe9 100644
--- a/include/ossim/elevation/ossimElevationDatabase.h
+++ b/include/ossim/elevation/ossimElevationDatabase.h
@@ -30,8 +30,14 @@ public:
    m_meanSpacing(src.m_meanSpacing)
    {
    }
-   
-   virtual double getMeanSpacingMeters() const
+
+   const ossimElevationDatabase& operator = (const ossimElevationDatabase& rhs);
+      
+   virtual bool getAccuracyInfo(ossimElevationAccuracyInfo& /*info*/, const ossimGpt& /*gpt*/) const
+   {
+      return false;
+   }
+  virtual double getMeanSpacingMeters() const
    {
       return m_meanSpacing;
    }
@@ -75,7 +81,7 @@ protected:
 
    ossimString m_connectionString;
    ossimRefPtr<ossimGeoid>    m_geoid;
-    ossim_float64              m_meanSpacing;
+   ossim_float64              m_meanSpacing;
    
 TYPE_DATA
 };
@@ -83,141 +89,142 @@ TYPE_DATA
 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)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;
-  virtual ossim_uint64 createId(const ossimGpt& /* pt */)const
-  {
-    return 0;
-  }
-  virtual ossimRefPtr<ossimElevCellHandler> getOrCreateCellHandler(const ossimGpt& gpt);
- 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;
-     }
-  }
+   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)
+   {
+   }
+   const ossimElevationCellDatabase& operator=(const ossimElevationCellDatabase& rhs);
 
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix)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;
+   virtual ossim_uint64 createId(const ossimGpt& /* pt */)const
+   {
+      return 0;
+   }
+   virtual ossimRefPtr<ossimElevCellHandler> getOrCreateCellHandler(const ossimGpt& gpt);
+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;
 };
 
diff --git a/include/ossim/elevation/ossimElevationDatabaseRegistry.h b/include/ossim/elevation/ossimElevationDatabaseRegistry.h
index 7095e2b..00f679c 100644
--- a/include/ossim/elevation/ossimElevationDatabaseRegistry.h
+++ b/include/ossim/elevation/ossimElevationDatabaseRegistry.h
@@ -1,10 +1,9 @@
 #ifndef ossimElevationDatabaseRegistry_HEADER
 #define ossimElevationDatabaseRegistry_HEADER
-#include "ossimElevationDatabaseFactoryBase.h"
-#include "ossimElevationDatabase.h"
+#include <ossim/elevation/ossimElevationDatabaseFactoryBase.h>
+#include <ossim/elevation/ossimElevationDatabase.h>
 #include <ossim/base/ossimFactoryListInterface.h>
-class OSSIM_DLL ossimElevationDatabaseRegistry : public ossimFactoryListInterface<ossimElevationDatabaseFactoryBase, 
-                                                                                  ossimElevationDatabase>
+class OSSIM_DLL ossimElevationDatabaseRegistry : public ossimFactoryListInterface<ossimElevationDatabaseFactoryBase, ossimElevationDatabase>
 
 {
 public:
diff --git a/include/ossim/elevation/ossimGeneralRasterElevationDatabase.h b/include/ossim/elevation/ossimGeneralRasterElevationDatabase.h
index c798772..f8fdb51 100644
--- a/include/ossim/elevation/ossimGeneralRasterElevationDatabase.h
+++ b/include/ossim/elevation/ossimGeneralRasterElevationDatabase.h
@@ -30,21 +30,27 @@ public:
    }
    virtual bool open(const ossimString& connectionString);
    virtual bool pointHasCoverage(const ossimGpt& gpt) const;
+
+   virtual bool getAccuracyInfo(ossimElevationAccuracyInfo& /*info*/, const ossimGpt& /*gpt*/) const
+   {
+      return false;
+   }
+
    /**
     * METHODS: accuracyLE90(), accuracyCE90()
     * Returns the vertical and horizontal accuracy (90% confidence) in the
     * region of gpt:
     */
-   virtual double getAccuracyLE90(const ossimGpt& /* gpt */) const
-   {
-      std::cout << "ossimGeneralElevationDatabase::getAccuracyLE90 \n";
-      return 0.0;
-   }
-   virtual double getAccuracyCE90(const ossimGpt& /* gpt */) const
-   {
-      std::cout << "ossimGeneralElevationDatabase::getAccuracyCE90 \n";
-      return 0.0;
-   }
+//   virtual double getAccuracyLE90(const ossimGpt& /* gpt */) const
+//   {
+//      std::cout << "ossimGeneralElevationDatabase::getAccuracyLE90 \n";
+//      return 0.0;
+//   }
+//   virtual double getAccuracyCE90(const ossimGpt& /* gpt */) const
+ //  {
+ //     std::cout << "ossimGeneralElevationDatabase::getAccuracyCE90 \n";
+ //     return 0.0;
+ //  }
    virtual double getHeightAboveMSL(const ossimGpt&);
    virtual double getHeightAboveEllipsoid(const ossimGpt& gpt);
    virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix = 0);
diff --git a/include/ossim/elevation/ossimHgtRef.h b/include/ossim/elevation/ossimHgtRef.h
index 7238c9a..ba29933 100644
--- a/include/ossim/elevation/ossimHgtRef.h
+++ b/include/ossim/elevation/ossimHgtRef.h
@@ -14,7 +14,6 @@
 #include <ossim/matrix/newmat.h>
 #include <ossim/matrix/newmatap.h>
 #include <ossim/matrix/newmatio.h>
-
 enum HeightRefType_t
 {
    AT_HGT = 0,
@@ -52,6 +51,17 @@ public:
    virtual ossim_float64 getRefHeight(const ossimGpt& pg) const;
    
    /**
+    * @brief Method to get surface information string.
+    *
+    * @param pg   Reference point.
+    * @param info ossimElevationAccuracyInfo string.
+    *
+    * @return true on success, false on error.
+    */
+  // virtual bool getSurfaceInfo
+  //    (const ossimGpt& pg, ossimElevationAccuracyInfo& info) const;
+   
+   /**
     * @brief Method to get surface covariance matrix.
     *
     * @param pg  Reference point.
diff --git a/include/ossim/elevation/ossimImageElevationDatabase.h b/include/ossim/elevation/ossimImageElevationDatabase.h
new file mode 100644
index 0000000..7ce9d1d
--- /dev/null
+++ b/include/ossim/elevation/ossimImageElevationDatabase.h
@@ -0,0 +1,208 @@
+//----------------------------------------------------------------------------
+//
+// 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/ossimElevationDatabase.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:
+
+   /** 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();
+
+   /**
+    * @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)const;
+
+   /**
+    * @brief Gets the bounding rectangle/coverage of elevation.
+    *
+    * @param rect Rectangle to initialize.
+    */
+   void getBoundingRect(ossimGrect& rect) const;
+
+   /**
+    * @brief ProcessFile method.
+    *
+    * This method is linked to the ossimFileWalker::walk method via a callback
+    * mechanism.  So 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.
+    */
+   void processFile(const ossimFilename& file);
+   
+protected:
+   /**
+    * @Brief Protected destructor.
+    *
+    * This class is derived from ossimReferenced so users should always use
+    * ossimRefPtr<ossimImageElevationDatabase> to hold instance.
+    */
+   ~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);
+
+      /** 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);
+   
+   /** Hidden from use assignment operator */
+   const ossimImageElevationDatabase& operator=(const ossimImageElevationDatabase& rhs);
+
+   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..3d643ba
--- /dev/null
+++ b/include/ossim/elevation/ossimImageElevationHandler.h
@@ -0,0 +1,129 @@
+//----------------------------------------------------------------------------
+//
+// 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>
+
+/**
+ * @class ossimImageElevationHandler
+ *
+ * Elevation source for a generic image opened via ossimImageHandler.
+ */
+class OSSIM_DLL ossimImageElevationHandler : public ossimElevCellHandler
+{
+public:
+
+   /** default constructor */
+   ossimImageElevationHandler();
+
+   /**
+    * 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;
+
+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;
+
+   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
index 7601ca7..74356a4 100644
--- a/include/ossim/elevation/ossimSrtmElevationDatabase.h
+++ b/include/ossim/elevation/ossimSrtmElevationDatabase.h
@@ -34,6 +34,7 @@ public:
       return new ossimSrtmElevationDatabase(*this);
    }
    virtual bool open(const ossimString& connectionString);
+   bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& /*gpt*/) const;
    virtual bool pointHasCoverage(const ossimGpt& gpt) const
    {
       ossimFilename filename;
@@ -41,21 +42,6 @@ public:
       
       return filename.exists();
    }
-   /**
-    * METHODS: accuracyLE90(), accuracyCE90()
-    * Returns the vertical and horizontal accuracy (90% confidence) in the
-    * region of gpt:
-    */
-   virtual double getAccuracyLE90(const ossimGpt& /* gpt */) const
-   {
-      std::cout << "ossimSrtmDatabase::getAccuracyLE90 \n";
-      return 0.0;
-   }
-   virtual double getAccuracyCE90(const ossimGpt& /* gpt */) const
-   {
-      std::cout << "ossimSrtmDatabase::getAccuracyCE90 \n";
-      return 0.0;
-   }
    virtual double getHeightAboveMSL(const ossimGpt&);
    virtual double getHeightAboveEllipsoid(const ossimGpt& gpt);
    virtual ossim_uint64 createId(const ossimGpt& pt)const
diff --git a/include/ossim/elevation/ossimTiledElevationDatabase.h b/include/ossim/elevation/ossimTiledElevationDatabase.h
new file mode 100644
index 0000000..57b5af2
--- /dev/null
+++ b/include/ossim/elevation/ossimTiledElevationDatabase.h
@@ -0,0 +1,213 @@
+//----------------------------------------------------------------------------
+//
+// 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/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:
+
+   /** 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)const;
+   
+    bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& /*gpt*/) const
+    {
+       info.makeNan();
+
+       return false;
+    }
+   /**
+    * @brief ProcessFile method.
+    *
+    * This method is linked to the ossimFileWalker::walk method via a callback
+    * mechanism.  So 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.
+    */
+   void processFile(const ossimFilename& file);
+   
+protected:
+   /** Protected destructor as this is derived from ossimRefenced. */
+   ~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);
+
+   /** Hidden from use assignment operator */
+   const ossimTiledElevationDatabase& operator=(const ossimTiledElevationDatabase& rhs);
+
+   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/include/ossim/font/ossimFreeTypeFont.h b/include/ossim/font/ossimFreeTypeFont.h
index c207a1c..0df5bf4 100644
--- a/include/ossim/font/ossimFreeTypeFont.h
+++ b/include/ossim/font/ossimFreeTypeFont.h
@@ -6,14 +6,14 @@
 // Author: Garrett Potts
 // 
 //********************************************************************
-// $Id: ossimFreeTypeFont.h 15766 2009-10-20 12:37:09Z gpotts $
+// $Id: ossimFreeTypeFont.h 21749 2012-09-18 14:06:13Z dburken $
 #ifndef ossimFreeTypeFont_HEADER
 #define ossimFreeTypeFont_HEADER
 
 #include <ossim/ossimConfig.h> /* To pick up OSSIM_HAS_FREETYPE. */
 
 #if OSSIM_HAS_FREETYPE
-#  include "ossimFont.h"
+#  include <ossim/font/ossimFont.h>
 #  include <ft2build.h>
 #  include FT_FREETYPE_H
 //#include <freetype/freetype.h>
diff --git a/include/ossim/imaging/ossimAppFixedTileCache.h b/include/ossim/imaging/ossimAppFixedTileCache.h
index a38657e..9470b4b 100644
--- a/include/ossim/imaging/ossimAppFixedTileCache.h
+++ b/include/ossim/imaging/ossimAppFixedTileCache.h
@@ -9,7 +9,7 @@
 // Description: This file contains the Application cache algorithm
 //
 //***********************************
-// $Id: ossimAppFixedTileCache.h 18421 2010-11-15 13:08:30Z gpotts $
+// $Id: ossimAppFixedTileCache.h 20127 2011-10-12 11:27:10Z gpotts $
 #ifndef ossimAppFixedTileCache_HEADER
 #define ossimAppFixedTileCache_HEADER
 #include <map>
@@ -56,7 +56,8 @@ public:
    ossimRefPtr<ossimImageData> getTile(ossimAppFixedCacheId cacheId,
                            const ossimIpt& origin);
    ossimRefPtr<ossimImageData> addTile(ossimAppFixedCacheId cacheId,
-                                       ossimRefPtr<ossimImageData> data);
+                                       ossimRefPtr<ossimImageData> data,
+                                       bool duplicateData=true);
    
    ossimRefPtr<ossimImageData> removeTile(ossimAppFixedCacheId cacheId,
                                           const ossimIpt& origin);
diff --git a/include/ossim/imaging/ossimBandSelector.h b/include/ossim/imaging/ossimBandSelector.h
index cbc5e62..c11fc01 100644
--- a/include/ossim/imaging/ossimBandSelector.h
+++ b/include/ossim/imaging/ossimBandSelector.h
@@ -8,14 +8,16 @@
 // Description:  Contains class declaration for ossimBandSelector.
 // 
 //*******************************************************************
-//  $Id: ossimBandSelector.h 15766 2009-10-20 12:37:09Z gpotts $
+//  $Id: ossimBandSelector.h 21631 2012-09-06 18:10:55Z dburken $
 #ifndef ossimBandSelector_HEADER
-#define ossimBandSelector_HEADER
+#define ossimBandSelector_HEADER 1
 
-#include <vector>
-#include <ossim/imaging/ossimImageSourceFilter.h>
 
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <vector>
+ 
 class ossimImageData;
+class ossimImageHandler;
 
 class OSSIM_DLL ossimBandSelector : public ossimImageSourceFilter
 {
@@ -28,7 +30,9 @@ public:
       ossimBandSelectorWithinRangeFlagState_OUT_OF_RANGE = 2,
 
    };
+
    ossimBandSelector();
+   virtual ~ossimBandSelector();
    
    
    virtual ossimString getLongName()  const;
@@ -65,6 +69,20 @@ public:
     */
    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;
@@ -95,10 +113,9 @@ public:
    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:
-   virtual ~ossimBandSelector();
 
    /**
     * Called on first getTile, will initialize all data needed.
@@ -106,24 +123,36 @@ protected:
    void allocate();
 
    /**
-    * @return true if theInputConnection->getOutputBandList is equal to
-    * this->theOutputBandList, false if not.
+    * Will check all combinations of the band list to see if its 
     */
-   bool isOrderedCorrectly() const;
+   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;
    
    
-   ossimRefPtr<ossimImageData> theTile;
-   vector<ossim_uint32>        theOutputBandList;
-   mutable ossimBandSelectorWithinRangeFlagState theWithinRangeFlag;
-   bool theOrderedCorrectlyFlag;
+   ossimRefPtr<ossimImageData>           theTile;
+   std::vector<ossim_uint32>             theOutputBandList;
+   ossimBandSelectorWithinRangeFlagState theWithinRangeFlag;
+   bool                                  thePassThroughFlag;
 
 TYPE_DATA
 };
 
-#endif
+#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/ossimCacheTileSource.h b/include/ossim/imaging/ossimCacheTileSource.h
index 0d61fbf..53461b3 100644
--- a/include/ossim/imaging/ossimCacheTileSource.h
+++ b/include/ossim/imaging/ossimCacheTileSource.h
@@ -7,7 +7,7 @@
 // Description:  ossimCacheTileSource
 // 
 //*******************************************************************
-//  $Id: ossimCacheTileSource.h 16276 2010-01-06 01:54:47Z gpotts $
+//  $Id: ossimCacheTileSource.h 20456 2012-01-13 19:39:30Z gpotts $
 #ifndef ossimCacheTileSource_HEADER
 #define ossimCacheTileSource_HEADER
 #include <ossim/imaging/ossimImageSourceFilter.h>
@@ -19,6 +19,7 @@
 class OSSIMDLLEXPORT ossimCacheTileSource : public ossimImageSourceFilter
 {
 public:
+   typedef std::vector<ossimAppFixedTileCache::ossimAppFixedCacheId> RLevelCacheList;
    /**
     * Will construct a new Application cache
     */
@@ -56,20 +57,23 @@ public:
    virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
    
 
+   
 protected:
    virtual ~ossimCacheTileSource();
 
    void allocate();
+   void deleteRlevelCache();
+   void initializeRlevelCache();
    
-   ossimAppFixedTileCache::ossimAppFixedCacheId theCacheId;
+   ossimAppFixedTileCache::ossimAppFixedCacheId getCacheId(ossim_uint32 resLevel);
 
    ossimRefPtr<ossimImageData> theTile;
    ossimIpt                    theFixedTileSize;
    bool                        theCachingEnabled;
    bool                        theEventProgressFlag;
-   ossim_uint32                theCacheRLevel;
-   ossimIrect                  theBoundingRect;
-
+   bool                        theUseInputTileSizeFlag;
+   RLevelCacheList             theRLevelCacheList;
+   
    /** For lock and unlock. */
 
    
diff --git a/include/ossim/imaging/ossimClosestToCenterCombiner.h b/include/ossim/imaging/ossimClosestToCenterCombiner.h
index c45227b..03e0b68 100644
--- a/include/ossim/imaging/ossimClosestToCenterCombiner.h
+++ b/include/ossim/imaging/ossimClosestToCenterCombiner.h
@@ -8,7 +8,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimClosestToCenterCombiner.h 9094 2006-06-13 19:12:40Z dburken $
+// $Id: ossimClosestToCenterCombiner.h 22162 2013-02-26 01:37:48Z gpotts $
 #ifndef ossimClosestToCenterCombiner_HEADER
 #define ossimClosestToCenterCombiner_HEADER
 #include <vector>
@@ -22,7 +22,7 @@
   * sensor data.
   * 
   */
-class ossimClosestToCenterCombiner : public ossimImageMosaic
+class OSSIM_DLL ossimClosestToCenterCombiner : public ossimImageMosaic
 {
 public:
    ossimClosestToCenterCombiner();
diff --git a/include/ossim/imaging/ossimConvolutionSource.h b/include/ossim/imaging/ossimConvolutionSource.h
index c7def30..597389a 100644
--- a/include/ossim/imaging/ossimConvolutionSource.h
+++ b/include/ossim/imaging/ossimConvolutionSource.h
@@ -8,7 +8,7 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimConvolutionSource.h 15766 2009-10-20 12:37:09Z gpotts $
+//  $Id: ossimConvolutionSource.h 22233 2013-04-15 15:12:54Z gpotts $
 #ifndef ossimConvolutionSource_HEADER
 #define ossimConvolutionSource_HEADER
 #include <vector>
@@ -21,7 +21,7 @@ using namespace std;
 class ossimTilePatch;
 class ossimDiscreteConvolutionKernel;
 
-class ossimConvolutionSource : public ossimImageSourceFilter
+class OSSIM_DLL ossimConvolutionSource : public ossimImageSourceFilter
 {
 public:
    ossimConvolutionSource();
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/ossimDtedElevationImageSource.h b/include/ossim/imaging/ossimDtedElevationImageSource.h
deleted file mode 100644
index cba65f9..0000000
--- a/include/ossim/imaging/ossimDtedElevationImageSource.h
+++ /dev/null
@@ -1,226 +0,0 @@
-//----------------------------------------------------------------------------
-// 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:
-//
-// Contains class declaration of ossimDtedElevationImageSource.
-//
-// $Id: ossimDtedElevationImageSource.h 9094 2006-06-13 19:12:40Z dburken $
-//----------------------------------------------------------------------------
-#ifndef ossimDtedElevationImageSource_HEADER
-#define ossimDtedElevationImageSource_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimGrect.h>
-
-
-// Forward class declarations.
-class ossimImageData;
-class ossimImageChain;
-class ossimDtedTileSource;
-class ossimConnectableObject;
-class ossimMapProjection;
-class ossimIrect;
-
-
-/**
- * Class to return large area blocks of data as an ossimImageData object from
- * multiple dted cells.  Source dted cells must be of the same resolution and
- * in the standard dted directory stucture.
- *
- * Example directory structure:
- *
- *                      dted_level2_directory
- *                        /              \  
- *                       /                \
- *                    w099                w100
- *                   /    \              /    \
- *                  /      \            /      \
- *               n32.dt2  n33.dt2   n32.dt2  n33.dt2
- */
-class OSSIMDLLEXPORT ossimDtedElevationImageSource
-{
-public:
-
-   enum ResamplerType
-   {
-      NEAREST_NEIGHBOR = 0,
-      BILINEAR         = 1
-   };
-   
-   /**
-    * Default constructor
-    */
-   ossimDtedElevationImageSource();
-
-   /**
-    * Destructor
-    */
-   virtual ~ossimDtedElevationImageSource();
-
-   /**
-    * @param rect Requested rectangle.
-    *
-    * @param lines Number of lines.  This will determine the
-    * post spacing in the latitude direction.
-    *
-    * @param samples Number of samples.  This will determine the post spacing
-    * in the longitude direction.
-    */
-   ossimRefPtr<ossimImageData> getBlock(const ossimGrect& rect,
-                                        ossim_uint32 lines,
-                                        ossim_uint32 samples) const;
-   
-   /**
-    * @param directory Directory to search for dted cells.
-    *
-    * @note Directory should be in a standard dted format.
-    *
-    * @note All cells in the directory should be of same resolution.
-    */
-   void setDirectory(const ossimFilename& directory);
-
-   /**
-    * @param directory Will be initialized to the current dted directory.
-    */
-   void getDirectory(ossimFilename& directory) const;
-
-    /**
-    * @param ext Should be the extension of cells in the directory like
-    * "dt1", "dt2".
-    *
-    * @note All cells in the directory should have same extension.
-    */
-   void setCellExtension(const ossimString& ext);
-
-   /**
-    * @param ext Will be initialized to the current cell extension.
-    */
-   void getCellExtension(ossimString& ext) const;
-
-   /**
-    * @param type Enumerated resampler type.
-    */
-   void setResamplerType(ossimDtedElevationImageSource::ResamplerType type);
-
-   /**
-    * @return Resampler type.
-    */
-   ossimDtedElevationImageSource::ResamplerType getResamplerType() const;
-   
-
-private:
-   
-   /**
-    * Finds all cells in "theDirectory" for rectangle passed in.
-    *
-    * @param rect Rectangle of requested elevation block.
-    *
-    * @param vf Vector of ossimFilenames to initialize with cells that are
-    * present and overlap rect.
-    *
-    * @note vf will be cleared upon entring this method, so if vf.empty() is
-    * true than no cells were found.
-    */
-   void findCells(const ossimGrect& rect,
-                  vector<ossimFilename>& vf) const;
-
-   /**
-    * Main resample method.
-    *
-    * @param rect Rectangle of requested elevation block.
-    *
-    */
-   void resampleCell(const ossimGrect& rect,
-                     const ossimFilename& dtedFile,
-                     ossimImageData& id,
-                     const ossimDpt& postSpacing) const;
-
-   /**
-    * Specialized resample method.  Uses ossimDtedHandler and its
-    * getHeightAboveMSL method to fill rect.
-    */
-   void resampleCellBilinear(const ossimGrect& rect,
-                             const ossimFilename& dtedFile,
-                             ossimImageData& id,
-                             const ossimDpt& postSpacing) const;
-
-   /**
-    * Specialized resample method.  Uses ossimDtedTileSource to fill a patch,
-    * then resamples to post spacing using nearest neighbor.
-    */
-   void resampleCellNearestNeighbor(const ossimGrect& rect,
-                                    const ossimFilename& dtedFile,
-                                    ossimImageData& id,
-                                    const ossimDpt& requestedPostSpacing)const;
-
-   /**
-    * @param rect Ground rectangle.
-    *
-    * @param lines Number of desired lines in latitude direction.
-    *
-    * @param samples Number of desired samples in the longitude direction.
-    *
-    * @param result
-    * result.y = (rect.ul().latd - rect.ll().latd) / lines
-    * result.x = (rect.lr().lond - rect.ll().lond) / samples
-    */
-   void getPostSpacing(const ossimGrect& rect,
-                       ossim_uint32 lines,
-                       ossim_uint32 samples,
-                       ossimDpt& result) const;
-
-   /**
-    * Aligns clip rect to requested rect with respect to post spacing.
-    */
-   void snap(const ossimGrect& rect,
-             const ossimDpt& postSpacing,
-             ossimGrect& clipRect) const;
-
-   /**
-    * @return The index for gpt into id's buf.  If point does not intersect
-    * the rectangle an "OSSIM_UINT_NAN" is returned.
-    */
-   ossim_uint32 computeIndex(const ossimImageData& id,
-                             const ossimGrect& idRect,
-                             const ossimGpt& gpt,
-                             const ossimDpt& postSpacing) const;
-
-   /**
-    * @return Returns the rLevel that is equal to, or greater than the
-    * requestedPostSpacing.
-    */
-   ossim_uint32 computeRLevel(ossim_uint32 numberOfRLevels,
-                              const ossimDpt& requestedPostSpacing,
-                              const ossimDpt& cellPostSpacing) const;
-
-   ossimConnectableObject* createRawChain(const ossimFilename& file) const;
-
-   ossimImageChain* createMosaic(
-      const std::vector<ossimFilename>& inputs) const;
-   
-   ossimImageChain* createMosaic(
-      const std::vector<ossimConnectableObject*>& inputs) const;
-
-   ossimMapProjection* getView(ossimConnectableObject* container) const;
-
-   void computeImageRect(const ossimMapProjection* view,
-                         const ossimGrect& grect,
-                         ossimIrect& irect) const;
-
-   ossimFilename theDirectory;
-   ossimString   theCellExtension;
-   ResamplerType theResamplerType;
-   
-};
-
-#endif /* End of #ifndef ossimDtedElevationImageSource_HEADER */
-
diff --git a/include/ossim/imaging/ossimEnviTileSource.h b/include/ossim/imaging/ossimEnviTileSource.h
new file mode 100644
index 0000000..472c981
--- /dev/null
+++ b/include/ossim/imaging/ossimEnviTileSource.h
@@ -0,0 +1,101 @@
+//----------------------------------------------------------------------------
+//
+// 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;
+
+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/ossimGeneralRasterInfo.h b/include/ossim/imaging/ossimGeneralRasterInfo.h
index 327bb47..6bec188 100644
--- a/include/ossim/imaging/ossimGeneralRasterInfo.h
+++ b/include/ossim/imaging/ossimGeneralRasterInfo.h
@@ -11,34 +11,32 @@
 //
 // Contains class declaration for ossimGeneralRasterInfo
 //*******************************************************************
-//  $Id: ossimGeneralRasterInfo.h 9852 2006-11-01 20:26:55Z gpotts $
+//  $Id: ossimGeneralRasterInfo.h 22197 2013-03-12 02:00:55Z dburken $
 
 #ifndef ossimGeneralRasterInfo_HEADER
-#define ossimGeneralRasterInfo_HEADER
-
-#include <vector>
+#define ossimGeneralRasterInfo_HEADER 1
 
 #include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimErrorStatusInterface.h>
+#include <ossim/base/ossimCommon.h>
 #include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimIrect.h>
 #include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimFilename.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 ossimString;
-
 
-//***************************************************************************
-// CLASS:  ossimGeneralRasterInfo
-//***************************************************************************
-class OSSIMDLLEXPORT ossimGeneralRasterInfo : public ossimObject,
-                                              public ossimErrorStatusInterface
+/**
+ * @class ossimGeneralRasterInfo
+ *
+ */
+class OSSIMDLLEXPORT ossimGeneralRasterInfo : public ossimObject
 {
 public:
 
@@ -53,51 +51,58 @@ public:
    {
       UNKNOWN = -1
    };
-   
-   ossimGeneralRasterInfo();
 
+   /* @brief default constructor */
+   ossimGeneralRasterInfo();
+   
    ossimGeneralRasterInfo(const std::vector<ossimFilename>& imageFileList,
                           ossimScalarType      pixelType,
                           ossimInterleaveType  il_type,
-                          ossim_uint32         numberOfBands,
-                          ossim_uint32         lines,
-                          ossim_uint32         samples,
-                          ossim_uint32         headerSize,
+                          ossim_int32          numberOfBands,
+                          ossim_int32          lines,
+                          ossim_int32          samples,
+                          ossim_int32          headerSize,
                           ossimFillMode        nullsMode,
-                          ossim_uint32         pixelsToChop);
+                          ossim_int32          pixelsToChop);
    
    ossimGeneralRasterInfo(const ossimKeywordlist& kwl, const char* prefix=0);
 
-   ~ossimGeneralRasterInfo ();
+   /* @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.
     */
-   ossimIrect imageRect()       const { return theImageRect;      }
+   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)
     */
-   ossimIrect validImageRect()  const { return theValidImageRect; }
+   const ossimIrect& validImageRect() const;
 
-   /*!
+   /**
     *  Zero based rectangle of the raw image.
     */
-   ossimIrect rawImageRect()    const { return theRawImageRect;   }
+   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.
     */
-   ossimIpt subImageOffset()  const { return theSubImageOffset; }
+   const ossimIpt& subImageOffset() const;
 
-   /*!
+   /**
     *  Returns the size of header in bytes.
     */
-   ossim_uint32 headerSize()      const { return theHeaderSize;     }
+   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.
@@ -105,171 +110,210 @@ public:
     *  - 2  Flip zeroes within the image line to minimum pixel value.
     *       This is used by edge walking code.
     */
-   ossim_uint32 fillToNullsMode() const { return theSetNullsMode;   }
+   ossim_uint32 fillToNullsMode() const;
 
-   /*!
+   /**
     *  Sets theSetNullsMode.
     */
    void setFillToNullsMode(ossim_uint32 mode);
 
-   void setMinPixelValue(ossim_uint32 band, double value)
-      {
-         theMetaData.setMinPix(band, value);
-      }
-  double getMinPixelValue(ossim_uint32 band)const
-  {
-    return theMetaData.getMinPix(band);
-  }
-   void setMaxPixelValue(ossim_uint32 band, double value)
-      {
-         theMetaData.setMaxPix(band, value);
-      }
-  double getMaxPixelValue(ossim_uint32 band)const
-  {
-    return theMetaData.getMaxPix(band);
-  }
-   void setNullPixelValue(ossim_uint32 band, double value)
-      {
-         theMetaData.setNullPix(band, value);
-      }
-  double getNullPixelValue(ossim_uint32 band)const
-  {
-    return theMetaData.getNullPix(band);
-  }
-   /*!
-    *  Sets theNumberOfBands.
+   /**
+    * @brief Number of bands. Inlined below.
+    * @return Number of bands from theMetaData class member cast to an int32.
     */
-   void setNumberOfBands(ossim_uint32 bands) { theMetaData.setNumberOfBands(bands); }
-
-   /*!
+   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_uint32 pixelsToChop()   const { return thePixelsToChop;   } 
-
-   /*!
-    *  Number of bands.  Defaulted to one.
-    */
-   ossim_uint32 numberOfBands()  const { return theMetaData.getNumberOfBands();  }
-
-   /*!
+   ossim_int32 pixelsToChop() const;
+   
+   /**
     *  Enumerated in InterleaveTypeLUT. Should be either bip,
     *  bil or bsq.  Defaulted to bip.
     */
-   ossimInterleaveType interleaveType() const { return theInterleaveType; }
+   ossimInterleaveType interleaveType() const;
 
-   /*!
-    * Returns the pixel type represented as a "PixelType" enumeration.
-    * See "constants.h" file for PixelType enumerations.
-    */
-   ossimScalarType getScalarType() const { return theMetaData.getScalarType(); }
-   
-   /*!
+   /**
     *  Returns the number of lines within "theValidImageRect".
     */
-   ossim_uint64 validLines()        const;
+   inline ossim_int32 validLines() const;
 
-   /*!
+   /**
     *  Returns the number of lines within "theRawImageRect".
     */
-   ossim_uint64 rawLines()          const;
+   inline ossim_int32 rawLines() const;
 
-   /*!
+   /**
     *  Returns the number of bytes in a raw line.
     */
-   ossim_uint64 bytesPerRawLine()   const;
+   inline ossim_int32 bytesPerRawLine() const;
 
-   /*!
+   /**
     *  Returns the number of bytes in a valid line.
     */
-   ossim_uint64 bytesPerValidLine() const;
+   inline ossim_int32 bytesPerValidLine() const;
 
-   /*!
+   /**
     *  Returns the number of samples within "theValidImageRect".
     */
-   ossim_uint64 validSamples()      const;
+   inline ossim_int32 validSamples() const;
 
-   /*!
+   /**
     *  Returns the number of samples within "theRawImageRect".
     */
-   ossim_uint64 rawSamples()        const;
+   inline ossim_int32 rawSamples() const;
 
-   /*!
+   /**
     *  Returns the offset in bytes to the first valid sample in the image.
     */
-   ossim_uint64 offsetToFirstValidSample() const;
+   inline std::streamoff offsetToFirstValidSample() const;
    
-   std::vector<ossimFilename> getImageFileList() const { return theImageFileList; }
+   const std::vector<ossimFilename>& getImageFileList() const;
 
-   void setImageFileList(const std::vector<ossimFilename>& list)
-      { theImageFileList = list; }
-   void setHeaderSize(ossim_uint32 headerSize) {theHeaderSize = headerSize;}
-   void setInterleaveType(ossimInterleaveType il_type)
-      {theInterleaveType = il_type;}
-   virtual std::ostream& print(std::ostream& out) const;
-   void setImageRect(const ossimIrect& imageRect){theImageRect = imageRect;}
-   void setValidImageRect(const ossimIrect &imageRect)
-      {theValidImageRect = imageRect;}
-   void setRawImageRect(const ossimIrect &imageRect)
-      {theRawImageRect=imageRect;}
-   void setSubImageOffset(const ossimIpt& d) { theSubImageOffset = d; }
+   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);
    
-   ossim_uint32 bytesPerPixel(ossimScalarType type) const;
-   ossim_uint32 bytesPerPixel() const;
+   void setInterleaveType(ossimInterleaveType il_type);
+
+   virtual std::ostream& print(std::ostream& out) const;
+
+   void setImageRect(const ossimIrect& imageRect);
    
-   ossimByteOrder getImageDataByteOrder() const
-      { return theImageDataByteOrder; }
+   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;
+                          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:
-  ossimImageMetaData           theMetaData;
+
+   /**
+    * @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;
-   ossim_uint32                theNumberOfBands;
 
-   /*!
+   /**
     *  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_uint32 theHeaderSize;
+   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.
@@ -278,32 +322,57 @@ private:
     */
    ossimFillMode theSetNullsMode;
 
-   /*!
+   /**
     *  Amount of pixels to chop for each line edge.
     */
-   ossim_uint32 thePixelsToChop;
+   ossim_int32 thePixelsToChop;
 
-   /*!
+   /**
     *  The byte order the image data is stored in.
     */
   ossimByteOrder theImageDataByteOrder;
 };
 
 
-//***
-// Inlines
-//***
-inline ossim_uint64 ossimGeneralRasterInfo::validLines() const
+//---
+// 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_uint64>(theValidImageRect.height());
+   return static_cast<ossim_int32>( theMetaData.getBytesPerPixel() );
 }
 
-inline ossim_uint64 ossimGeneralRasterInfo::rawLines() const
+inline ossim_int32 ossimGeneralRasterInfo::validLines() const
 {
-   return static_cast<ossim_uint64>(theRawImageRect.height());
+   return static_cast<ossim_int32>(theValidImageRect.height());
 }
 
-inline ossim_uint64 ossimGeneralRasterInfo::bytesPerRawLine() const
+inline ossim_int32 ossimGeneralRasterInfo::rawLines() const
+{
+   return static_cast<ossim_int32>(theRawImageRect.height());
+}
+
+inline ossim_int32 ossimGeneralRasterInfo::bytesPerRawLine() const
 {
    if (interleaveType() == OSSIM_BIP)
    {
@@ -315,7 +384,7 @@ inline ossim_uint64 ossimGeneralRasterInfo::bytesPerRawLine() const
    }
 }
 
-inline ossim_uint64 ossimGeneralRasterInfo::bytesPerValidLine() const
+inline ossim_int32 ossimGeneralRasterInfo::bytesPerValidLine() const
 {
    if (interleaveType() == OSSIM_BIP)
    {
@@ -327,22 +396,17 @@ inline ossim_uint64 ossimGeneralRasterInfo::bytesPerValidLine() const
    }
 }
 
-inline ossim_uint64 ossimGeneralRasterInfo::validSamples() const
+inline ossim_int32 ossimGeneralRasterInfo::validSamples() const
 {
-   return static_cast<ossim_uint64>(theValidImageRect.width());
+   return static_cast<ossim_int32>(theValidImageRect.width());
 }
 
-inline ossim_uint64 ossimGeneralRasterInfo::rawSamples() const
+inline ossim_int32 ossimGeneralRasterInfo::rawSamples() const
 {
-   return static_cast<ossim_uint64>(theRawImageRect.width());
+   return static_cast<ossim_int32>(theRawImageRect.width());
 }
 
-inline ossim_uint32 ossimGeneralRasterInfo::bytesPerPixel() const
-{
-   return bytesPerPixel((ossimScalarType)theMetaData.getScalarType());
-}
-
-inline ossim_uint64 ossimGeneralRasterInfo::offsetToFirstValidSample() const
+inline std::streamoff ossimGeneralRasterInfo::offsetToFirstValidSample() const
 {
    if (interleaveType() == OSSIM_BIP)
    {
@@ -354,7 +418,7 @@ inline ossim_uint64 ossimGeneralRasterInfo::offsetToFirstValidSample() const
    {
       return headerSize() +
          ( bytesPerRawLine() * validImageRect().ul().y * numberOfBands() ) +
-         ( validImageRect().ul().x * bytesPerPixel());
+         ( validImageRect().ul().x * bytesPerPixel() );
    }
    else // BSQ
    {
diff --git a/include/ossim/imaging/ossimGeneralRasterTileSource.h b/include/ossim/imaging/ossimGeneralRasterTileSource.h
index 93d260c..fe102b7 100644
--- a/include/ossim/imaging/ossimGeneralRasterTileSource.h
+++ b/include/ossim/imaging/ossimGeneralRasterTileSource.h
@@ -12,14 +12,17 @@
 // ossimGeneralRasterTileSource is derived from ImageHandler which is
 // derived from ossimTileSource.
 //*******************************************************************
-//  $Id: ossimGeneralRasterTileSource.h 16075 2009-12-10 15:46:43Z gpotts $
+//  $Id: ossimGeneralRasterTileSource.h 21631 2012-09-06 18:10:55Z dburken $
 
 #ifndef ossimGeneralRasterTileSource_HEADER
-#define ossimGeneralRasterTileSource_HEADER
+#define ossimGeneralRasterTileSource_HEADER 1
+
 
-#include <ossim/base/ossimIoStream.h>
 #include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimIoStream.h>
 #include <ossim/imaging/ossimGeneralRasterInfo.h>
+#include <vector>
+  
 
 class  ossimImageData;
 
@@ -140,32 +143,70 @@ public:
    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 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 bool initializeHandler();
-   virtual void checkBuffer(const ossimIrect& rect);
-   ossimRefPtr<ossimImageData>  theTile;
-   ossim_uint8*                 theBuffer;
-   ossimInterleaveType          theBufferInterleave;
-   std::vector<ossimRefPtr<ossimIFStream> > theFileStrList;
-//   vector<istream*>            theFileStrList;   
-   ossimGeneralRasterInfo       theImageData;
-   ossimIrect                   theBufferRect;
-   bool                         theSwapBytesFlag;
-   ossim_uint32                 theBufferSizeInPixels;
+   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
-
+#endif /* #ifndef ossimGeneralRasterTileSource_HEADER */
diff --git a/include/ossim/imaging/ossimGeneralRasterWriter.h b/include/ossim/imaging/ossimGeneralRasterWriter.h
index 4059ce7..dc146d0 100644
--- a/include/ossim/imaging/ossimGeneralRasterWriter.h
+++ b/include/ossim/imaging/ossimGeneralRasterWriter.h
@@ -1,4 +1,4 @@
-//*******************************************************************
+ //*******************************************************************
 // Copyright (C) 2001 ImageLinks Inc.
 //
 // License:  See top level LICENSE.txt file.
@@ -10,24 +10,25 @@
 // Contains class declaration for ossimGeneralRasterWriter.
 //
 //*******************************************************************
-//  $Id: ossimGeneralRasterWriter.h 16081 2009-12-10 20:56:36Z eshirschorn $
+// $Id: ossimGeneralRasterWriter.h 22197 2013-03-12 02:00:55Z dburken $
 
 #ifndef ossimGeneralRasterWriter_HEADER
-#define ossimGeneralRasterWriter_HEADER
+#define ossimGeneralRasterWriter_HEADER 1
 
+#include <ossim/base/ossimConstants.h>
 #include <ossim/imaging/ossimImageFileWriter.h>
 #include <ossim/base/ossimIrect.h>
 #include <ossim/base/ossimFilename.h>
 #include <ossim/base/ossimKeywordlist.h>
 #include <ossim/base/ossimKeyword.h>
 
-class ossimGeneralRasterWriter : public ossimImageFileWriter
+class OSSIM_DLL ossimGeneralRasterWriter : public ossimImageFileWriter
 {
 public:
-   ossimGeneralRasterWriter();
-   ossimGeneralRasterWriter(ossimImageSource* inputSource,
-                            const ossimFilename& file=ossimFilename(""));
 
+   /** @brief default constructor */
+   ossimGeneralRasterWriter();
+   
    /**
     * void getImageTypeList(std::vector<ossimString>& imageTypeList)const
     *
@@ -69,11 +70,37 @@ public:
     */
    virtual bool loadState(const ossimKeywordlist& kwl,
                           const char* prefix=0);
+
+   /**
+    * @brief Method to write the image to a stream.
+    *
+    * Callers must call setOutputStream(...) method prior to this.
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool writeStream();
+
+   /**
+    * @brief Sets the output stream to write to.
+    *
+    * The stream will not be closed/deleted by this object.
+    *
+    * @param output The stream to write to.
+    */
+   virtual bool setOutputStream(std::ostream& stream);
+   
 protected:
+
+   /**
+    * Write out the file.
+    * @return true on success, false on error.
+    */
+   virtual bool writeFile();
+
+   /** @brief Protected ( this is a ossimRefPtr) destructor. */
    virtual ~ossimGeneralRasterWriter();
 
 private:
-   virtual bool writeFile();
 
    /**
     *  Writes image data to output file in BIP(Band Interleaved by Pixel)
@@ -113,9 +140,8 @@ private:
     */
    ossimString getInterleaveString() const;
    
-   
-   std::ofstream       theFileStream;
-   bool                theOverviewFlag;
+   std::ostream*       theOutputStream;
+   bool                theOwnsStreamFlag;
    ossim_uint32        theRlevel;
    ossimByteOrder      theOutputByteOrder;
    
diff --git a/include/ossim/imaging/ossimGeoAnnotationPolyObject.h b/include/ossim/imaging/ossimGeoAnnotationPolyObject.h
index 39e16ac..6cedf52 100644
--- a/include/ossim/imaging/ossimGeoAnnotationPolyObject.h
+++ b/include/ossim/imaging/ossimGeoAnnotationPolyObject.h
@@ -6,7 +6,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimGeoAnnotationPolyObject.h 15766 2009-10-20 12:37:09Z gpotts $
+// $Id: ossimGeoAnnotationPolyObject.h 19734 2011-06-06 23:45:36Z dburken $
 #ifndef ossimGeoAnnotationPolyObject_HEADER
 #define ossimGeoAnnotationPolyObject_HEADER
 
@@ -18,6 +18,12 @@
 class OSSIMDLLEXPORT ossimGeoAnnotationPolyObject : public ossimGeoAnnotationObject
 {
 public:
+   enum ossimPolyType
+   {
+     OSSIM_POLY_EXTERIOR_RING  = 0,
+     OSSIM_POLY_INTERIOR_RING = 1
+   };
+
    ossimGeoAnnotationPolyObject(bool enableFill = false,
                                 ossim_uint8 r=255,
                                 ossim_uint8 g=255,
@@ -76,12 +82,19 @@ public:
     */
    virtual bool loadState(const ossimKeywordlist& kwl,
                           const char* prefix=0);
+
+   virtual std::vector<ossimGpt> getPoints() { return thePolygon; }
+
+   virtual ossimPolyType getPolyType () { return m_PolyType; }
+
+   virtual void setPolyType(ossimPolyType polyType) { m_PolyType = polyType; }
    
 protected:
    virtual ~ossimGeoAnnotationPolyObject();
 
    std::vector<ossimGpt>      thePolygon;
    ossimRefPtr<ossimAnnotationPolyObject> theProjectedPolyObject;
+   ossimPolyType              m_PolyType;
 
 TYPE_DATA
 };
diff --git a/include/ossim/imaging/ossimGeoPolyCutter.h b/include/ossim/imaging/ossimGeoPolyCutter.h
index 3a4e41a..ce4012b 100644
--- a/include/ossim/imaging/ossimGeoPolyCutter.h
+++ b/include/ossim/imaging/ossimGeoPolyCutter.h
@@ -5,7 +5,7 @@
 // Author: Garrett Potts (gpotts at imagelinks)
 //
 //*************************************************************************
-// $Id: ossimGeoPolyCutter.h 18423 2010-11-16 16:05:12Z gpotts $
+// $Id: ossimGeoPolyCutter.h 19907 2011-08-05 19:55:46Z dburken $
 #ifndef ossimGeoPolyCutter_HEADER
 #define ossimGeoPolyCutter_HEADER
 #include <ossim/imaging/ossimPolyCutter.h>
@@ -90,6 +90,7 @@ class OSSIM_DLL ossimGeoPolyCutter : public ossimPolyCutter,
 {
 public:
    ossimGeoPolyCutter();
+
    virtual bool saveState(ossimKeywordlist& kwl,
                           const char* prefix=0)const;
    
diff --git a/include/ossim/imaging/ossimHistogramRemapper.h b/include/ossim/imaging/ossimHistogramRemapper.h
index e4498e2..bcedbee 100644
--- a/include/ossim/imaging/ossimHistogramRemapper.h
+++ b/include/ossim/imaging/ossimHistogramRemapper.h
@@ -28,7 +28,7 @@
 //   but is provided for convenience.
 //   
 //*************************************************************************
-// $Id: ossimHistogramRemapper.h 18921 2011-02-18 20:06:40Z gpotts $
+// $Id: ossimHistogramRemapper.h 21787 2012-09-30 21:27:09Z gpotts $
 #ifndef ossimHistogramRemapper_HEADER
 #define ossimHistogramRemapper_HEADER
 
@@ -60,7 +60,6 @@ public:
                                                ossim_uint32 resLevel=0);
 
    virtual void initialize();
-
    /**
     * - Disables this source.
     * - Sets all clip points to default.
@@ -408,6 +407,10 @@ public:
     */
    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
@@ -510,6 +513,8 @@ private:
     */
    void setNullCount();
 
+   void initializeMinMaxOutput();
+   
    /**
     * Initialized base class (ossimTableRemapper) values:
     * - theTableBinCount
@@ -538,6 +543,11 @@ private:
     */
    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();
 
    StretchMode                   theStretchMode;
    bool                          theDirtyFlag;
@@ -553,7 +563,8 @@ private:
 
    // Internally bypassed flag.
    bool theBypassFlag;
-   
+   bool theResetBandIndicesFlag;
+
    TYPE_DATA
 };
 
diff --git a/include/ossim/imaging/ossimHsiRemapper.h b/include/ossim/imaging/ossimHsiRemapper.h
index cc73a94..172fcfd 100644
--- a/include/ossim/imaging/ossimHsiRemapper.h
+++ b/include/ossim/imaging/ossimHsiRemapper.h
@@ -12,7 +12,7 @@
 // Remapper to adjust hue, saturation and intensity.
 //
 //*************************************************************************
-// $Id: ossimHsiRemapper.h 15766 2009-10-20 12:37:09Z gpotts $
+// $Id: ossimHsiRemapper.h 19689 2011-05-31 15:55:21Z gpotts $
 
 #ifndef ossimHsiRemapper_HEADER
 #define ossimHsiRemapper_HEADER
@@ -39,7 +39,12 @@ public:
    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);
 
@@ -190,6 +195,7 @@ protected:
    void   verifyEnabled();
    double calculateMinNormValue();
 
+   bool theValidFlag;
    ossimRefPtr<ossimImageData> theTile;
    double*                     theBuffer;
    double                      theNormalizedMinPix;
diff --git a/include/ossim/imaging/ossimImageCacheBase.h b/include/ossim/imaging/ossimImageCacheBase.h
new file mode 100644
index 0000000..411d9a9
--- /dev/null
+++ b/include/ossim/imaging/ossimImageCacheBase.h
@@ -0,0 +1,337 @@
+//-----------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Mingjie Su
+//
+// Description: This class give the capability to access tiles from the
+//              input frames.
+//
+//-----------------------------------------------------------------------
+//$Id: ossimImageCacheBase.h 2685 2011-06-07 16:24:41Z david.burken $
+#ifndef ossimImageCacheBase_HEADER
+#define ossimImageCacheBase_HEADER 1
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/support_data/ossimRpfFrameEntry.h>
+
+class ossimRpfToc;
+class ossimRpfTocEntry;
+class ossimRpfFrame;
+
+class OSSIMDLLEXPORT ossimImageCacheBase : public ossimImageHandler
+{
+public:
+
+   /**
+    * Default constructor.
+    *
+    * Initializes all internal attributes to a default state.
+    */
+   ossimImageCacheBase();
+
+   /**
+    * Closes this image handler and deletes any allocated data.
+    */
+   virtual void close();
+   
+   /**
+    */
+   virtual bool open() = 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 ;
+   
+
+  /**
+    * @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);
+   
+
+   /**
+    * 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 void getEntryList(std::vector<ossim_uint32>& entryList)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;
+
+   /**
+    *  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();
+
+protected:
+   /**
+    * Destructor.
+    *
+    * Will return allocated memory back to the heap.
+    */
+   virtual ~ossimImageCacheBase();
+   
+   /**
+    * Will shift the rect and clamp it so not to go outside the -180 to 180
+    * degree range.
+    */
+   void setActualImageRect();
+
+   /**
+    * @brief Method to test for 180.0 <--> 180.00 and set leftLon to -180 if
+    * both left and right are 180.0 degrees.
+    * 
+    * @param leftLon Left hand side longitude of scene.  This is the value
+    * that will be flipped to -180 if test is true.
+    *
+    * @param rightLon Right hand side of scene.
+    */
+   void checkLongitude(ossim_float64& leftLon,  const ossim_float64& rightLon) const;
+   
+   /**
+    * 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;
+   };
+
+
+   /**
+    * 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);
+
+   void deleteAll();
+
+   bool buildFrameEntryArray(ossimFilename imageFile, ossim_uint32 frameWidth, ossim_uint32 frameHeight);
+   virtual void establishDecimationFactors();
+   
+   /**
+    * This holds the image bounds for the current entry.
+    */
+   ossimIrect                  m_actualImageRect;
+   
+   /**
+    * 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                m_numberOfLines;
+
+   /**
+    * 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                m_numberOfSamples;
+
+    /**
+    * This is the actual data returned from a getTile request.
+    */
+   ossim_uint32                m_numberOfBands;
+
+    /**
+    * The size of the input frames.
+    */
+   std::vector<ossimString> m_fileNames;
+  
+   /**
+    * The size of the output tile.
+    */
+   ossimIpt                     m_tileSize;
+   
+   mutable ossimRpfFrame*       m_workFrame;
+
+   // data to use in property retrieval
+
+   ossim_float64 m_bBox_LL_Lon;
+   ossim_float64 m_bBox_LL_Lat;
+   ossim_float64 m_bBox_UR_Lon;
+   ossim_float64 m_bBox_UR_Lat;
+   ossim_uint32  m_numOfFramesVertical;
+   ossim_uint32  m_numOfFramesHorizontal;
+   ossim_uint32  m_frame_width;
+   ossim_uint32  m_frame_height;
+
+   std::vector< std::vector<ossimRpfFrameEntry> > m_frameEntryArray;
+	
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimImageCacheBase_HEADER */
diff --git a/include/ossim/imaging/ossimImageCacheTileSource.h b/include/ossim/imaging/ossimImageCacheTileSource.h
new file mode 100644
index 0000000..9738e3c
--- /dev/null
+++ b/include/ossim/imaging/ossimImageCacheTileSource.h
@@ -0,0 +1,153 @@
+//-----------------------------------------------------------------------
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Mingjie Su
+//
+// Description: This class give the capability to access tiles from the
+//              input frames.
+//
+//-----------------------------------------------------------------------
+//$Id: ossimImageCacheTileSource.h 2644 2011-05-26 15:20:11Z oscar.kramer $
+#ifndef ossimImageCacheTileSource_HEADER
+#define ossimImageCacheTileSource_HEADER 1
+
+#include <ossim/imaging/ossimImageCacheBase.h>
+
+class OSSIMDLLEXPORT ossimImageCacheTileSource : public ossimImageCacheBase
+{
+public:
+
+   /**
+    * Default constructor.
+    *
+    * Initializes all internal attributes to a default state.
+    */
+   ossimImageCacheTileSource();
+
+   /**
+    * 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();
+
+   /**
+    *  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);
+
+   /**
+    * 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;
+
+    /**
+    * 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;
+
+protected:
+   /**
+    * Destructor.
+    *
+    * Will return allocated memory back to the heap.
+    */
+   virtual ~ossimImageCacheTileSource();
+   
+   /**
+    *
+    * @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);
+
+   bool buildFrameEntryArray(ossimFilename imageFile);
+ 
+   /**
+    * This is the actual data returned from a getTile request.
+    */
+   ossimRefPtr<ossimImageData>  m_tile;
+
+   ossimRefPtr<ossimImageHandler>  m_imageHandler;
+   double                          m_minPixelValue;
+   double                          m_maxPixelValue;
+   double                          m_nullPixelValue;
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimImageCacheTileSource_HEADER */
diff --git a/include/ossim/imaging/ossimImageChain.h b/include/ossim/imaging/ossimImageChain.h
index 277a5d6..e5ee2b9 100644
--- a/include/ossim/imaging/ossimImageChain.h
+++ b/include/ossim/imaging/ossimImageChain.h
@@ -8,7 +8,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimImageChain.h 19484 2011-05-03 16:28:27Z gpotts $
+// $Id: ossimImageChain.h 20316 2011-12-02 15:56:38Z oscarkramer $
 #ifndef ossimImageChain_HEADER
 #define ossimImageChain_HEADER
 #include <vector>
@@ -20,8 +20,6 @@ using namespace std;
 #include <ossim/base/ossimId.h>
 #include <ossim/base/ossimConnectableContainerInterface.h>
 
-class ossimImageChainChildListener;
-
 class OSSIMDLLEXPORT ossimImageChain : public ossimImageSource,
                                        public ossimConnectableObjectListener,
                                        public ossimConnectableContainerInterface
@@ -30,6 +28,9 @@ public:
    ossimImageChain();
    virtual ~ossimImageChain();
 
+   ossimConnectableObject::ConnectableObjectList& getChainList(){return theImageChainList;}
+   const ossimConnectableObject::ConnectableObjectList& getChainList()const{return theImageChainList;}
+   
    /**
     * @param index Index of object to get.
     *
@@ -60,6 +61,8 @@ public:
     * getTile request
     */
    virtual ossimImageSource* getFirstSource();
+   virtual const ossimImageSource* getFirstSource() const;
+   
    virtual ossimObject* getFirstObject();
 
    /**
@@ -67,6 +70,8 @@ public:
     * getTile request.
     */
    virtual ossimImageSource* getLastSource();
+   virtual const ossimImageSource* getLastSource() const;
+   
    virtual ossimObject* getLastObject();
 
 
@@ -84,7 +89,7 @@ public:
     * Returns true on success, false on error.
     */
    bool addLast(ossimConnectableObject* obj);
-
+   
    /**
     * Deletes the first object.
     * Note this is really most right of the chain.
@@ -238,38 +243,66 @@ public:
    // ________________________CONNECTABLE CONTAINER DEFINTIONS_________________
    //
    
-   /**
-    * Will find all objects of the past in type.  Use the RTTI type info.  An optional
-    * recurse flag will say if there is another container then recurse it to
-    * find the type you are looking for else it just looks within its immediate
-    * children
-    * 
-    * Example: passing STATIC_TYPE_INFO(ossimImageRenderer) as an argument will
-    *          look for all ossimImageRenderer's and return the list.
+   /*!
+    * 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));
 
-   /**
-    * Will find the firt object of the past in type.  Use the RTTI type info.An optional
-    * recurse flag will say if there is another container then recurse it to
-    * find the type you are looking for else it just looks within its immediate
-    * children
-    * 
-    * Example: passing STATIC_TYPE_INFO(ossimImageRenderer) as an argument will
-    *          look for the first ossimImageRenderer and return that object.
+   /*!
+    * 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));
 
-   /**
-    * will search for the object given an id.  If recurse is true it will
-    * recurse to other containers.
-    */ 
+   /*!
+    * 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));
 
@@ -327,11 +360,32 @@ public:
    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:
-   friend class ossimImageChainChildListener;
+   void prepareForRemoval(ossimConnectableObject* connectableObject);
+   
   /**
     * This will hold a sequence of image sources.
     * theFirst one in the list will be the head of the
@@ -340,7 +394,6 @@ protected:
    ossimConnectableObject::ConnectableObjectList theImageChainList;
    
    ossimRefPtr<ossimImageData>     theBlankTile;
-   ossimImageChainChildListener*   theChildListener;
   // mutable bool                    thePropagateEventFlag;
    mutable bool                    theLoadStateFlag;
    /**
@@ -357,7 +410,6 @@ protected:
                                const char* prefix=NULL);
    bool connectAllSources(const map<ossimId, vector<ossimId> >& idMapping);
    
-   void deleteList();
    
 TYPE_DATA
 };
diff --git a/include/ossim/imaging/ossimImageData.h b/include/ossim/imaging/ossimImageData.h
index a12f68d..db9dfe3 100644
--- a/include/ossim/imaging/ossimImageData.h
+++ b/include/ossim/imaging/ossimImageData.h
@@ -9,9 +9,9 @@
 // Description: Container class for a tile of image data.
 //
 //*******************************************************************
-// $Id: ossimImageData.h 18078 2010-09-14 14:43:09Z dburken $
+// $Id: ossimImageData.h 22366 2013-08-09 12:13:24Z gpotts $
 #ifndef ossimImageData_HEADER
-#define ossimImageData_HEADER
+#define ossimImageData_HEADER 1
 
 #include <vector>
 #include <iosfwd> /* for ostream */
@@ -84,6 +84,8 @@ public:
 
    /** @brief copy constructor */
    ossimImageData(const ossimImageData &rhs);
+   
+   ossimImageData();
 
    /**
     * @brief Constructor
@@ -193,7 +195,25 @@ public:
     * OSSIM_EMPTY no action is performed.
     */
    virtual void computeMinMaxPix(std::vector<ossim_float64>& minBands,
-                                 std::vector<ossim_float64>& maxBands);
+                                 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;
@@ -530,9 +550,10 @@ public:
    /**
     * @brief Writes tile to stream.
     *
-    * This will write the buffer to the stream 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.
+    * 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.
     *
@@ -783,6 +804,16 @@ public:
                            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,
@@ -836,11 +867,23 @@ public:
                          ossim_int32 lineStartSample,
                          ossim_int32 lineStopSample,
                          ossimInterleaveType lineInterleave);
-   
-protected:
 
-   ossimImageData();
+   /**
+    * @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;
+   
+   
+   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,
@@ -981,9 +1024,16 @@ protected:
                                    ossim_float32* buf);
 
    
-   template <class T> void computeMinMaxPix(T dummyValue,
-                                            std::vector<ossim_float64>& minBands,
-                                            std::vector<ossim_float64>& maxBands);
+   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,
@@ -1034,6 +1084,11 @@ protected:
                                                    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,
@@ -1099,27 +1154,22 @@ protected:
       return result;
    }
    
-   /**
-    * Have a null pixel value per band.
-    */
+   /**  Null pixel value for each band. */
    std::vector<ossim_float64> m_nullPixelValue;
 
-   /**
-    * Have a min pixel value per band.
-    */
+   /** Min pixel value for each band. */
    std::vector<ossim_float64> m_minPixelValue;
 
-   /**
-    * Have a max pixel value per band.
-    */
+   /** Max pixel value for each band. */
    std::vector<ossim_float64> m_maxPixelValue;
 
-   /**
-    * Alpha channel:
-    */
+   /** Alpha channel */
    std::vector<ossim_uint8> m_alpha;
    
-   ossimIpt       m_origin;
+   ossimIpt m_origin;
+
+   /** Indicates data contains palette indexes. */
+   bool m_indexedFlag;
 
 private:
 
diff --git a/include/ossim/imaging/ossimImageFileWriter.h b/include/ossim/imaging/ossimImageFileWriter.h
index 136e3fb..7163d1a 100644
--- a/include/ossim/imaging/ossimImageFileWriter.h
+++ b/include/ossim/imaging/ossimImageFileWriter.h
@@ -8,7 +8,7 @@
 //
 // Contains class declaration for ossimImageWriter
 //*******************************************************************
-//  $Id: ossimImageFileWriter.h 19180 2011-03-22 17:36:33Z oscarkramer $
+//  $Id: ossimImageFileWriter.h 21963 2012-12-04 16:28:12Z dburken $
 
 #ifndef ossimImageFileWriter_HEADER
 #define ossimImageFileWriter_HEADER
@@ -214,10 +214,24 @@ public:
 
    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();
 
    /**
@@ -461,8 +475,8 @@ protected:
    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:
diff --git a/include/ossim/imaging/ossimImageGeometry.h b/include/ossim/imaging/ossimImageGeometry.h
index 7c8c9a4..a50e01d 100644
--- a/include/ossim/imaging/ossimImageGeometry.h
+++ b/include/ossim/imaging/ossimImageGeometry.h
@@ -1,4 +1,4 @@
-//**************************************************************************************************
+//***********************************************************************************************
 //
 // License:  LGPL
 // 
@@ -8,23 +8,31 @@
 //
 // Description: Class declaration of ossimImageGeometry.
 //
-//**************************************************************************************************
-// $Id$
+//***********************************************************************************************
+// $Id: ossimImageGeometry.h 3102 2012-01-18 15:30:20Z oscar.kramer $
 
 #ifndef ossimImageGeometry_HEADER
 #define ossimImageGeometry_HEADER 1
 
-#include <vector>
 #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/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;
+
+//***********************************************************************************************
 //! 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()
@@ -51,10 +59,12 @@
 //
 //! 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();
@@ -122,6 +132,11 @@ public:
    //! 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.
@@ -141,6 +156,20 @@ public:
    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(); }
    
@@ -153,12 +182,86 @@ public:
    //! 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.
-   const ossimDpt& getMetersPerPixel() const;
+   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;
 
@@ -212,6 +315,18 @@ public:
    {
       return m_imageSize;
    }
+
+   /**
+    * @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.
+   
    //! 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); }
@@ -244,9 +359,59 @@ public:
     */
    ossim_uint32 getTargetRrds() const;
 
-   //! When either the projection or the transform changes, this method recomputes the GSD.
-   void computeGsd()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.
@@ -266,7 +431,6 @@ protected:
 
    ossimRefPtr<ossim2dTo2dTransform> m_transform;   //!< Maintains local_image-to-full_image transformation 
    ossimRefPtr<ossimProjection>      m_projection;  //!< Maintains full_image-to-world_space transformation
-   mutable ossimDpt                  m_gsd;         //!< meters per pixel
    std::vector<ossimDpt>             m_decimationFactors; //!< List of decimation factors for R-levels
    ossimIpt                          m_imageSize; // Image width and height
 
diff --git a/include/ossim/imaging/ossimImageGeometryRegistry.h b/include/ossim/imaging/ossimImageGeometryRegistry.h
index 51bc961..5ae90ca 100644
--- a/include/ossim/imaging/ossimImageGeometryRegistry.h
+++ b/include/ossim/imaging/ossimImageGeometryRegistry.h
@@ -14,7 +14,7 @@
 #include <ossim/imaging/ossimImageGeometryFactoryBase.h>
 #include <ossim/imaging/ossimImageGeometry.h>
 #include <ossim/base/ossimFactoryListInterface.h>
-class OSSIM_DLL ossimImageGeometryRegistry : public ossimBaseObjectFactory,
+class OSSIM_DLL ossimImageGeometryRegistry : public ossimImageGeometryFactoryBase,
                                              public ossimFactoryListInterface<ossimImageGeometryFactoryBase,
                                                                               ossimImageGeometry>
 {
@@ -22,6 +22,13 @@ 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.
     */
@@ -38,7 +45,7 @@ public:
    {
       return createObjectFromRegistry(kwl, prefix);
    }
-   
+#endif
    virtual bool extendGeometry(ossimImageHandler* handler)const;
    
    /*!
@@ -53,11 +60,11 @@ public:
    
 protected:
    ossimImageGeometryRegistry()
-   :ossimBaseObjectFactory()
+   :ossimImageGeometryFactoryBase()
    {}
    
    ossimImageGeometryRegistry( const ossimImageGeometryRegistry& rhs )
-   :ossimBaseObjectFactory(rhs)
+   :ossimImageGeometryFactoryBase(rhs)
    {}
    void operator =(const ossimImageGeometryRegistry&){}
    static ossimImageGeometryRegistry* m_instance;
diff --git a/include/ossim/imaging/ossimImageHandler.h b/include/ossim/imaging/ossimImageHandler.h
index aee1d3e..929c8b6 100644
--- a/include/ossim/imaging/ossimImageHandler.h
+++ b/include/ossim/imaging/ossimImageHandler.h
@@ -12,18 +12,18 @@
 // derive from.
 //
 //********************************************************************
-// $Id: ossimImageHandler.h 19194 2011-03-23 14:23:34Z dburken $
+// $Id: ossimImageHandler.h 22187 2013-03-07 20:29:00Z dburken $
 #ifndef ossimImageHandler_HEADER
-#define ossimImageHandler_HEADER
+#define ossimImageHandler_HEADER 1
 
 #include <ossim/imaging/ossimImageSource.h>
-#include <ossim/imaging/ossimImageMetaData.h>
 #include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimNBandLutDataObject.h>
-#include <ossim/base/ossimIrect.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)
@@ -42,18 +42,15 @@ public:
       OSSIM_OVERVIEW_COMPRESSION_PACKBITS
    };
 
-   /**
-    * Constructor (default):
-    */
+   /** Constructor (default): */
    ossimImageHandler();
+   
    /**
     * Destructor:
     * Derived classes should implement.
     */
    virtual ~ossimImageHandler();
    
-
-   //virtual ossimObject* dup()const;
    /**
     * initialize
     * Does nothing in this class.  Implemented to satisfy pure virtual.
@@ -115,8 +112,6 @@ public:
     */
    virtual ossimFilename createDefaultMetadataFilename() const;
 
-   
-
    /**
     *  @return ossimFilename represents an external OSSIM histogram filename.
     */
@@ -127,7 +122,6 @@ public:
     */
    virtual ossimFilename createDefaultValidVerticesFilename() const;
    
-
    /**
     *  Outputs vertices to file and updates the internal vertex
     *  array variable "theValidImageVertices".
@@ -155,7 +149,6 @@ public:
     */
    virtual bool openValidVertices();
 
-
    /**
     *  Pure virtual open.  Derived classes must implement.
     *  
@@ -301,15 +294,23 @@ public:
    virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const = 0;
    
    /**
-    * 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.
+    * @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; 
 
    /**
-    * Returns the absolute bounding rectangle of the image. The upper left
-    * corner may be non-zero if this is a subimage.
+    * @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;
 
@@ -408,18 +409,42 @@ public:
                                       ossim_uint32 resLevel=0)const;
 
    /**
-    * Indicates whether or not the image handler can control output
+    * @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;
 
    /**
-    * If the image handler "isBandSeletor()" then the band selection
+    * @brief If the image handler "isBandSeletor()" then the band selection
     * of the output chip can be controlled.
-    * Returns true on success, false on error.
+    *
+    * 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() &&
@@ -448,6 +473,8 @@ public:
    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
@@ -514,6 +541,23 @@ public:
     * @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.
@@ -532,6 +576,19 @@ public:
     */
    virtual void getEntryStringList(
       std::vector<ossimString>& entryStringList) 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;
 
@@ -579,6 +636,18 @@ public:
    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
@@ -597,6 +666,10 @@ public:
   //! 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; }
+
 protected:
    
    /**
@@ -646,21 +719,35 @@ protected:
    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.
-   */
+    * @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.
-   */
+    * @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;
@@ -677,6 +764,13 @@ protected:
     * 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
 };
diff --git a/include/ossim/imaging/ossimImageHandlerFactory.h b/include/ossim/imaging/ossimImageHandlerFactory.h
index 5ba48bf..7f342c7 100644
--- a/include/ossim/imaging/ossimImageHandlerFactory.h
+++ b/include/ossim/imaging/ossimImageHandlerFactory.h
@@ -8,12 +8,12 @@
 //
 // Contains class declaration for ossimImageHandlerFactoryMaker.
 //*******************************************************************
-//  $Id: ossimImageHandlerFactory.h 18002 2010-08-30 18:01:10Z gpotts $
+// $Id: ossimImageHandlerFactory.h 22228 2013-04-12 14:11:45Z dburken $
 
 #ifndef ossimImageHandlerFactory_HEADER
-#define ossimImageHandlerFactory_HEADER
-#include <ossim/imaging/ossimImageHandlerFactoryBase.h>
+#define ossimImageHandlerFactory_HEADER 1
 
+#include <ossim/imaging/ossimImageHandlerFactoryBase.h>
 #include <ossim/base/ossimString.h>
 
 class ossimImageHandler;
@@ -28,11 +28,26 @@ class OSSIMDLLEXPORT ossimImageHandlerFactory : public ossimImageHandlerFactoryB
 public:
    virtual ~ossimImageHandlerFactory();
    static ossimImageHandlerFactory* instance();
-   
-   virtual ossimImageHandler* open(const ossimFilename& fileName)const;
+
+   /**
+    * @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;
    
    /*!
diff --git a/include/ossim/imaging/ossimImageHandlerFactoryBase.h b/include/ossim/imaging/ossimImageHandlerFactoryBase.h
index cc772f4..af19abf 100644
--- a/include/ossim/imaging/ossimImageHandlerFactoryBase.h
+++ b/include/ossim/imaging/ossimImageHandlerFactoryBase.h
@@ -2,13 +2,13 @@
 //
 // License:  See top level LICENSE.txt file.
 // 
-// Author:  Garrett Potts (gpotts at imagelinks.com)
+// Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimImageHandlerFactoryBase.h 18011 2010-08-31 12:48:56Z dburken $
+//  $Id: ossimImageHandlerFactoryBase.h 22228 2013-04-12 14:11:45Z dburken $
 
 #ifndef ossimImageHandlerFactoryBase_HEADER
-#define ossimImageHandlerFactoryBase_HEADER
+#define ossimImageHandlerFactoryBase_HEADER 1
 
 #include <algorithm>
 
@@ -23,8 +23,7 @@ class ossimKeywordlist;
 class OSSIM_DLL ossimImageHandlerFactoryBase : public ossimObjectFactory
 {
 public:
-   template <class T>
-      class UniqueList
+   template <class T> class UniqueList
    {
    public:
       
@@ -59,10 +58,24 @@ public:
    typedef UniqueList<ossimString> UniqueStringList;
    typedef std::vector<ossimRefPtr<ossimImageHandler> > ImageHandlerList;
    
-   virtual ossimImageHandler* open(const ossimFilename& fileName)const = 0;
+   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 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;
 
diff --git a/include/ossim/imaging/ossimImageHandlerRegistry.h b/include/ossim/imaging/ossimImageHandlerRegistry.h
index 981dbba..5f7b0dd 100644
--- a/include/ossim/imaging/ossimImageHandlerRegistry.h
+++ b/include/ossim/imaging/ossimImageHandlerRegistry.h
@@ -2,22 +2,23 @@
 //
 // License:  See top level LICENSE.txt file.
 // 
-// Author:  Garrett Potts (gpott at imagelinks.com)
+// Author:  Garrett Potts
 //
 // Description:  Contains class definition for the class
 //               ImageHandlerRegistry.
 //
 //*******************************************************************
-//  $Id: ossimImageHandlerRegistry.h 18964 2011-02-25 18:59:50Z gpotts $
+//  $Id: ossimImageHandlerRegistry.h 22228 2013-04-12 14:11:45Z dburken $
 
 #ifndef ossimImageHandlerRegistry_HEADER
-#define ossimImageHandlerRegistry_HEADER
+#define ossimImageHandlerRegistry_HEADER 1
 
-#include <vector>
 #include <ossim/base/ossimObjectFactory.h>
 #include <ossim/base/ossimRtti.h>
 #include <ossim/imaging/ossimImageHandlerFactoryBase.h>
 #include <ossim/base/ossimFactoryListInterface.h>
+#include <vector>
+
 class ossimImageHandler;
 class ossimFilename;
 class ossimKeywordlist;
@@ -30,23 +31,43 @@ public:
    
    static ossimImageHandlerRegistry* instance();
    
-   
-   ossimImageHandler* open(const ossimFilename& fileName, bool trySuffixFirst=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.
     */
-   ossimImageHandler* open(const ossimKeywordlist& kwl, const char* prefix=0)const;
+   virtual ossimImageHandler* open(const ossimKeywordlist& kwl,
+                                   const char* prefix=0)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
-   {
-      return createObjectFromRegistry(typeName);
-   }
+   virtual ossimObject* createObject(const ossimString& typeName) const;
    
    /*!
     * Creates and object given a keyword list.
@@ -55,13 +76,15 @@ public:
                                      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.
-    *
-    * 
+    * 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)const; 
+   virtual ossimRefPtr<ossimImageHandler> openBySuffix(const ossimFilename& file,
+                                                       bool openOverview=true)const; 
    
    /**
     *
@@ -83,26 +106,32 @@ public:
     * 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);
-   }
+   virtual void getTypeNameList( std::vector<ossimString>& typeList ) const;
+
+   virtual void getSupportedExtensions(
+      ossimImageHandlerFactoryBase::UniqueStringList& extensionList)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();
+   OSSIM_DLL  void* ossimImageHandlerRegistryGetInstance();
 }
-#endif
+
+#endif /* #ifndef ossimImageHandlerRegistry_HEADER */
diff --git a/include/ossim/imaging/ossimImageMetaData.h b/include/ossim/imaging/ossimImageMetaData.h
index ba57ba5..81e431d 100644
--- a/include/ossim/imaging/ossimImageMetaData.h
+++ b/include/ossim/imaging/ossimImageMetaData.h
@@ -12,13 +12,15 @@
 // Contains class declaration for ossimImageMetaData.
 // 
 //*******************************************************************
-//  $Id: ossimImageMetaData.h 9094 2006-06-13 19:12:40Z dburken $
+//  $Id: ossimImageMetaData.h 21527 2012-08-26 16:50:49Z dburken $
 #ifndef ossimImageMetaData_HEADER
-#define ossimImageMetaData_HEADER
+#define ossimImageMetaData_HEADER 1
+
 #include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimFilename.h>
+#include <iosfwd>
+#include <string>
+
+class ossimKeywordlist;
 
 class OSSIM_DLL ossimImageMetaData
 {
@@ -27,11 +29,13 @@ public:
    ossimImageMetaData(ossimScalarType aType,
                       ossim_uint32 numberOfBands);
    ossimImageMetaData(const ossimImageMetaData& rhs);
+
+   const ossimImageMetaData& operator=(const ossimImageMetaData& rhs);
    
-   virtual ~ossimImageMetaData();
+   ~ossimImageMetaData();
    
    void clear();
-   void clearBandInfo();
+
    void setDefaultsForArrays();
    
    void setNumberOfBands(ossim_uint32 numberOfBands);
@@ -41,6 +45,9 @@ public:
    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;
    
@@ -59,7 +66,7 @@ public:
    const double* getMaxPixelArray()const;
    
    const double* getNullPixelArray()const;
-   
+
    void setMinValuesValid(bool flag);
    
    void setMaxValuesValid(bool flag);
@@ -71,32 +78,61 @@ public:
    bool getMaxValuesValidFlag()const;
 
    bool getNullValuesValidFlag()const;
-   
-   const ossimImageMetaData& operator=(const ossimImageMetaData& rhs);
 
    bool isValid()const;
-
-   void assign(const ossimImageMetaData& rhs);
    
    bool loadState(const ossimKeywordlist& kwl,
                   const char* prefix=0);
    bool saveState(ossimKeywordlist& kwl,
                   const char* prefix=0)const;
 
-protected:
-  double*         theNullPixelArray;
-  double*         theMinPixelArray;
-  double*         theMaxPixelArray;
-  
-  bool            theMinValuesValidFlag;
-  bool            theMaxValuesValidFlag;
-  bool            theNullValuesValidFlag;
-  
-  ossimScalarType theScalarType;
-  ossim_uint32    theNumberOfBands;
-  
+   /**
+    * @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;
   
-  void loadBandInfo(const ossimKeywordlist& kwl, const char* prefix = 0);
+   bool            theMinValuesValidFlag;
+   bool            theMaxValuesValidFlag;
+   bool            theNullValuesValidFlag;
+   
+   ossimScalarType theScalarType;
+   ossim_uint32    theBytesPerPixel;
+   ossim_uint32    theNumberOfBands;
 };
 
-#endif
+#endif /* #ifndef ossimImageMetaData_HEADER */
diff --git a/include/ossim/imaging/ossimImageRenderer.h b/include/ossim/imaging/ossimImageRenderer.h
index 64a0a87..c484d3c 100644
--- a/include/ossim/imaging/ossimImageRenderer.h
+++ b/include/ossim/imaging/ossimImageRenderer.h
@@ -8,7 +8,7 @@
 // Author: Garrett Potts
 //
 //*******************************************************************
-// $Id: ossimImageRenderer.h 17932 2010-08-19 20:34:35Z dburken $
+// $Id: ossimImageRenderer.h 20236 2011-11-09 15:36:38Z dburken $
 
 #ifndef ossimImageRenderer_HEADER
 #define ossimImageRenderer_HEADER
@@ -33,8 +33,6 @@ public:
    virtual ossimString getLongName()  const;
    virtual ossimString getShortName() const;
 
-   virtual void enableSource();
-   
    /**
     * 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
@@ -55,6 +53,17 @@ public:
    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.
     */
@@ -106,10 +115,39 @@ public:
    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();
 
@@ -209,7 +247,11 @@ private:
    //! this is called on a property event and on input connection changes.
    void checkIVT();
 
-   void computeRects();
+   /**
+    * @brief Initializes m_inputR0Rect and m_viewBoundingRect and sets
+    * m_rectsDirty appropriately.
+    */
+   void initializeBoundingRects();
 
    ossimRefPtr<ossimImageData> getTileAtResLevel(const ossimIrect& boundingRect,
                                      ossim_uint32 resLevel);
@@ -237,8 +279,6 @@ private:
     */
    void deallocate();
 
-   virtual void fireProgressEvent(double percentComplete);
-   
    ossimFilterResampler*       m_Resampler;
    ossimRefPtr<ossimImageData> m_BlankTile;
    ossimRefPtr<ossimImageData> m_Tile;
@@ -255,11 +295,13 @@ private:
     */
    ossim_uint32             m_StartingResLevel;
    ossimRefPtr<ossimImageViewTransform> m_ImageViewTransform;
-   mutable ossimIrect       m_BoundingRect;
-   mutable ossimIrect       m_BoundingViewRect;
+
+   ossimIrect               m_inputR0Rect;
+   ossimIrect               m_viewRect;
+   bool                     m_rectsDirty;
+
    ossim_uint32             m_MaxRecursionLevel;
    bool                     m_AutoUpdateInputTransform;
-   vector<ossimDpt>         m_InputDecimationFactors;
    ossim_uint32             m_MaxLevelsToCompute;
    
 TYPE_DATA
diff --git a/include/ossim/imaging/ossimImageSource.h b/include/ossim/imaging/ossimImageSource.h
index 24a71ee..e45bb6b 100644
--- a/include/ossim/imaging/ossimImageSource.h
+++ b/include/ossim/imaging/ossimImageSource.h
@@ -7,9 +7,9 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimImageSource.h 17932 2010-08-19 20:34:35Z dburken $
+// $Id: ossimImageSource.h 21637 2012-09-06 21:17:57Z dburken $
 #ifndef ossimImageSource_HEADER
-#define ossimImageSource_HEADER
+#define ossimImageSource_HEADER 1
 
 #include <ossim/base/ossimConstants.h>
 #include <ossim/base/ossimSource.h>
@@ -105,9 +105,14 @@ public:
    virtual ossim_uint32 getNumberOfOutputBands() const;
 
    /**
-    * Initializes bandList to the zero based order of output bands.
+    * @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;
+   virtual void getOutputBandList( std::vector<ossim_uint32>& bandList ) const;
 
    /**
     * This will be used to query the output pixel type of the tile source.
@@ -126,12 +131,11 @@ public:
    virtual ossim_uint32 getTileHeight() const;
 
    /**
-         * Each band has a null pixel associated with it.  The null pixel 
+    * 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.
     */
@@ -155,6 +159,18 @@ public:
    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.
     */
@@ -177,38 +193,48 @@ public:
     *
     * 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;
+   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.
+   /**
+    * 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.
+    * 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.
-    */
+   /** 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&);
 
diff --git a/include/ossim/imaging/ossimImageSourceSequencer.h b/include/ossim/imaging/ossimImageSourceSequencer.h
index ab0e8ec..0a1b3fd 100644
--- a/include/ossim/imaging/ossimImageSourceSequencer.h
+++ b/include/ossim/imaging/ossimImageSourceSequencer.h
@@ -8,7 +8,7 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimImageSourceSequencer.h 19002 2011-03-02 21:02:16Z oscarkramer $
+//  $Id: ossimImageSourceSequencer.h 20302 2011-11-29 14:21:12Z dburken $
 #ifndef ossimImageSourceSequencer_HEADER
 #define ossimImageSourceSequencer_HEADER
 #include <ossim/imaging/ossimImageSource.h>
@@ -25,6 +25,7 @@ public:
    ossimImageSourceSequencer(ossimImageSource* inputSource=NULL,
                              ossimObject* owner=NULL);
 
+   virtual ~ossimImageSourceSequencer();
   /*!
     * This will return the number of tiles within the
     * area of interest.
@@ -72,7 +73,7 @@ public:
    virtual void setToStartOfSequence();
 
    virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                   ossim_uint32 resLevel=0);
+                                               ossim_uint32 resLevel=0);
 
    /*!
     * Will allow you to get the next tile in the sequence.
@@ -89,8 +90,16 @@ public:
     */
    virtual ossimRefPtr<ossimImageData> getNextTile(ossim_uint32 resLevel=0);
 
-   virtual bool getTileOrigin(ossim_int32 id,
-                              ossimIpt& origin)const;
+   virtual bool getTileOrigin(ossim_int32 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_uint32 tile_id, ossimIrect& rect) const;
+
    virtual ossimRefPtr<ossimImageData> getTile(ossim_int32 id,
                                                ossim_uint32 resLevel=0);
 
@@ -134,7 +143,6 @@ public:
    virtual double getMaxPixelValue(ossim_uint32 band=0)const;
    
 protected:
-   virtual ~ossimImageSourceSequencer();
    ossimImageSource*  theInputConnection;
    ossimRefPtr<ossimImageData> theBlankTile;
    /*!
diff --git a/include/ossim/imaging/ossimImageToPlaneNormalFilter.h b/include/ossim/imaging/ossimImageToPlaneNormalFilter.h
index ed33f31..4de7145 100644
--- a/include/ossim/imaging/ossimImageToPlaneNormalFilter.h
+++ b/include/ossim/imaging/ossimImageToPlaneNormalFilter.h
@@ -8,7 +8,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimImageToPlaneNormalFilter.h 13382 2008-08-04 18:53:26Z gpotts $
+// $Id: ossimImageToPlaneNormalFilter.h 20078 2011-09-09 12:25:50Z gpotts $
 #ifndef ossimImageToPlaneNormalFilter_HEADER
 #define ossimImageToPlaneNormalFilter_HEADER
 #include <ossim/imaging/ossimImageSourceFilter.h>
@@ -54,11 +54,13 @@ public:
 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);
 
diff --git a/include/ossim/imaging/ossimImageWriterFactoryRegistry.h b/include/ossim/imaging/ossimImageWriterFactoryRegistry.h
index ed794c7..1d4d68f 100644
--- a/include/ossim/imaging/ossimImageWriterFactoryRegistry.h
+++ b/include/ossim/imaging/ossimImageWriterFactoryRegistry.h
@@ -8,7 +8,7 @@
 // Author:  Frank Warmerdam (warmerda at home.com)
 //
 //*******************************************************************
-//  $Id: ossimImageWriterFactoryRegistry.h 18966 2011-02-25 19:39:58Z gpotts $
+//  $Id: ossimImageWriterFactoryRegistry.h 19907 2011-08-05 19:55:46Z dburken $
 
 #ifndef ossimImageWriterFactoryRegistry_HEADER
 #define ossimImageWriterFactoryRegistry_HEADER
@@ -17,14 +17,13 @@
 #include <ossim/base/ossimFactoryListInterface.h>
 #include <vector>
 #include <iosfwd>
-#include <ossim/base/ossimCommon.h>
 
 class ossimImageFileWriter;
 class ossimKeywordlist;
 
-class OSSIMDLLEXPORT ossimImageWriterFactoryRegistry : public ossimObjectFactory,
-                                    public ossimFactoryListInterface<ossimImageWriterFactoryBase, ossimImageFileWriter>
-
+class OSSIMDLLEXPORT ossimImageWriterFactoryRegistry :
+   public ossimObjectFactory,
+   public ossimFactoryListInterface<ossimImageWriterFactoryBase, ossimImageFileWriter>
 {   
 public:
    static ossimImageWriterFactoryRegistry* instance();
@@ -36,23 +35,15 @@ public:
    ossimImageFileWriter* createWriter(const ossimString& typeName)const;
    
    ossimObject* createObject(const ossimKeywordlist &kwl,
-                             const char *prefix=0)const
-   {
-      return createObjectFromRegistry(kwl, prefix);
-   }
-   ossimObject* createObject(const ossimString& typeName)const
-   {
-      return createObjectFromRegistry(typeName);
-   }
+                             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
-   {
-      getAllTypeNamesFromRegistry(typeList);
-   }
+   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
    
    /**
     * getImageTypeList.  This is the actual image type name.  So for
diff --git a/include/ossim/imaging/ossimJpegMemDest.h b/include/ossim/imaging/ossimJpegMemDest.h
new file mode 100644
index 0000000..4f54786
--- /dev/null
+++ b/include/ossim/imaging/ossimJpegMemDest.h
@@ -0,0 +1,36 @@
+//----------------------------------------------------------------------------
+// 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 ossimJpegMemSrc_HEADER
+#define ossimJpegMemSrc_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/include/ossim/imaging/ossimJpegTileSource.h b/include/ossim/imaging/ossimJpegTileSource.h
index e5e3e2f..a12fa7d 100644
--- a/include/ossim/imaging/ossimJpegTileSource.h
+++ b/include/ossim/imaging/ossimJpegTileSource.h
@@ -12,7 +12,7 @@
 // JpegTileSource is derived from ImageHandler which is derived from
 // TileSource.
 //*******************************************************************
-//  $Id: ossimJpegTileSource.h 16860 2010-03-11 15:28:09Z gpotts $
+//  $Id: ossimJpegTileSource.h 22117 2013-01-18 21:04:23Z dburken $
 
 #ifndef ossimJpegTileSource_HEADER
 #define ossimJpegTileSource_HEADER
@@ -157,7 +157,22 @@ public:
     * @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;
    /**
diff --git a/include/ossim/imaging/ossimMaskFilter.h b/include/ossim/imaging/ossimMaskFilter.h
index ce7545f..d0a90aa 100644
--- a/include/ossim/imaging/ossimMaskFilter.h
+++ b/include/ossim/imaging/ossimMaskFilter.h
@@ -10,10 +10,10 @@
   // Description: Class declaration for ossimMaskFilter.
   //
   //*************************************************************************
-    // $Id: ossimMaskFilter.h 18532 2010-12-09 16:49:58Z dburken $
+    // $Id: ossimMaskFilter.h 20409 2011-12-22 16:57:05Z dburken $
 #ifndef  ossimMaskFilter_HEADER
 #define  ossimMaskFilter_HEADER 1
-#include <ossim/imaging/ossimImageCombiner.h>
+#include <ossim/imaging/ossimImageSource.h>
 
     /**
      * <pre>
@@ -27,40 +27,64 @@
      *    to the first input.
      *
      * Keywords:
-     *      mask_type:
+     *    mask_type:
      *
-     * keywords description
-     *      mask_type  This keyword can have the following values:
-     *                 select, invert, or weighted.
-     *                  - select will use the input data and every where
-     *                    the mask is greater than 0 it will copy the input to the output.
-     *                  - 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.
+     * 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 ossimImageCombiner
+class OSSIMDLLEXPORT ossimMaskFilter : public ossimImageSource
 {
 public:
    /**
-    * Enumeration used to identify what the selection type for this mask is to be
-    *  A list of events:
-    *    - OSSIM_MASK_TYPE_SELECT
-    *      is used as a true false mask.  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
-    *      has the inverted rule of the above.  If the input is tru 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.
+    * 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
   {
@@ -73,29 +97,25 @@ public:
      /**< binary image> */
      OSSIM_MASK_TYPE_BINARY         = 4,
      /**< inverse binary image> */
-     OSSIM_MASK_TYPE_BINARY_INVERSE = 5
+     OSSIM_MASK_TYPE_BINARY_INVERSE = 5,
+     /**< Standard select if mask is true then keep with min. */
+     OSSIM_MASK_TYPE_SELECT_CLAMP_MIN = 6,
   };
 
    /**
-    * Constructor.
+    * Default Constructor.
     */
    ossimMaskFilter(ossimObject* owner=NULL);
 
    /**
-    * Constructs with two inputs
-    */
-   ossimMaskFilter(ossimImageSource* imageSource,
-                   ossimImageSource* maskSource);
-
-   
-   /**
-    * Constructs with two inputs and an owner
+    * 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.
     */
-   ossimMaskFilter(ossimObject* owner,
-                   ossimImageSource* imageSource,
-                   ossimImageSource* maskSource);
+   void setMaskSource(ossimImageSource* maskSource);
 
-  
    /**
     * Sets the mask type.
     * @param type The mask algorithm type to be used.
@@ -125,14 +145,6 @@ public:
    virtual ossimString getMaskTypeString() const;
 
    /**
-    * Returns the bounding rect in pixel space for this object.
-    * \param resLevel optional res level argument is given.
-    * \return The bounding rect.  It will pass the inputs bounding
-    *         rect since it does not update the bounds.
-    */
-   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
-
-   /**
     * Main entry point for the algorithm.
     * \param rect 
     *
@@ -141,39 +153,17 @@ public:
                                                ossim_uint32 resLevel=0);
 
    virtual void initialize();
-   virtual void getDecimationFactor(ossim_uint32 resLevel,
-                                    ossimDpt& result)const;
-   virtual void getDecimationFactors(vector<ossimDpt>& decimations)const;
-
-   virtual ossim_uint32 getNumberOfDecimationLevels()const;
-
-   virtual ossim_uint32 getNumberOfOutputBands() const;
-   
-   virtual ossimScalarType getOutputScalarType() const;
-
-   virtual void getValidImageVertices(vector<ossimIpt>& validVertices,
-                                      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
-                                      ossim_uint32 resLevel=0)const;
-
-   virtual ossim_uint32 getTileWidth() const;
-
-   virtual ossim_uint32 getTileHeight() const;
-
-   virtual double getNullPixelValue(ossim_uint32 band)const;
-   
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-   
    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 bool canConnectMyInputTo(ossim_int32 index, const ossimConnectableObject* object)const;
    
+   virtual ossim_uint32 getNumberOfInputBands() const;
+   
+
    virtual ossimRefPtr<ossimImageData> executeMaskFilter(
       ossimRefPtr<ossimImageData> imageSourceData,
       ossimRefPtr<ossimImageData> maskSourceData);
@@ -187,7 +177,7 @@ public:
 
    /** @brief Adds "mask_type" to list. */
    virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
+
 protected:
    /**
     * Will delete its owned tile.
@@ -268,7 +258,8 @@ protected:
     * from the call to getTile.
     */
    ossimRefPtr<ossimImageData> theTile;
-   
+   ossimRefPtr<ossimImageSource> theMaskSource;
+
    TYPE_DATA
 };
 
diff --git a/include/ossim/imaging/ossimMaskTileSource.h b/include/ossim/imaging/ossimMaskTileSource.h
deleted file mode 100644
index 1b0325c..0000000
--- a/include/ossim/imaging/ossimMaskTileSource.h
+++ /dev/null
@@ -1,157 +0,0 @@
-//*******************************************************************
-//
-// License:  LGPL
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Mingjie Su
-//
-// Description:
-//
-// Contains class declaration for ossimMaskTileSource.
-// ossimMaskTileSource is derived from ossimGeneralRasterTileSource
-//*******************************************************************
-//  $Id: ossimMaskTileSource.h 1185 2010-07-28 18:22:03Z ming.su $
-
-#ifndef ossimMaskTileSource_HEADER
-#define ossimMaskTileSource_HEADER
-
-#include <ossim/imaging/ossimImageHandler.h>
-
-class OSSIM_DLL ossimMaskTileSource : public ossimImageHandler
-{
-public:
-
-   ossimMaskTileSource();
-
-   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;
-   
-   /**
-    * 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();
-  
-   /**
-    * 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;
-
-   void setImageBoundingRect(ossimIrect rect);
-
-   bool isSupportedExtension();
-
-   static const ossim_uint32  DEFAULT_CHAR_SIZE;
-   
-protected:
-   virtual ~ossimMaskTileSource();
-   /**
-    * @note this method assumes that setImageRectangle has been called on
-    * theTile.
-    */
-  template <class T>
-  void fillTile(T, // dummy template variable
-                const ossimIrect& tile_rect, 
-                ossimImageData* tile,
-                ossim_uint32 resLevel);
-
-  ossim_uint32 getPixelValue(ossim_uint32 index,
-                             ossim_uint32 samplePos,
-                             ossim_uint32 linePos,
-                             ossim_uint32 pixelOffset);
-
-   ossimRefPtr<ossimImageData>  theTile;
-   ossim_uint32                 m_numberOfSamples;
-   ossim_uint32                 m_numberOfLines;
-   char*                        m_buffer;
-   ossim_uint32                 m_bufferSize;
-  
-TYPE_DATA
-};
-
-#endif
-
diff --git a/include/ossim/imaging/ossimMaskedImageHandler.h b/include/ossim/imaging/ossimMaskedImageHandler.h
deleted file mode 100644
index 20cadb2..0000000
--- a/include/ossim/imaging/ossimMaskedImageHandler.h
+++ /dev/null
@@ -1,179 +0,0 @@
-
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  LGPL
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Mingjie Su
-//
-// Description:
-//
-// Contains class definition for the class "ossimMaskedImageHandler".
-// ossimMaskedImageHandler is derived from ImageHandler which is derived from
-// TileSource.
-//
-//*******************************************************************
-//  $Id: ossimMaskedImageHandler.h 1242 2010-08-06 20:37:21Z david.burken $
-
-#ifndef ossimMaskedImageHandler_HEADER
-#define ossimMaskedImageHandler_HEADER
-
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimMaskFilter.h>
-#include <ossim/base/ossimIrect.h>
-
-class ossimMaskTileSource;
-
-class ossimMaskedImageHandler : public ossimImageHandler
-{
-public:
-   ossimMaskedImageHandler();
-   virtual ~ossimMaskedImageHandler();
-
-   /**
-    *  @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 bool open(const ossimFilename& imageFile);
-
-   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& 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:  Shape files should never have reduced res sets so this method is
-    * returns "8" to avoid the question of "Do you want to build res sets".
-    */
-   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=0);
-   
-   //! 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();
-
-   /*!
-    * 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;
-
-   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 getImageTileHeight() 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 setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)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);
-
-   void setInputImageSource(ossimRefPtr<ossimImageHandler> inputImageSource);
-
-   bool isSupportedExtensions();
-
-private:
-
-   ossimRefPtr<ossimImageHandler>                   m_inputImageSource;
-   ossimRefPtr<ossimMaskTileSource>                 m_maskImageSource;
-   ossimRefPtr<ossimMaskFilter>                     m_maskFilter;
- 
-TYPE_DATA
-};
-
-#endif
diff --git a/include/ossim/imaging/ossimMemoryImageSource.h b/include/ossim/imaging/ossimMemoryImageSource.h
index f6866a6..f5114ed 100644
--- a/include/ossim/imaging/ossimMemoryImageSource.h
+++ b/include/ossim/imaging/ossimMemoryImageSource.h
@@ -7,9 +7,11 @@
 //*************************************************************************
 //
 #ifndef ossimMemoryImageSource_HEADER
-#define ossimMemoryImageSource_HEADER
+#define ossimMemoryImageSource_HEADER 1
 
 #include <ossim/base/ossimConstants.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageGeometry.h>
 #include <ossim/imaging/ossimImageSource.h>
 
 class OSSIM_DLL ossimMemoryImageSource : public ossimImageSource
@@ -76,12 +78,12 @@ public:
    /**
     *  save state is not implemented for this source and only passes to the base.
     */
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix)const;
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
    
    /**
     * loadState is here so one can construct a memory source as a blank tile.
     */
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix);
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
    
 protected:
    ossimRefPtr<ossimImageData> m_image;
diff --git a/include/ossim/imaging/ossimNitfTileSource.h b/include/ossim/imaging/ossimNitfTileSource.h
index 2de0b45..1d97446 100644
--- a/include/ossim/imaging/ossimNitfTileSource.h
+++ b/include/ossim/imaging/ossimNitfTileSource.h
@@ -11,17 +11,17 @@
 // Contains class declaration for NitfTileSource.
 //
 //*******************************************************************
-//  $Id: ossimNitfTileSource.h 17932 2010-08-19 20:34:35Z dburken $
-#ifndef ossimNitfTileSource_HEADER
-#define ossimNitfTileSource_HEADER
+//  $Id: ossimNitfTileSource.h 21445 2012-08-03 20:30:10Z dburken $
 
-#include <fstream>
+#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;
 
@@ -254,12 +254,28 @@ protected:
 
    /**
     * @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.
-    * @note allocate is called on a entry change to an already open nitf file.
     */
    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.
     * */
@@ -501,7 +517,14 @@ protected:
    //---
    std::vector<std::streamoff>   theNitfBlockOffset;
    std::vector<ossim_uint32>     theNitfBlockSize;
-   mutable bool                  m_isJpeg12Bit;
+   
+   bool m_isJpeg12Bit;
+
+   //---
+   // If set to true indicates scanForJpegBlockOffsets() needs to be called
+   // prior to grabbing a block.
+   //---
+   bool m_jpegOffsetsDirty;
    
 TYPE_DATA
 };
diff --git a/include/ossim/imaging/ossimNitfWriterBase.h b/include/ossim/imaging/ossimNitfWriterBase.h
index fcf83d3..32d9639 100644
--- a/include/ossim/imaging/ossimNitfWriterBase.h
+++ b/include/ossim/imaging/ossimNitfWriterBase.h
@@ -10,7 +10,7 @@
 // all nitf writers.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimKakaduNitfWriter.h 15073 2009-08-13 19:55:34Z dburken $
+// $Id: ossimNitfWriterBase.h 2981 2011-10-10 21:14:02Z david.burken $
 #ifndef ossimNitfWriterBase_HEADER
 #define ossimNitfWriterBase_HEADER
 
@@ -104,16 +104,16 @@ public:
     * 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;
+
+   /**
+    * 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:
 
@@ -156,6 +156,14 @@ protected:
    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;
    
@@ -165,6 +173,8 @@ protected:
     */
    bool theEnableBlockaTagFlag;
 
+   
+
 private:
 
 TYPE_DATA
diff --git a/include/ossim/imaging/ossimOverviewBuilderBase.h b/include/ossim/imaging/ossimOverviewBuilderBase.h
index 8f7f576..8731981 100644
--- a/include/ossim/imaging/ossimOverviewBuilderBase.h
+++ b/include/ossim/imaging/ossimOverviewBuilderBase.h
@@ -9,23 +9,24 @@
 // Description:  Base class for overview builders.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimOverviewBuilderBase.h 17932 2010-08-19 20:34:35Z dburken $
+// $Id: ossimOverviewBuilderBase.h 21653 2012-09-07 15:03:08Z dburken $
 #ifndef ossimOverviewBuilderBase_HEADER
-#define 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 ossimImageHandler;
 class ossimFilename;
 
-
 class OSSIM_DLL ossimOverviewBuilderBase
    :
       public ossimSource,
@@ -48,13 +49,13 @@ public:
    virtual bool setOutputWriter(ossimImageFileWriter* outputWriter);
 
    /**
-    * @brief Sets the input to the builder. (pure virtual)
+    * @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) = 0;
+   virtual bool setInputSource(ossimImageHandler* imageSource);
 
    /**
     * @brief Sets the output file name. (pure virtual)
@@ -141,11 +142,42 @@ public:
     */
    virtual bool execute()=0;
 
-    /**
-    * @brief Sets the histogram accumulation mode.
-    * @param mode NONE, NORMAL or FAST.
+   /**
+    * @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.
     */
-   void setMaskBuildFlag(bool maskBuildFlag) { m_maskBuildFlag = maskBuildFlag; }
+   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 */
@@ -165,19 +197,41 @@ protected:
    ossim_uint32 getRequiredResLevels(const ossimImageHandler* ih) const;
   
    /**
-    * @brief Gets the default stop dimension.
+    * @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.
     * 
-    * @returns Returns the default stop dimension.
+    * 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.
     */
-   ossim_uint32 getDefaultStopDimension() const;
+   void initializeScanOptions();
    
    ossim_uint32 m_overviewStopDimension;
-   ossimHistogramMode m_histoMode;   
-
-   bool m_maskBuildFlag;
+   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
diff --git a/include/ossim/imaging/ossimOverviewBuilderFactoryRegistry.h b/include/ossim/imaging/ossimOverviewBuilderFactoryRegistry.h
index 82790ed..a588a13 100644
--- a/include/ossim/imaging/ossimOverviewBuilderFactoryRegistry.h
+++ b/include/ossim/imaging/ossimOverviewBuilderFactoryRegistry.h
@@ -7,18 +7,17 @@
 // Description: The factory registry for overview builders.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimOverviewBuilderFactoryRegistry.h 19184 2011-03-23 11:59:03Z gpotts $
+// $Id: ossimOverviewBuilderFactoryRegistry.h 19907 2011-08-05 19:55:46Z dburken $
 
 #ifndef ossimOverviewBuilderFactoryRegistry_HEADER
-#define ossimOverviewBuilderFactoryRegistry_HEADER
-
-#include <vector>
+#define ossimOverviewBuilderFactoryRegistry_HEADER 1
 
 #include <ossim/base/ossimConstants.h>
 #include <ossim/base/ossimString.h>
 #include <ossim/imaging/ossimOverviewBuilderFactoryBase.h>
 #include <ossim/imaging/ossimOverviewBuilderBase.h>
 #include <ossim/base/ossimFactoryListInterface.h>
+#include <vector>
 
 /**
  * @class ossimOverviewBuilderFactoryRegistry
@@ -31,8 +30,9 @@
  * ossimOverviewBuilderFactoryRegistry::instance()->createBuilder(
  * someStringFromTypeList);
  */
-class OSSIM_DLL ossimOverviewBuilderFactoryRegistry : public ossimObjectFactory, 
-                                                      public ossimFactoryListInterface<ossimOverviewBuilderFactoryBase, ossimOverviewBuilderBase>
+class OSSIM_DLL ossimOverviewBuilderFactoryRegistry :
+   public ossimObjectFactory, 
+   public ossimFactoryListInterface<ossimOverviewBuilderFactoryBase, ossimOverviewBuilderBase>
 {
 public:
 
@@ -42,20 +42,16 @@ public:
     */
    static ossimOverviewBuilderFactoryRegistry* instance();
 
-
    /*!
     * Creates an object given a type name.
     */
-   virtual ossimObject* createObject(const ossimString& typeName)const
-   {
-      return createObjectFromRegistry(typeName);
-   }
+   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;
+                                     const char* prefix=0) const;
    /**
     * @brief Creates a builder from a string.  This should match a string from
     * the getTypeNameList() method.
@@ -75,10 +71,7 @@ public:
     *
     * @param typeList List of ossimStrings to add to.
     */
-   virtual void getTypeNameList(std::vector<ossimString>& typeList)const
-   {
-      getAllTypeNamesFromRegistry(typeList);
-   }
+   virtual void getTypeNameList(std::vector<ossimString>& typeList) const;
    
 private:
    /** default constructor hidden from use */
@@ -92,8 +85,6 @@ private:
 
    /** The static instance of this class. */
    static ossimOverviewBuilderFactoryRegistry* m_instance;
-
-   
 };
 
 #endif /* #ifndef ossimOverviewBuilderFactoryRegistry_HEADER */
diff --git a/include/ossim/imaging/ossimOverviewSequencer.h b/include/ossim/imaging/ossimOverviewSequencer.h
index f3a0b36..3751143 100644
--- a/include/ossim/imaging/ossimOverviewSequencer.h
+++ b/include/ossim/imaging/ossimOverviewSequencer.h
@@ -7,9 +7,9 @@
 // Description: Class definition for sequencer for building overview files.
 // 
 //----------------------------------------------------------------------------
-// $Id: ossimOverviewSequencer.h 17864 2010-08-11 20:10:39Z dburken $
+// $Id: ossimOverviewSequencer.h 22149 2013-02-11 21:36:10Z dburken $
 #ifndef ossimOverviewSequencer_HEADER
-#define ossimOverviewSequencer_HEADER
+#define ossimOverviewSequencer_HEADER 1
 
 #include <ossim/base/ossimReferenced.h>
 #include <ossim/base/ossimConstants.h>
@@ -17,14 +17,19 @@
 #include <ossim/base/ossimMultiBandHistogram.h>
 #include <ossim/imaging/ossimImageHandler.h>
 #include <ossim/imaging/ossimFilterResampler.h>
+#include <ossim/imaging/ossimBitMaskWriter.h>
+#include <ossim/imaging/ossimMaskFilter.h>
+#include <string>
+#include <vector>
 
 class ossimFilename;
-class ossimImageHandler;
 
 /**
  * @class Sequencer for building overview files.
  */
-class OSSIM_DLL ossimOverviewSequencer : public ossimReferenced
+class OSSIM_DLL ossimOverviewSequencer
+   : public ossimReferenced, public ossimErrorStatusInterface
+   
 {
 public:
 
@@ -60,6 +65,14 @@ public:
     * @note This object does not own the image handler.
     */
    void setImageHandler(ossimImageHandler* input);
+   
+   /**
+    * @brief Enabled the 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 setBitMaskObjects(ossimBitMaskWriter* mask_writer,
+                          ossimMaskFilter* mask_filter);
 
    /**
     * @brief Sets the input source resolution to decimate from.
@@ -157,6 +170,42 @@ public:
    void setResampleType(
       ossimFilterResampler::ossimFilterResamplerType resampleType);
 
+   /**
+    * @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;
+
+   /**
+    * @brief Writes an ossim metadata(omd) file with min, max, null values.
+    *
+    * Writes omd file to disk with min, max, null values.  If file existed
+    * previously it will be ingested into keyword list prior to addition
+    * of the min, max, nulls computed in this method.
+    *
+    * Note that prior to writing a sanity check is performed on the values as
+    * a scan for null value might actually pick up the min if the image is
+    * full.
+    * 
+    * @param file to write.
+    */
+   bool writeOmdFile(const std::string& file);   
+
 protected:
 
    /** virtual destructor */
@@ -188,15 +237,21 @@ protected:
     */
    void resampleTile(const ossimImageData* inputTile);
 
-   template <class T> void  resampleTile(const ossimImageData* inputTile, T dummy);
+   template <class T> void resampleTile(const ossimImageData* inputTile,
+                                        T dummy);
 
-   ossimRefPtr<ossimImageHandler> m_imageHandler;
-   ossimRefPtr<ossimImageData>    m_tile;
-   ossimIrect                     m_areaOfInterest;
-   ossimIpt                       m_tileSize;
-   ossim_uint32                   m_numberOfTilesHorizontal;
-   ossim_uint32                   m_numberOfTilesVertical;
-   ossim_uint32                   m_currentTileNumber;
+   /** @brief Clears out the arrays from a scan for min, max, nulls. */
+   void clearMinMaxNullArrays();
+
+   ossimRefPtr<ossimImageHandler>  m_imageHandler;
+   ossimRefPtr<ossimBitMaskWriter> m_maskWriter;
+   ossimRefPtr<ossimMaskFilter>    m_maskFilter;
+   ossimRefPtr<ossimImageData>     m_tile;
+   ossimIrect                      m_areaOfInterest;
+   ossimIpt                        m_tileSize;
+   ossim_uint32                    m_numberOfTilesHorizontal;
+   ossim_uint32                    m_numberOfTilesVertical;
+   ossim_uint32                    m_currentTileNumber;
 
    /** This is the resolution level to build overviews from. */
    ossim_uint32                   m_sourceResLevel;
@@ -215,11 +270,20 @@ protected:
    ossimHistogramMode m_histoMode;
 
    /**
-    * Used to determine which tiles to accumulate a histogram from.  If set to 1 every tile is
-    * accumulated, 2 every other tile, 3 every 3rd tile, and so on.  Set in initialize method
-    * based on mode and image size.
+    * Used to determine which tiles to accumulate a histogram from.  If set to
+    * 1 every tile is accumulated, 2 every other tile, 3 every 3rd tile, and
+    * so on.  Set in initialize method based on mode and image size.
     */
    ossim_uint32 m_histoTileIndex;
+
+   /** Control flags for min, max, null scanning. */
+   bool m_scanForMinMax;
+   bool m_scanForMinMaxNull;
+ 
+   /** Arrays o hold the min value for each band for scan min/max methods. */
+   std::vector<ossim_float64> m_minValues; 
+   std::vector<ossim_float64> m_maxValues; 
+   std::vector<ossim_float64> m_nulValues;
 };
 
 #endif /* #ifndef ossimOverviewSequencer_HEADER */
diff --git a/include/ossim/imaging/ossimPdfWriter.h b/include/ossim/imaging/ossimPdfWriter.h
new file mode 100644
index 0000000..0f38a80
--- /dev/null
+++ b/include/ossim/imaging/ossimPdfWriter.h
@@ -0,0 +1,554 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file
+//
+// Author:  David Burken
+//
+// Description: OSSIM Portable Document Format (PDF) writer.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimPdfWriter_HEADER
+#define ossimPdfWriter_HEADER 1
+
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <ossim/base/ossimConnectableObject.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimRtti.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <OpenThreads/Mutex>
+#include <iosfwd>
+
+// Forward class declarations:
+class ossimImageData;
+class ossimIpt;
+class ossimIrect;
+
+/**
+ * @class ossimPdfWriter
+ *
+ * References:
+ * 
+ * Adobe PDF Reference sixth edition, Version 1.7 November 2006
+ * pdf_reference_1-7.pdf
+ *
+ * PDF Georegistration Encoding Best Practice Version (2.2 OGC 08-139r3)
+ * 08-139r3_PDF_Geo-registration_Encoding_Best_Practice_Version_2.2.pdf
+ *
+ * @note Spaces and newlines for formatting have been left in the code for
+ * sanity purposes only.  Code is heavily traced.  You can enable trace on any
+ * ossim application with "-T ossimPdfWriter".
+ */
+class OSSIM_DLL ossimPdfWriter : public ossimImageFileWriter
+{
+public:
+
+   enum ossimPdfImageType
+   {
+      UNKNOWN = 0,
+      JPEG    = 1, // JPEG
+      RAW     = 2  // general raster, band interleaved by pixel(BIP)
+   };
+
+   /** @brief default constructor */
+   ossimPdfWriter();
+
+   /** @brief virtual destructor */
+   virtual ~ossimPdfWriter();
+
+   /** @return "pdf writer" */
+   virtual ossimString getShortName() const;
+
+   /** @return "ossim pdf writer" */
+   virtual ossimString getLongName()  const;
+
+   /** @return "ossimPdfWriter" */
+   virtual ossimString getClassName()    const;
+
+   /**
+    * @brief 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 void getImageTypeList(std::vector<ossimString>& imageTypeList)const
+    *
+    * Appends this writer image types to list "imageTypeList".
+    *
+    * This writer only has one type "pdf".
+    *
+    * @param imageTypeList stl::vector<ossimString> list to append to.
+    */
+   virtual void getImageTypeList(std::vector<ossimString>& imageTypeList)const;
+
+   /** @return true if open, false if not. */
+   virtual bool isOpen() const;
+
+   /**
+    * @brief Open method.
+    * @return True on success, false on error.
+    */
+   virtual bool open();
+   
+   /** @brief Closes file. */
+   virtual void close();
+   
+   /** @brief saves the state of the object. */
+   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 on success, false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   /**
+    * @brief Will set the property whose name matches the argument
+    * "property->getName()".
+    *
+    * @param property Object containing property to set.
+    */
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   
+   /**
+    * @brief Gets property for name.
+    * 
+    * @param name Name of property to return.
+    * 
+    * @returns A pointer to a property object which matches "name".
+    */
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+
+   /**
+    * @brief 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;
+
+   virtual 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.
+    *
+    * The stream will not be closed/deleted by this object.
+    *
+    * @param output The stream to write to.
+    */
+   virtual bool setOutputStream( std::ostream& stream );
+
+private:
+
+   /**
+    * @brief Writes the file to disk or a stream.
+    * @return true on success, false on error.
+    */
+   virtual bool writeFile();
+
+   /**
+    * @brief Writes header.
+    * @param str Stream to write to.
+    */
+   void writeHeader( std::ostream* str );
+
+   /**
+    * @brief Writes Catalog object.
+    * @param str Stream to write to.
+    * @param xref To capture object positions.
+    */
+   void writeCatalog( std::ostream* str,
+                      std::vector<std::streamoff>& xref );
+   
+   /**
+    * @brief Writes Outlines object.
+    * @param str Stream to write to.
+    * @param xref To capture object positions.
+    */
+#if 0
+   void writeOutlines( std::ostream* str,
+                       std::vector<std::streamoff>& xref );
+#endif
+
+   /**
+    * @brief Writes Pages object.
+    * @param str Stream to write to.
+    * @param xref To capture object positions.
+    */
+   void writePages( std::ostream* str,
+                    std::vector<std::streamoff>& xref );
+
+   /**
+    * @brief Writes document infomation dictionary.
+    * @param str Stream to write to.
+    * @param xrefOffset Offset to cross reference(xref) table. 
+    */
+   void writeInfo( std::ostream* str,
+                   std::vector<std::streamoff>& xref );
+   
+   /**
+    * @brief Writes the image dictionary and associated objects.
+    * @param str Stream to write to.
+    * @return true on success, false on error.
+    */
+   bool writeImage( std::ostream* str );
+
+   /**
+    * @brief Write a JPEG-compresses the raster tile buffer to the output stream
+    * provided.
+    * @param str Stream to write to.
+    * @param xref To capture object positions.
+    * @param id Pointer to tile data.
+    * @param aoi Area of interest.
+    * @param outputTileRect Initialized by this with output tile rect clamped
+    * to aoi.
+    */
+   void writeJpegTile( std::ostream* str,
+                       std::vector<std::streamoff>& xref,
+                       ossimImageData* id,
+                       const ossimIrect& aoi,
+                       ossimIrect& outputTileRect );
+   
+   /**
+    * @brief Write raw raster tile buffer to the output stream
+    * provided.
+    * @param str Stream to write to.
+    * @param xref To capture object positions.
+    * @param id Pointer to tile data.
+    * @param aoi Area of interest.
+    * @param outputTileRect Initialized by this with output tile rect clamped
+    * to aoi.
+    */
+   void writeRawTile( std::ostream* str,
+                      std::vector<std::streamoff>& xref,
+                      ossimImageData* id,
+                      const ossimIrect& aoi,
+                      ossimIrect& outputTileRect );
+   
+   /**
+    * @brief Writes Cross Reference(xref) section.
+    * @param str Stream to write to.
+    * @param xref Array of object offsets.
+    */
+   void writeXref( std::ostream* str,
+                   const std::vector<std::streamoff>& xref );
+
+   /**
+    * @brief Writes trailer.
+    * @param str Stream to write to.
+    * @param entrySize Number of entries, one plus object count.
+    * @param xrefOffset Offset to cross reference(xref) table. 
+    */
+   void writeTrailer( std::ostream* str,
+                      ossim_uint32 entrySize,
+                      std::streamoff xrefOffset );
+
+   /**
+    * @brief Writes "dummy"  or blank object just to keep object references
+    * in line.
+    * @param str Stream to write to.
+    * @param xref To capture object positions.
+    */
+#if 0
+   void writeDummy( std::ostream* str,
+                    std::vector<std::streamoff>& xref );
+#endif
+   
+   /**
+    * @brief Sets up input image source.
+    * This sets up the chain fed to theInputConnection which is an image
+    * source sequencer.  This will remap input to eight bit if not already and
+    * make input one or three band depending on number of bands. Also sets
+    * m_saveInput for reconnection at the end of write.
+    */
+   void setupInputChain();
+
+   /**
+    * @brief Gets the enumerated value of IMAGE_TYPE_KW lookup.
+    *
+    * This is the image type of the stream embedded in the pdf.
+    * Default "raw" if not found.
+    * 
+    * @return ossimPdfImageType, e.g. PNG, RAW...
+    */
+   ossimPdfImageType getImageType() const;   
+
+   /**
+    * @brief Initializes image type from IMAGE_TYPE_KW lookup.
+    *
+    * This is the image type of the stream embedded in the pdf.
+    * Default "raw" if not found.
+    *
+    * @param type Initialized by this.
+    */
+   void getImageType( std::string& type ) const;
+
+   /**
+    * @brief Adds option to m_kwl with mutex lock.
+    * @param key
+    * @param value
+    */
+   void addOption( const std::string& key, const std::string& value );
+
+   /**
+    * @brief Gets the page size.
+    *
+    * Takes into account image width, height, and annotations.
+    * 
+    * @param width Width of image.
+    * @param height Height of image.
+    * @param size Initialized by this.
+    */
+#if 0
+   void getMediaBoxSize( ossim_uint32 imageWidth,
+                         ossim_uint32 imageHeight,
+                         ossimIpt& size ) const;
+#endif
+
+   /**
+    * @brief Gets page offset for image from lower left corner of media box.
+    * @param aoi Area of interest.
+    * @param offset Initialized by this.
+    */
+   void getLowerLeftPageOffset( const ossimIrect& aoi,
+                                ossimIpt& offset ) const;
+
+   /**
+    * @brief Get the LGIDict string.
+    * @param geom Image geometry.
+    * @param aoi Area of interest.
+    * @param s Initialized by this.
+    */
+   void getLgiDict( ossimImageGeometry* geom,
+                    const ossimIrect& aoi,
+                    std::string& s ) const;
+
+   /**
+    * @brief Gets projection part of LGIDict string.
+    * @param geom Image geometry.
+    * @param s Initialized by this. 
+    */ 
+   void getLgiDictProjection( ossimImageGeometry* geom,
+                              std::string& s ) const;
+
+   
+   /**
+    * @brief Gets Coordinate Transformation Matrix(CTM) part of
+    * LGIDict string from geom. 
+    * @param geom Image geometry.
+    * @param aoi Area of interest.
+    * @param s Initialized by this or cleared on error.
+    */
+   void getLgiDictCtm( ossimImageGeometry* geom,
+                       const ossimIrect& aoi,
+                       std::string& s ) const;
+
+   /**
+    * @brief Gets datum part of LGIDict string from geom. 
+    * @param geom Image geometry.
+    * @param s Initialized by this or cleared on error.
+    */   
+   void getLgiDictDatum( ossimImageGeometry* geom,
+                         std::string& s ) const;
+
+   /**
+    * @brief Gets description part of LGIDict string from geom. 
+    * @param geom Image geometry.
+    * @param s Initialized by this or cleared on error.
+    */   
+   void getLgiDictDescription( ossimImageGeometry* geom,
+                               std::string& s ) const;
+   
+   /**
+    * @brief Gets neatline part of LGIDict string from geom. 
+    * @param geom Image geometry.
+    * @param s Initialized by this or cleared on error.
+    */
+#if 0
+   void getLgiDictNeatline( ossimImageGeometry* geom,
+                            std::string& s ) const;
+#endif
+
+   /**
+    * @brief Gets projection type part of LGIDict string from geom. 
+    * @param geom Image geometry.
+    * @param s Initialized by this or cleared on error.
+    */
+   void getLgiDictProjectionType( ossimImageGeometry* geom,
+                                  std::string& s ) const;
+   
+   /**
+    * @brief Gets the EPSG/PCS code from geometry.
+    * @param geom Image geometry.
+    * @return EPSG code or 32767 on error.
+    */
+   ossim_uint32 getEpsgCode( const ossimImageGeometry* geom ) const;
+
+#if 0
+   void getNumberOfTiles( ossim_uint32 imageWidth,
+                          ossim_uint32 imageHeight,
+                          ossimIpt& size ) const;
+#endif
+
+   /**
+    * @brief Gets the Title.
+    *
+    * Looks in m_kwl for options keyword: "Title"
+    *
+    * Defaults to basename of output file if not found.
+    *
+    * @param s Initialed by this.
+    */
+   void getTitle( std::string& s ) const;
+   
+   /**
+    * @brief Gets the Author.
+    *
+    * Looks in m_kwl for options keyword: "Author"
+    *
+    * Defaults to "ossim" if not found.
+    *
+    * @param s Initialed by this.
+    */
+   void getAuthor( std::string& s ) const;
+
+   /**
+    * @brief Gets the Subject.
+    *
+    * Looks in m_kwl for options keyword: "Subject"
+    *
+    * Default: No default, empty string if not found.
+    *
+    * @param s Initialed by this.
+    */
+   void getSubject( std::string& s ) const;
+
+   /**
+    * @brief Gets the Keywords.
+    *
+    * Looks in m_kwl for options keyword: "Keywords"
+    *
+    * Default: No default, empty string if not found.
+    *
+    * @param s Initialed by this.
+    */
+   void getKeywords( std::string& s ) const;
+
+   /**
+    * @brief Gets the Creator.
+    *
+    * Looks in m_kwl for options keyword: "Creator"
+    *
+    * Defaults to "ossim" if not found.
+    *
+    * @param s Initialed by this.
+    */
+   void getCreator( std::string& s ) const;
+   
+   /**
+    * @brief Gets the Producer.
+    *
+    * Looks in m_kwl for options keyword: "Producer"
+    *
+    * Defaults to "ossim" if not found.
+    *
+    * @param s Initialed by this.
+    */
+   void getProducer( std::string& s ) const;
+
+   /**
+    * @brief Gets the Producer.
+    *
+    * Looks in m_kwl for options keyword: "CreationDate"
+    *
+    * Defaults to current time if not found.
+    *
+    * @param s Initialed by this.
+    *
+    * NOTE: This is a formatted string in the form of:
+    * D:YYYYMMDDHHmmSSOHH'mm'
+    */   
+   void getCreationDate( std::string& s ) const;
+
+   /**
+    * @brief Gets the Producer.
+    *
+    * Looks in m_kwl for options keyword: "ModDate"
+    *
+    * Defaults to current time if not found.
+    *
+    * @param s Initialed by this.
+    *
+    * NOTE: This is a formatted string in the form of:
+    * D:YYYYMMDDHHmmSSOHH'mm'
+    */
+   void getModDate( std::string& s ) const;
+
+   /**
+    * @brief Get's the date in format of:
+    * (D:YYYYMMDDHHmmSSZ00'00')
+    *
+    * @param s Initialed by this.
+    *
+    * NOTE: Date code is NOT thread safe.
+    */
+   void getGmtDate( std::string& s ) const;
+
+   /**
+    * @brief Gets tiles size as string.
+    *
+    * Looks in m_kwl for options keyword: "output_tile_size"
+    *
+    * Defaults to 1024 if not found.
+    *
+    * @param s Initialized by this.
+    */
+   void getTileSize( std::string& s ) const;
+
+   /**
+    * @brief Gets Tile size as integer point.
+    *
+    * Defaults to 1024x1024 if not found.
+    * @param tileSize Initialized by this.
+    */
+   void getTileSize( ossimIpt& tileSize ) const;
+   
+   /**
+    * @return string for x and y in the form of (x=1, y=3): "/Tile_0001_0003"
+    */
+   std::string getTileString( ossim_uint32 x, ossim_uint32 y ) const;
+
+   std::ostream* m_str;
+   bool m_ownsStream;
+
+   /**
+    * Holds the origin end of the chain connected to theInputConnection.
+    */
+   ossimRefPtr<ossimConnectableObject> m_savedInput;
+
+   /** Holds all options in key, value pair map. */
+   ossimRefPtr<ossimKeywordlist> m_kwl;
+
+   OpenThreads::Mutex m_mutex;
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimPdfWriter_HEADER */
diff --git a/include/ossim/imaging/ossimPixelFlipper.h b/include/ossim/imaging/ossimPixelFlipper.h
index 6a1b3a1..5659834 100644
--- a/include/ossim/imaging/ossimPixelFlipper.h
+++ b/include/ossim/imaging/ossimPixelFlipper.h
@@ -13,7 +13,7 @@
 // This was written to fix partial null pixels.
 // 
 //*************************************************************************
-// $Id: ossimPixelFlipper.h 18633 2011-01-04 20:39:15Z dburken $
+// $Id: ossimPixelFlipper.h 19728 2011-06-06 21:31:17Z dburken $
 #ifndef ossimPixelFlipper_HEADER
 #define ossimPixelFlipper_HEADER
 
@@ -37,50 +37,78 @@
 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[];
 
    /**
-    * ReplacementMode:
+    * Target Replacement Mode:
     * 
-    * If mode is REPLACE_ALL_TARGETS (default):
-    * Any pixel with a value of target will be replaced.
-    * pixel (r=0, g=0, b=0)   becomes  (r=1, g=1, b=1)
-    * pixel (r=0, g=30, b=21) becomes  (r=1, g=30, b=21)
+    * 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_PARTIAL_TARGETS:
-    * Pixel with a value of target will be replaced only if at least one
-    * subpixel(band) does not have the target.
-    * pixel (r=0, g=0, b=0)   remains  (r=0, g=0, b=0)
-    * pixel (r=0, g=30, b=21) becomes  (r=1, g=30, b=21)
-    * 
-    * If mode is REPLACE_BANDS_PARTIAL_TARGETS_ALL_BANDS:
-    * All bands will be replaced if any band has target but not all.
-    * pixel (r=0, g=0, b=0)   remains  (r=0, g=0, b=0)
-    * pixel (r=0, g=30, b=21) becomes  (r=1, g=1, b=1)
-    * 
-    * If mode is REPLACE_FULL_TARGETS:
-    * Target will be repaced only if all subpixels(bands) have the target.
-    * pixel (r=0, g=0, b=0)   becomes  (r=1, g=1, b=1)
-    * pixel (r=0, g=30, b=21) remains  (r=0, g=30, b=21)
+    * 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)
     *
-    * Default mode is REPLACE_ALL_TARGETS.
+    * 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_ALL_TARGETS               = 0,
-      REPLACE_PARTIAL_TARGETS           = 1,
-      REPLACE_PARTIAL_TARGETS_ALL_BANDS = 2,
-      REPLACE_FULL_TARGETS              = 3
+      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
    {
-      ossimPixelFlipperClipMode_NONE = 0,
-      ossimPixelFlipperClipMode_BOUNDING_RECT  = 1,
-      ossimPixelFlipperClipMode_VALID_VERTICES = 2
+      NONE = 0,
+      BOUNDING_RECT  = 1,
+      VALID_VERTICES = 2
    };
-   
+
    /** default constructor */
-   ossimPixelFlipper(ossimObject* owner=0);
+   ossimPixelFlipper(ossimObject* owner=NULL);
+
 
    /** @return "Pixel flipper" as an ossimString. */
    virtual ossimString getShortName()const;
@@ -116,49 +144,74 @@ public:
    
    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. */
+   /** 
+    * @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);
 
-   /** @param replacement_value This is the value to flip target to. */
-   void setReplacementValue(ossim_float64 replacement_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);
-   void setReplacementMode(const ossimString& modeString);
 
-   void setClipMode(const ossimString& modeString);
-   void setClipMode(ossimPixelFlipper::ClipMode mode);
-   
-   /**
-    * @param clamp_value If set all pixel values above this range will
-    * be clamped to clamp_value.  Must be less than max pixel value of the
-    * input and cannot be null.
+   /** 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 setClampValue(ossim_float64 clamp_value);
+   void setClipMode(const ossimString& modeString);
+   void setClipMode(ClipMode mode);
 
-   ossim_float64 getTargetValue()      const;
+   //ossim_float64 getTargetValue()      const;
    ossim_float64 getReplacementValue() const;
-   ossim_float64 getClampValue() const;
+   //ossim_float64 getClampValue() const;
    ossimPixelFlipper::ReplacementMode getReplacementMode()  const;
    ossimString getReplacementModeString() const;
    ossimString getClipModeString() const;
-   ossimPixelFlipper::ClipMode getClipMode() 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 flipPixels(T dummy,
-                                      ossimImageData* inpuTile,
-                                      ossim_uint32 resLevel);
-
    template <class T> void clipTile(T dummy,
                                     ossimImageData* inpuTile,
                                     ossim_uint32 resLevel);
@@ -170,26 +223,27 @@ protected:
    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;
 
-   /** The value to replace. */
-   ossim_float64 theTargetValue;
-
-   /** The replacement value. */
+    /** 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
 
-   /**
-    * If set and not > max pixel values any values higher than theClampValue
-    * will be clamped to theClampValue.
-    */
-   ossim_float64 theClampValue;
-   
-   /** Target Replacement Mode.  Default mode is REPLACE_ALL_TARGETS. */
-   ReplacementMode theReplacementMode;
+  /** 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;
 
    /**
-    * Clip mode
+    * Border Clip mode
     *
-    * This will flip nulls any pixel value outside the specified mode.
+    * This will flip to nulls any pixel value outside the specified mode.
     *
     * Valid modes are:
     *
@@ -197,11 +251,11 @@ protected:
     * 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.
+    * 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;
+   ClipMode        theClipMode;
    
    /** For lock and unlock. */
    mutable OpenThreads::ReentrantMutex      theMutex;
diff --git a/include/ossim/imaging/ossimPolyCutter.h b/include/ossim/imaging/ossimPolyCutter.h
index 782838e..a0afc16 100644
--- a/include/ossim/imaging/ossimPolyCutter.h
+++ b/include/ossim/imaging/ossimPolyCutter.h
@@ -8,7 +8,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimPolyCutter.h 15766 2009-10-20 12:37:09Z gpotts $
+// $Id: ossimPolyCutter.h 19907 2011-08-05 19:55:46Z dburken $
 #ifndef ossimPolyCutter_HEADER
 #define ossimPolyCutter_HEADER
 #include <ossim/imaging/ossimImageSourceFilter.h>
@@ -69,6 +69,10 @@ public:
    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;
@@ -97,6 +101,7 @@ protected:
     */
    ossimPolyCutterCutType theCutType;
    ossimImageDataHelper theHelper;
+   bool m_boundingOverwrite;
 
 TYPE_DATA  
 };
diff --git a/include/ossim/imaging/ossimQbTileFilesHandler.h b/include/ossim/imaging/ossimQbTileFilesHandler.h
index 428daf0..5fa1484 100644
--- a/include/ossim/imaging/ossimQbTileFilesHandler.h
+++ b/include/ossim/imaging/ossimQbTileFilesHandler.h
@@ -6,28 +6,18 @@
 //
 // 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$
+// $Id: ossimQbTileFilesHandler.h 2669 2011-06-06 12:28:20Z oscar.kramer $
 #ifndef ossimQbTileFilesHandler_HEADER
 #define ossimQbTileFilesHandler_HEADER
 
-#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimTiledImageHandler.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 ossimQbTileFilesHandler : public ossimImageHandler
+//! Image handler used for tiled Quickbird imagery. 
+class OSSIMDLLEXPORT ossimQbTileFilesHandler : public ossimTiledImageHandler
 {
 public:
    //!  Constructor (default):
@@ -37,125 +27,16 @@ public:
    virtual ~ossimQbTileFilesHandler();
    
    //! @return Returns true on success, false on error.
-   //! @note This method relies on the data member ossimImageData::theImageFile
-   //! being set.  
+   //! @note This method relies on the data member ossimImageData::theImageFile being set.  
    virtual bool open();
 
-   //! 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 ossimRefPtr<ossimImageGeometry> getImageGeometry();
    
-   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;
-
-#if USING_SUB_OVRS
-   //! 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;
-
-#endif /* #if USING_SUB_OVRS */
-
-   //! 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;
-  ossimIrect  m_fullImgRect;
-  ossim_uint32 m_startOvrResLevel;
-
-#if USING_SUB_OVRS
-   //! Will complete the opening process. If there are overviews it will open them. 
-   virtual void completeOpen();
-  
-   bool m_lockSubOvrs;
-#endif
+   //! 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
 };
diff --git a/include/ossim/imaging/ossimRgbToGreyFilter.h b/include/ossim/imaging/ossimRgbToGreyFilter.h
index 0b7cb76..a274034 100644
--- a/include/ossim/imaging/ossimRgbToGreyFilter.h
+++ b/include/ossim/imaging/ossimRgbToGreyFilter.h
@@ -8,12 +8,12 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimRgbToGreyFilter.h 15766 2009-10-20 12:37:09Z gpotts $
+// $Id: ossimRgbToGreyFilter.h 20197 2011-11-03 13:22:02Z dburken $
 #ifndef ossimRgbToGreyFilter_HEADER
 #define ossimRgbToGreyFilter_HEADER
 #include <ossim/imaging/ossimImageSourceFilter.h>
 
-class ossimRgbToGreyFilter : public ossimImageSourceFilter
+class OSSIMDLLEXPORT ossimRgbToGreyFilter : public ossimImageSourceFilter
 {
 public:
    ossimRgbToGreyFilter(ossimObject* owner=NULL);
diff --git a/include/ossim/imaging/ossimSFIMFusion.h b/include/ossim/imaging/ossimSFIMFusion.h
index 5df3a78..eef34a9 100644
--- a/include/ossim/imaging/ossimSFIMFusion.h
+++ b/include/ossim/imaging/ossimSFIMFusion.h
@@ -6,7 +6,7 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimSFIMFusion.h 15766 2009-10-20 12:37:09Z gpotts $
+//  $Id: ossimSFIMFusion.h 19827 2011-07-15 19:47:30Z gpotts $
 #ifndef ossimSFIMFusion_HEADER
 #define ossimSFIMFusion_HEADER
 #include <ossim/imaging/ossimFusionCombiner.h>
@@ -78,6 +78,7 @@ protected:
    ossimRefPtr<ossimImageData>           theNormColorData;
 
    NEWMAT::Matrix                        theHighPassMatrix;
+   bool                                  theAutoAdjustScales;
 
 TYPE_DATA   
 };
diff --git a/include/ossim/imaging/ossimSingleImageChain.h b/include/ossim/imaging/ossimSingleImageChain.h
index c0700de..f4f52f6 100644
--- a/include/ossim/imaging/ossimSingleImageChain.h
+++ b/include/ossim/imaging/ossimSingleImageChain.h
@@ -30,15 +30,13 @@ class ossimFilename;
 class ossimSrcRecord;
 
 /**
+ * @class ossimSingleImageChain
+ * 
  * @brief Single image chain class.
  *
- * Typical usage:
- * ossimRefPtr<ossimSingleImageChain> myChain = new ossimSingleImageChain();
- * if ( myChain->open(myFile) == true )
- * {
- *    myChain->createRenderedChain();
- *    your-code-goes-here();
- * }
+ * 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.
@@ -86,11 +84,17 @@ public:
     *
     * 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 open(const ossimFilename& file, bool openOverview=true);
 
    /**
     * @brief open method that takes an ossimSrcRecord.
@@ -134,7 +138,10 @@ public:
     * 8) chain cache
     *
     * NOTES:
-    * 1) If doing a sequential write where tiles to the right of the
+    * 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.
     */
@@ -147,10 +154,17 @@ public:
 
    /**
     * @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 addImageHandler(const ossimFilename& file,
+                        bool openOverview=true);
 
    /**
     * @brief Adds an image handler from src record.
@@ -189,7 +203,10 @@ public:
     */
    void addHistogramRemapper(const ossimSrcRecord& src);
 
-   /** @return A a new cache. */
+   /**
+    * @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. */ 
@@ -408,6 +425,27 @@ public:
     */
    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. */
diff --git a/include/ossim/imaging/ossimSubImageTileSource.h b/include/ossim/imaging/ossimSubImageTileSource.h
index cb5b949..152a06a 100644
--- a/include/ossim/imaging/ossimSubImageTileSource.h
+++ b/include/ossim/imaging/ossimSubImageTileSource.h
@@ -14,7 +14,7 @@
 // LIMITATIONS: None.
 //
 //*****************************************************************************
-//  $Id: ossimSubImageTileSource.h 15766 2009-10-20 12:37:09Z gpotts $
+//  $Id: ossimSubImageTileSource.h 22233 2013-04-15 15:12:54Z gpotts $
 
 #ifndef ossimSubImageTileSource_HEADER
 #define ossimSubImageTileSource_HEADER
@@ -30,7 +30,7 @@
  *  a full-image space coordinate to a sub-image coordinate.
  *
  *****************************************************************************/
-class ossimSubImageTileSource : public ossimImageSourceFilter
+class OSSIM_DLL ossimSubImageTileSource : public ossimImageSourceFilter
 {
 public:
    /*!
diff --git a/include/ossim/imaging/ossimTiffOverviewBuilder.h b/include/ossim/imaging/ossimTiffOverviewBuilder.h
index 8c1cc6f..fa81b86 100644
--- a/include/ossim/imaging/ossimTiffOverviewBuilder.h
+++ b/include/ossim/imaging/ossimTiffOverviewBuilder.h
@@ -11,7 +11,7 @@
 // Contains class declaration for TiffOverviewBuilder.
 //
 //*******************************************************************
-//  $Id: ossimTiffOverviewBuilder.h 18073 2010-09-13 15:55:48Z dburken $
+//  $Id: ossimTiffOverviewBuilder.h 22232 2013-04-13 20:06:19Z dburken $
 
 #ifndef ossimTiffOverviewBuilder_HEADER
 #define ossimTiffOverviewBuilder_HEADER
@@ -29,7 +29,6 @@
 class ossimConnectableObject;
 class ossimFilename;
 class ossimImageGeometry;
-class ossimImageHandler;
 
 class OSSIM_DLL ossimTiffOverviewBuilder
    :
@@ -110,15 +109,23 @@ public:
    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.
-    */
+   /** @return ossimObject* to this object. */
    virtual ossimObject* getObject();
 
    /**
@@ -254,22 +261,26 @@ private:
                        ossim_uint32 resLevel,
                        TIFF* tif);
 
-   TIFF* openTiff(const ossimString& filename,
-                  const ossimString& openMode);
+   TIFF* openTiff( const ossimString& filename ) const;
 
    void closeTiff(TIFF* tif);
 
-   bool openMaskFile();
-   bool writeMaskStrip();
-   bool closeMaskFile();
-   void packAlphaValues(ossim_uint8* alphaValues, ossimIrect rect, ossim_uint32 maskWidth);
+   /**
+    * @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); 
 
-   ossimRefPtr<ossimImageHandler>                     m_imageHandler;
-   ossimFilename                                      m_outputFile;
    std::vector<ossim_uint8>                           m_nullDataBuffer;
    ossim_int32                                        m_bytesPerPixel;
    ossim_int32                                        m_bitsPerSample;
@@ -284,8 +295,7 @@ private:
    std::vector<double>                                m_nullPixelValues;
    bool                                               m_copyAllFlag;
    bool                                               m_outputTileSizeSetFlag;
-   std::map<ossim_uint32, std::vector<ossim_uint8> >  m_alphaMask;
-   std::ofstream                                      m_maskFileStream;
+   bool                                               m_internalOverviewsFlag;
 
 TYPE_DATA   
 };
diff --git a/include/ossim/imaging/ossimTiffTileSource.h b/include/ossim/imaging/ossimTiffTileSource.h
index 3958348..7eee5fd 100644
--- a/include/ossim/imaging/ossimTiffTileSource.h
+++ b/include/ossim/imaging/ossimTiffTileSource.h
@@ -13,15 +13,15 @@
 // ossimTiffTileSource  is derived from ImageHandler which is derived from
 // TileSource.
 //*******************************************************************
-//  $Id: ossimTiffTileSource.h 18373 2010-11-02 18:31:14Z gpotts $
+//  $Id: ossimTiffTileSource.h 22243 2013-04-20 15:27:22Z dburken $
 
 #ifndef ossimTiffTileSource_HEADER
-#define 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;
@@ -37,7 +37,8 @@ public:
       READ_RGBA_U8_STRIP,
       READ_RGBA_U8A_STRIP,
       READ_SCAN_LINE,
-      READ_TILE
+      READ_TILE,
+      READ_U16_STRIP
    };
 
    ossimTiffTileSource();
@@ -79,6 +80,29 @@ public:
     */
    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.
@@ -226,8 +250,6 @@ private:
    ossim_uint32 getCurrentTiffRLevel() const;
    
    ossimString getReadMethod(ossim_uint32 directory) const;
-
-   bool allocateBuffer();
    
    bool loadTile(const ossimIrect& tile_rect,
                  const ossimIrect& clip_rect,
@@ -244,17 +266,18 @@ private:
    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();
    
-   virtual bool initializeBuffers();
-
    /**
     * Change tiff directory and sets theCurrentDirectory.
     *
@@ -269,6 +292,32 @@ private:
     * 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;
    
@@ -303,12 +352,13 @@ private:
    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
+#endif /* #ifndef ossimTiffTileSource_HEADER */
diff --git a/include/ossim/imaging/ossimTiffWriter.h b/include/ossim/imaging/ossimTiffWriter.h
index ac101b5..e6b134b 100644
--- a/include/ossim/imaging/ossimTiffWriter.h
+++ b/include/ossim/imaging/ossimTiffWriter.h
@@ -9,7 +9,7 @@
 // Contains class declaration for TiffWriter.
 //
 //*******************************************************************
-//  $Id: ossimTiffWriter.h 18047 2010-09-06 14:25:27Z dburken $
+//  $Id: ossimTiffWriter.h 20026 2011-09-01 16:33:18Z dburken $
 #ifndef ossimTiffWriter_HEADER
 #define ossimTiffWriter_HEADER
 
@@ -219,7 +219,6 @@ protected:
    ossimString             thePhotoMetric;
    ossim_int32             theJpegQuality;
    bool                    theOutputGeotiffTagsFlag;
-   bool                    theImagineNad27Flag;
    bool                    theColorLutFlag;
    ossimRefPtr<ossimMapProjectionInfo> theProjectionInfo;
    ossimIpt                theOutputTileSize;
diff --git a/include/ossim/imaging/ossimQbTileFilesHandler.h b/include/ossim/imaging/ossimTiledImageHandler.h
similarity index 92%
copy from include/ossim/imaging/ossimQbTileFilesHandler.h
copy to include/ossim/imaging/ossimTiledImageHandler.h
index 428daf0..f86d5a2 100644
--- a/include/ossim/imaging/ossimQbTileFilesHandler.h
+++ b/include/ossim/imaging/ossimTiledImageHandler.h
@@ -14,9 +14,9 @@
 // scheme handled by this class.
 //
 //**************************************************************************************************
-// $Id$
-#ifndef ossimQbTileFilesHandler_HEADER
-#define ossimQbTileFilesHandler_HEADER
+// $Id: ossimTiledImageHandler.h 2644 2011-05-26 15:20:11Z oscar.kramer $
+#ifndef ossimTiledImageHandler_HEADER
+#define ossimTiledImageHandler_HEADER
 
 #include <ossim/imaging/ossimImageHandler.h>
 
@@ -27,19 +27,19 @@
  *  This class defines an abstract Handler which all image handlers(loaders)
  *  should derive from.
  */
-class OSSIMDLLEXPORT ossimQbTileFilesHandler : public ossimImageHandler
+class OSSIMDLLEXPORT ossimTiledImageHandler : public ossimImageHandler
 {
 public:
    //!  Constructor (default):
-   ossimQbTileFilesHandler();
+   ossimTiledImageHandler();
    
    //! Destructor:
-   virtual ~ossimQbTileFilesHandler();
+   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();
+   virtual bool open() = 0;
 
    //! Deletes the overview and clears the valid image vertices.  Derived
    //! classes should implement. */
@@ -49,8 +49,6 @@ public:
    //! @return true if open, false if not.
    virtual bool isOpen()const;
 
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-   
    virtual ossim_uint32 getNumberOfInputBands() const;
    
    //! @param resLevel Reduced resolution level to return lines of.
@@ -90,33 +88,6 @@ public:
    //! image tile height on disk.
    virtual ossim_uint32 getImageTileHeight() const;
 
-#if USING_SUB_OVRS
-   //! 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;
-
-#endif /* #if USING_SUB_OVRS */
-
    //! Fills the requested tile by pulling pixels from multiple file tiles as needed.
    virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect, ossim_uint32 resLevel);
 
@@ -143,21 +114,47 @@ protected:
    //!  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
+
+#endif /* #if USING_SUB_OVRS */
 
 TYPE_DATA
 };
 
-#endif /* #ifndef ossimQbTileFilesHandler_HEADER */
+#endif /* #ifndef ossimTiledImageHandler_HEADER */
diff --git a/include/ossim/imaging/ossimTiling.h b/include/ossim/imaging/ossimTiling.h
index 0d9cb34..21acd77 100644
--- a/include/ossim/imaging/ossimTiling.h
+++ b/include/ossim/imaging/ossimTiling.h
@@ -10,7 +10,7 @@
 // Description: implementation for image generator
 //
 //*************************************************************************
-// $Id: ossimTiling.h 13135 2008-07-06 14:47:46Z dburken $
+// $Id: ossimTiling.h 20103 2011-09-17 16:10:42Z dburken $
 #ifndef ossimTiling_HEADER
 #define ossimTiling_HEADER
 #include <ossim/base/ossimObject.h>
@@ -178,6 +178,12 @@ protected:
    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;
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/ossimTwoColorView.h b/include/ossim/imaging/ossimTwoColorView.h
index 6210e53..c578b38 100644
--- a/include/ossim/imaging/ossimTwoColorView.h
+++ b/include/ossim/imaging/ossimTwoColorView.h
@@ -17,6 +17,19 @@
 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;
    /**
@@ -31,14 +44,42 @@ public:
    double getMaxPixelValue(ossim_uint32 band)const;
    
    /**
-    * Will allow you to change the mapping of the new input and old input to the output band.  
-    * Indexing from 0 based band numbering, by default the new channel (input 0) will be mapped to 
-    * the output tile's blue channel (band 2) and the input 1 will be mapped to the red channel (band 0) 
-    * and the green will have the value of min pix.  Use this method to change the new and old default output
-    * mappings.
+    * @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 setIndexMapping(ossim_uint32 newIndex,
-                        ossim_uint32 oldIndex);
+   void setBandIndexMapping(
+      ossim_uint32 oldInputBandIndex,
+      ossim_uint32 newInputBandIndex,
+      ossimTwoColorMultiViewOutputSource redOutputSource,
+      ossimTwoColorMultiViewOutputSource grnOutputSource,
+      ossimTwoColorMultiViewOutputSource bluOutputSource);
+
    virtual void initialize();
    
 protected:
@@ -47,16 +88,18 @@ protected:
    void runNative8(ossimImageData* newData,   ossimImageData* oldData);
    void runNorm(ossimImageData* newData,   ossimImageData* oldData);
    
-   bool theByPassFlag;
-   bool theNativeFlag;
-   ossimRefPtr<ossimImageData> theTwoColorTile;
-   ossimImageSource* theNewInput;
-   ossimImageSource* theOldInput;
-   ossim_uint32 theNewBufferDestinationIndex;
-   ossim_uint32 theOldBufferDestinationIndex;
-   ossim_uint32 theMinBufferDestinationIndex;
+   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
+#endif /* #ifndef ossimTwoColorView_HEADER */
diff --git a/include/ossim/imaging/ossimUsgsDemTileSource.h b/include/ossim/imaging/ossimUsgsDemTileSource.h
index 22b0ce2..7b19497 100644
--- a/include/ossim/imaging/ossimUsgsDemTileSource.h
+++ b/include/ossim/imaging/ossimUsgsDemTileSource.h
@@ -11,7 +11,7 @@
 // is intended to be an image handler for USGS dem files.
 //
 //********************************************************************
-// $Id: ossimUsgsDemTileSource.h 17932 2010-08-19 20:34:35Z dburken $
+// $Id: ossimUsgsDemTileSource.h 19640 2011-05-25 15:58:00Z oscarkramer $
 
 #ifndef ossimUsgsDemTileSource_HEADER
 #define ossimUsgsDemTileSource_HEADER
@@ -141,6 +141,11 @@ public:
 
    virtual bool isOpen()const;
    
+   /**
+    * Override base-class method to make sure the internal geometry is explored before extending.
+    */
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
 protected:
 
    /**
diff --git a/include/ossim/imaging/ossimVpfAnnotationFeatureInfo.h b/include/ossim/imaging/ossimVpfAnnotationFeatureInfo.h
index 480f9e1..6833c32 100644
--- a/include/ossim/imaging/ossimVpfAnnotationFeatureInfo.h
+++ b/include/ossim/imaging/ossimVpfAnnotationFeatureInfo.h
@@ -7,7 +7,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimVpfAnnotationFeatureInfo.h 15836 2009-10-30 12:29:09Z dburken $
+// $Id: ossimVpfAnnotationFeatureInfo.h 19636 2011-05-24 16:48:45Z gpotts $
 #ifndef ossimVpfAnnotationFeatureInfo_HEADER
 #define ossimVpfAnnotationFeatureInfo_HEADER
 #include <ossim/base/ossimRefPtr.h>
@@ -220,7 +220,7 @@ protected:
 		      int startEdgeId,
 		      ossimVpfTable& edgTable);
 
-  ossimDpt* getXy(vpf_table_type table, row_type row, long pos, long* count);
+  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
diff --git a/include/ossim/init/ossimInit.h b/include/ossim/init/ossimInit.h
index b9ff8be..298641f 100644
--- a/include/ossim/init/ossimInit.h
+++ b/include/ossim/init/ossimInit.h
@@ -17,9 +17,9 @@
 //              Initial coding.
 //<
 //*****************************************************************************
-// $Id: ossimInit.h 18967 2011-02-25 19:40:48Z gpotts $
+// $Id: ossimInit.h 19440 2011-04-25 16:41:28Z dburken $
 #ifndef ossimInit_HEADER
-#define ossimInit_HEADER
+#define ossimInit_HEADER 1
 
 #include <ossim/base/ossimFilename.h>
 
@@ -38,6 +38,7 @@ public:
    static ossimInit* instance();
 
    void addOptions(ossimArgumentParser& parser);
+
    /*!
     * METHOD: initialize()
     * This method shall be called from the application's main module with
@@ -69,6 +70,17 @@ public:
     */
    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);
 
    /**
@@ -104,10 +116,9 @@ public:
     * e.g. "version 1.7.0 (20071003)"
     */
    ossimString version() const;
-   ossimFilename appName()const
-   {
-	   return theAppName;
-   }
+
+   ossimFilename appName()const;
+
 protected:
    /** protected default constructor. */
    ossimInit();
diff --git a/include/ossim/kbool/graph.h b/include/ossim/kbool/graph.h
index 34283ff..ea44ff1 100644
--- a/include/ossim/kbool/graph.h
+++ b/include/ossim/kbool/graph.h
@@ -8,7 +8,7 @@
     RCS-ID: $Id: graph.h 9094 2006-06-13 19:12:40Z dburken $
 */
 
-/* @@(#) $Source$ $Revision: 9094 $ $Date: 2006-06-13 21:12:40 +0200(mar, 13 giu 2006) $ */
+/* @@(#) $Source$ $Revision: 9094 $ $Date: 2006-06-13 15:12:40 -0400 (Tue, 13 Jun 2006) $ */
 
 /*
 Program	GRAPH.H
diff --git a/include/ossim/kbool/graphlst.h b/include/ossim/kbool/graphlst.h
index 4f86bb2..ffbbda0 100644
--- a/include/ossim/kbool/graphlst.h
+++ b/include/ossim/kbool/graphlst.h
@@ -8,7 +8,7 @@
     RCS-ID: $Id: graphlst.h 9094 2006-06-13 19:12:40Z dburken $
 */
 
-/* @@(#) $Source$ $Revision: 9094 $ $Date: 2006-06-13 21:12:40 +0200(mar, 13 giu 2006) $ */
+/* @@(#) $Source$ $Revision: 9094 $ $Date: 2006-06-13 15:12:40 -0400 (Tue, 13 Jun 2006) $ */
 
 /*
 Program	GRAPHLST.H
diff --git a/include/ossim/kbool/lpoint.h b/include/ossim/kbool/lpoint.h
index e9fbd3e..a918a17 100644
--- a/include/ossim/kbool/lpoint.h
+++ b/include/ossim/kbool/lpoint.h
@@ -8,7 +8,7 @@
     RCS-ID: $Id: lpoint.h 9094 2006-06-13 19:12:40Z dburken $
 */
 
-/* @@(#) $Source$ $Revision: 9094 $ $Date: 2006-06-13 21:12:40 +0200(mar, 13 giu 2006) $ */
+/* @@(#) $Source$ $Revision: 9094 $ $Date: 2006-06-13 15:12:40 -0400 (Tue, 13 Jun 2006) $ */
 
 /*
 Program	LPOINT.H
diff --git a/include/ossim/parallel/ossimIgen.h b/include/ossim/parallel/ossimIgen.h
index 7d74cfc..b25cc19 100644
--- a/include/ossim/parallel/ossimIgen.h
+++ b/include/ossim/parallel/ossimIgen.h
@@ -10,7 +10,7 @@
 // Description: Class declaration for image generator.
 //
 //*************************************************************************
-// $Id: ossimIgen.h 17815 2010-08-03 13:23:14Z dburken $
+// $Id: ossimIgen.h 20303 2011-11-29 16:11:46Z oscarkramer $
 #ifndef ossimIgen_HEADER
 #define ossimIgen_HEADER
 
@@ -38,12 +38,12 @@ class OSSIM_DLL ossimIgen : public ossimReferenced
 {
 public:
    ossimIgen();
+   virtual ~ossimIgen();
 
    virtual void initialize(const ossimKeywordlist& kwl);
    virtual void outputProduct();
    
 protected:
-   virtual ~ossimIgen();
    void initializeAttributes();
    void slaveSetup();
    bool loadProductSpec();
@@ -55,15 +55,16 @@ protected:
    ossimRefPtr<ossimConnectableContainer> theContainer;
    ossimRefPtr<ossimMapProjection>  theProductProjection;
    ossimRefPtr<ossimImageChain>  theProductChain;
+   ossimRefPtr<ossimTiling>      theTiling;
    ossimDrect        theOutputRect;
    bool              theBuildThumbnailFlag;
    ossimIpt          theThumbnailSize;
    long              theNumberOfTilesToBuffer;
    ossimKeywordlist  theKwl;
    bool              theTilingEnabled;
-   ossimTiling       theTiling;
    bool              theProgressFlag;
    bool              theStdoutFlag;
+   ossim_uint32      theThreadCount;
 
 };
 
diff --git a/include/ossim/parallel/ossimImageChainMtAdaptor.h b/include/ossim/parallel/ossimImageChainMtAdaptor.h
new file mode 100644
index 0000000..6887a6b
--- /dev/null
+++ b/include/ossim/parallel/ossimImageChainMtAdaptor.h
@@ -0,0 +1,122 @@
+//*************************************************************************************************
+//                                            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);
+   ~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/include/ossim/parallel/ossimImageHandlerMtAdaptor.h b/include/ossim/parallel/ossimImageHandlerMtAdaptor.h
new file mode 100644
index 0000000..ecf44ad
--- /dev/null
+++ b/include/ossim/parallel/ossimImageHandlerMtAdaptor.h
@@ -0,0 +1,101 @@
+//**************************************************************************************************
+//                          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/include/ossim/parallel/ossimJob.h b/include/ossim/parallel/ossimJob.h
new file mode 100644
index 0000000..370fc33
--- /dev/null
+++ b/include/ossim/parallel/ossimJob.h
@@ -0,0 +1,266 @@
+//**************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+//**************************************************************************************************
+//  $Id$
+#ifndef ossimJob_HEADER
+#define ossimJob_HEADER
+#include <ossim/base/ossimObject.h>
+#include <OpenThreads/Mutex>
+#include <OpenThreads/ScopedLock>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimString.h>
+#include <list>
+
+class ossimJob;
+
+//*************************************************************************************************
+//! Generic callback class needed by ossimJob
+//*************************************************************************************************
+class OSSIM_DLL ossimJobCallback : public ossimReferenced
+{
+public:
+   ossimJobCallback(ossimJobCallback* nextCallback=0):m_nextCallback(nextCallback){}
+
+   virtual void ready(ossimJob* job)    {if(m_nextCallback.valid()) m_nextCallback->ready(job);   }
+   virtual void started(ossimJob* job)  {if(m_nextCallback.valid()) m_nextCallback->started(job); }
+   virtual void finished(ossimJob* job) {if(m_nextCallback.valid()) m_nextCallback->finished(job);}
+   virtual void canceled(ossimJob* job) {if(m_nextCallback.valid()) m_nextCallback->canceled(job);}
+
+   virtual void nameChanged(const ossimString& name, ossimJob* job)
+   {if(m_nextCallback.valid()) m_nextCallback->nameChanged(name, job);}
+   
+   virtual void descriptionChanged(const ossimString& description, ossimJob* job)
+   {if(m_nextCallback.valid()) m_nextCallback->descriptionChanged(description, job);}
+
+   virtual void idChanged(const ossimString& id, ossimJob* job)
+   {if(m_nextCallback.valid()) m_nextCallback->idChanged(id, job);}
+
+   virtual void percentCompleteChanged(double percentValue, ossimJob* job)
+   {if(m_nextCallback.valid()) m_nextCallback->percentCompleteChanged(percentValue, job);}
+
+   void setCallback(ossimJobCallback* c){m_nextCallback = c;}
+   ossimJobCallback* callback(){return m_nextCallback.get();}
+
+protected:
+   ossimRefPtr<ossimJobCallback> m_nextCallback;
+};
+
+
+//*************************************************************************************************
+//! Pure virtual base class for all job types
+//*************************************************************************************************
+class OSSIM_DLL ossimJob : public ossimObject
+{
+public:
+   typedef std::list<ossimRefPtr<ossimJob> > List;
+
+   /** 
+   * This is a Bit vector.  The only value that can be assigned as both active is FINISHED and CANCEL.
+   * CANCELED job may not yet be finished.  Once the job is finished the Cancel is complete
+   */ 
+   enum State
+   {
+      ossimJob_NONE     = 0,
+      ossimJob_READY    = 1,
+      ossimJob_RUNNING  = 2,
+      ossimJob_CANCEL   = 4,
+      ossimJob_FINISHED = 8,
+      ossimJob_ALL = (ossimJob_READY|ossimJob_RUNNING|ossimJob_CANCEL|ossimJob_FINISHED)
+   };
+   
+   ossimJob() : m_state(ossimJob_READY),  m_priority(0.0) {}
+
+   virtual void start()=0;
+   
+   void setPercentComplete(double value)
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+      if(m_callback.valid())
+      {
+         m_callback->percentCompleteChanged(value, this);
+      }
+   }
+
+   void setPriority(double value)
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+      m_priority = value;
+   }
+
+   double priority()const
+   {
+      return m_priority;
+   }
+
+   virtual void release(){}
+
+   State state()const
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+      return m_state;
+   }
+
+   virtual void resetState(int value)
+   {
+      m_jobMutex.lock();
+      if(value != m_state)
+      {
+         m_state = ossimJob_NONE;
+         m_jobMutex.unlock();
+         setState(value);
+      }
+      else 
+      {
+         m_jobMutex.unlock();
+      }
+
+   }
+
+   virtual void setState(int value, bool on=true);
+
+   bool isCanceled()const
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+      return (m_state & ossimJob_CANCEL);
+   }
+
+   virtual void cancel()
+   {
+      // append the cancel flag to current state
+      setState(ossimJob_CANCEL);
+   }
+
+   virtual void ready()
+   {
+      resetState(ossimJob_READY);
+   }
+
+   virtual void running()
+   {
+      resetState(ossimJob_RUNNING);
+   }
+
+   virtual void finished()
+   {
+      int newState = 0;
+      {
+         // maintain the cancel flag so we can indicate the job has now finished
+         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+         newState = ((m_state & ossimJob_CANCEL) | 
+            (ossimJob_FINISHED));
+      }
+      // now reset to the new state
+      resetState(newState);
+   }
+
+   bool isReady()const
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+      return m_state & ossimJob_READY;
+   }
+
+   bool isStopped()const
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+      return (m_state & ossimJob_FINISHED);
+   }
+
+   bool isFinished()const
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+      return (m_state & ossimJob_FINISHED);
+   }
+
+   bool isRunning()const
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+      return (m_state & ossimJob_RUNNING);
+   }
+
+   void setCallback(ossimJobCallback* callback)
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+      m_callback = callback;
+   }
+
+   void setName(const ossimString& value)
+   {
+      bool changed = false;
+      ossimRefPtr<ossimJobCallback> callback;
+      {
+         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+         changed = value!=m_name;
+         m_name = value;
+         callback = m_callback;
+      }
+      if(changed&&callback.valid())
+      {
+         callback->nameChanged(value, this);
+      }
+   }
+
+   const ossimString& name()const
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+      return m_name;
+   }
+
+   void setId(const ossimString& value)
+   {
+      bool changed = false;
+      ossimRefPtr<ossimJobCallback> callback;
+      {
+         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+         changed = value!=m_id;
+         m_id = value;
+         callback = m_callback;
+      }
+      if(changed&&callback.valid())
+      {
+         callback->idChanged(value, this);
+      }
+   }
+
+   const ossimString& id()const
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+      return m_id;
+   }
+
+   void setDescription(const ossimString& value)
+   {
+      bool changed = false;
+      ossimRefPtr<ossimJobCallback> callback;
+      {
+         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+         changed = value!=m_description;
+         m_description = value;
+         callback = m_callback;
+      }
+      if(changed&&callback.valid())
+      {
+         callback->descriptionChanged(value, this);
+      }
+   }
+
+   const ossimString& description()const
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+      return m_description;
+   }
+   ossimJobCallback* callback() {return m_callback.get();}
+
+protected:
+   mutable OpenThreads::Mutex m_jobMutex;
+   ossimString m_name;
+   ossimString m_description;
+   ossimString m_id;
+   State       m_state;
+   double      m_priority;
+   ossimRefPtr<ossimJobCallback> m_callback;
+};
+
+#endif
diff --git a/include/ossim/parallel/ossimJobMultiThreadQueue.h b/include/ossim/parallel/ossimJobMultiThreadQueue.h
new file mode 100644
index 0000000..43c08d0
--- /dev/null
+++ b/include/ossim/parallel/ossimJobMultiThreadQueue.h
@@ -0,0 +1,27 @@
+#ifndef ossimJobMultiThreadQueue_HEADER
+#define ossimJobMultiThreadQueue_HEADER
+#include <ossim/parallel/ossimJobThreadQueue.h>
+
+class OSSIM_DLL ossimJobMultiThreadQueue : public ossimReferenced
+{
+public:
+   typedef std::vector<ossimRefPtr<ossimJobThreadQueue> > ThreadQueueList;
+   
+   ossimJobMultiThreadQueue(ossimJobQueue* q=0, ossim_uint32 nThreads=0);
+   ossimJobQueue* getJobQueue();
+   const ossimJobQueue* getJobQueue()const;
+   void setQueue(ossimJobQueue* q);
+   void setNumberOfThreads(ossim_uint32 nThreads);
+   ossim_uint32 getNumberOfThreads() const;
+   ossim_uint32 numberOfBusyThreads()const;
+   bool areAllThreadsBusy()const;
+   
+   bool hasJobsToProcess()const;
+
+protected:
+   mutable OpenThreads::Mutex  m_mutex;
+   ossimRefPtr<ossimJobQueue> m_jobQueue;
+   ThreadQueueList m_threadQueueList;
+};
+
+#endif
diff --git a/include/ossim/parallel/ossimJobQueue.h b/include/ossim/parallel/ossimJobQueue.h
new file mode 100644
index 0000000..4a9c4b4
--- /dev/null
+++ b/include/ossim/parallel/ossimJobQueue.h
@@ -0,0 +1,58 @@
+//**************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+//**************************************************************************************************
+//  $Id$
+#ifndef ossimJobQueue_HEADER
+#define ossimJobQueue_HEADER
+
+#include <ossim/parallel/ossimJob.h>
+#include <OpenThreads/Block>
+
+//*************************************************************************************************
+//! Class for maintaining an ordered list of jobs to be processed. As the jobs are completed and
+//! the product consumed, the jobs are removed from this list
+//*************************************************************************************************
+class OSSIM_DLL ossimJobQueue : public ossimReferenced
+{
+public:
+   class OSSIM_DLL Callback : public ossimReferenced
+   {
+   public:
+      Callback(){}
+      virtual void adding(ossimJobQueue* /*q*/, ossimJob* /*job*/){}
+      virtual void added(ossimJobQueue* /*q*/, ossimJob* /*job*/){}
+      virtual void removed(ossimJobQueue* /*q*/, ossimJob* /*job*/){}
+   protected:
+   };
+   ossimJobQueue();
+   
+   virtual void add(ossimJob* job, bool guaranteeUniqueFlag=true);
+   virtual ossimRefPtr<ossimJob> removeByName(const ossimString& name);
+   virtual ossimRefPtr<ossimJob> removeById(const ossimString& id);
+   virtual void remove(const ossimJob* Job);
+   virtual void removeStoppedJobs();
+   virtual void clear();
+   virtual ossimRefPtr<ossimJob> nextJob(bool blockIfEmptyFlag=true);
+   virtual void releaseBlock();
+   bool isEmpty()const;
+   ossim_uint32 size();
+   void setCallback(Callback* c);
+   Callback* callback();
+   
+protected:
+   ossimJob::List::iterator findById(const ossimString& id);
+   ossimJob::List::iterator findByName(const ossimString& name);
+   ossimJob::List::iterator findByPointer(const ossimJob* job);
+   ossimJob::List::iterator findByNameOrPointer(const ossimJob* job);
+   bool hasJob(ossimJob* job);
+   
+   mutable OpenThreads::Mutex m_jobQueueMutex;
+   OpenThreads::Block m_block;
+   ossimJob::List m_jobQueue;
+   ossimRefPtr<Callback> m_callback;
+};
+
+#endif
diff --git a/include/ossim/parallel/ossimJobThreadQueue.h b/include/ossim/parallel/ossimJobThreadQueue.h
new file mode 100644
index 0000000..1e03dc5
--- /dev/null
+++ b/include/ossim/parallel/ossimJobThreadQueue.h
@@ -0,0 +1,48 @@
+#ifndef ossimJobThreadQueue_HEADER
+#define ossimJobThreadQueue_HEADER
+#include <ossim/parallel/ossimJobQueue.h>
+#include <OpenThreads/Mutex>
+#include <OpenThreads/Thread>
+
+class OSSIM_DLL ossimJobThreadQueue : public ossimReferenced, 
+                                      public OpenThreads::Thread
+{
+public:
+   ossimJobThreadQueue(ossimJobQueue* jqueue=0);
+   void setJobQueue(ossimJobQueue* jqueue);
+   
+   ossimJobQueue* getJobQueue();
+   
+   const ossimJobQueue* getJobQueue() const; 
+   
+   ossimRefPtr<ossimJob> currentJob();
+   
+   void cancelCurrentJob();
+   bool isValidQueue()const;
+   
+   virtual void run();
+   
+   void setDone(bool done);
+   
+   bool isDone()const;
+   virtual int cancel();
+   bool isEmpty()const;
+   
+   bool isProcessingJob()const;
+   
+   bool hasJobsToProcess()const;
+   
+protected:
+   virtual ~ossimJobThreadQueue();
+   
+   void startThreadForQueue();
+   virtual ossimRefPtr<ossimJob> nextJob();
+   
+   bool                       m_doneFlag;
+   mutable OpenThreads::Mutex m_threadMutex;
+   ossimRefPtr<ossimJobQueue> m_jobQueue;
+   ossimRefPtr<ossimJob>      m_currentJob;
+   
+};
+
+#endif
diff --git a/include/ossim/parallel/ossimMtDebug.h b/include/ossim/parallel/ossimMtDebug.h
new file mode 100644
index 0000000..826dfef
--- /dev/null
+++ b/include/ossim/parallel/ossimMtDebug.h
@@ -0,0 +1,44 @@
+#ifndef ossimMtDebug_HEADER
+#define ossimMtDebug_HEADER
+
+//*************************************************************************************************
+//! For debugging purposes. To be removed with final release:
+//*************************************************************************************************
+class OSSIMDLLEXPORT ossimMtDebug
+{
+   friend class ossimMultiThreadSequencer;
+   friend class ossimImageChainMtAdaptor;
+   friend class ossimImageHandlerMtAdaptor;
+
+public:
+   ossimMtDebug() 
+      : handlerCacheEnabled (false), 
+      handlerUseFauxTile (false),
+      chainDebugEnabled (false),
+      chainSharedHandlers (false),
+      seqDebugEnabled (false),
+      seqTimedBlocksDt (0),
+      seqMetricsEnabled (false),
+      maxTileCacheSize (0) { m_instance = this; }
+
+   static ossimMtDebug* instance()
+   { 
+      if (m_instance == NULL) 
+         m_instance = new ossimMtDebug; 
+      return m_instance; 
+   }
+   
+   bool handlerCacheEnabled;
+   bool handlerUseFauxTile;
+   bool chainDebugEnabled;
+   bool chainSharedHandlers;
+   bool seqDebugEnabled;
+   ossim_uint32 seqTimedBlocksDt;
+   bool seqMetricsEnabled;
+   ossim_uint32 maxTileCacheSize;
+
+private:
+   static ossimMtDebug* m_instance;
+};
+
+#endif
diff --git a/include/ossim/parallel/ossimMultiThreadSequencer.h b/include/ossim/parallel/ossimMultiThreadSequencer.h
new file mode 100644
index 0000000..bd084b4
--- /dev/null
+++ b/include/ossim/parallel/ossimMultiThreadSequencer.h
@@ -0,0 +1,142 @@
+//**************************************************************************************************
+//                          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/include/ossim/parallel/ossimOrthoIgen.h b/include/ossim/parallel/ossimOrthoIgen.h
index 95cd185..93effe1 100644
--- a/include/ossim/parallel/ossimOrthoIgen.h
+++ b/include/ossim/parallel/ossimOrthoIgen.h
@@ -10,7 +10,7 @@
 // Description: Class declaration for ortho-image generator.
 //
 //*************************************************************************
-// $Id: ossimOrthoIgen.h 17815 2010-08-03 13:23:14Z dburken $
+// $Id: ossimOrthoIgen.h 20936 2012-05-18 14:45:00Z oscarkramer $
 
 #ifndef ossimOrthoIgen_HEADER
 #define ossimOrthoIgen_HEADER
@@ -33,6 +33,7 @@ class ossimConnectableObject;
 class ossimMapProjection;
 class ossimImageSource;
 class ossimImageHandler;
+class ossimImageCombiner;
 
 class OSSIM_DLL ossimOrthoIgen : public ossimIgen
 {
@@ -51,7 +52,7 @@ public:
       OSSIM_CENTER_ORIGIN     = 0,
       OSSIM_UPPER_LEFT_ORIGIN = 1
    };
-   typedef std::map<ossimString,ossimString> PropertyMap;
+   typedef std::map<ossimString,ossimString, ossimStringLtstr> PropertyMap;
    
    ossimOrthoIgen();
 
@@ -107,7 +108,7 @@ protected:
    ossimOrthoIgenProjectionType theProjectionType;
    ossimString   theProjectionName;
    ossimString   theCrsString;
-   ossim_float64 theGeographicOriginOfLatitude;
+   ossim_float64 theGeoScalingLatitude;
    ossimString   theCombinerType;
    ossimString   theResamplerType;
    ossimString   theWriterType;
@@ -129,14 +130,23 @@ protected:
    ossim_float64 theHighPercentClip;
    ossim_int32   theStdDevClip;
    bool          theUseAutoMinMaxFlag;
-   bool          theScaleToEightBitFlag;
-   PropertyMap   theWriterProperties;
-   bool          theCutRectSpecIsConsolidated;
+   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.
    *
@@ -147,6 +157,20 @@ protected:
    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.
@@ -170,13 +194,6 @@ protected:
                  bool withEncodedEntry);
 
    /**
-   * Implemented to fix the misalignment between the input projection and the product. This was
-   * due to an UL corner in the product that was not an integral distance (in pixels) from the UL
-   * corner of the input image (assuming single input). OLK 3/10
-   */
-   void snapTiePointToRefProj();
-
-   /**
    * Consolidates specification of bounding rect given various ways of specifying on the command
    * line. This avoids multiple, redundant checks scattered throughout the code.
    */
@@ -202,6 +219,31 @@ protected:
    */
    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/plugin/ossimDynamicLibrary.h b/include/ossim/plugin/ossimDynamicLibrary.h
index 0b7c027..fec12d6 100644
--- a/include/ossim/plugin/ossimDynamicLibrary.h
+++ b/include/ossim/plugin/ossimDynamicLibrary.h
@@ -8,14 +8,12 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimDynamicLibrary.h 13600 2008-09-24 15:11:44Z gpotts $
+// $Id: ossimDynamicLibrary.h 20694 2012-03-19 12:22:05Z dburken $
 #ifndef ossimDynamicLibrary_HEADER
-#define ossimDynamicLibrary_HEADER
+#define ossimDynamicLibrary_HEADER 1
 
 #include <ossim/base/ossimString.h>
-#include <ossim/base/ossimRtti.h>
 #include <ossim/base/ossimReferenced.h>
-
 #include <ossim/ossimConfig.h>
 
 #if defined(_WIN32) || defined(__WIN32__)
@@ -46,21 +44,20 @@ public:
    void *getSymbol(const ossimString& name) const;
 
    const ossimString& getName()const
-      {
-         return theLibraryName;
-      }
+   {
+      return theLibraryName;
+   }
    
 protected:
-    // the handle to DLL or NULL
+   // the handle to DLL or NULL
 #if defined(_WIN32)
-	HINSTANCE theLibrary;
+   HINSTANCE theLibrary;
 #else
-	void* theLibrary;
+   void* theLibrary;
 #endif
    ossimString theLibraryName;
 
-TYPE_DATA
 };
 
-
 #endif
+
diff --git a/include/ossim/plugin/ossimPluginLibrary.h b/include/ossim/plugin/ossimPluginLibrary.h
index b43356a..1be043d 100644
--- a/include/ossim/plugin/ossimPluginLibrary.h
+++ b/include/ossim/plugin/ossimPluginLibrary.h
@@ -5,9 +5,9 @@
 // Author: Garrett Potts (gpotts at imagelinks)
 //
 //*************************************************************************
-// $Id: ossimPluginLibrary.h 18967 2011-02-25 19:40:48Z gpotts $
+// $Id: ossimPluginLibrary.h 20694 2012-03-19 12:22:05Z dburken $
 #ifndef ossimPluginLibrary_HEADER
-#define ossimPluginLibrary_HEADER
+#define ossimPluginLibrary_HEADER 1
 #include <ossim/plugin/ossimSharedObjectBridge.h>
 #include <ossim/plugin/ossimDynamicLibrary.h>
 
@@ -25,8 +25,6 @@ public:
 protected:
    ossimString m_options;
    ossimSharedObjectInfo* m_info;
-
-TYPE_DATA
 };
 
 #endif 
diff --git a/include/ossim/projection/ossimAlphaSensor.h b/include/ossim/projection/ossimAlphaSensor.h
new file mode 100644
index 0000000..7e07c7d
--- /dev/null
+++ b/include/ossim/projection/ossimAlphaSensor.h
@@ -0,0 +1,97 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Dave Hicks
+//
+// Description:  Alpha Sensor Base Class
+//
+//*******************************************************************
+//  $Id$
+#ifndef ossimAlphaSensor_HEADER
+#define ossimAlphaSensor_HEADER 1
+#include <ossim/projection/ossimSensorModel.h>
+
+class OSSIM_DLL ossimAlphaSensor : public ossimSensorModel
+{
+public:
+   ossimAlphaSensor();
+
+   ossimAlphaSensor(const ossimAlphaSensor& src);
+
+   virtual ossimObject* dup()const;
+   
+      
+   virtual void lineSampToWorld(const ossimDpt& image_point,
+                                ossimGpt&       worldPoint) const;
+
+   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
+                                const double&   heightEllipsoid,
+                                ossimGpt&       worldPoint) const;
+
+   virtual void updateModel();
+
+   inline virtual bool useForward()const {return true;}
+   
+   virtual void initAdjustableParameters();
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+
+   void setFov(const double fov);
+   void setRollBias(const double rollBias);
+   void setPitchBias(const double pitchBias);
+   void setHeadingBias(const double headingBias);
+   void setSlitRot(const double slitRot);
+
+   void setRollPoly(const std::vector< ossim_float64 > rollPoly);
+   void setPitchPoly(const std::vector< ossim_float64 > pitchPoly);
+   void setHeadingPoly(const std::vector< ossim_float64 > headingPoly);
+   void setLonPoly(const std::vector< ossim_float64 > lonPoly);
+   void setLatPoly(const std::vector< ossim_float64 > latPoly);
+   void setAltPoly(const std::vector< ossim_float64 > altPoly);
+   void setScanPoly(const std::vector< ossim_float64 > scanPoly);
+
+   void getPositionOrientation(const ossim_float64& line,
+                                     ossimEcefPoint& pos,
+                                     NEWMAT::Matrix& cam2EcfRot)const;
+
+   ossimEcefPoint getCameraPosition(const ossim_float64& line)const;
+
+   NEWMAT::Matrix getPlatform2LocalRot(const ossim_float64& line)const;
+
+   ossim_float64  evalPoly(const std::vector<ossim_float64>& polyCoef,
+                           const ossim_float64& line)const;
+   
+protected:
+   NEWMAT::Matrix formHPRmat(const ossim_float64& roll,
+                             const ossim_float64& pitch,
+                             const ossim_float64& heading)const;
+
+   NEWMAT::Matrix formLLAmat(const ossim_float64& lat,
+                             const ossim_float64& lon,
+                             const ossim_float64& az)const;
+
+   ossim_float64 m_rollBias;
+   ossim_float64 m_pitchBias;
+   ossim_float64 m_headingBias;
+   ossim_float64 m_fov;
+   ossim_float64 m_slitRot;
+
+   ossim_float64 m_focalLength;
+
+   std::vector< ossim_float64 > m_rollPoly;
+   std::vector< ossim_float64 > m_pitchPoly;
+   std::vector< ossim_float64 > m_headingPoly;
+   std::vector< ossim_float64 > m_lonPoly;
+   std::vector< ossim_float64 > m_latPoly;
+   std::vector< ossim_float64 > m_altPoly;
+   std::vector< ossim_float64 > m_scanPoly;
+
+   // Bias rotation matrix
+   NEWMAT::Matrix m_cam2Platform;
+  
+   ossim_float64 m_adjustedFocalLength;
+   TYPE_DATA
+};
+
+#endif // #ifndef ossimAlphaSensor_HEADER
diff --git a/include/ossim/projection/ossimAlphaSensorHRI.h b/include/ossim/projection/ossimAlphaSensorHRI.h
new file mode 100644
index 0000000..e38f689
--- /dev/null
+++ b/include/ossim/projection/ossimAlphaSensorHRI.h
@@ -0,0 +1,50 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Dave Hicks
+//
+// Description:  Alpha HRI Sensor Model
+//
+//*******************************************************************
+//  $Id$
+#ifndef ossimAlphaSensorHRI_HEADER
+#define ossimAlphaSensorHRI_HEADER 1
+#include <ossim/projection/ossimAlphaSensor.h>
+
+class ossimAlphaSensorSupportData;
+
+class OSSIM_DLL ossimAlphaSensorHRI : public ossimAlphaSensor
+{
+public:
+   ossimAlphaSensorHRI();
+
+   ossimAlphaSensorHRI(const ossimAlphaSensorHRI& src);
+
+   virtual ossimObject* dup()const;
+   
+   virtual void imagingRay(const ossimDpt& image_point,
+                           ossimEcefRay&   image_ray) const;
+
+   virtual void worldToLineSample(const ossimGpt& world_point,
+                                  ossimDpt&       image_point) const;
+
+   virtual void updateModel();
+   
+   virtual void initAdjustableParameters();
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+   
+   /**
+    * @brief Initializes model from support data and calls update Model on 
+    * success.
+    * @param supData
+    * @return true on success, false on error.
+    */
+   virtual bool initialize( const ossimAlphaSensorSupportData& supData );
+   
+protected:
+   TYPE_DATA
+};
+
+#endif // #ifndef ossimAlphaSensorHRI_HEADER
diff --git a/include/ossim/projection/ossimAlphaSensorHSI.h b/include/ossim/projection/ossimAlphaSensorHSI.h
new file mode 100644
index 0000000..940f319
--- /dev/null
+++ b/include/ossim/projection/ossimAlphaSensorHSI.h
@@ -0,0 +1,52 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Dave Hicks
+//
+// Description:  Alpha HSI Sensor Model
+//
+//*******************************************************************
+//  $Id$
+#ifndef ossimAlphaSensorHSI_HEADER
+#define ossimAlphaSensorHSI_HEADER 1
+#include <ossim/projection/ossimAlphaSensor.h>
+
+class ossimAlphaSensorSupportData;
+
+class OSSIM_DLL ossimAlphaSensorHSI : public ossimAlphaSensor
+{
+public:
+   ossimAlphaSensorHSI();
+
+   ossimAlphaSensorHSI(const ossimAlphaSensorHSI& src);
+
+   virtual ossimObject* dup()const;
+   
+   virtual void imagingRay(const ossimDpt& image_point,
+                           ossimEcefRay&   image_ray) const;
+   
+   virtual void worldToLineSample(const ossimGpt& world_point,
+                                  ossimDpt&       image_point) const;
+
+   virtual void updateModel();
+   
+   virtual void initAdjustableParameters();
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+
+   ossim_float64 getScanAngle(const ossim_float64& line)const;
+   
+   /**
+    * @brief Initializes model from support data and calls update Model on 
+    * success.
+    * @param supData
+    * @return true on success, false on error.
+    */
+   virtual bool initialize( const ossimAlphaSensorSupportData& supData );
+
+protected:
+   TYPE_DATA
+};
+
+#endif // #ifndef ossimAlphaSensorHSI_HEADER
diff --git a/include/ossim/projection/ossimApplanixEcefModel.h b/include/ossim/projection/ossimApplanixEcefModel.h
index 8d670d9..2c8ac0d 100644
--- a/include/ossim/projection/ossimApplanixEcefModel.h
+++ b/include/ossim/projection/ossimApplanixEcefModel.h
@@ -6,7 +6,7 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimApplanixEcefModel.h 16174 2009-12-23 16:34:06Z dburken $
+//  $Id: ossimApplanixEcefModel.h 20496 2012-01-25 17:15:43Z gpotts $
 #ifndef ossimApplanixEcefModel_HEADER
 #define ossimApplanixEcefModel_HEADER
 #include <ossim/projection/ossimFcsiModel.h>
@@ -45,6 +45,17 @@ public:
 
    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,
diff --git a/include/ossim/projection/ossimBuckeyeSensor.h b/include/ossim/projection/ossimBuckeyeSensor.h
index 3421f8e..9a79062 100644
--- a/include/ossim/projection/ossimBuckeyeSensor.h
+++ b/include/ossim/projection/ossimBuckeyeSensor.h
@@ -1,142 +1,134 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// 
-//*******************************************************************
-//  $Id$
-#ifndef ossimBuckeyeSensor_HEADER
-#define ossimBuckeyeSensor_HEADER
-#include "ossimSensorModel.h"
-#include "ossimSmacCallibrationSystem.h"
-#include "ossimUtmProjection.h"
-
-/**
- * The Buckey sensor has a set of simple orientation paramters.  For this model we are using the
- * orientation paramters found in the MetaData_GSTI.txt file typically found in the directory where the
- * imagery sits.
- *
- * There are 2 forms the class takes for keyword lists.  The first allows one to point
- * to a file containing the frame numbers and all the orientation paramters. You will still
- * need to define the Camera information and callibrartion paramters.  The pixel_size, 
- * focal_length and principal point are all in millimeters. 
- *
- * <pre>
- * EXAMPLE 1:
- *
- * type: ossimBuckeyeSensor
- * framemeta_gsti: /data/buckey/01-31 at 09/01-31 at 09/10-39-48/FrameMeta_GSTI.txt
- * frame_number: 10001
- * pixel_size: (0.0068,0.0068)
- * focal_length: 211.0211
- * principal_point: (-0.1853,1.2428)
- * smac_radial: -.2165e-3 .4230e-7 -.1652e-11 .2860e-19 .5690e-26
- * smac_decent: -.1483e-6 .1558e-6 -.1464e-18 .1233e-38
- * rect: 0 0 7239 5432
- *
- *
- * EXAMPLE 2:
- * roll: 0.074405
- * pitch: 2.849851
- * yaw: 269.517649
- * platform_position: (34.927014,69.353684,3757.12,WGE)
- * pixel_size: (0.0068,0.0068)
- * focal_length: 211.0211
- * principal_point: (-0.1853,1.2428)
- * smac_radial: -.2165e-3 .4230e-7 -.1652e-11 .2860e-19 .5690e-26
- * smac_decent: -.1483e-6 .1558e-6 -.1464e-18 .1233e-38
- * rect: 0 0 7239 5432
- */
-class OSSIM_DLL ossimBuckeyeSensor : public ossimSensorModel
-{
-public:
-   ossimBuckeyeSensor();
-   ossimBuckeyeSensor(const ossimBuckeyeSensor& src)
-   :ossimSensorModel(src),
-   m_compositeMatrix(src.m_compositeMatrix),
-   m_compositeMatrixInverse(src.m_compositeMatrixInverse),
-   m_roll(src.m_roll),
-   m_pitch(src.m_pitch),
-   m_yaw(src.m_yaw),
-   m_principalPoint(src.m_principalPoint), // in millimeters
-   m_pixelSize(src.m_pixelSize),      // in millimeters
-   m_focalLength(src.m_focalLength),    // in millimeters
-   m_ecefPlatformPosition(src.m_ecefPlatformPosition),
-   m_platformPosition(src.m_platformPosition),
-   m_lensDistortion(src.m_lensDistortion)
-   {
-   }
-   virtual ossimObject* dup()const
-   {
-      return new ossimBuckeyeSensor(*this);
-   }
-   
-   virtual void imagingRay(const ossimDpt& image_point,
-                           ossimEcefRay&   image_ray) const;
-
-   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
-                                        const double&   heightEllipsoid,
-                                        ossimGpt&       worldPoint) const;
-   void lineSampleToWorld(const ossimDpt& image_point,
-                          ossimGpt&       gpt) const;
-   
-//   virtual void worldToLineSample(const ossimGpt& world_point,
-//                                  ossimDpt&       image_point) const;
-   virtual void updateModel();
-   
-   void setRollPitchYaw(double r, double p, double y)
-   {
-      m_roll  = r;
-      m_pitch = p;
-      m_yaw   = y;
-   }
-   void setFocalLength(double value)
-   {
-      m_focalLength = value;
-   }
-   void setPlatformPosition(const ossimGpt& value)
-   {
-      m_platformPosition     = value;
-      m_ecefPlatformPosition = value;
-   }
-   
-   void setPrincipalPoint(const ossimDpt& value)
-   {
-      m_principalPoint = value;
-   }
-   void setPixelSize(const ossimDpt& value)
-   {
-      m_pixelSize = value;
-   }
-   inline virtual bool useForward()const {return true;} //!ground to image faster (you don't need DEM) //TBC
-   
-   void setLensDistortion(ossimSmacCallibrationSystem* distortion)
-   {
-      m_lensDistortion = distortion;
-   }
-   virtual void initAdjustableParameters();
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-   
-protected:
-   NEWMAT::Matrix m_compositeMatrix;
-   NEWMAT::Matrix m_compositeMatrixInverse;
-   double         m_roll;
-   double         m_pitch;
-   double         m_yaw;
-   ossimDpt       m_principalPoint; // in millimeters
-   ossimDpt       m_pixelSize;      // in millimeters
-   double         m_focalLength;    // in millimeters
-   ossimEcefPoint m_ecefPlatformPosition;
-   ossimGpt       m_platformPosition;
-   
-   ossimRefPtr<ossimSmacCallibrationSystem> m_lensDistortion;
-   
-TYPE_DATA
-};
-
-#endif
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// 
+//*******************************************************************
+//  $Id$
+#ifndef ossimBuckeyeSensor_HEADER
+#define ossimBuckeyeSensor_HEADER
+/**
+ * The Buckey sensor has a set of simple orientation paramters.  For this model we are using the
+ * orientation paramters found in the MetaData_GSTI.txt file typically found in the directory where the
+ * imagery sits.
+ *
+ * There are 2 forms the class takes for keyword lists.  The first allows one to point
+ * to a file containing the frame numbers and all the orientation paramters. You will still
+ * need to define the Camera information and callibrartion paramters.  The pixel_size, 
+ * focal_length and principal point are all in millimeters. 
+ *
+ * <pre>
+ * EXAMPLE 1:
+ *
+ * type: ossimBuckeyeSensor
+ * framemeta_gsti: /data/buckey/01-31 at 09/01-31 at 09/10-39-48/FrameMeta_GSTI.txt
+ * frame_number: 10001
+ * pixel_size: (0.0068,0.0068)
+ * focal_length: 211.0211
+ * principal_point: (-0.1853,1.2428)
+ * smac_radial: -.2165e-3 .4230e-7 -.1652e-11 .2860e-19 .5690e-26
+ * smac_decent: -.1483e-6 .1558e-6 -.1464e-18 .1233e-38
+ * rect: 0 0 7239 5432
+ *
+ *
+ * EXAMPLE 2:
+ * roll: 0.074405
+ * pitch: 2.849851
+ * yaw: 269.517649
+ * platform_position: (34.927014,69.353684,3757.12,WGE)
+ * pixel_size: (0.0068,0.0068)
+ * focal_length: 211.0211
+ * principal_point: (-0.1853,1.2428)
+ * smac_radial: -.2165e-3 .4230e-7 -.1652e-11 .2860e-19 .5690e-26
+ * smac_decent: -.1483e-6 .1558e-6 -.1464e-18 .1233e-38
+ * rect: 0 0 7239 5432
+ */
+#include <ossim/projection/ossimFcsiModel.h>
+#include <ossim/base/ossimDpt3d.h>
+#include "ossimSmacCallibrationSystem.h"
+
+class OSSIM_DLL ossimBuckeyeSensor : public ossimSensorModel
+{
+public:
+   ossimBuckeyeSensor();
+   ossimBuckeyeSensor(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
+   ossimBuckeyeSensor(const ossimBuckeyeSensor& 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 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<ossimSmacCallibrationSystem> theLensDistortion;
+
+
+   ossimEcefPoint theAdjEcefPlatformPosition;
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/projection/ossimEpsgProjectionDatabase.h b/include/ossim/projection/ossimEpsgProjectionDatabase.h
index 383d8f7..d07b7d3 100644
--- a/include/ossim/projection/ossimEpsgProjectionDatabase.h
+++ b/include/ossim/projection/ossimEpsgProjectionDatabase.h
@@ -6,19 +6,22 @@
 // Author: Oscar Kramer
 //
 //*************************************************************************************************
-//  $Id$
+//  $Id: ossimEpsgProjectionDatabase.h 21511 2012-08-21 22:00:11Z dburken $
 
 #ifndef ossimEpsgProjectionDatabase_HEADER
-#define 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 ossimMapProjection;
 class ossimEpsgProjectionFactory;
+class ossimUtmProjection;
 
 //*************************************************************************************************
 //! Projection Database for coded projections defined in database files and specified via some 
@@ -67,20 +70,35 @@ public:
 
    //! ENGINEERING CODE. Used for testing
    size_t numRecords() const { return m_projDatabase.size(); }
-   ossim_uint32 getEpsgCode(unsigned int index) const { return m_projDatabase[index].code; }
 
 protected:
-   //! Represents one line (record) from the database file, split by delimiter into string list.
-   typedef std::vector<ossimString> DbEntry;
+   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)
-   struct ProjRecord
+   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
-      ossimKeywordlist kwl;
+      RecordFormat     csvFormat;
+      std::vector<ossimString>        csvRecord;
+      ossimRefPtr<ossimMapProjection> proj;
    };
 
    //! Constructor loads all Db files specified in the ossim prefs. Protected as part of
@@ -88,30 +106,27 @@ protected:
    ossimEpsgProjectionDatabase();
 
    //! Parses the "Spadac EPSG" Db record format and produces a projection (or NULL if invalid)   
-   ossimMapProjection* createProjFromFormatARecord(const DbEntry& record, bool& datum_valid) const;
+   ossimMapProjection* createProjFromFormatARecord(ProjDbRecord* record) const;
 
    //! Parses the State Plane Db record format and produce a projection (or NULL if invalid)
-   ossimMapProjection* createProjFromFormatBRecord(const DbEntry& record) const;
+   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 arrive 
-   //! at the UTM projection.
+   //! 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();
 
-   //! Throws an exception if datum code is not handled.
-   void checkForUnhandledDatum(const ProjRecord& record) const;
-
-   //! This method collects all custom entries that are added manually to the database (i.e., they 
-   //! are not provided in the DB files or are more efficiently handled this way.
-   void addCustomEntries();
-
-   std::vector<ProjRecord> m_projDatabase;
+   mutable std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> > m_projDatabase;
+   mutable OpenThreads::Mutex m_mutex;
    static ossimEpsgProjectionDatabase*  m_instance; //!< Singleton implementation
-
+   
 };
 
 #endif
diff --git a/include/ossim/projection/ossimEquDistCylProjection.h b/include/ossim/projection/ossimEquDistCylProjection.h
index 518e7a2..92483a2 100644
--- a/include/ossim/projection/ossimEquDistCylProjection.h
+++ b/include/ossim/projection/ossimEquDistCylProjection.h
@@ -8,13 +8,15 @@
 //
 // Calls Geotrans Equidistant Cylinder projection code.  
 //*******************************************************************
-//  $Id: ossimEquDistCylProjection.h 16414 2010-01-26 18:10:18Z gpotts $
+//  $Id: ossimEquDistCylProjection.h 20352 2011-12-12 17:24:52Z dburken $
 
 #ifndef ossimEquDistCylProjection_HEADER
 #define ossimEquDistCylProjection_HEADER
 
 #include <ossim/projection/ossimLlxyProjection.h>
 
+class ossimIpt;
+
 class OSSIMDLLEXPORT ossimEquDistCylProjection : public ossimMapProjection//public ossimLlxyProjection
 {
 public:
@@ -69,12 +71,27 @@ public:
                                         ossimGpt&       worldPt) const;
    virtual void     worldToLineSample(const ossimGpt &worldPoint,
                                       ossimDpt&       lineSample)const;
+
+   /**
+    * @brief Specialized worldToLineSample.
+    * 
+    * Takes into consideration the image size and crossing the date line.
+    * Also makes local points outside of image negative or positive based on
+    * there relative closeness to left or right edge.
+    *
+    * @param worldPoint Ground point to convert to line sample.
+    * @param imageSize Size of image in pixels.
+    * @param lineSample Initialized by this.
+    */
+   void worldToLineSample( const ossimGpt& worldPoint,
+                           const ossimIpt& imageSize,
+                           ossimDpt&       lineSample ) const;
+   
    virtual bool isGeographic()const
    {
       return true;
    }
    void setDefaults();
-//   virtual void setMetersPerPixel(const ossimDpt& pt);
 
    /*!
     * Method to save the state of an object to a keyword list.
@@ -90,7 +107,6 @@ public:
    virtual bool loadState(const ossimKeywordlist& kwl,
                           const char* prefix=0);
    
-   
 private:   
    //---------------------GEOTRANS-------------------------------
    mutable double Eqcy_a;                  /* Semi-major axis of ellipsoid in meters */
diff --git a/include/ossim/projection/ossimIkonosRpcModel.h b/include/ossim/projection/ossimIkonosRpcModel.h
index fab35f3..3943aa3 100644
--- a/include/ossim/projection/ossimIkonosRpcModel.h
+++ b/include/ossim/projection/ossimIkonosRpcModel.h
@@ -13,7 +13,7 @@
 // LIMITATIONS: None.
 //
 //*****************************************************************************
-//  $Id: ossimIkonosRpcModel.h 15766 2009-10-20 12:37:09Z gpotts $
+//  $Id: ossimIkonosRpcModel.h 20606 2012-02-24 12:29:52Z gpotts $
 
 #ifndef ossimIkonosRpcModel_HEADER
 #define ossimIkonosRpcModel_HEADER
diff --git a/include/ossim/projection/ossimImageViewAffineTransform.h b/include/ossim/projection/ossimImageViewAffineTransform.h
index 08ba5bc..2a06aa3 100644
--- a/include/ossim/projection/ossimImageViewAffineTransform.h
+++ b/include/ossim/projection/ossimImageViewAffineTransform.h
@@ -8,7 +8,7 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimImageViewAffineTransform.h 18629 2011-01-04 12:44:14Z gpotts $
+//  $Id: ossimImageViewAffineTransform.h 19803 2011-07-11 11:08:32Z gpotts $
 #ifndef ossimImageViewAffineTransform_HEADER
 #define ossimImageViewAffineTransform_HEADER
 #include <ossim/projection/ossimImageViewTransform.h>
@@ -130,12 +130,21 @@ public:
     */
    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();
    
diff --git a/include/ossim/projection/ossimImageViewProjectionTransform.h b/include/ossim/projection/ossimImageViewProjectionTransform.h
index 7b2ab76..4e964b3 100644
--- a/include/ossim/projection/ossimImageViewProjectionTransform.h
+++ b/include/ossim/projection/ossimImageViewProjectionTransform.h
@@ -13,10 +13,10 @@
 // LIMITATIONS: None.
 //
 //*****************************************************************************
-//  $Id: ossimImageViewProjectionTransform.h 18424 2010-11-16 16:06:04Z gpotts $
+//  $Id: ossimImageViewProjectionTransform.h 20352 2011-12-12 17:24:52Z dburken $
 
 #ifndef ossimImageViewProjectionTransform_HEADER
-#define ossimImageViewProjectionTransform_HEADER
+#define ossimImageViewProjectionTransform_HEADER 1
 
 #include <ossim/projection/ossimImageViewTransform.h>
 #include <ossim/imaging/ossimImageGeometry.h>
@@ -82,6 +82,19 @@ public:
    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;
    
diff --git a/include/ossim/projection/ossimIpodSensor.h b/include/ossim/projection/ossimIpodSensor.h
new file mode 100644
index 0000000..b41f7f6
--- /dev/null
+++ b/include/ossim/projection/ossimIpodSensor.h
@@ -0,0 +1,110 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// SkyBox
+//*******************************************************************
+//  $Id$
+#ifndef ossimIpodSensor_HEADER
+#define ossimIpodSensor_HEADER
+#include "ossimSensorModel.h"
+#include "ossimUtmProjection.h"
+#include <ossim/base/ossimDpt3d.h>
+class OSSIM_DLL ossimIpodSensor : public ossimSensorModel
+{
+public:
+   ossimIpodSensor();
+   ossimIpodSensor(const ossimIpodSensor& src)
+   :ossimSensorModel(src),
+   m_air2Ned(src.m_air2Ned),
+   m_ecef2Ned(src.m_ecef2Ned),
+   m_ecef2NedInverse(src.m_ecef2NedInverse),
+   m_roll(src.m_roll),
+   m_pitch(src.m_pitch),
+   m_yaw(src.m_yaw),
+   m_principalPoint(src.m_principalPoint), // in meters
+   m_pixelSize(src.m_pixelSize),      // in meters
+   m_focalLength(src.m_focalLength),    // in meters
+   m_ecefPlatformPosition(src.m_ecefPlatformPosition),
+   m_platformPosition(src.m_platformPosition),
+   m_platformPositionEllipsoid(src.m_platformPositionEllipsoid),
+   m_fovIntrack(src.m_fovIntrack),
+   m_fovCrossTrack(src.m_fovCrossTrack),
+   m_adjustedPlatformPosition(src.m_adjustedPlatformPosition)
+   {
+   }
+   virtual ossimObject* dup()const
+   {
+      return new ossimIpodSensor(*this);
+   }
+   
+   virtual void imagingRay(const ossimDpt& image_point,
+                           ossimEcefRay&   image_ray) const;
+   
+   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 setRollPitchYaw(double r, double p, double y)
+   {
+      m_roll  = r;
+      m_pitch = p;
+      m_yaw   = y;
+   }
+   void setFocalLength(double value)
+   {
+      m_focalLength = value;
+   }
+   void setPlatformPosition(const ossimGpt& value)
+   {
+      m_platformPosition     = value;
+      m_ecefPlatformPosition = value;
+   }
+   
+   void setPrincipalPoint(const ossimDpt& value)
+   {
+      m_principalPoint = value;
+   }
+   void setPixelSize(const ossimDpt& value)
+   {
+      m_pixelSize = value;
+   }
+   inline virtual bool useForward()const {return true;} //!ground to image faster (you don't need DEM) //TBC
+   
+   virtual void initAdjustableParameters();
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+   
+protected:
+   NEWMAT::Matrix m_air2Ned;
+   NEWMAT::Matrix m_ecef2Ned;
+   NEWMAT::Matrix m_ecef2NedInverse;
+
+   NEWMAT::Matrix m_composite;
+   NEWMAT::Matrix m_compositeInverse;
+
+   double         m_roll;
+   double         m_pitch;
+   double         m_yaw;
+   ossimDpt       m_principalPoint; // in meters
+   ossimDpt       m_pixelSize;      // in meters
+   double         m_focalLength;    // in meters
+   ossimEcefPoint m_ecefPlatformPosition;
+   ossimGpt       m_platformPosition;
+   ossimGpt       m_platformPositionEllipsoid;
+   double         m_fovIntrack;
+   double         m_fovCrossTrack;
+   
+   ossimGpt       m_adjustedPlatformPosition;
+   TYPE_DATA
+};
+
+#endif
+
diff --git a/include/ossim/projection/ossimLlxyProjection.h b/include/ossim/projection/ossimLlxyProjection.h
index bb6a0f3..bdcbcaa 100644
--- a/include/ossim/projection/ossimLlxyProjection.h
+++ b/include/ossim/projection/ossimLlxyProjection.h
@@ -11,7 +11,7 @@
 // synonymous in this projection.
 // 
 //*******************************************************************
-//  $Id: ossimLlxyProjection.h 9968 2006-11-29 14:01:53Z gpotts $
+//  $Id: ossimLlxyProjection.h 19651 2011-05-25 18:49:22Z gpotts $
 
 #ifndef ossimLlxyProjection_HEADER
 #define ossimLlxyProjection_HEADER
@@ -39,12 +39,6 @@ public:
    virtual ossimGpt inverse(const ossimDpt &projectedPoint) const;
    
    /*!
-    * METHOD:  setOrigin(const ossimGpt& origin)
-    * Set the origin of the projection.
-    */
-   virtual void setOrigin(const ossimGpt& origin);
-
-   /*!
     *  METHOD:  getLatSpacing() 
     *  Returns the latitude spacing as a double representing decimal degrees.
     */
diff --git a/include/ossim/projection/ossimMapProjection.h b/include/ossim/projection/ossimMapProjection.h
index 18d3f29..9980168 100644
--- a/include/ossim/projection/ossimMapProjection.h
+++ b/include/ossim/projection/ossimMapProjection.h
@@ -9,7 +9,7 @@
 // Base class for all map projections.
 // 
 //*******************************************************************
-//  $Id: ossimMapProjection.h 19509 2011-05-05 14:11:18Z gpotts $
+//  $Id: ossimMapProjection.h 20133 2011-10-12 19:03:47Z oscarkramer $
 
 #ifndef ossimMapProjection_HEADER
 #define ossimMapProjection_HEADER 1
@@ -100,13 +100,10 @@ public:
    virtual void update();
 
    virtual void setPcsCode(ossim_uint32 pcsCode);
-   virtual void setGcsCode(ossim_uint32 pcsCode);
 
    //! Returns the EPSG PCS code or 32767 if the projection is a custom (non-EPSG) projection
    virtual ossim_uint32 getPcsCode()const;
 
-   virtual ossim_uint32 getGcsCode()const;
-   
    /**
     *  Returns the projection name.
     */
@@ -205,15 +202,8 @@ public:
    //! specification and ignores image geometry differences.
    virtual bool operator==(const ossimProjection& projection) const;
 
-   /**
-    * This will go from the ground point and give
-    * you an approximate lat and lon per pixel. the Delta Lat
-    * and delta lon will be in degrees.
-    */
-   virtual void computeDegreesPerPixel(const ossimGpt& ground,
-                                       const ossimDpt& metersPerPixel,
-                                       double &deltaLat,
-                                       double &deltaLon);
+   //! Computes the approximate resolution in degrees/pixel
+   virtual void computeDegreesPerPixel();
 
    
    /**
@@ -221,19 +211,7 @@ public:
     * you an approximate meters per pixel. the Delta Lat
     * and delta lon will be in degrees.
     */
-   virtual void computeMetersPerPixel(const ossimGpt& center,
-                                      double deltaDegreesPerPixelLat,
-                                      double deltaDegreesPerPixelLon,
-                                      ossimDpt &metersPerPixel);
-
-   /**
-    * This will go from its internal origin of latitude and longitude and give
-    * you an approximate meters per pixel. the Delta Lat
-    * and delta lon will be in degrees.
-    */
-   virtual void computeMetersPerPixel(double deltaDegreesPerPixelLat,
-                                      double deltaDegreesPerPixelLon,
-                                      ossimDpt &metersPerPixel);
+   virtual void computeMetersPerPixel();
 
    void setMatrix(double rotation,
                   const ossimDpt& scale,
@@ -296,6 +274,9 @@ public:
    
    void setProjectionUnits(ossimUnitType units) { theProjectionUnits = units; }
    ossimUnitType getProjectionUnits() const { return theProjectionUnits; }
+   
+   virtual bool isEqualTo(const ossimObject& obj, ossimCompareType compareType = OSSIM_COMPARE_FULL)const;
+
 
 protected:
    
@@ -363,9 +344,6 @@ protected:
    //! EPSG code, then the PCS is set to 32767.
    mutable ossim_uint32      thePcsCode;
 
-   /** Datum code (EPSG). */
-   mutable ossim_uint32      theGcsCode;
-
    bool              theElevationLookupFlag;
 
    // Will always be a 4x4 matrix.
diff --git a/include/ossim/projection/ossimMgrs.h b/include/ossim/projection/ossimMgrs.h
index 0575c17..28a4721 100644
--- a/include/ossim/projection/ossimMgrs.h
+++ b/include/ossim/projection/ossimMgrs.h
@@ -1,5 +1,5 @@
 #ifndef MGRS_H
-  #define MGRS_H
+#define MGRS_H 1
 
 /***************************************************************************/
 /* RSC IDENTIFIER:  MGRS
@@ -107,14 +107,14 @@ extern "C" {
 
    OSSIM_DLL long Set_OSSIM_MGRS_Parameters(double a,
                                             double f,
-                                            char   *Ellipsoid_Code);
+                                            const char* Ellipsoid_Code);
 /*
  * The function Set_MGRS_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 MGRS_NO_ERROR is returned.
  *
  *   a                : Semi-major axis of ellipsoid in meters (input)
- *   f                : Flattening of ellipsoid					       (input)
+ *   f                : Flattening of ellipsoid                (input)
  *   Ellipsoid_Code   : 2-letter code for ellipsoid            (input)
  */
 
diff --git a/include/ossim/projection/ossimPpjFrameSensor.h b/include/ossim/projection/ossimPpjFrameSensor.h
new file mode 100644
index 0000000..0be2080
--- /dev/null
+++ b/include/ossim/projection/ossimPpjFrameSensor.h
@@ -0,0 +1,76 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Dave Hicks
+//
+// Description:  PPJ Frame Model
+//
+//*******************************************************************
+//  $Id$
+#ifndef ossimPpjFrameSensor_HEADER
+#define ossimPpjFrameSensor_HEADER 1
+#include <ossim/projection/ossimSensorModel.h>
+
+class OSSIM_DLL ossimPpjFrameSensor : public ossimSensorModel
+{
+public:
+   ossimPpjFrameSensor();
+
+   ossimPpjFrameSensor(const ossimPpjFrameSensor& src);
+
+   virtual ossimObject* dup()const;
+   
+   virtual void imagingRay(const ossimDpt& image_point,
+                           ossimEcefRay&   image_ray) const;
+   
+   virtual void lineSampleToWorld(const ossimDpt& image_point,
+                                 ossimGpt&       worldPoint) 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 setFocalLength(double focX, double focY);
+
+   void setCameraPosition(const ossimGpt& value);
+   
+   void setPrincipalPoint(const ossimDpt& value);
+
+   void setecef2CamMatrix(const NEWMAT::Matrix& value);
+   void setAveragePrjectedHeight(double averageProjectedHeight);
+
+   inline virtual bool useForward()const {return true;}
+   
+   virtual void initAdjustableParameters();
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+   
+protected:
+   NEWMAT::Matrix m_ecef2Cam;
+   NEWMAT::Matrix m_ecef2CamInverse;
+   ossimDpt       m_principalPoint;   // pixels
+   double         m_focalLengthX;     // pixels
+   double         m_focalLengthY;     // pixels
+   double         m_focalLength;      // pixels
+   ossimEcefPoint m_ecefCameraPosition;
+   ossimGpt       m_cameraPositionEllipsoid;
+
+   // Not used yet
+   double         m_radialK1;
+   double         m_radialK2;
+   double         m_radialP1;
+   double         m_radialP2;
+   
+   ossimGpt       m_adjustedCameraPosition;
+   double         m_adjustedFocalLength;
+   double         m_averageProjectedHeight;
+   TYPE_DATA
+};
+
+#endif /* #ifndef ossimPpjFrameSensor_HEADER */
diff --git a/include/ossim/projection/ossimProjection.h b/include/ossim/projection/ossimProjection.h
index b409a4d..b8a0d0b 100644
--- a/include/ossim/projection/ossimProjection.h
+++ b/include/ossim/projection/ossimProjection.h
@@ -7,7 +7,7 @@
 // Description: Base class for all projections (2D-to-3D transform)
 //
 //*******************************************************************
-//  $Id: ossimProjection.h 17815 2010-08-03 13:23:14Z dburken $
+//  $Id: ossimProjection.h 19793 2011-06-30 13:26:56Z gpotts $
 #ifndef ossimProjection_HEADER
 #define ossimProjection_HEADER
 #include <iostream>
@@ -89,6 +89,11 @@ public:
    virtual bool loadState(const ossimKeywordlist& kwl,
                           const char* prefix=0);
 
+   virtual bool isEqualTo(const ossimObject& obj, ossimCompareType compareType = OSSIM_COMPARE_FULL)const
+   {
+      return ossimObject::isEqualTo(obj, compareType);
+   }
+   
    /*!
     * OPERATOR: ==
     * Compares this instance with arg projection.
diff --git a/include/ossim/projection/ossimQuickbirdRpcModel.h b/include/ossim/projection/ossimQuickbirdRpcModel.h
index de2e354..736e346 100644
--- a/include/ossim/projection/ossimQuickbirdRpcModel.h
+++ b/include/ossim/projection/ossimQuickbirdRpcModel.h
@@ -14,7 +14,7 @@
 // LIMITATIONS: None.
 //
 //*****************************************************************************
-//  $Id: ossimQuickbirdRpcModel.h 17932 2010-08-19 20:34:35Z dburken $
+//  $Id: ossimQuickbirdRpcModel.h 20606 2012-02-24 12:29:52Z gpotts $
 #ifndef ossimQuickbirdRpcModel_HEADER
 #define ossimQuickbirdRpcModel_HEADER
 
diff --git a/include/ossim/projection/ossimRS1SarModel.h b/include/ossim/projection/ossimRS1SarModel.h
new file mode 100644
index 0000000..c2e02ec
--- /dev/null
+++ b/include/ossim/projection/ossimRS1SarModel.h
@@ -0,0 +1,156 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Oscar Kramer
+//
+// Description:
+//
+// Sensor Model for Radarsat1 SAR sensor.
+// 
+//*******************************************************************
+//  $Id:$
+
+#ifndef ossimRS1SarModel_HEADER
+#define ossimRS1SarModel_HEADER 1
+
+#include <ossim/base/ossimLsrPoint.h>
+#include <ossim/base/ossimLsrVector.h>
+#include <ossim/base/ossimEcefPoint.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimDblGrid.h>
+#include <ossim/projection/ossimSarModel.h>
+#include <ossim/base/ossimLagrangeInterpolator.h>
+#include <ossim/support_data/ossimCeosData.h>
+
+// Namespace class forward class declaration.
+namespace NEWMAT
+{
+   class Matrix;
+}
+
+//*****************************************************************************
+// CLASS:  ossimRS1SarModel
+//*****************************************************************************
+class ossimRS1SarModel : public ossimSensorModel
+{
+public:
+   ossimRS1SarModel();
+   ossimRS1SarModel(const ossimFilename& imageDir);
+
+   virtual ~ossimRS1SarModel();
+   
+   enum ImagingMode
+   {
+      UNKNOWN_MODE = 0,
+      SCN,     // ScanSAR Narrow Beam
+      SCW,     // ScanSAR Wide Beam
+      SGC,     // SAR Georeferenced Coarse Resolution
+      SGF,     // SAR Georeferenced Fine Resolution
+      SGX,     // SAR Georeferenced Extra Fine Resolution
+      SLC,     // Single Look Complex
+      SPG,     // SAR Precision Geocoded
+      SSG,     // SAR Systematically Geocoded
+      RAW,
+      ERS
+   };
+
+   enum DirectionFlag
+   {
+      UNKNOWN_DIRECTION = 0,
+      ASCENDING,
+      DESCENDING
+   };
+   
+   //! Fulfills ossimObject base-class pure virtuals. Saves modeling info to KWL.
+   //! Returns true if successful.
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=NULL) const;
+   
+   //! Fulfills ossimObject base-class pure virtuals. Reads modeling info from KWL.
+   //! Returns true if successful.
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=NULL);
+
+   //! Establishes geographic 3D point given image line, sample and ellipsoid height.
+   virtual void lineSampleHeightToWorld(const ossimDpt& imagePt, 
+                                        const double& heightAboveEllipsoid, 
+                                        ossimGpt& worldPt) const;
+
+   //! Given an image point, returns a ray originating at some arbitrarily high
+   //! point (in this model at the sensor position) and pointing towards the target.
+   virtual void imagingRay(const ossimDpt& image_point, ossimEcefRay& image_ray) const;
+
+   inline virtual bool useForward() const { return false; } //!image to ground faster 
+
+   //!  Returns pointer to a new instance, copy of this.
+   virtual ossimObject* dup() const { return 0; } // TBR
+
+protected:
+   void setImagingMode(char* modeStr);
+   void initFromCeos(const ossimFilename& dataDir);
+   void initAdjParms();
+   void establishEphemeris();
+   void eciToEcfXform(const double& julianDay, NEWMAT::Matrix& xform) const;
+   void establishOrpInterp();
+   void establishOrpGrid();
+   void establishVehicleSpace();
+   void interpolatedScanORP(const ossimDpt& orp, ossimEcefPoint& orp_ecf) const;
+   void deallocateMemory();
+   
+   ossimRefPtr<ossimCeosData> theCeosData;
+   ossimRefPtr<ossimLagrangeInterpolator> theArpPosInterp;   // in ECF
+   ossimRefPtr<ossimLagrangeInterpolator> theArpVelInterp;   // in ECF
+   ossimRefPtr<ossimLagrangeInterpolator> theLocalOrpInterp; // in ECF
+   ImagingMode     theImagingMode;
+   double          theIllumAzimuth;
+   double          theIllumElevation;
+   ossimEcefPoint  theORP;
+   double          theRefHeight;
+   double          theGHA;           // Greenwich Hour Angle of first eph. pt.
+   double          theEphFirstSampTime; // in seconds from start of day
+   double          theSinOrientation;
+   double          theCosOrientation;
+   double          theSinSkew;
+   ossimLsrSpace   theVehicleSpace;
+   ossimEcefVector thePosCorrection;
+   int             theFirstLineDay;   // julian day
+   double          theFirstLineTime;  // seconds
+   double          theTimePerLine;    // seconds
+   DirectionFlag   theDirectionFlag;
+   double          theSrGrCoeff[6];
+   ossimDpt        thePixelSpacing; 
+   //***
+   // Additional data members used for scan-mode imagery:
+   //***
+   ossimDblGrid    theLatGrid;
+   ossimDblGrid    theLonGrid;
+   
+   //***
+   // Adjustable Parameters:
+   //***
+   double          theInTrackOffset; // meters
+   double          theCrTrackOffset; // meters
+   double          theRadialOffset;  // meters
+   double          theLineScale;
+   double          theSkew;
+   double          theOrientation; // degrees
+   
+   //***
+   // Adjustable model parameters array indexes:
+   //***
+   enum ADJUSTABLE_PARAM_INDEXES
+   {
+      INTRACK_OFFSET,
+      CRTRACK_OFFSET,
+      RADIAL_OFFSET,
+      LINE_SCALE,
+      SKEW,
+      ORIENTATION,
+      NUM_ADJUSTABLE_PARAMS  // not a parameter
+   };
+
+};
+
+
+#endif
diff --git a/include/ossim/projection/ossimSensorModel.h b/include/ossim/projection/ossimSensorModel.h
index 945c1af..b23f780 100644
--- a/include/ossim/projection/ossimSensorModel.h
+++ b/include/ossim/projection/ossimSensorModel.h
@@ -25,7 +25,7 @@
 // LIMITATIONS: None.
 //
 //*****************************************************************************
-//  $Id: ossimSensorModel.h 19180 2011-03-22 17:36:33Z oscarkramer $
+//  $Id: ossimSensorModel.h 21807 2012-10-05 14:22:02Z dhicks $
 
 #ifndef ossimSensorModel_HEADER
 #define ossimSensorModel_HEADER
@@ -116,10 +116,10 @@ public:
    /*!
     * METHOD: lineSampleHeightToWorld
     * This is the pure virtual that performs the actual work of projecting
-    * the image point to the given elevation above MSL. 
+    * the image point to the given elevation above Ellipsoid. 
     */
    virtual void lineSampleHeightToWorld(const ossimDpt& lineSampPt,
-                                        const double&   heightAboveMSL,
+                                        const double&   heightEllipsoid,
                                         ossimGpt&       worldPt) const = 0;
    /*!
     * METHOD: imagingRay(image_point, &ossimEcefRay)
@@ -246,10 +246,11 @@ public:
 
    /*!
     * METHOD: getObsCovMat()
-    * gives 2X2 covariance matrix of observations
+    * @brief Gives 2X2 covariance matrix of observations
     */
    virtual ossimSensorModel::CovMatStatus getObsCovMat(
-      const ossimDpt& ipos, NEWMAT::SymmetricMatrix& Cov);
+      const ossimDpt& ipos, NEWMAT::SymmetricMatrix& Cov,
+      const ossim_float64 defPointingSigma = 0.5);
 
    /**
     * @brief Implementation of pure virtual
diff --git a/include/ossim/projection/ossimSensorModelTuple.h b/include/ossim/projection/ossimSensorModelTuple.h
index 306c65e..c386981 100644
--- a/include/ossim/projection/ossimSensorModelTuple.h
+++ b/include/ossim/projection/ossimSensorModelTuple.h
@@ -6,7 +6,7 @@
 //
 // Description: Base class for tuple-based ossimSensorModel metric operations.
 //----------------------------------------------------------------------------
-// $Id: ossimSensorModelTuple.h 12459 2008-02-11 18:05:01Z dburken $
+// $Id: ossimSensorModelTuple.h 21806 2012-10-05 14:20:45Z dhicks $
 #ifndef ossimSensorModelTuple_HEADER
 #define ossimSensorModelTuple_HEADER
 
@@ -189,7 +189,6 @@ private:
     * @param img Image set index of current image.
     */
    bool getGroundObsEqComponents(const ossim_int32 img,
-                                 const ossim_int32 iter,
                                  const ossimDpt& obs,
                                  const ossimGpt& ptEst,
                                  ossimDpt& resid,
diff --git a/include/ossim/projection/ossimSonomaSensor.h b/include/ossim/projection/ossimSonomaSensor.h
index 426a8f2..740be96 100644
--- a/include/ossim/projection/ossimSonomaSensor.h
+++ b/include/ossim/projection/ossimSonomaSensor.h
@@ -171,6 +171,7 @@ protected:
    NEWMAT::Matrix m_compositeMatrixInverse;
    NEWMAT::Matrix m_pixelToCamera;
    NEWMAT::Matrix m_mount;
+   NEWMAT::Matrix m_mountInverse;
    double         m_roll;
    double         m_pitch;
    double         m_heading;
diff --git a/include/ossim/projection/ossimSpaceObliqueMercatorProjection.h b/include/ossim/projection/ossimSpaceObliqueMercatorProjection.h
index 8478526..a8ebf84 100644
--- a/include/ossim/projection/ossimSpaceObliqueMercatorProjection.h
+++ b/include/ossim/projection/ossimSpaceObliqueMercatorProjection.h
@@ -7,7 +7,7 @@
 // Description:
 //
 //*******************************************************************
-//  $Id: ossimSpaceObliqueMercatorProjection.h 17815 2010-08-03 13:23:14Z dburken $
+//  $Id: ossimSpaceObliqueMercatorProjection.h 20197 2011-11-03 13:22:02Z dburken $
 #ifndef ossimSpaceObliqueMercatorProjection_HEADER
 #define ossimSpaceObliqueMercatorProjection_HEADER
 #include <ossim/projection/ossimMapProjection.h>
@@ -24,7 +24,7 @@
  *
  * 
  */
-class ossimSpaceObliqueMercatorProjection : public ossimMapProjection
+class OSSIMDLLEXPORT ossimSpaceObliqueMercatorProjection : public ossimMapProjection
 {
 public:
    enum ossimSatelliteType
diff --git a/include/ossim/projection/ossimUtm.h b/include/ossim/projection/ossimUtm.h
index 0b32051..adcb783 100644
--- a/include/ossim/projection/ossimUtm.h
+++ b/include/ossim/projection/ossimUtm.h
@@ -1,6 +1,5 @@
 #ifndef UTM_H
   #define UTM_H
-
 /***************************************************************************/
 /* RSC IDENTIFIER: UTM
  *
@@ -76,6 +75,7 @@
 /*
  *                              DEFINES
  */
+#include <ossim/base/ossimConstants.h>
 
   #define UTM_NO_ERROR            0x0000
   #define UTM_LAT_ERROR           0x0001
@@ -100,7 +100,7 @@
 extern "C" {
   #endif
 
-  long Set_UTM_Parameters(double a,      
+  long OSSIM_DLL Set_UTM_Parameters(double a,      
                           double f,
                           long   override);
 /*
@@ -115,7 +115,7 @@ extern "C" {
  */
 
 
-  void Get_UTM_Parameters(double *a,
+  void OSSIM_DLL Get_UTM_Parameters(double *a,
                           double *f,
                           long   *override);
 /*
@@ -128,7 +128,7 @@ extern "C" {
  */
 
 
-  long Convert_Geodetic_To_UTM (double Latitude,
+  long OSSIM_DLL Convert_Geodetic_To_UTM (double Latitude,
                                 double Longitude,
                                 long   *Zone,
                                 char   *Hemisphere,
@@ -150,7 +150,7 @@ extern "C" {
  */
 
 
-  long Convert_UTM_To_Geodetic(long   Zone,
+  long OSSIM_DLL Convert_UTM_To_Geodetic(long   Zone,
                                char   Hemisphere,
                                double Easting,
                                double Northing,
diff --git a/include/ossim/projection/ossimWktProjectionFactory.h b/include/ossim/projection/ossimWktProjectionFactory.h
new file mode 100644
index 0000000..ea9bc41
--- /dev/null
+++ b/include/ossim/projection/ossimWktProjectionFactory.h
@@ -0,0 +1,71 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author:  Oscar Kramer
+//
+//*******************************************************************
+//  $Id: ossimWktProjectionFactory.h 19879 2011-07-30 16:21:50Z dburken $
+
+#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;
+
+//*************************************************************************************************
+//! 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();
+
+   struct WktProjRecord : public ossimReferenced
+   {
+      WktProjRecord() : epsgCode(0), wktString(""), proj(0) {}
+      ossim_uint32     epsgCode;
+      ossimString      wktString;
+      ossimRefPtr<ossimMapProjection> proj;
+   };
+
+   static ossimWktProjectionFactory*  m_instance; //!< Singleton implementation
+   mutable std::vector<ossimRefPtr<WktProjRecord> > m_wktProjRecords;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimAlphaSensorSupportData.h b/include/ossim/support_data/ossimAlphaSensorSupportData.h
new file mode 100644
index 0000000..5b951b5
--- /dev/null
+++ b/include/ossim/support_data/ossimAlphaSensorSupportData.h
@@ -0,0 +1,89 @@
+#ifndef ossimAlphaSensorSupportData_HEADER
+#define ossimAlphaSensorSupportData_HEADER 1
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/matrix/newmat.h>
+#include <ossim/base/ossimPolynom.h>
+
+class ossimEnviHeader;
+
+class OSSIM_DLL ossimAlphaSensorSupportData : public ossimObject
+{
+public:
+   enum PolynomialDegrees
+   {
+      MAX_DEGREE     = 10,
+      MAX_TERMS      = MAX_DEGREE + 1,
+      SCAN_ANGLE_DEG = 2,
+      ROLL_DEG       = 7,
+      PITCH_DEG      = 5,
+      HEADING_DEG    = 4,
+      LON_DEG        = 2,
+      LAT_DEG        = 2,
+      ALT_DEG        = 2
+   };
+
+   ossimAlphaSensorSupportData();
+
+   virtual bool readSupportFiles(const ossimFilename& hdrFile);
+   virtual bool readSupportFiles(const ossimEnviHeader& hdr);
+   virtual bool readHdrFile(const ossimFilename& hdrFile);
+   virtual bool readHdrFile(const ossimEnviHeader& hdr);
+   virtual bool readInsGpsFile(const ossimFilename& txtFile);
+
+   inline bool isHSI()const {return m_isHSI;}
+
+   const ossimDpt&      getImageSize()const;
+   const ossim_float64& getRollBias()const;
+   const ossim_float64& getPitchBias()const;
+   const ossim_float64& getHeadingBias()const;
+   const ossim_float64& getFov()const;
+   const ossim_float64& getSlitRot()const;
+
+   const std::vector< ossim_float64 >& getRollPoly()const;
+   const std::vector< ossim_float64 >& getPitchPoly()const;
+   const std::vector< ossim_float64 >& getHeadingPoly()const;
+   const std::vector< ossim_float64 >& getLonPoly()const;
+   const std::vector< ossim_float64 >& getLatPoly()const;
+   const std::vector< ossim_float64 >& getAltPoly()const;
+   const std::vector< ossim_float64 >& getScanPoly()const;
+
+protected:
+   void reset();
+   ossimAlphaSensorSupportData(const ossimAlphaSensorSupportData& src);
+   ossimAlphaSensorSupportData& operator =(const ossimAlphaSensorSupportData& src);
+
+   bool m_isHSI;
+
+   // hdr data
+   ossimString   m_sensorType;
+   ossimDpt      m_imageSize;
+   ossim_float64 m_rollBias;
+   ossim_float64 m_pitchBias;
+   ossim_float64 m_headingBias;
+   ossim_float64 m_fov;
+   ossim_float64 m_slitRot;
+
+   // insgps data
+   std::vector< ossimPolynom<ossim_float64,1>::VAR_TUPLE > m_imgLine;
+   std::vector< ossim_float64 > m_roll;
+   std::vector< ossim_float64 > m_pitch;
+   std::vector< ossim_float64 > m_heading;
+   std::vector< ossim_float64 > m_lon;
+   std::vector< ossim_float64 > m_lat;
+   std::vector< ossim_float64 > m_alt;
+   std::vector< ossim_float64 > m_scanAng;
+
+   // insgps polynomials
+   std::vector< ossim_float64 > m_rollPolyCoef;
+   std::vector< ossim_float64 > m_pitchPolyCoef;
+   std::vector< ossim_float64 > m_headingPolyCoef;
+   std::vector< ossim_float64 > m_lonPolyCoef;
+   std::vector< ossim_float64 > m_latPolyCoef;
+   std::vector< ossim_float64 > m_altPolyCoef;
+   std::vector< ossim_float64 > m_scanAngPolyCoef;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimApplanixEOFile.h b/include/ossim/support_data/ossimApplanixEOFile.h
index 091bd76..89f0a58 100644
--- a/include/ossim/support_data/ossimApplanixEOFile.h
+++ b/include/ossim/support_data/ossimApplanixEOFile.h
@@ -6,19 +6,22 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimApplanixEOFile.h 9094 2006-06-13 19:12:40Z dburken $
+//  $Id: ossimApplanixEOFile.h 20483 2012-01-21 15:42:22Z dburken $
 #ifndef ossimApplanixEOFile_HEADER
-#define 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>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimFilename.h>
 
 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)
@@ -202,7 +205,7 @@ protected:
    ossim_float64 theMaxLon;
    std::vector<ossimString> theRecordFormat;
    std::vector< ossimRefPtr<ossimApplanixEORecord> > theApplanixRecordList;
-   std::map<ossimString, ossimRefPtr<ossimApplanixEORecord> > theRecordIdMap;
+   std::map<ossimString, ossimRefPtr<ossimApplanixEORecord>, ossimStringLtstr> theRecordIdMap;
 };
 
 #endif
diff --git a/include/ossim/support_data/ossimAuxFileHandler.h b/include/ossim/support_data/ossimAuxFileHandler.h
index 70ce645..d28cbba 100644
--- a/include/ossim/support_data/ossimAuxFileHandler.h
+++ b/include/ossim/support_data/ossimAuxFileHandler.h
@@ -1,227 +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 468 2009-12-23 16:58:08Z ming.su $
-
-#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();
-
+//*******************************************************************
+// 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:
+                           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.
-  */
-  ossimString getProjectionName();
-
-  ossimString getDatumName();
-
-private:
-
-  ossimAuxInfo* m_auxInfo;
-  ossimString projName;
-  ossimString datumName;
-};
-
-#endif  // #ifndef ossimAuxFileHandlerl_HEADER
+    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/ossimCeosData.h b/include/ossim/support_data/ossimCeosData.h
new file mode 100644
index 0000000..b191e6e
--- /dev/null
+++ b/include/ossim/support_data/ossimCeosData.h
@@ -0,0 +1,1054 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Oscar Kramer
+//
+// Description:
+//
+// Class for reading CEOS-formatted metadata.
+// 
+//*******************************************************************
+//  $Id:$
+#ifndef ossimCeosData_HEADER
+#define ossimCeosData_HEADER
+
+#include <cstdio>
+#include <iostream>
+
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimReferenced.h>
+
+struct desc_rec                  // Record description                  
+{
+   ossim_int32   rec_seq;               // Record sequence number (B4) 
+   ossim_uint8   rec_sub1;              // First record sub-type code (B1) 
+   ossim_uint8   rec_type;              // Record type code (B1) 
+   ossim_uint8   rec_sub2;              // Second record sub-type code (B1) 
+   ossim_uint8   rec_sub3;              // Third record sub-type code (B1) 
+   ossim_int32   length;                // Length of this record, bytes (B4) 
+};
+
+
+struct vol_desc_rec              // Volume descriptor record            
+{
+   struct desc_rec desc;         // Record description                  
+   char   ascii_flag[2];         // ASCII flag (A2) 
+   char   spare1[2];             // Unused (A2) 
+   char   format_doc[12];        // Format control documentation (A12) 
+   char   format_ver[2];         // Format doc version (A2) 
+   char   format_rev[2];         // Format doc revision (A2) 
+   char   software_id[12];       // Software identifier (A12) 
+   char   phyvol_id[16];         // Physical volume identifier (A16) 
+   char   logvol_id[16];         // Logical volume identifier (A16) 
+   char   volset_id[16];         // Volume set identifier (A16) 
+   char   phyvol_cnt[2];         // Total physical volume count (I2) 
+   char   first_phyvol[2];       // Physical vol of first tape (I2) 
+   char   last_phyvol[2];        // Physical vol of last tape (I2) 
+   char   curr_phyvol[2];        // Physical vol of current tape (I2) 
+   char   first_file[4];         // First file number in phyvol (I4) 
+   char   volset_log[4];         // Logical volume within set (I4) 
+   char   phyvol_log[4];         // Logical volume within phyvol (I4) 
+   char   logvol_date[8];        // Logvol creation date (A8) 
+   char   logvol_time[8];        // Logvol creation time (A8) 
+   char   logvol_country[12];    // Logvol generation country (A12) 
+   char   logvol_agency[8];      // Logvol generation agency (A8) 
+   char   logvol_facility[12];   // Logvol generation facility (A12) 
+   char   n_filepoint[4];        // Number of file pointer records (I4) 
+   char   n_voldir[4];           // Number of voldir records (I4) 
+   char   spare2[92];            // Unused (A92) 
+   char   product_id[8];         // Product identifier (A8) 
+   char   spare3[92];            // Local use segment (A92) 
+};
+
+
+struct file_pntr_rec             // File pointer record                 
+{
+   struct desc_rec desc;         // Record description                  
+   char   ascii_flag[2];         // ASCII flag (A2) 
+   char   spare1[2];             // Unused (A2) 
+   char   file_num[4];           // Referenced file number (I4) 
+   char   file_name[16];         // Referenced file name (A16) 
+   char   file_class[28];        // Referenced file class (A28) 
+   char   file_code[4];          // Referenced file class code (A4) 
+   char   data_type[28];         // Referenced file data type (A28) 
+   char   data_code[4];          // Referenced file data type code (A4) 
+   char   nrec[8];               // Referenced file record count (I8) 
+   char   first_len[8];          // First record length, bytes (I8) 
+   char   max_len[8];            // Maximum record length, bytes (I8) 
+   char   len_type[12];          // Record length type (A12) 
+   char   len_code[4];           // Record length type code (A4) 
+   char   first_phyvol[2];       // First physical volume (I2) 
+   char   last_phyvol[2];        // Last physical volume (I2) 
+   char   first_rec[8];          // First phyvol record (I8) 
+   char   last_rec[8];           // Last phyvol record (I8) 
+   char   spare2[100];           // Unused (A100) 
+   char   spare3[100];           // Unused (A100) 
+};
+
+
+struct text_rec                  // Text record                         
+{
+   struct desc_rec desc;         // Record description                  
+   char   ascii_flag[2];         // ASCII flag (A2) 
+   char   cont_flag[2];          // Continuation flag (A2) 
+   char   product_type[40];      // Product type specifier (A40) 
+   char   product_create[60];    // Product creation info (A60) 
+   char   phyvol_id[40];         // Physical volume identifier (A40) 
+   char   scene_id[40];          // Scene identifier (A40) 
+   char   scene_loc[40];         // Scene location (A40) 
+   char   copyright_info[20];    // Unused (A20) 
+   char   spare2[104];           // Unused (A104) 
+};
+
+
+struct sar_desc_rec              // SAR leader/trailer descriptor       
+{
+   struct desc_rec desc;         // Record description                  
+   char   ascii_flag[2];         // ASCII flag (A2) 
+   char   spare1[2];             // Unused (A2) 
+   char   format_doc[12];        // Format control document (A12) 
+   char   format_rev[2];         // Format document revision (A2) 
+   char   design_rev[2];         // File design revision (A2) 
+   char   software_id[12];       // Software identifier (A12) 
+   char   file_num[4];           // File number (I4) 
+   char   file_name[16];         // File name (A16) 
+   char   rec_seq[4];            // Record sequence/location flag (A4) 
+   char   seq_loc[8];            // Sequence number location (I8) 
+   char   seq_len[4];            // Sequence number length (I4) 
+   char   rec_code[4];           // Record code/location flag (A4) 
+   char   code_loc[8];           // Record code location (I8) 
+   char   code_len[4];           // Record code length (I4) 
+   char   rec_len[4];            // Record length/location flag (A4) 
+   char   rlen_loc[8];           // Record length location (I8) 
+   char   rlen_len[4];           // Record length, bytes (I4) 
+   char   spare2;                // Reserved (A1) 
+   char   spare3;                // Reserved (A1) 
+   char   spare4;                // Reserved (A1) 
+   char   spare5;                // Reserved (A1) 
+   char   spare6[64];            // Reserved segment (A64) 
+   char   n_dataset[6];          // Number of dataset summary records (I6) 
+   char   l_dataset[6];          // Data set summary record length, bytes (I6) 
+   char   n_map_proj[6];         // Number of map proj records (I6) 
+   char   l_map_proj[6];         // Map proj record length, bytes (I6) 
+   char   n_plat_pos[6];         // Number of plat pos records (I6) 
+   char   l_plat_pos[6];         // Plat pos record length, bytes (I6) 
+   char   n_att_data[6];         // Number of att data records (I6) 
+   char   l_att_data[6];         // Att data record length, bytes (I6) 
+   char   n_radi_data[6];        // Number of radiometric data records (I6) 
+   char   l_radi_data[6];        // Radi data record length, bytes (I6) 
+   char   n_radi_comp[6];        // Number of radiometric compensation records (I6)
+   char   l_radi_comp[6];        // Radiometric compensation record length, bytes (I6)
+   char   n_qual_sum[6];         // Number of data qual sum records (I6) 
+   char   l_qual_sum[6];         // Dat qual sum record length,bytes (I6) 
+   char   n_data_hist[6];        // Number of data histogram records (I6) 
+   char   l_data_hist[6];        // Data hist record length, bytes (I6) 
+   char   n_rang_spec[6];        // Number of range spectra records (I6) 
+   char   l_rang_spec[6];        // Range spectra record length, bytes (I6) 
+   char   n_dem_desc[6];         // Number of DEM descriptor records (I6) 
+   char   l_dem_desc[6];         // DEM desc record length, bytes (I6) 
+   char   n_radar_par[6];        // Number of RADAR par records (I6) 
+   char   l_radar_par[6];        // RADAR par record length, bytes (I6) 
+   char   n_anno_data[6];        // Number of annotation data records (I6) 
+   char   l_anno_data[6];        // Annotation data record length, bytes (I6) 
+   char   n_det_proc[6];         // Number of processing parameter records (I6) 
+   char   l_det_proc[6];         // Processing parameter record length, bytes (I6)
+   char   n_cal[6];              // Number of calibration records (I6) 
+   char   l_cal[6];              // Calibration record length, bytes (I6) 
+   char   n_gcp[6];              // Number of GCP records (I6) 
+   char   l_gcp[6];              // GCP record length, bytes (I6) 
+   char   spare7[10][6];         // Unused (I6) 
+   char   n_fac_data[6];         // Number of facility data records (I6) 
+   char   l_fac_data[6];         // Fac data record length, bytes (I6) 
+   char   spare8[288];           // Unused (A288) 
+};
+
+
+struct dataset_sum_rec           // Data set summary record                  
+{
+   struct desc_rec desc;         // Record description                       
+   char   seq_num[4];            // Sequence number (I4) 
+   char   sar_chn[4];            // SAR channel indicator (I4) 
+   char   scene_id[16];          // Scene identifier (A16) 
+   char   scene_des[32];         // Scene designator (A32) 
+   char   inp_sctim[32];         // Input scene centre time (A32) 
+   char   asc_des[16];           // Ascending/descending (A16) 
+   char   pro_lat[16];           // Processed scene centre latitude (F16.7) 
+   char   pro_long[16];          // Processed scene centre longitude (F16.7) 
+   char   pro_head[16];          // Processed scene centre headng (F16.7) 
+   char   ellip_des[16];         // Ellipsoid designator (A16) 
+   char   ellip_maj[16];         // Ellipsoid semi-major axis, km (F16.7) 
+   char   ellip_min[16];         // Ellipsoid semi_minor axis, km (F16.7) 
+   char   earth_mass[16];        // Earth's mass (E16.7) 
+   char   grav_const[16];        // Gravitational constant (E16.7) 
+   char   ellip_j[3][16];        // Ellipsoid J2-4 parameters (E16.7) 
+   char   spare1[16];            // Unused (A16) 
+   char   terrain_h[16];         // Average terrain height, km (F16.7) 
+   char   sc_lin[8];             // Scene centre line number (I8) 
+   char   sc_pix[8];             // Scene centre pixel number (I8) 
+   char   scene_len[16];         // Scene length, km (F16.7) 
+   char   scene_wid[16];         // Scene width, km (F16.7) 
+   char   spare2[16];            // Unused (A16) 
+   char   nchn[4];               // Number of SAR channels (I4) 
+   char   spare3[4];             // Unused (A4) 
+   char   mission_id[16];        // Mission identifier (A16) 
+   char   sensor_id[32];         // Sensor identifier (A32) 
+   char   orbit_num[8];          // Orbit number (A8) 
+   char   plat_lat[8];           // Platform geodetic latitude (F8.3) 
+   char   plat_long[8];          // Platform geodetic longitude (F8.3) 
+   char   plat_head[8];          // Platform heading (F8.3) 
+   char   clock_ang[8];          // Sensor clock angle (F8.3) 
+   char   incident_ang[8];       // Incidence angle (F8.3) 
+   char   spare4[8];             // Unused (A8) 
+   char   wave_length[16];       // Radar wave length (F16.7) 
+   char   motion_comp[2];        // Motion compensation indicator (A2) 
+   char   pulse_code[16];        // Range pulse code specifier (A16) 
+   char   ampl_coef[5][16];      // Range chirp coefficients (E16.7) 
+   char   phas_coef[5][16];      // Range phase coefficients (E16.7) 
+   char   chirp_ext_ind[8];      // Chirp extraction index (I8) 
+   char   spare5[8];             // Unused (A8) 
+   char   fr[16];                // Range sampling rate (F16.7) 
+   char   rng_gate[16];          // Range gate start time (F16.7) 
+   char   rng_length[16];        // Range pulse length (F16.7) 
+   char   baseband_f[4];         // Baseband conversion flag (A4) 
+   char   rngcmp_f[4];           // Range compressed flag (A4) 
+   char   gn_polar[16];          // Like polarized gain (F16.7) 
+   char   gn_cross[16];          // Cross polarized gain (F16.7) 
+   char   chn_bits[8];           // Number of bits per channel (I8) 
+   char   quant_desc[12];        // Quantization descriptor (A12) 
+   char   i_bias[16];            // I channel DC bias (F16.7) 
+   char   q_bias[16];            // Q channel DC bias (F16.7) 
+   char   iq_ratio[16];          // I/Q channel ratio (F16.7) 
+   char   spare6[16];            // Unused (F16.7) 
+   char   spare7[16];            // Unused (F16.7) 
+   char   ele_sight[16];         // Electronic boresight (F16.7) 
+   char   mech_sight[16];        // Mechanical boresight (F16.7) 
+   char   echo_track[4];         // Echo tracker on/off flag (A4) 
+   char   fa[16];                // Nominal PRF, Hz (F16.7) 
+   char   elev_beam[16];         // Elevation beamwidth (F16.7) 
+   char   azim_beam[16];         // Azimuth beamwidth (F16.7) 
+   char   sat_bintim[16];        // Satellite binary time (I16) 
+   char   sat_clktim[32];        // Satellite clock time (I32) 
+   char   sat_clkinc[8];         // Satellite clock increment (I8) 
+   char   spare8[8];             // Unused (A8) 
+   char   fac_id[16];            // Processing facility identifier (A16) 
+   char   sys_id[8];             // Processing system identifier (A8) 
+   char   ver_id[8];             // Processing version identifier (A8) 
+   char   fac_code[16];          // Facility process code (A16) 
+   char   lev_code[16];          // Product level code (A16) 
+   char   prod_type[32];         // Product type specifier (A32) 
+   char   algor_id[32];          // Processing algorithm identifier (A32) 
+   char   n_azilok[16];          // Number of azimuth looks (F16.7) 
+   char   n_rnglok[16];          // Number of range looks (F16.7) 
+   char   bnd_azilok[16];        // Bandwidth per look in azimuth,Hz (F16.7) 
+   char   bnd_rnglok[16];        // Bandwidth per look in range,Hz (F16.7) 
+   char   bnd_azi[16];           // Total azimuth look bandwidth (F16.7) 
+   char   bnd_rng[16];           // Total range look bandwidth (F16.7) 
+   char   azi_weight[32];        // Azimuth weighting designator (A32) 
+   char   rng_weight[32];        // Range weighting designator (A32) 
+   char   data_inpsrc[16];       // Data input source (A16) 
+   char   rng_res[16];           // Range resolution, meter (F16.7) 
+   char   azi_res[16];           // Azimuth resolution, meter (F16.7) 
+   char   radi_stretch[2][16];   // Radiometric stretch terms (F16.7) 
+   char   alt_dopcen[3][16];     // Along track Doppler frequency terms (E16.7) 
+   char   spare9[16];            // Unused (A16) 
+   char   crt_dopcen[3][16];     // Cross track Doppler frequency terms (E16.7) 
+   char   time_dir_pix[8];       // Pixel time direction indicator (A8) 
+   char   time_dir_lin[8];       // Line time direction indicator (A8) 
+   char   alt_rate[3][16];       // Along track Doppler rate term (E16.7)
+   char   spare10[16];           // Unused (A16) 
+   char   crt_rate[3][16];       // Cross track Doppler rate term (E16.7)
+   char   spare11[16];           // Unused (A16) 
+   char   line_cont[8];          // Line content indicator (A8) 
+   char   clutter_lock[4];       // Clutter lock applied flag (A4) 
+   char   auto_focus[4];         // Auto-focus applied flag (A4) 
+   char   line_spacing[16];      // Line spacing, meters (F16.7) 
+   char   pix_spacing[16];       // Pixel spacing, meters (F16.7) 
+   char   rngcmp_desg[16];       // Range compression designator (A16) 
+   char   spare12[2362];         // Unused (A2362) 
+};
+
+
+struct rad_unc_rec               // Radiometric uncertainty record
+{
+   char   db[16];                // Units of db (F16.7)  
+   char   deg[16];               // Units of deg (F16.7)  
+};
+
+struct misreg_rec                // Misregistration record 
+{
+   char   alt_m[16];             // Nominal along track misregistration (F16.7)
+   char   crt_m[16];             // Nominal cross track misregistration (F16.7)
+};
+
+struct qual_sum_rec              // Data quality summary record 
+{
+   struct desc_rec desc;         // Record description
+   char   rec_seq[4];            // Record sequence number (I4) 
+   char   sar_chn[4];            // SAR channel indicator (A4) 
+   char   cali_date[6];          // Calibration update date (A6) 
+   char   nchn[4];               // Number of channels (I4) 
+   char   islr[16];              // Nominal integrated side lobe ratio (F16.7) 
+   char   pslr[16];              // Nominal peak side lobe ratio (F16.7) 
+   char   azi_ambig[16];         // Nominal azimuth ambiguity (F16.7) 
+   char   rng_ambig[16];         // Nominal range ambiguity (F16.7) 
+   char   snr[16];               // Nominal signal to noise ratio (F16.7) 
+   char   ber[16];               // Nominal bit error rate (F16.7) 
+   char   rng_res[16];           // Nominal slant range resolution (F16.7) 
+   char   azi_res[16];           // Nominal azimuth resolution,meter (F16.7) 
+   char   rad_res[16];           // Nominal radiometric resolution,dB (F16.7) 
+   char   dyn_rng[16];           // Instantaneous dynamic range (F16.7) 
+   char   rad_unc_db[16];        // Nominal radiometric uncertainty,dB (F16.7) 
+   char   rad_unc_deg[16];       // Nominal Radiometric uncertainty,deg (F16.7) 
+   struct rad_unc_rec rad_unc[16];   // Radiometric data quality          
+   char   alt_locerr[16];        // Nominal along track location error (F16.7) 
+   char   crt_locerr[16];        // Nominal cross track location error (F16.7) 
+   char   alt_scale[16];         // Nominal along track distortion scale (F16.7)
+   char   crt_scale[16];         // Nominal cross track distortion scale (F16.7)
+   char   dis_skew[16];          // Nominal distortion skew (F16.7) 
+   char   ori_err[16];           // Nominal Scene orientation error (F16.7) 
+   struct misreg_rec misreg[16]; // Misregistration error
+   char   nesz[16];              // Nominal noise equivalent sigma zero (F16.7) 
+   char   enl[16];               // Nominal equivalent number of looks (F16.7) 
+   char   tb_update[8];          // Default parameters table update date (A8) 
+   char   spare[238];            // Unused (A238) 
+};
+
+
+struct sdr_htab_rec              // Histogram table record 
+{
+   char   hist_desc[32];         // Histogram descriptor (A32) 
+   char   nrec[4];               // Records per table (I4) 
+   char   tab_seq[4];            // Table sequence number (I4) 
+   char   nbin[8];               // Total number of table bins (I8) 
+   char   ns_lin[8];             // Total number of lines (I8) 
+   char   ns_pix[8];             // Total number of pixels per line (I8) 
+   char   ngrp_lin[8];           // Group size along line axis (I8) 
+   char   ngrp_pix[8];           // Group size along pixel axis (I8) 
+   char   nsamp_lin[8];          // Number of samples used per group along line axis (I8) 
+   char   nsamp_pix[8];          // Number of samples used per group along pixel (I8) 
+   char   min_smp[16];           // Minimum first bin (E16.7) 
+   char   max_smp[16];           // Maximum last bin (E16.7) 
+   char   mean_smp[16];          // Mean sample value (E16.7) 
+   char   std_smp[16];           // Sample standard deviation (E16.7) 
+   char   smp_inc[16];           // Sample value increment (E16.7) 
+   char   min_hist[16];          // Minimum histogram value (E16.7) 
+   char   max_hist[16];          // Maximum histogram value (E16.7) 
+   char   mean_hist[16];         // Histogram mean value (E16.7) 
+   char   std_hist[16];          // Histogram standard deviation (E16.7) 
+   char   nhist[8];              // Histogram table size (I8) 
+   char   hist[256][8];          // 256 histogram table values of 16 bins
+   //   I x 16 bins Q (I8) 
+};
+
+struct sdr_hist_rec              // Data histogram record
+{
+   struct desc_rec desc;         // Record description
+   char   rec_seq[4];            // Record sequence number (I4) 
+   char   sar_chn[4];            // SAR channel number (I4) 
+   char   ntab[8];               // Number of histogram table data sets in this record (I8) 
+   char   ltab[8];               // Histogram table data set size (I8) 
+   struct sdr_htab_rec htab;     // Histogram tables
+   char   spare[14588];          // Unused (A14588) 
+};
+
+
+struct pdr16_htab_rec            // Histogram table record              
+{
+   char   hist_desc[32];         // Histogram descriptor (A32) 
+   char   nrec[4];               // Records per table (I4) 
+   char   tab_seq[4];            // Table sequence number (I4) 
+   char   nbin[8];               // Total number of table bins (I8) 
+   char   ns_lin[8];             // Total number of lines n (I8) 
+   char   ns_pix[8];             // Total number of pixels per line (I8) 
+   char   ngrp_lin[8];           // Group size along line axis (I8) 
+   char   ngrp_pix[8];           // Group size along pixel axis (I8) 
+   char   nsamp_lin[8];          // Number of samples used per group along line axis (I8) 
+   char   nsamp_pix[8];          // Number of samples used per group along pixel (I8) 
+   char   min_smp[16];           // Minimum first bin (E16.7) 
+   char   max_smp[16];           // Maximum last bin (E16.7) 
+   char   mean_smp[16];          // Mean sample value (E16.7) 
+   char   std_smp[16];           // Sample standard deviation (E16.7) 
+   char   smp_inc[16];           // Sample value increment (E16.7) 
+   char   min_hist[16];          // Minimum histogram value (E16.7) 
+   char   max_hist[16];          // Maximum histogram value (E16.7) 
+   char   mean_hist[16];         // Histogram mean value (E16.7) 
+   char   std_hist[16];          // Histogram standard deviation (E16.7) 
+   char   nhist[8];              // Histogram table size (I8) 
+   char   hist[1024][8];         // 1024 histogram table values for 1024 bins
+   // (I8) 
+};
+
+struct pdr16_hist_rec            // Data histogram record
+{
+   struct desc_rec desc;         // Record description
+   char   rec_seq[4];            // Record sequence number (I4) 
+   char   sar_chn[4];            // SAR channel number (I4) 
+   char   ntab[8];               // Number of histogram table data sets in this record (I8) 
+   char   ltab[8];               // Histogram table data set size (I8) 
+   struct pdr16_htab_rec htab[2];// Histogram tables 
+   char   spare[3];              // Unused (A3) 
+};
+
+
+struct pix_count_rec             // Beam pixel count record 
+{
+   char   pix_update[21];        // Pixel count update date/time (A21) 
+   char   n_pix[4][8];           // Count of image pixels in beams (4I8) 
+};
+
+struct beam_info_rec             // Beam information record
+{
+   char   beam_type[3];          // Beam type (A3) 
+   char   beam_look_src[9];      // Elevation beam look angle source (A9) 
+   char   beam_look_ang[16];     // Applied elevation beam look angle (deg) (F16.7) 
+   char   prf[16];               // Actual PRF (Hz) (F16.7) 
+};
+
+struct temp_rec                  // Temperature settings record
+{
+   char   temp_set[4][4];        // Temperature settings (4I4) 
+};
+
+struct dopcen_est_rec
+{
+   char   dopcen_conf[16];       // Doppler centroid confidence measure (F16.7) 
+   char   dopcen_ref_tim[16];    // Doppler centroid reference time (sec) (F16.7) 
+   char   dopcen_coef[4][16];    // Doppler centroid coefficients (4F16.7) 
+};
+
+struct srgr_coefset_rec
+{
+   char   srgr_update[21];       // SRGR update date/time (A21) 
+   char   srgr_coef[6][16];      // SRGR coefficients (6F16.7) 
+};
+
+struct proc_parm_rec             // Detailed processing parameters record
+{
+   struct desc_rec desc;         // Record description
+   char   rec_seq[4];            // Record sequence number (I4) 
+   char   spare1[4];             // Unused (A4) 
+   char   inp_media[3];          // Input media (A3) 
+   char   n_tape_id[4];          // Number of tape input ids (I4) 
+   char   tape_id[10][8];        // Tape identifiers (10A8) 
+   char   exp_ing_start[21];     // Expected ingest start time (A21) 
+   char   exp_ing_stop[21];      // Expected ingest stop time (A21)  
+   char   act_ing_start[21];     // Actual ingest start time (A21) 
+   char   act_ing_stop[21];      // Actual ingest stop time (A21) 
+   char   proc_start[21];        // Processing start time (A21) 
+   char   proc_stop[21];         // Processing stop time (A21) 
+   char   mn_sig_lev[10][16];    // Mean signal levels across range (10F16.7) 
+   char   scr_data_ind[4];       // Source data quality indicator (I4) 
+   char   miss_ln[8];            // Number of missing lines (I8) 
+   char   rej_ln[8];             // Number of rejected lines (I8) 
+   char   large_gap[8];          // Number of time inconsistencies (large gaps) (I8) 
+   char   bit_err_rate[16];      // Measured bit error rate (E16.7) 
+   char   fm_crc_err[16];        // Percent of frames with CRC errors (E16.7) 
+   char   date_incons[8];        // Number of date inconsistencies (I8) 
+   char   prf_changes[8];        // Number of unexpected PRF changes (I8) 
+   char   delay_changes[8];      // Number of delay changes (I8) 
+   char   skipd_frams[8];        // Number of skipped frames (I8) 
+   char   rej_bf_start[8];       // Range lines rejected before start time (I8) 
+   char   rej_few_fram[8];       // Range lines rejected due to too few frames   (I8) 
+   char   rej_many_fram[8];      // Range lines rejected due to too many frames   (I8) 
+   char   rej_mchn_err[8];       // Frames rejected due to master channel error (I8) 
+   char   rej_vchn_err[8];       // Frames rejected due to virtual channel error (I8) 
+   char   rej_rec_type[8];       // Frames rejected due to incorrect recording type (I8) 
+   char   sens_config[10];       // Sensor configuration (A10) 
+   char   sens_orient[9];        // Sensor orientation (A9) 
+   char   sych_marker[8];        // Frame synch marker (I8) 
+   char   rng_ref_src[12];       // Range reference function source (A12) 
+   char   rng_amp_coef[4][16];   // Range reference amplitude coefficients (4E16.7) 
+   char   rng_phas_coef[4][16];  // Range reference phase coefficients (4E16.7) 
+   char   err_amp_coef[4][16];   // Error function amplitude coefficients (4E16.7) 
+   char   err_phas_coef[4][16];  // Error function phase coefficients (4E16.7) 
+   char   pulse_bandw[4];        // Pulse bandwidth code (I4) 
+   char   adc_samp_rate[5];      // ADC sampling rate (I5) 
+   char   rep_agc_attn[16];      // Replica AGC attenuation (F16.7) 
+   char   gn_corctn_fctr[16];    // Gain correction factor (dB) (F16.7) 
+   char   rep_energy_gn[16];     // Replica energy gain correction (F16.7) 
+   char   orb_data_src[11];      // Orbit data source (A11) 
+   char   pulse_cnt_1[4];        // Pulse count 1 (I4) 
+   char   pulse_cnt_2[4];        // Pulse count 2 (I4) 
+   char   beam_edge_rqd[3];      // Beam edge detection requested (A3) 
+   char   beam_edge_conf[16];    // Beam edge confidence measure (F16.7) 
+   char   pix_overlap[4];        // Number of pixels in beam overlap (I4) 
+   char   n_beams[4];            // Number of beams (I4) 
+   struct beam_info_rec beam_info[4]; // Beam info 
+   char   n_pix_updates[4];      // Number of pixel count updates (I4) 
+   struct pix_count_rec pix_count[20];   // Beam pixel counts
+   char   pwin_start[16];        // Processing window start time (sec) (F16.7) 
+   char   pwin_end[16];          // Processing window end time (sec) (F16.7) 
+   char   recd_type[9];          // Recording type (A9) 
+   char   temp_set_inc[16];      // Time increment between temperature settings (sec) (F16.7) 
+   char   n_temp_set[4];         // Number of temperature settings (I4) 
+   struct temp_rec temp[20];     // Temperature settings 
+   char   n_image_pix[8];        // Number of image pixels (I8) 
+   char   prc_zero_pix[16];      // Percent zero pixels (F16.7) 
+   char   prc_satur_pix[16];     // Percent saturated pixels (F16.7) 
+   char   img_hist_mean[16];     // Image histogram mean intensity (F16.7) 
+   char   img_cumu_dist[3][16];  // Image cumulative distribution (3F16.7) 
+   char   pre_img_gn[16];        // Pre-image calibration gain factor (F16.7) 
+   char   post_img_gn[16];       // Post-image calibration gain factor (F16.7) 
+   char   dopcen_inc[16];        // Time increment between Dopcen estimates (sec) (F16.7) 
+   char   n_dopcen[4];           // Number of Doppler centroid estimates (I4) 
+   struct dopcen_est_rec dopcen_est[20]; // Doppler centroid estimates
+   char   dop_amb_err[4];        // Doppler ambiguity error (I4) 
+   char   dopamb_conf[16];       // Doppler ambiguity confidence measure (F16.7)
+   char   eph_orb_data[7][16];   // Ephemeris orbit data (7E16.7) 
+   char   appl_type[12];         // Application type (A12) 
+   char   slow_time_coef[5][22]; // Slow time coefficients (5D22.15) 
+   char   n_srgr[4];             // Number of SRGR coefficient sets (I4) 
+   struct srgr_coefset_rec srgr_coefset[20]; // SRGR coefficient sets 
+   char   pixel_spacing[16];     // SGF product pixel spacing (F16.7) 
+   char   gics_reqd[3];          // GICS product required (A3) 
+   char   wo_number[8];          // Work order identifier (A8) 
+   char   wo_date[20];           // Work order entry date (A20) 
+   char   satellite_id[10];      // Satellite identifier (A10) 
+   char   user_id[20];           // User id (A20) 
+   char   complete_msg[3];       // Completion message required flag (A3) 
+   char   scene_id[15];          // SGF product scene identifier (A15) 
+   char   density_in[4];         // Density of SGF product media (A4) 
+   char   media_id[8];           // SGF product identifier (A8) 
+   char   angle_first[16];       // Incidence angle of first pixel in SGF product line (F16.7) 
+   char   angle_last[16];        // Incidence angle of last pixel in SGF product line (F16.7) 
+   char   prod_type[3];          // GICS output product type (A3) 
+   char   map_system[16];        // Map system identifier (A16) 
+   char   centre_lat[22];        // GICS output product scene centre latitude (D22.15) 
+   char   centre_long[22];       // GICS output product scene centre longitude (D22.15) 
+   char   span_x[22];            // GICS output product size - map eastings (km) (D22.15) 
+   char   span_y[22];            // GICS output product size - map northings (km) (D22.15) 
+   char   apply_dtm[3];          // DTM correction to be applied flag (A3) 
+   char   density_out[4];        // GICS output product density (A4) 
+   char   state_time[21];        // Time of the first state vector (A21) 
+   char   num_state_vectors[4];  // Number of state vectors (I4) 
+   char   state_time_inc[16];    // Time increment between state vectors (F16.7)
+   char   spare2[206];           // Unused (A207) 
+};
+
+
+struct map_proj_rec              // Map projection data record          
+{
+   struct desc_rec desc;         // Record description                  
+   char   spare1[16];            // Unused (A16) 
+   char   map_desc[32];          // Map projection descriptor (A32) 
+   char   n_pixel[16];           // Pixels per line (I16) 
+   char   n_line[16];            // Lines per processed band (I16) 
+   char   pixel_spacing[16];     // Inter-pixel distance (F16.7) 
+   char   line_spacing[16];      // Inter-line distance (F16.7) 
+   char   osc_orient[16];        // Output scene cntr orientation (F16.7)
+   char   orb_incl[16];          // Orbital inclination (F16.7) 
+   char   asc_node[16];          // Ascending node (F16.7) 
+   char   isc_dist[16];          // Input scene cntr plat dist (F16.7) 
+   char   geo_alt[16];           // Geodedic platform altitude (F16.7) 
+   char   isc_vel[16];           // Ground speed at input scene (F16.7) 
+   char   plat_head[16];         // Platform heading (F16.7) 
+   char   ref_ellip[32];         // Reference ellipsoid name (A32) 
+   char   semi_major[16];        // Ellipsoid semi-major axis (F16.7) 
+   char   semi_minor[16];        // Ellipsoid semi-minor axis (F16.7) 
+   char   datum_shift[3][16];    // Datum shift parameters (F16.7) 
+   char   aux_datum_shift[3][16];// Aux datum shift parameters (F16.7) 
+   char   scal_ellip[16];        // Ellisoid scale factor (F16.7) 
+   char   proj_desc[32];         // Map projection description (A32) 
+   char   utm_desc[32];          // UTM descriptor (A32) 
+   char   utm_zone_sig[4];       // UTM zone signature (A4) 
+   char   utm_east_orig[16];     // Map origin, false easting (F16.7) 
+   char   utm_north_orig[16];    // Map origin, false northing (F16.7) 
+   char   utm_cent_long[16];     // Projection centre longitude (F16.7) 
+   char   utm_cent_lat[16];      // Projection centre latitude (F16.7) 
+   char   utm_stand_par[2][16];  // Standard parallels (F16.7) 
+   char   utm_scale[16];         // Scale factor (F16.7) 
+   char   ups_desc[32];          // UPS descriptor (A32) 
+   char   ups_cent_long[16];     // Projection centre longitude (F16.7) 
+   char   ups_cent_lat[16];      // Projection centre latitude (F16.7) 
+   char   ups_scale[16];         // Scale factor (F16.7) 
+   char   nsp_desc[32];          // NSP descriptor (A32) 
+   char   nsp_east_orig[16];     // Map origin, false easting (F16.7) 
+   char   nsp_north_orig[16];    // Map origin, false northing (F16.7) 
+   char   nsp_cent_long[16];     // Projection centre longitude (F16.7) 
+   char   nsp_cent_lat[16];      // Projection centre latitude (F16.7) 
+   char   nsp_stand_par[4][16];  // Standard parallels (F16.7) 
+   char   nsp_stand_mer[3][16];  // Standard meridians (F16.7) 
+   char   nsp_spare[4][16];      // Project dependent (4A16) 
+   char   corner_ne[8][16];      // Corner northing/easting (F16.7) 
+   char   corner_ll[8][16];      // Corner latitude/longitude (F16.7) 
+   char   terr_height[4][16];    // Corner terrain height (F16.7) 
+   char   lp_conv_coef[8][20];   // Line/pixel coefficients (E20.10) 
+   char   mp_conv_coef[8][20];   // Map proj coefficients (E20.10) 
+   char   dem_type[4];           // DEM type (A4) 
+   char   spare3[32];            // Unused (A32) 
+};
+
+
+struct pos_vect_rec              // Position vector record              
+{
+   char   pos[3][22];            // Data point position (D22.15) 
+   char   vel[3][22];            // Data point velocity (D22.15) 
+};
+
+struct pos_data_rec               // Platform position data record       
+{
+   struct desc_rec desc;         // Record description                  
+   char   orbit_ele_desg[32];    // Orbital elements designator (A32) 
+   char   orbit_ele[6][16];      // Orbital elements (F16.7) 
+   char   ndata[4];              // Number of data points (I4) 
+   char   year[4];               // Year of data point (I4) 
+   char   month[4];              // Month of data point (I4) 
+   char   day[4];                // Day of data point (I4) 
+   char   gmt_day[4];            // Day of year (I4) 
+   char   gmt_sec[22];           // Seconds of day (D22.15) 
+   char   data_int[22];          // Data sampling interval (D22.15) 
+   char   ref_coord[64];         // Reference coordinate system (A64) 
+   char   hr_angle[22];          // Greenwich mean hour angle (D22.15) 
+   char   alt_poserr[16];        // Along track position error (F16.7) 
+   char   crt_poserr[16];        // Cross track position error (F16.7) 
+   char   rad_poserr[16];        // Radial position error (F16.7) 
+   char   alt_velerr[16];        // Along track velocity error (F16.7) 
+   char   crt_velerr[16];        // Cross track velocity error (F16.7) 
+   char   rad_velerr[16];        // Radial velocity error (F16.7) 
+   struct pos_vect_rec pos_vect[64]; // Data point position/velocity        
+   char   spare[126];            // Unused (A126) 
+};
+
+
+struct att_vect_rec              // Attitude point record               
+{
+   char   gmt_day[4];            // Day of the year, GMT (I4) 
+   char   gmt_sec[8];            // Milliseconds of day, GMT (I8) 
+   char   pitch_flag[4];         // Pitch data quality flag (I4) 
+   char   roll_flag[4];          // Roll data quality flag (I4) 
+   char   yaw_flag[4];           // Yaw data quality flag (I4) 
+   char   pitch[14];             // Pitch error, degrees (E14.6) 
+   char   roll[14];              // Roll error, degrees (E14.6) 
+   char   yaw[14];               // Yaw error, degrees (E14.6) 
+   char   pitch_rate_flag[4];    // Pitch rate data quality flag (I4) 
+   char   roll_rate_flag[4];     // Roll rate data quality flag (I4) 
+   char   yaw_rate_flag[4];      // Yaw rate data quality flag (I4) 
+   char   pitch_rate[14];        // Pitch rate, degrees/sec (E14.6) 
+   char   roll_rate[14];         // Roll rate, degrees/sec (E14.6) 
+   char   yaw_rate[14];          // Yaw rate, degrees/sec (E14.6) 
+};
+
+struct att_data_rec              // Attitude data record                
+{
+   struct desc_rec desc;         // Record description                  
+   char   npoint[4];             // Number of data points (I4) 
+   struct att_vect_rec att_vect[20]; // Data points                         
+   char   pitch_bias[14];        // Pitch bias (degrees) (E14.6) 
+   char   roll_bias[14];         // Roll bias (degrees) (E14.6) 
+   char   yaw_bias[14];          // Yaw bias (degrees) (E14.6) 
+   char   spare[6502];           // Unused (A6502) 
+};
+
+
+struct radi_dset_rec             // Radiometric data set record
+{
+   char   chan_ind[4];           // SAR channel indicator (A4) 
+   char   spare1[4];             // Unused (A4) 
+   char   table_desig[24];       // Table designator (A24) 
+   char   n_samp[8];             // Number of lookup table samples (I8) 
+   char   samp_type[16];         // Sample type designator (A16) 
+   char   samp_inc[4];           // Increment between table entries, range samples (I4) 
+   char   lookup_tab[512][16];   // Output scaling gain table (E16.7) 
+   char   spare2[4];             // Unused (A4) 
+   char   noise_scale[16];       // Thermal noise reference level (F16.7) 
+   char   spare3[16];            // Unused (A16) 
+   char   offset[16];            // Scaling offset (E16.7) 
+   char   calib_const[16];       // Calibration constant (E16.7) 
+};
+
+struct radi_data_rec             // Radiometric data record
+{
+   struct desc_rec desc;         // Record description
+   char   seq_num[4];            // Record sequence number (I4) 
+   char   n_data[4];             // Number of data fields (I4) 
+   char   field_size[8];         // Field size in bytes (I8) 
+   struct radi_dset_rec dset[1]; // Radiometric data set records
+   char   spare1[1512];          // Unused (A1512) 
+};
+
+
+struct comp_dset_rec             // Compensation data set record
+{
+   char   comp_desig[8];         // Compensation data designator (A8) 
+   char   comp_descr[32];        // Compensation data descriptor (A32) 
+   char   n_comp_rec[4];         // Number of compensation records (I4) 
+   char   comp_seq_no[4];        // Compensation record sequence number (I4) 
+   char   beam_tab_size[8];      // Number of beam table entries (I8) 
+   char   beam_tab[256][16];     // Elevation gain beam profile (256F16.7) 
+   char   beam_type[16];         // Beam type (A16) 
+   char   look_angle[16];        // Look angle of beam table centre (F16.7) 
+   char   beam_tab_inc[16];      // Increment between beam table entries (F16.7)
+};
+
+struct radi_comp_rec             // Radiometric compensation data record
+{
+   struct desc_rec desc;         // Record description 
+   char   seq_num[4];            // Record sequence number (I4) 
+   char   chan_ind[4];           // SAR channel indicator (A4) 
+   char   n_dset[8];             // Number of data sets in record (I8) 
+   char   dset_size[8];          // Compensation data set size (I8) 
+   struct comp_dset_rec dset[4]; // Compensation data set records
+};
+
+
+struct imop_desc_rec             // Image options file descriptor       
+{
+   struct desc_rec desc;         // Record description                  
+   char   ascii_flag[2];         // ASCII flag (A2) 
+   char   spare1[2];             // Unused (A2) 
+   char   format_doc[12];        // Format control document (A12) 
+   char   format_rev[2];         // Format document revision (A2) 
+   char   design_rev[2];         // File design revision (A2) 
+   char   software_id[12];       // Software identifier (A12) 
+   char   file_num[4];           // File number (I4) 
+   char   file_name[16];         // File name (A16) 
+   char   rec_seq[4];            // Record sequence/location flag (A4) 
+   char   seq_loc[8];            // Sequence number location (I8) 
+   char   seq_len[4];            // Sequence number length (I4) 
+   char   rec_code[4];           // Record code/location flag (A4) 
+   char   code_loc[8];           // Record code location (I8) 
+   char   code_len[4];           // Record code length (I4) 
+   char   rec_len[4];            // Record length/location flag (A4) 
+   char   rlen_loc[8];           // Record length location (I8) 
+   char   rlen_len[4];           // Record length length (I4) 
+   char   spare2[4];             // Reserved (4A1) 
+   char   spare3[64];            // Reserved segment (A64) 
+   char   n_dataset[6];          // Number of SAR data records (I6) 
+   char   l_dataset[6];          // SAR data record length (I6) 
+   char   spare4[24];            // Unused (A24) 
+   char   nbit[4];               // Number of bits per sample (I4) 
+   char   nsamp[4];              // Samples per data group (I4) 
+   char   nbyte[4];              // Bytes per data group (I4) 
+   char   justify[4];            // Sample justification and order (A4) 
+   char   nchn[4];               // Number of SAR channels (I4) 
+   char   nlin[8];               // Lines per data set (I8) 
+   char   nleft[4];              // Left border pixels per line (I4) 
+   char   ngrp[8];               // Groups per line per channel (I8) 
+   char   nright[4];             // Right border pixels per line (I4) 
+   char   ntop[4];               // Top border lines (I4) 
+   char   nbott[4];              // Bottom border lines (I4) 
+   char   intleav[4];            // Interleave indicator (A4) 
+   char   nrec_lin[2];           // Number of physical records per line (I2) 
+   char   nrec_chn[2];           // Number of physical records per multi-channel line in this file (I2) 
+   char   n_prefix[4];           // Number of bytes of prefix data per record (I4) 
+   char   n_sar[8];              // Number of bytes of SAR data (or pixel data) per record (I8) 
+   char   n_suffix[4];           // Number of bytes of suffix data per record (I4) 
+   char   spare5[4];             // Unused (A4) 
+   char   lin_loc[8];            // Line number locator (A8) 
+   char   chn_loc[8];            // Channel number locator (A8) 
+   char   tim_loc[8];            // Time locator (A8) 
+   char   left_loc[8];           // Left fill locator (A8) 
+   char   right_loc[8];          // Right fill locator (A8) 
+   char   pad_ind[4];            // Pad pixel indicator (A4) 
+   char   spare6[28];            // Unused (A28) 
+   char   qual_loc[8];           // Quality code locator (A8) 
+   char   cali_loc[8];           // Calibration info locator (A8) 
+   char   gain_loc[8];           // Gain value locator (A8) 
+   char   bias_loc[8];           // Bias value locator (A8) 
+   char   type_id[28];           // Data type identifier (A28) 
+   char   type_code[4];          // Data type code (A4) 
+   char   left_fill[4];          // Number of left fill bits (I4) 
+   char   right_fill[4];         // Number of right fill bits (I4) 
+   char   pix_rng[8];            // Maximum data range of pixel (I8) 
+   char   spare7[15804];         // Unused (A15804) 
+};
+
+
+struct acq_date_rec              // Acquisition date/time               
+{
+   ossim_int32  acq_year;              // Acquisition year (B4) 
+   ossim_int32  acq_day;               // Acquisition day of year (B4) 
+   ossim_int32  acq_msec;              // Acquisition msecs of day (B4) 
+};
+
+struct sdr_prefix_rec            // Signal data prefix data                    
+{
+   ossim_int32  line_num;              // Image data line number (B4) 
+   ossim_int32  rec_num;               // Image data record index (B4) 
+   ossim_int32  n_left_pixel;          // Left fill pixel count (B4) 
+   ossim_int32  n_data_pixel;          // Data pixel count (B4) 
+   ossim_int32  n_right_pixel;         // Right fill pixel count. (B4) 
+   ossim_int32  sensor_updf;           // Sensor parameter update flag (B4) 
+   struct acq_date_rec acq_date; // Acquisition date                           
+   ossim_int16  sar_chan_ind;          // SAR channel indicator (B2) 
+   ossim_int16  sar_chan_code;         // SAR channel code (B2) 
+   ossim_int16  tran_polar;            // Transmitted polarization (B2) 
+   ossim_int16  recv_polar;            // Received polarization (B2) 
+   ossim_int32  prf;                   // Pulse repetition frequency, Hz (B4) 
+   ossim_uint8   spare1[4];             // Unused (B4) 
+   ossim_int16  obrc;                  // On-board range compressed flag (B2) 
+   ossim_int16  pulse_type;            // Pulse type designator (B2) 
+   ossim_int32  chp_len;               // Chirp length, ns (B4) 
+   ossim_int32  chp_coef1;             // Chirp constant coefficient,Hz (B4) 
+   ossim_int32  chp_coef2;             // Chirp linear coefficient,Hz/usec (B4) 
+   ossim_int32  chp_coef3;             // Chirp quadratic coefficient,Hz/usec^2 (B4) 
+   ossim_uint8   spare2[2][4];          // Spare (2B4) 
+   ossim_int32  recv_gain;             // Receiver gain (B4) 
+   ossim_int32  nt_line;               // Nought line flag (B4) 
+   ossim_int32  ele_nadir;             // Elec. nadir angle, 10**-6 deg (B4) 
+   ossim_int32  mec_nadir;             // Mech. nadir angle, 10**-6 deg (B4) 
+   ossim_int32  ele_squint;            // Elec. squint angle, 10**-6 deg (B4) 
+   ossim_int32  mec_squint;            // Mech. squint angle, 10**-6 deg (B4) 
+   ossim_int32  sr_first;              // First sample slant range, m (B4) 
+   ossim_int32  dr_window;             // Data record window time, ns (B4) 
+   ossim_uint8   spare3[4];             // Spare (B4) 
+   ossim_int32  plat_updf;             // Platform position update flag (B4) 
+   ossim_int32  plat_lat;              // Platform latitude, 10**-6 deg (B4) 
+   ossim_int32  plat_long;             // Platform longitude, 10**-6 deg (B4) 
+   ossim_int32  plat_alt;              // Platform altitude, m (B4) 
+   ossim_int32  plat_speed;            // Platform speed, cm/s (B4) 
+   ossim_int32  plat_vel[3];           // Platform velocity, cm/s (3B4) 
+   ossim_int32  plat_acc[3];           // Platform acceleration, cm/s (3B4) 
+   ossim_int32  plat_track;            // Platform track, 10**-6 deg (B4) 
+   ossim_int32  plat_head;             // Platform heading, 10**-6 deg (B4) 
+   ossim_int32  plat_pitch;            // Platform pitch, 10**-6 deg (B4) 
+   ossim_int32  plat_roll;             // Platform roll, 10**-6 deg (B4) 
+   ossim_int32  plat_yaw;              // Platform yaw, 10**-6 deg (B4) 
+};
+
+struct sdr_data_rec              // Signal data record                  
+{
+   struct desc_rec desc;         // Record description                  
+   struct sdr_prefix_rec prefix; // Prefix data                         
+   ossim_uint8   sdr_data;              // SAR signal data (jBk) 
+};
+
+
+struct pdr_prefix_rec            // Processed data prefix data
+{
+   ossim_int32  line_num;              // Image data line number (B4) 
+   ossim_int32  rec_num;               // Image data record index (B4) 
+   ossim_int32  n_left_pixel;          // Left fill pixel count (B4) 
+   ossim_int32  n_data_pixel;          // Data pixel count (B4) 
+   ossim_int32  n_right_pixel;         // Right fill pixel count (B4) 
+   ossim_int32  sensor_updf;           // Sensor parameter update flag (B4) 
+   struct acq_date_rec acq_date; // Acquisition date
+   ossim_int16  sar_chan_ind;          // SAR channel indicator (B2) 
+   ossim_int16  sar_chan_code;         // SAR channel code (B2) 
+   ossim_int16  tran_polar;            // Transmitted polarization (B2) 
+   ossim_int16  recv_polar;            // Received polarization (B2) 
+   ossim_int32  prf;                   // Pulse repetition frequency, Hz (B4) 
+   ossim_uint8   spare1[4];             // Unused (B4) 
+   ossim_int32  sr_first;              // Slant range to first pixel, m (B4) 
+   ossim_int32  sr_mid;                // Slant range to mid-pixel, m (B4) 
+   ossim_int32  sr_last;               // Slant range to last pixel, m (B4) 
+   ossim_int32  fdc_first;             // First pixel Doppler centroid, Hz (B4) 
+   ossim_int32  fdc_mid;               // Mid-pixel Doppler centroid, Hz (B4) 
+   ossim_int32  fdc_last;              // Last pixel Doppler centroid, Hz (B4) 
+   ossim_int32  ka_first;              // First pixel azimuth FM rate, Hz (B4) 
+   ossim_int32  ka_mid;                // Mid-pixel azimuth FM rate, Hz (B4) 
+   ossim_int32  ka_last;               // Last pixel azimuth  FM rate, Hz (B4) 
+   ossim_int32  nadir_ang;             // Nadir look angle, 10**-6 deg (B4) 
+   ossim_int32  squint_ang;            // Azimuth squint angle, 10**-6 deg (B4) 
+   ossim_int32  null_f;                // Null line flag - 1 for NULL line, 0 for otherwise (B4) 
+   ossim_uint8   spare2[4][4];          // Unused (4B4) 
+   ossim_int32  geo_updf;              // Geographic parameter update flag (B4) 
+   ossim_int32  lat_first;             // First pixel latitude, millionths of deg (B4)
+   ossim_int32  lat_mid;               // Mid-pixel latitude (B4) 
+   ossim_int32  lat_last;              // Last pixel latitude (B4) 
+   ossim_int32  long_first;            // First pixel longitude, millionths of deg (B4) 
+   ossim_int32  long_mid;              // Mid pixel longitue (B4) 
+   ossim_int32  long_last;             // Last pixel longitude (B4) 
+   ossim_int32  north_first;           // Northing of first pixel, m (B4) 
+   ossim_uint8   spare3[4];             // Unused (B4) 
+   ossim_int32  north_last;            // Northing of last pixel, m (B4) 
+   ossim_int32  east_first;            // Easting of first pixel, m (B4) 
+   ossim_uint8   spare4[4];             // Spare (B4) 
+   ossim_int32  east_last;             // Easting of last pixel, m (B4) 
+   ossim_int32  heading;               // Line heading, millionths of deg (B4) 
+   ossim_uint8   spare5[8];             // Unused (B8) 
+};
+
+struct pdr_data_rec              // Processed data record               
+{
+   struct desc_rec       desc;   // Record description                  
+   struct pdr_prefix_rec prefix; // Prefix data                         
+};
+
+
+struct pdr8_htab_rec             // Histogram table record 
+{
+   char   hist_desc[32];         // Histogram descriptor (A32) 
+   char   nrec[4];               // Records per table (I4) 
+   char   tab_seq[4];            // Table sequence number (I4) 
+   char   nbin[8];               // Total number of table bins (I8) 
+   char   ns_lin[8];             // Total number of pixels in line direction (I8) 
+   char   ns_pix[8];             // Total number of lines (I8) 
+   char   ngrp_lin[8];           // Group size along pixel axis (I8) 
+   char   ngrp_pix[8];           // Group size along line axis (I8) 
+   char   nsamp_lin[8];          // Number of samples used per group along pixel axis (I8) 
+   char   nsamp_pix[8];          // Number of samples used per group along line (I8)
+   char   min_smp[16];           // Minimum first bin (E16.7) 
+   char   max_smp[16];           // Maximum last bin (E16.7) 
+   char   mean_smp[16];          // Mean sample value (E16.7) 
+   char   std_smp[16];           // Sample standard deviation (E16.7) 
+   char   smp_inc[16];           // Sample value increment (E16.7) 
+   char   min_hist[16];          // Minimum histogram value (E16.7) 
+   char   max_hist[16];          // Maximum histogram value (E16.7) 
+   char   mean_hist[16];         // Histogram mean value (E16.7) 
+   char   std_hist[16];          // Histogram standard deviation (E16.7) 
+   char   nhist[8];              // Histogram table size (I8) 
+   char   hist[256][8];          // 256 histogram table values for 256 bins (I8)
+};
+
+struct pdr8_hist_rec             // Data histogram record
+{
+   struct desc_rec desc;         // Record description
+   char   rec_seq[4];            // Record sequence number (I4) 
+   char   sar_chn[4];            // SAR channel number (I4) 
+   char   ntab[8];               // Num hist. table data sets in record (I8) 
+   char   ltab[8];               // Histogram table data set size (I8) 
+   struct pdr8_htab_rec htab;    // Histogram tables
+   char   spare[14588];          // Unused (A14588) 
+};
+
+
+struct null_vol_rec              // Null volume descriptor record       
+{
+   struct desc_rec desc;         // Record description                  
+   char   ascii_flag[2];         // ASCII flag (A2) 
+   char   spare1[2];             // Unused (A2) 
+   char   format_doc[12];        // Format control doc (A12) 
+   char   format_ver[2];         // Format doc version (A2) 
+   char   format_rev[2];         // Format doc revision (A2) 
+   char   software_id[12];       // Software identifier (A12) 
+   char   tape_id[16];           // Physical tape id (A16) 
+   char   logvol_id[16];         // Logical volume id (A16) 
+   char   phyvol_id[16];         // Physical volume id (A16) 
+   char   n_phyvol[2];           // Total physical volume count (I2) 
+   char   first_phyvol[2];       // First physical volume (I2) 
+   char   last_phyvol[2];        // Last physical volume (I2) 
+   char   curr_phyvol[2];        // Current physical volume (I2) 
+   char   first_file[4];         // First file in volume (I4) 
+   char   volset_log[4];         // Logical volume within set (I4) 
+   char   logvol_vol[4];         // Logical volume within phyvol (I4) 
+   char   spare2[248];           // Unused (A248) 
+};
+
+struct VolumeDirectoryFile
+{
+   vol_desc_rec      volDescRec;
+   file_pntr_rec     leaderFilePntrRec;
+   file_pntr_rec     imageOptionsFilePntrRec;
+   file_pntr_rec     trailerFilePntrRec;
+   text_rec          textRec;
+};
+
+struct SarLeaderFile
+{
+   sar_desc_rec      sarDescRec;
+   dataset_sum_rec   dataSetSumRec;
+   qual_sum_rec      qualSumRec;
+   sdr_hist_rec      sdrHistRec;
+   pdr16_hist_rec    pdr16HistRec;
+   proc_parm_rec     procParmRec;
+   map_proj_rec      mapProjRec;
+   pos_data_rec      posDataRec;
+   att_data_rec      attDataRec;
+   radi_data_rec     radiDataRec;
+   radi_comp_rec     radiCompRec;
+};
+
+struct SarTrailerFile
+{
+   sar_desc_rec      sarDescRec;
+   dataset_sum_rec   dataSetSumRec;
+   qual_sum_rec      qualSumRec;
+   sdr_hist_rec      sdrHistRec;
+   pdr8_hist_rec     pdr8HistRec;
+   proc_parm_rec     procParmRec;
+   att_data_rec      attDataRec;
+   radi_data_rec     radiDataRec;
+   radi_comp_rec     radiCompRec;
+};
+
+class ossimCeosData : public ossimReferenced
+{
+public:
+
+   enum ErrorStatus
+   {
+      OK = 0,
+      ERROR
+   };
+   
+   ossimCeosData(const ossimFilename& volDirFile,
+            const ossimFilename& leaderFile,
+            const ossimFilename& imageFile,
+            const ossimFilename& trailerFile);
+
+   ossimCeosData(const ossimFilename& imageDir);
+
+   bool errorStatus()   const { return theErrorStatus; }
+
+   const ossimFilename& volDirFile()    const { return theVolDirFileName; }
+   const ossimFilename& leaderFile()    const { return theLeaderFileName; }
+   const ossimFilename& imageFile()     const { return theImageFileName; }
+   const ossimFilename& trailerFile()   const { return theTrailerFileName; }
+
+   const vol_desc_rec*    volDescRec()    const { return theVolDescRec; }
+   const text_rec*        textRec()       const { return theTextRec; }
+   const imop_desc_rec*   imopDescRec()   const { return &theImopDescRec; }
+   const dataset_sum_rec* dataSetSumRec() const { return theDataSetSumRec; }
+   const qual_sum_rec*    qualSumRec()    const { return theQualSumRec; }
+   const sdr_hist_rec*    sdrHistRec()    const { return theSdrHistRec; }
+   const pdr16_hist_rec*  pdr16HistRec()  const { return thePdr16HistRec; }
+   const pdr8_hist_rec*   pdr8HistRec()   const { return thePdr8HistRec; }
+   const proc_parm_rec*   procParmRec()   const { return theProcParmRec; }
+   const map_proj_rec*    mapProjRec()    const { return theMapProjRec; }
+   const pos_data_rec*    posDataRec()    const { return thePosDataRec; }
+   const att_data_rec*    attDataRec()    const { return theAttDataRec; }
+   const radi_data_rec*   radiDataRec()   const { return theRadiDataRec; }
+   const radi_comp_rec*   radiCompRec()   const { return theRadiCompRec; }
+   
+   void                   dump(std::ostream& strm = std::clog) const;
+   void                   dumpVolDescRec   (std::ostream&) const;
+   void                   dumpTextRec      (std::ostream&) const;
+   void                   dumpImopDescRec  (std::ostream&) const;
+   void                   dumpDataSetSumRec(std::ostream&) const;
+   void                   dumpQualSumRec   (std::ostream&) const;
+   void                   dumpSdrHistRec   (std::ostream&) const;
+   void                   dumpPdr16HistRec (std::ostream&) const;
+   void                   dumpPdr8HistRec  (std::ostream&) const;
+   void                   dumpProcParmRec  (std::ostream&) const;
+   void                   dumpMapProjRec   (std::ostream&) const;
+   void                   dumpPosDataRec   (std::ostream&) const;
+   void                   dumpAttDataRec   (std::ostream&) const;
+   void                   dumpRadiDataRec  (std::ostream&) const;
+   void                   dumpRadiCompRec  (std::ostream&) const;
+
+private:
+   void                   loadCeosRecords();
+   ossim_int32             sizeOfNextRec(FILE*);
+   
+   VolumeDirectoryFile    theVolumeDirectory;
+   SarLeaderFile          theSarLeaderFile;
+   imop_desc_rec          theImopDescRec;
+   SarTrailerFile         theSarTrailerFile;
+
+   ossimFilename          theVolDirFileName;
+   ossimFilename          theLeaderFileName;
+   ossimFilename          theImageFileName;
+   ossimFilename          theTrailerFileName;
+   
+   bool                   theErrorStatus;
+
+   vol_desc_rec*          theVolDescRec;
+   text_rec*              theTextRec;
+   dataset_sum_rec*       theDataSetSumRec;
+   qual_sum_rec*          theQualSumRec;
+   sdr_hist_rec*          theSdrHistRec;
+   pdr16_hist_rec*        thePdr16HistRec;
+   pdr8_hist_rec*         thePdr8HistRec;
+   proc_parm_rec*         theProcParmRec;
+   map_proj_rec*          theMapProjRec;
+   pos_data_rec*          thePosDataRec;
+   att_data_rec*          theAttDataRec;
+   radi_data_rec*         theRadiDataRec;
+   radi_comp_rec*         theRadiCompRec;
+};
+
+
+
+#endif
diff --git a/include/ossim/support_data/ossimDoqq.h b/include/ossim/support_data/ossimDoqq.h
index 10706b9..0365617 100644
--- a/include/ossim/support_data/ossimDoqq.h
+++ b/include/ossim/support_data/ossimDoqq.h
@@ -11,22 +11,27 @@
 //              header.
 //
 //********************************************************************
-// $Id: ossimDoqq.h 9094 2006-06-13 19:12:40Z dburken $
+// $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/base/ossimReferenced.h>
+#include <ossim/support_data/ossimInfoBase.h>
 
-class OSSIM_DLL ossimDoqq : public ossimReferenced
+class OSSIM_DLL ossimDoqq : public ossimInfoBase
 {
 public:
+   ossimDoqq();
    ossimDoqq(ossimFilename file);
    ~ossimDoqq();
    
@@ -38,11 +43,6 @@ public:
 
    enum
    {
-      NUMBER_OF_RECORDS       = 4,
-      QUADRANGLE_NAME_OFFSET  = 0,
-      QUADRANT_OFFSET         = 38,
-      NATION_OFFSET           = 40,
-      STATE_OFFSET            = 44,
       GSD_X_OFFSET            = 59,
       GSD_Y_OFFSET            = 59,
       DATA_ORDER_OFFSET       = 142,      
@@ -55,10 +55,6 @@ public:
       UTM_ZONE_OFFSET         = 199,
       DATUM_OFFSET            = 168,
 
-      QUADRANGLE_NAME_SIZE    = 37,
-      QUADRANT_SIZE           = 2,
-      NATION_SIZE             = 4,
-      STATE_SIZE              = 2,
       DATA_ORDER_SIZE         = 3,
       LINE_SIZE               = 8,
       SAMPLE_SIZE             = 8,  
@@ -72,9 +68,14 @@ public:
       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;
@@ -84,7 +85,9 @@ public:
    ossimString theDataOrder;
    ossimString theMarkU;
    ossimString theMarkV;
-   
+   ossimString theImageSource;
+   ossimString theSourceImageID;
+
    ossim_int32 theUtmZone;
    ossim_int32 theLine;
    ossim_int32 theSample;
@@ -93,7 +96,10 @@ public:
    ossimString theAcqYear;
    ossimString theAcqMonth;
    ossimString theAcqDay;
-   
+   ossimString theAcqYearMonthDay;
+
+   ossim_float64 theRMSE;
+
    ossim_float64   theEasting;
    ossim_float64   theNorthing;
    ossim_float64   theUN;
@@ -104,14 +110,12 @@ public:
    ossim_int32     theHeaderSize;
    ossim_int32     theRecordSize;
 
-   friend std::ostream& operator<<(std::ostream& os, const ossimDoqq& doq);
    ossim_int32 errorStatus() const { return theErrorStatus; }
    
 private:
-   // prevent use
-   ossimDoqq();
 
-   ossimErrorStatus        theErrorStatus;
+   std::ifstream           theDoqFile;
+   ossimErrorStatus   theErrorStatus;
    
    ossim_float64 convertStr(const char* str) const;
 
diff --git a/include/ossim/support_data/ossimEnviHeader.h b/include/ossim/support_data/ossimEnviHeader.h
index baaea8a..7199f0b 100644
--- a/include/ossim/support_data/ossimEnviHeader.h
+++ b/include/ossim/support_data/ossimEnviHeader.h
@@ -7,35 +7,70 @@
 // Description:
 // 
 // Class for reading and writing an ENVI (The Environment for Visualizing
-// Images) header file.
+// Images) header file.  This parses envi header and places in a keyword
+// list.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimEnviHeader.h 9094 2006-06-13 19:12:40Z dburken $
+// $Id: ossimEnviHeader.h 22356 2013-08-05 13:47:11Z gpotts $
+
 #ifndef ossimEnviHeader_HEADER
-#define ossimEnviHeader_HEADER
+#define ossimEnviHeader_HEADER 1
 
-#include <ossim/base/ossimErrorStatusInterface.h>
 #include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
 #include <ossim/base/ossimString.h>
-
-
-class ossimFilename;
-class ossimKeywordlist;
+#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 ossimErrorStatusInterface
+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.
     * 
@@ -61,6 +96,10 @@ public:
     */
    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.
     */
@@ -108,6 +147,22 @@ public:
    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;
@@ -178,12 +233,12 @@ public:
    void setSensorType(const ossimString& sensorType);
 
    /**
-    * @return The envi byte order.
+    * @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;
    
@@ -198,13 +253,25 @@ public:
     * @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.
@@ -310,27 +377,39 @@ public:
     */
    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:
 
-   void parseDescription(std::ifstream& is);
-   void parseWavelength(std::ifstream& is);
-   void parseBandNames(std::ifstream& is);
-
-   ossimString         theDescription;
-   ossim_uint32        theSamples;
-   ossim_uint32        theLines;
-   ossim_uint32        theBands;
-   ossim_uint32        theHeaderOffset;
-   ossimString         theFileType;
-   ossim_uint32        theDataType;
-   ossimString         theInterleave;
-   ossimString         theSensorType;
-   ossimByteOrder      theByteOrder;
-   ossim_int32         theXStart;
-   ossimString         theMapInfo;
-   ossimString         theWavelengthUnits;
-   std::vector<ossimString> theBandName;
-   std::vector<ossimString> theWavelength;
+   /**
+    * @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/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/ossimGeoTiff.h b/include/ossim/support_data/ossimGeoTiff.h
index fd1a6bd..9022ed1 100644
--- a/include/ossim/support_data/ossimGeoTiff.h
+++ b/include/ossim/support_data/ossimGeoTiff.h
@@ -9,7 +9,7 @@
 // information.
 //
 //***************************************************************************
-// $Id: ossimGeoTiff.h 17815 2010-08-03 13:23:14Z dburken $
+// $Id: ossimGeoTiff.h 21023 2012-05-29 20:32:22Z dburken $
 
 #ifndef ossimGeoTiff_HEADER
 #define ossimGeoTiff_HEADER 1
@@ -24,12 +24,12 @@
 #include <vector>
 
 #include <tiffio.h>
-#include <geo_normalize.h>
 #include <OpenThreads/Mutex>
 #include <OpenThreads/ScopedLock>
 
 class ossimFilename;
 class ossimKeywordlist;
+class ossimPrivateGtifDef;
 class ossimProjection;
 class ossimTieGptSet;
 
@@ -122,12 +122,14 @@ public:
     * @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);
+                                  std::vector<ossim_uint8>& buf,
+                                  ossimPixelType pixelType);
    
    /**
     *  Reads tags.
@@ -196,6 +198,7 @@ public:
    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;
@@ -263,7 +266,7 @@ private:
    ossim_uint16          theBitsPerSample;                 // tag 258
 
    ossim_uint16          theModelType;                     // key 1024
-   ossim_uint16          theRasterType;                    // key 1025
+   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
@@ -279,9 +282,9 @@ private:
    double                theFalseNorthing;                 // key 3083
    double                theScaleFactor;                   // key 3092
    
-   GTIFDefn*             theNormalizedDefinitions;
+   ossimPrivateGtifDef*  thePrivateDefinitions;
+   
    static OpenThreads::Mutex theMutex;
-
 };
 
 #endif
diff --git a/include/ossim/support_data/ossimInfoFactory.h b/include/ossim/support_data/ossimInfoFactory.h
index ec1a8dd..fd04c38 100644
--- a/include/ossim/support_data/ossimInfoFactory.h
+++ b/include/ossim/support_data/ossimInfoFactory.h
@@ -9,7 +9,7 @@
 // Description: Factory for info objects.
 // 
 //----------------------------------------------------------------------------
-// $Id$
+// $Id: ossimInfoFactory.h 20125 2011-10-11 19:47:19Z dburken $
 #ifndef ossimInfoFactory_HEADER
 #define ossimInfoFactory_HEADER
 
@@ -51,6 +51,9 @@ private:
 
    /** 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
index 47b7818..f36df89 100644
--- a/include/ossim/support_data/ossimInfoFactoryInterface.h
+++ b/include/ossim/support_data/ossimInfoFactoryInterface.h
@@ -14,15 +14,26 @@
 #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
+class OSSIM_DLL ossimInfoFactoryInterface // : public ossimObjectFactory
 {
 public:
 
@@ -42,6 +53,28 @@ public:
     * 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/include/ossim/support_data/ossimInfoFactoryRegistry.h b/include/ossim/support_data/ossimInfoFactoryRegistry.h
index 28be538..af39de3 100644
--- a/include/ossim/support_data/ossimInfoFactoryRegistry.h
+++ b/include/ossim/support_data/ossimInfoFactoryRegistry.h
@@ -10,10 +10,11 @@
 // $Id$
 
 #ifndef ossimInfoFactoryRegistry_HEADER
-#define ossimInfoFactoryRegistry_HEADER
+#define ossimInfoFactoryRegistry_HEADER 1
 
-#include <vector>
 #include <ossim/base/ossimConstants.h> /* for OSSIM_DLL macro */
+#include <OpenThreads/Mutex>
+#include <vector>
 
 // Forward class declarations.
 class ossimInfoFactoryInterface;
@@ -35,12 +36,18 @@ public:
    static ossimInfoFactoryRegistry* instance();
 
    /**
-    * Method to add factory to registry.
+    * @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.
@@ -72,7 +79,11 @@ protected:
    const ossimInfoFactoryRegistry& operator=(
       const ossimInfoFactoryRegistry& rhs);
    
-   std::vector<ossimInfoFactoryInterface*> theFactoryList;
+   std::vector<ossimInfoFactoryInterface*> m_factoryList;
+
+   OpenThreads::Mutex m_mutex;
+
+   static ossimInfoFactoryRegistry* m_instance;
 };
 
 #endif /* #ifndef ossimInfoFactoryRegistry_HEADER */
diff --git a/include/ossim/support_data/ossimJp2Info.h b/include/ossim/support_data/ossimJp2Info.h
new file mode 100644
index 0000000..7788725
--- /dev/null
+++ b/include/ossim/support_data/ossimJp2Info.h
@@ -0,0 +1,63 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: JP2 Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimJp2Info.h 20125 2011-10-11 19:47:19Z dburken $
+#ifndef ossimJp2Info_HEADER
+#define ossimJp2Info_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimInfoBase.h>
+#include <ossim/base/ossimFilename.h>
+
+/**
+ * @brief JP2 info class.
+ */
+class OSSIM_DLL ossimJp2Info : public ossimInfoBase
+{
+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;
+
+private:
+
+   ossimFilename m_file;
+};
+
+#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/include/ossim/support_data/ossimJpipMessageDecoder.h b/include/ossim/support_data/ossimJpipMessageDecoder.h
new file mode 100644
index 0000000..574d4c2
--- /dev/null
+++ b/include/ossim/support_data/ossimJpipMessageDecoder.h
@@ -0,0 +1,51 @@
+#ifndef ossimJpipMessageDecoder_HEADER
+#define ossimJpipMessageDecoder_HEADER 1
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimByteStreamBuffer.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/support_data/ossimJpipMessage.h>
+
+class OSSIM_DLL ossimJpipMessageDecoder : public ossimReferenced
+{
+public:
+    ossimJpipMessageDecoder();
+    ossimByteStreamBuffer& inputStreamBuffer(){return m_streamBuffer;}
+    std::istream& inputStream()const{return m_inputStream;}
+    
+    // virtual ossimJpipMessage* readMessage() throw(ossimException);
+    virtual ossimJpipMessage* readMessage();
+    
+protected:
+    /**
+     * Reads a Variable-length Byte-Aligned Segment. 
+     * 
+     * @return the value which has been read from the VBAS.
+     * 
+     * @throws ossimException if an I/O error occurs.
+     */
+    // ossim_int64 readVBAS() throw(ossimException);
+    ossim_int64 readVBAS();
+    
+    // ossimJpipMessage* readEORMessage() throw(ossimException);
+    ossimJpipMessage* readEORMessage(); 
+    
+    ossim_int32 m_lastClass;
+    
+    /**
+     * Contains the last CSn value. It is a state variables used when dependent
+     * form is used.
+     */
+    ossim_int32 m_lastCSn;
+    
+    /**
+     * Indicates the length of the JPIP message header. This attribute is
+     * useful for statistics.
+     */
+    ossim_int64 m_headerLength;
+    
+    mutable ossimByteStreamBuffer m_streamBuffer;
+    mutable std::istream m_inputStream;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimJpipMessageHeader.h b/include/ossim/support_data/ossimJpipMessageHeader.h
new file mode 100644
index 0000000..9924430
--- /dev/null
+++ b/include/ossim/support_data/ossimJpipMessageHeader.h
@@ -0,0 +1,234 @@
+/*********************************************************************************************
+ *
+ * ossimJpipMessage was modified from the oiginal source found in a JAVA based framework called
+ *
+ * CADI Software - a JPIP Client/Server framework
+ * 
+ *********************************************************************************************/
+#ifndef ossimJpipMessageHeader_HEADER
+#define ossimJpipMessageHeader_HEADER
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
+#include <sstream>
+
+class OSSIM_DLL ossimJpipMessageHeader : public ossimReferenced
+{
+public:
+    ossimJpipMessageHeader()
+    :m_isLastByte(true),
+    m_inClassIdentifier(-1),
+    m_classIdentifier(-1),
+    m_CSn(-1),
+    m_msgOffset(-1),
+    m_msgLength(-1),
+    m_aux(-1),
+    m_isEOR(false),
+    m_EORCode(-1),
+    m_EORReasonMessage("")
+    {
+        
+    }
+    void reset()
+    {
+        m_isLastByte        = true;
+        m_inClassIdentifier = -1;
+        m_classIdentifier   = -1;
+        m_CSn               = -1;
+        m_msgOffset         = -1;
+        m_msgLength         = -1;
+        m_aux               = -1;
+        m_isEOR             = false;
+        m_EORCode           = -1;
+        m_EORReasonMessage  = "";
+    }
+    ossimString toString() const
+    {
+        std::ostringstream out;
+        
+        out << "m_isLastByte: " << ossimString::toString(m_isLastByte) << "\n"
+        << "m_inClassIdentifier: " << m_inClassIdentifier << "\n"
+        << "m_classIdentifier: " << m_classIdentifier << "\n"
+        << "m_CSn: " << m_CSn << "\n"
+        << "m_msgOffset: " << m_msgOffset << "\n"
+        << "m_msgLength: " << m_msgLength << "\n"
+        << "m_aux: "       << m_aux << "\n"
+        << "m_isEOR: "            << m_isEOR << "\n"
+        << "m_EORCode: "          << m_EORCode << "\n"
+        << "m_EORReasonMessage: " << m_EORReasonMessage << "\n";
+        
+        return ossimString(out.str());
+	}	
+    
+    /**
+	 *	Bin-ID = [BinIdIndicator, completeDataBin, InClassIdentifier]
+	 * 
+	 * Bin-ID format:<BR>
+	 *  
+	 *  <samp>
+	 *  MSB                                                 LSB 
+	 *   7 6 5 4 3 2 1 0    7 6 5 4 3 2 1 0    7 6 5 4 3 2 1 0  
+	 *  -----------------  -----------------  -----------------
+	 *  |a|b b|c|d d d d|  |a|d d d d d d d|  |a|d d d d d d d| .....
+	 *  -----------------  -----------------  -----------------
+	 *  </samp>
+	 * <P>
+	 *  Bits 6 and 5 of the first, BinIDIndicator, byte indicate whether the
+	 *  Class and CSn VBASs are present in the message header. Next table defines
+	 *  the bit values and its meaning
+	 *  <P>
+	 *  <table border=1 cellspacing=0 cellpadding=2>
+	 *  	<tr align=center>
+	 *  		<td> <b> Indicator </b> </td>
+	 *  		<td> <b> Meaning </b> </td>
+	 *  	</tr>
+	 *  	<tr>
+	 *  		<td> 0 </td>
+	 *  		<td> Prohibited </td>
+	 *  	</tr>
+	 *  	<tr>
+	 * 	 	<td> 1 </td>
+	 *  		<td> No Class or CSn VBAS is present in message header </td>
+	 *  	</tr>    
+	 *  	<tr>
+	 *  		<td> 2 </td>
+	 *  		<td> Class VBAS is present but CSn is no present in message header </td>
+	 *  	</tr>  
+	 *  	<tr>
+	 *  		<td> 3 </td>
+	 *  		<td> Class and CSn VBAS are both present in the message header </td>
+	 *  	</tr>  
+	 *  </table>
+	 *  <P>
+	 *  Bit 4, completeDataBin, of the first byte of the Bin-ID indicates
+	 *  whether or not this message contains the last byte in the asociated
+	 *  data-bin: '0' means it is not the last byte in the data-bin; '1'
+	 *  inidates tat it is the last byte in the data-bin.
+	 *  <P>
+	 *  The remaining 4 bits of the first byte and the 7 low order bits of
+	 *  any remaining bytes in the Bin-ID VBAS form an "in-class identifier".
+	 *  <P>
+	 */
+    bool m_isLastByte;	// completeDataBin better???
+    ossim_int64 m_inClassIdentifier;
+    
+	/**
+	 * If present, provides a message class identifier. The message class
+	 * identifier is a non-negative integer, formed by concatenating the
+	 * least significant 7 bits of each byte of the VBAS in big-endian order.
+	 * If no present, the message class identifier is unchanged form that
+	 * associated with the previous message. If the Class VBAS is not present
+	 * and there is no previous message, the message class identifier is 0.
+	 * <P>
+	 * <table border=1 cellspacing=0 cellpadding=2>
+	 *  	<tr align=center>
+	 *  		<td> <b> Class identifier </b> </td>
+	 *  		<td> <b> Message class </b> </td>
+	 *  		<td> <b> Data-bin class </b> </td>
+	 *  		<td> <b> Stream type </b> </td>
+	 *  	</tr>
+	 *		<tr>
+	 *  		<td> 0 </td>
+	 *  		<td> Precinct data-bin message </td>
+	 *  	 	<td> Precinct data-bin</td>
+	 *    	<td> JPP-stream only </td>
+	 *  	</tr>
+	 *   	<tr>
+	 *  		<td> 1 </td>
+	 *  		<td> Extended precinct data-bin message </td>
+	 *  	 	<td> Precinct data-bin</td>
+	 *    	<td> JPP-stream only </td>
+	 *  	</tr>	
+	 *   	<tr>
+	 *  		<td> 2 </td>
+	 *  		<td> Tile header data-bin message </td>
+	 *  	 	<td> Tile header data-bin</td>
+	 *    	<td> JPP-stream only </td>
+	 *  	</tr>
+	 *  	<tr>
+	 *  		<td> 4 </td>
+	 *  		<td> Tile data-bin message </td>
+	 *  	 	<td> Tile data-bin</td>
+	 *    	<td> JPT-stream only </td>
+	 *  	</tr>
+	 *   	<tr>
+	 *  		<td> 5 </td>
+	 *  		<td> Extended precinct data-bin message </td>
+	 *  	 	<td> Tile data-bin</td>
+	 *    	<td> JPT-stream only </td>
+	 *  	</tr>
+	 *   	<tr>
+	 *  		<td> 6 </td>
+	 *  		<td> Main header data-bin message </td>
+	 *  	 	<td> Main heaer data-bin</td>
+	 *    	<td> JPP- and JPT-stream </td>
+	 *  	</tr>
+	 *  	<tr>
+	 *  		<td> 8 </td>
+	 *  		<td> Metadata-bin message </td>
+	 *  	 	<td> Metadata-bin</td>
+	 *    	<td> JPP and JPT-stream </td>
+	 *  	</tr>
+	 *  </table>
+	 *  
+	 *  <p>
+	 *  Allowed values, see {@link CADI.Common.Network.JPIP.ClassIdentifiers}.
+	 */
+	ossim_int32 m_classIdentifier;
+    
+	/**
+	 * If present, identifies the index (stating from 0) of the codestream to
+	 * which the data-bin belongs. The codestream index is formed by concatenating
+	 * the leas significant 7 bits of each byte of the VBAS in big-endian order.
+	 * If the CSn VBAS is no present, the codestream index is unchanged from the
+	 * previous message. If CSn VBAS is no present and there is no previous
+	 * message, the codestream index is 0.
+	 */
+    ossim_int32 m_CSn;
+    
+	/**
+	 * Identifies the offset of the data in the message from the start of the
+	 * data-bin. It is a non-negative integer value, formed by concatenating the
+	 * least significant 7 bits of each byte in the VBAS in big-endian order.
+	 */
+    ossim_int64 m_msgOffset;	
+    
+	/**
+	 * Identifies the total number of bytes in the body of the message. It is a
+	 * non-negative integer value, formed by concatenating the least significant
+	 * 7 bits of each byte in the VBAS in big-endian order.
+	 */
+    ossim_int64 m_msgLength;
+    
+	/**
+	 * If present, it represents a non-negative integer value, formed by
+	 * concatenating the least significant 7 bits of each byte in the VBAS in
+	 * big-endian order.
+	 * <p>
+	 * Its presence and meaning if present, is determined by the message class
+	 * identifier found within the Bin-ID VBAS.
+	 */
+    ossim_int64 m_aux;
+    
+	/**
+	 * Indicates if this JPIP Message is an End of Response Message.
+	 */
+	bool m_isEOR;
+	
+	/**
+	 * Definition in {@link CADI.Common.Network.JPIP.EORCodes}.
+	 * <p>
+	 * Further information, see ISO/IEC 15444-9 sect. D.3
+	 */
+	int m_EORCode;		// <<<<<<<<<< NOTICE: the inClassIdentifier could be used as a EORCode >>>>>>>>>>
+	
+	/**
+	 * It is and reason message associated with the <code>EORReasonCode</code>.
+	 * <p>
+	 * It is an optional attribute.
+	 */
+    ossimString m_EORReasonMessage;
+    
+};
+
+#endif
+
diff --git a/include/ossim/support_data/ossimNitfAcftbTag.h b/include/ossim/support_data/ossimNitfAcftbTag.h
index 37b0548..3687135 100644
--- a/include/ossim/support_data/ossimNitfAcftbTag.h
+++ b/include/ossim/support_data/ossimNitfAcftbTag.h
@@ -62,21 +62,12 @@ public:
    /** @brief destructor */
    virtual ~ossimNitfAcftbTag();
 
-   /**
-    * @brief Method to return tag name.
-    * @return "ACFTB" as an ossimString.
-    */
-   virtual ossimString getRegisterTagName()const;
-
    /** @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);
 
-   /** @return Byte size of this tag. */
-   virtual ossim_uint32 getSizeInBytes()const;
-
    /** @brief Method to clear all fields including null terminating. */
    virtual void clearFields();
 
diff --git a/include/ossim/support_data/ossimNitfAimidbTag.h b/include/ossim/support_data/ossimNitfAimidbTag.h
index c1f9ad7..73aaeae 100644
--- a/include/ossim/support_data/ossimNitfAimidbTag.h
+++ b/include/ossim/support_data/ossimNitfAimidbTag.h
@@ -15,7 +15,7 @@
 // $Id
 
 #ifndef ossimNitfAimidbTag_HEADER
-#define ossimNitfAimidbTag_HEADER
+#define ossimNitfAimidbTag_HEADER 1
 
 #include <ossim/support_data/ossimNitfRegisteredTag.h>
 
@@ -52,21 +52,12 @@ public:
    /** @brief destructor */
    virtual ~ossimNitfAimidbTag();
 
-   /**
-    * @brief Method to return tag name.
-    * @return "AIMIDB" as an ossimString.
-    */
-   virtual ossimString getRegisterTagName()const;
-
    /** @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);
 
-   /** @return Byte size of this tag. */
-   virtual ossim_uint32 getSizeInBytes()const;
-
    /** @brief Method to clear all fields including null terminating. */
    virtual void clearFields();
 
diff --git a/include/ossim/support_data/ossimNitfBlockaTag.h b/include/ossim/support_data/ossimNitfBlockaTag.h
index 5ed5395..bc53cc8 100644
--- a/include/ossim/support_data/ossimNitfBlockaTag.h
+++ b/include/ossim/support_data/ossimNitfBlockaTag.h
@@ -13,7 +13,7 @@
 // http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
 //
 //----------------------------------------------------------------------------
-// $Id: ossimNitfBlockaTag.h 14241 2009-04-07 19:59:23Z dburken $
+// $Id: ossimNitfBlockaTag.h 22013 2012-12-19 17:37:20Z dburken $
 #ifndef ossimNitfBlockaTag_HEADER
 #define ossimNitfBlockaTag_HEADER
 #include <ossim/support_data/ossimNitfRegisteredTag.h>
@@ -42,9 +42,6 @@ public:
    
    /** default constructor */
    ossimNitfBlockaTag();
-
-   /** @return "BLOCKA" as an ossimString. */
-   virtual ossimString getRegisterTagName() const;
   
    /**
     * Parse method.
@@ -60,9 +57,6 @@ public:
     */
    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.
     */
@@ -169,7 +163,7 @@ public:
    /** @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.
diff --git a/include/ossim/support_data/ossimNitfCsccgaTag.h b/include/ossim/support_data/ossimNitfCsccgaTag.h
new file mode 100644
index 0000000..2da55f3
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfCsccgaTag.h
@@ -0,0 +1,145 @@
+//----------------------------------------------------------------------------
+//
+// 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/include/ossim/support_data/ossimNitfCscrnaTag.h b/include/ossim/support_data/ossimNitfCscrnaTag.h
index 52a8365..07eb738 100644
--- a/include/ossim/support_data/ossimNitfCscrnaTag.h
+++ b/include/ossim/support_data/ossimNitfCscrnaTag.h
@@ -16,7 +16,7 @@
 // $Id
 
 #ifndef ossimNitfCscrnaTag_HEADER
-#define ossimNitfCscrnaTag_HEADER
+#define ossimNitfCscrnaTag_HEADER 1
 #include <ossim/support_data/ossimNitfRegisteredTag.h>
 
 class OSSIM_DLL ossimNitfCscrnaTag : public ossimNitfRegisteredTag
@@ -28,21 +28,12 @@ public:
    /** @brief destructor */
    virtual ~ossimNitfCscrnaTag();
 
-   /**
-    * @brief Method to return tag name.
-    * @return "CSCRNA" as an ossimString.
-    */
-   virtual ossimString getRegisterTagName()const;
-
    /** @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);
 
-   /** @return Byte size of this tag, 109 without CETAG and CEL fields. */
-   virtual ossim_uint32 getSizeInBytes()const;
-
    /** @brief Method to clear all fields including null terminating. */
    virtual void clearFields();
 
diff --git a/include/ossim/support_data/ossimNitfCsdidaTag.h b/include/ossim/support_data/ossimNitfCsdidaTag.h
index bf449dd..661e11b 100644
--- a/include/ossim/support_data/ossimNitfCsdidaTag.h
+++ b/include/ossim/support_data/ossimNitfCsdidaTag.h
@@ -16,7 +16,7 @@
 // $Id
 
 #ifndef ossimNitfCsdidaTag_HEADER
-#define ossimNitfCsdidaTag_HEADER
+#define ossimNitfCsdidaTag_HEADER 1
 #include <ossim/support_data/ossimNitfRegisteredTag.h>
 
 class OSSIM_DLL ossimNitfCsdidaTag : public ossimNitfRegisteredTag
@@ -28,21 +28,12 @@ public:
    /** @brief destructor */
    virtual ~ossimNitfCsdidaTag();
 
-   /**
-    * @brief Method to return tag name.
-    * @return "CSDIDA" as an ossimString.
-    */
-   virtual ossimString getRegisterTagName()const;
-
    /** @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);
 
-   /** @return Byte size of this tag. */
-   virtual ossim_uint32 getSizeInBytes()const;
-
    /** @brief Method to clear all fields including null terminating. */
    virtual void clearFields();
 
diff --git a/include/ossim/support_data/ossimNitfCsexraTag.h b/include/ossim/support_data/ossimNitfCsexraTag.h
index fef8a55..3c97b9a 100644
--- a/include/ossim/support_data/ossimNitfCsexraTag.h
+++ b/include/ossim/support_data/ossimNitfCsexraTag.h
@@ -16,7 +16,7 @@
 // $Id
 
 #ifndef ossimNitfCsexraTag_HEADER
-#define ossimNitfCsexraTag_HEADER
+#define ossimNitfCsexraTag_HEADER 1
 #include <ossim/support_data/ossimNitfRegisteredTag.h>
 
 class OSSIM_DLL ossimNitfCsexraTag : public ossimNitfRegisteredTag
@@ -28,21 +28,12 @@ public:
    /** @brief destructor */
    virtual ~ossimNitfCsexraTag();
 
-   /**
-    * @brief Method to return tag name.
-    * @return "CSEXRA" as an ossimString.
-    */
-   virtual ossimString getRegisterTagName()const;
-
    /** @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);
 
-   /** @return Byte size of this tag, 132 without CETAG and CEL fields. */
-   virtual ossim_uint32 getSizeInBytes()const;
-
    /** @brief Method to clear all fields including null terminating. */
    virtual void clearFields();
 
diff --git a/include/ossim/support_data/ossimNitfCsproaTag.h b/include/ossim/support_data/ossimNitfCsproaTag.h
new file mode 100644
index 0000000..c9e4b36
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfCsproaTag.h
@@ -0,0 +1,49 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description: CSCCGA tag class definition
+//
+//----------------------------------------------------------------------------
+// $Id$
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfCsproaTag : public ossimNitfRegisteredTag
+{
+public:
+   enum{
+      RESERVE1_SIZE = 12,
+      RESERVE2_SIZE = 12,
+      RESERVE3_SIZE = 12,
+      RESERVE4_SIZE = 12,
+      RESERVE5_SIZE = 12,
+      RESERVE6_SIZE = 12,
+      RESERVE7_SIZE = 12,
+      RESERVE8_SIZE = 12,
+      RESERVE9_SIZE = 12,
+      BWC_SIZE = 12
+   };
+
+   ossimNitfCsproaTag();
+
+   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:
+   char m_reserved1[RESERVE1_SIZE+1];
+   char m_reserved2[RESERVE1_SIZE+1];
+   char m_reserved3[RESERVE1_SIZE+1];
+   char m_reserved4[RESERVE1_SIZE+1];
+   char m_reserved5[RESERVE1_SIZE+1];
+   char m_reserved6[RESERVE1_SIZE+1];
+   char m_reserved7[RESERVE1_SIZE+1];
+   char m_reserved8[RESERVE1_SIZE+1];
+   char m_reserved9[RESERVE1_SIZE+1];
+   char m_bwc[BWC_SIZE+1];
+};
diff --git a/include/ossim/support_data/ossimNitfEmbeddedRpfDes.h b/include/ossim/support_data/ossimNitfEmbeddedRpfDes.h
index 30ba414..b9edb5c 100644
--- a/include/ossim/support_data/ossimNitfEmbeddedRpfDes.h
+++ b/include/ossim/support_data/ossimNitfEmbeddedRpfDes.h
@@ -9,9 +9,9 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfEmbeddedRpfDes.h 15766 2009-10-20 12:37:09Z gpotts $
+// $Id: ossimNitfEmbeddedRpfDes.h 22013 2012-12-19 17:37:20Z dburken $
 #ifndef ossimNitfEmbeddedRpfDes_HEADER
-#define ossimNitfEmbeddedRpfDes_HEADER
+#define ossimNitfEmbeddedRpfDes_HEADER 1
 
 #include <iosfwd>
 #include <ossim/support_data/ossimNitfRegisteredTag.h>
@@ -21,12 +21,7 @@ class OSSIMDLLEXPORT ossimNitfEmbeddedRpfDes : public ossimNitfRegisteredTag
 {
 public:
    ossimNitfEmbeddedRpfDes();
-   /*!
-    * This will return the name of the registered tag for this
-    * user defined header.
-    */
-   virtual ossimString getRegisterTagName()const{return "RPFDES";}
-
+   
    virtual void parseStream(std::istream &in);
 
    /**
diff --git a/include/ossim/support_data/ossimNitfEngrdaTag.h b/include/ossim/support_data/ossimNitfEngrdaTag.h
index 80aa1f6..2166955 100644
--- a/include/ossim/support_data/ossimNitfEngrdaTag.h
+++ b/include/ossim/support_data/ossimNitfEngrdaTag.h
@@ -14,7 +14,7 @@
 // $Id
 
 #ifndef ossimNitfEngrdaTag_HEADER
-#define ossimNitfEngrdaTag_HEADER
+#define ossimNitfEngrdaTag_HEADER 1
 
 #include <string>
 #include <vector>
@@ -45,21 +45,12 @@ public:
    /** @brief destructor */
    virtual ~ossimNitfEngrdaTag();
 
-   /**
-    * @brief Method to return tag name.
-    * @return "ENGRDA" as an ossimString.
-    */
-   virtual ossimString getRegisterTagName()const;
-
    /** @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);
 
-   /** @return Byte size of this tag. */
-   virtual ossim_uint32 getSizeInBytes()const;
-
    /** @brief Method to clear all fields including null terminating. */
    virtual void clearFields();
 
diff --git a/include/ossim/support_data/ossimNitfExoptaTag.h b/include/ossim/support_data/ossimNitfExoptaTag.h
new file mode 100644
index 0000000..80d811e
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfExoptaTag.h
@@ -0,0 +1,174 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description: EXOPTA tag header definition
+//
+//----------------------------------------------------------------------------
+// $Id$
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+/**
+*
+* EXOPTA - Exploitation Usability Optical Information Extension Format
+*
+*/
+class OSSIM_DLL ossimNitfExoptaTag : public ossimNitfRegisteredTag
+{
+public:
+   enum{
+      ANGLE_TO_NORTH_SIZE   = 3,
+      MEAN_GSD_SIZE         = 5,
+      EXOPTA_RESERVED1_SIZE = 1,
+      DYNAMIC_RANGE_SIZE    = 5,
+      EXOPTA_RESERVED2_SIZE = 7,
+      OBL_ANG_SIZE          = 5,
+      ROLL_ANG_SIZE         = 6,
+      PRIME_ID_SIZE         = 12,
+      PRIME_BE_SIZE         = 15,
+      EXOPTA_RESERVED3_SIZE = 5,
+      N_SEC_SIZE            = 3,
+      EXOPTA_RESERVED4_SIZE = 2,
+      EXOPTA_RESERVED5_SIZE = 7,
+      N_SEG_SIZE            = 3,
+      MAX_LP_SEG_SIZE       = 6,
+      EXOPTA_RESERVED6_SIZE = 12,
+      SUN_EL_SIZE           = 5,
+      SUN_AZ_SIZE           = 5,
+      CEL_SIZE              = 107 // total
+   };
+
+   ossimNitfExoptaTag();
+
+   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: ANGLE_TO_NORTH
+   *  
+   *  Angle to True North. Angle,
+   *  measured clockwise, from the
+   *  first-row vector (pointing from
+   *  the first column to the last) to
+   *  a vector pointing to True
+   *  North.
+   */
+   char m_angleToNorth[ANGLE_TO_NORTH_SIZE+1];
+
+   /**
+   * Field: MEAN_GSD
+   *
+   * Mean Ground Sample
+   * Distance. The geometric
+   * mean of the cross and along
+   * scan center-to-center distance
+   * between contiguous ground
+   * samples. Accuracy = ±10%
+   * Note: Systems requiring an
+   * extended range shall insert a
+   * default value of “000.0” for this
+   * field and utilize the PIAMC
+   * tag.
+   */
+   char m_meanGsd[MEAN_GSD_SIZE+1];
+
+   char m_reserved1[EXOPTA_RESERVED1_SIZE+1];
+
+   /**
+   * Field: DYNAMIC_RANGE
+   *
+   * Dynamic Range of image pixels.
+   */
+   char m_dynamicRange[DYNAMIC_RANGE_SIZE+1];
+   char m_reserved2[EXOPTA_RESERVED2_SIZE+1];
+
+   /**
+   * Field: OBL_ANG
+   *
+   * Obliquity Angle. Angle between the local NED
+   * horizontal and the optical axis of the image.
+   */
+   char m_oblAng[OBL_ANG_SIZE+1];
+
+   /**
+   * Field: ROLL_ANG
+   *
+   * Roll Angle of the platform body
+   */
+   char m_rollAng[ROLL_ANG_SIZE+1];
+
+   /**
+   * Field: PRIME_ID
+   *
+   * Primary Target ID
+   */
+   char m_primeId[PRIME_ID_SIZE+1];
+
+   /**
+   * Field: PRIME_BE
+   *
+   * Primary Target BE / OSUFFIX (target designator)
+   */
+   char m_primeBe[PRIME_BE_SIZE+1];
+   char m_reserved3[EXOPTA_RESERVED3_SIZE+1];
+   
+   /**
+   * Field: N_SEC
+   *
+   * Number Of Secondary Targets in Image. Determines the number of SECTG
+   * extension present in the image subheader.
+   */
+   char m_nSec[N_SEC_SIZE+1];
+   char m_reserved4[EXOPTA_RESERVED4_SIZE+1];
+   char m_reserved5[EXOPTA_RESERVED5_SIZE+1];
+
+   /**
+   * Field: N_SEG
+   *
+   *
+   * Number of Segments. Segments are separate imagery pieces within an 
+   * imaging operation. Range 001 to 999
+   */
+   char m_nSeg[N_SEG_SIZE+1];
+
+   /**
+   * Field: MAX_LP_SEG
+   *
+   * Maximum Number of Lines Per Segment. Includes overlap lines.
+   *
+   * Range: 000001 to 199999
+   */
+   char m_maxLpSeg[MAX_LP_SEG_SIZE+1];
+
+   char m_reserved6[EXOPTA_RESERVED6_SIZE+1];
+
+  /**
+   * Field: SUN_EL
+   *
+   * Sun Elevation. Angle in degrees, measured from the target plane at intersection of
+   * the optical line of sight with the earth’s surface at the time
+   * of the first image line (NITF row 1). 999.9 indicates data is
+   * not available.
+   * 
+   * range: +-90.0, 999.9
+   */
+   char m_sunEl[SUN_EL_SIZE+1];
+
+  /**
+   * Field: SUN_AZ
+   *
+   * Sun Azimuth. Angle in degrees, from True North
+   * clockwise (as viewed from space) at the time of the first
+   * image line. 999.9 indicates data is not available.
+   *
+   * Range: 000.0 to 359.9, 999.9
+   */
+   char m_sunAz[SUN_AZ_SIZE+1];
+};
diff --git a/include/ossim/support_data/ossimNitfFile.h b/include/ossim/support_data/ossimNitfFile.h
index 350dba6..54b94fe 100644
--- a/include/ossim/support_data/ossimNitfFile.h
+++ b/include/ossim/support_data/ossimNitfFile.h
@@ -9,7 +9,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfFile.h 18413 2010-11-11 19:56:22Z gpotts $
+// $Id: ossimNitfFile.h 19583 2011-05-13 10:58:10Z gpotts $
 #ifndef ossimNitfFile_HEADER
 #define ossimNitfFile_HEADER
 
@@ -54,6 +54,7 @@ public:
                        bool printOverviews=false) const;
    
    ossimNitfFile();
+   virtual ~ossimNitfFile();
 
    /*!
     *  Opens the nitf file and attempts to parse.
@@ -82,7 +83,6 @@ public:
    virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix)const;
 
 protected:
-   virtual ~ossimNitfFile();
    ossimNitfImageHeader* allocateImageHeader()const;
    
    ossimFilename                    theFilename;
diff --git a/include/ossim/support_data/ossimNitfFileHeaderV2_1.h b/include/ossim/support_data/ossimNitfFileHeaderV2_1.h
index 66f1cd2..127ca44 100644
--- a/include/ossim/support_data/ossimNitfFileHeaderV2_1.h
+++ b/include/ossim/support_data/ossimNitfFileHeaderV2_1.h
@@ -9,7 +9,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfFileHeaderV2_1.h 18674 2011-01-11 16:24:12Z dburken $
+// $Id: ossimNitfFileHeaderV2_1.h 20123 2011-10-11 17:55:44Z dburken $
 #ifndef ossimNitfFileHeaderV2_1_HEADER
 #define ossimNitfFileHeaderV2_1_HEADER
 
@@ -213,19 +213,30 @@ public:
    virtual void setOriginatorsName(const ossimString& name);
    virtual void setOriginatorsPhone(const ossimString& phone);
    
-   virtual bool setDefaults(const ossimKeywordlist& kwl,
-                             const char* prefix=0);
-   
    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 FSCLASY_KW;
+   static const ossimString FSCLSY_KW;
    static const ossimString FSDCTP_KW;
    static const ossimString FSDCDT_KW;
    static const ossimString FSDCXM_KW;
@@ -302,7 +313,7 @@ private:
    
    // START Of header variables
    /**
-    * Field: FSCLASY
+    * Field: FSCLSY
     * 
     * Is a 2 byte field.  Required but can be blank:
     *
diff --git a/include/ossim/support_data/ossimNitfFileHeaderV2_X.h b/include/ossim/support_data/ossimNitfFileHeaderV2_X.h
index 1e10b6c..ee1c473 100644
--- a/include/ossim/support_data/ossimNitfFileHeaderV2_X.h
+++ b/include/ossim/support_data/ossimNitfFileHeaderV2_X.h
@@ -5,14 +5,14 @@
 // See LICENSE.txt file in the top level directory for more details.
 // 
 //----------------------------------------------------------------------------
-// $Id: ossimNitfFileHeaderV2_X.h 18413 2010-11-11 19:56:22Z gpotts $
+// $Id: ossimNitfFileHeaderV2_X.h 20123 2011-10-11 17:55:44Z 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
@@ -93,6 +93,20 @@ public:
    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.
diff --git a/include/ossim/support_data/ossimNitfGeoPositioningTag.h b/include/ossim/support_data/ossimNitfGeoPositioningTag.h
index debf5ce..dbf5c84 100644
--- a/include/ossim/support_data/ossimNitfGeoPositioningTag.h
+++ b/include/ossim/support_data/ossimNitfGeoPositioningTag.h
@@ -12,10 +12,10 @@
 // DIGEST Part 2 Annex D - Appendix 1, Table D1-3
 // 
 //********************************************************************
-// $Id: ossimNitfGeoPositioningTag.h 14241 2009-04-07 19:59:23Z dburken $
+// $Id: ossimNitfGeoPositioningTag.h 22013 2012-12-19 17:37:20Z dburken $
 //
 #ifndef ossimNitfGeoPositioningTag_HEADER
-#define ossimNitfGeoPositioningTag_HEADER
+#define ossimNitfGeoPositioningTag_HEADER 1
 #include <ossim/support_data/ossimNitfRegisteredTag.h>
 
 class OSSIM_DLL ossimNitfGeoPositioningTag : public ossimNitfRegisteredTag
@@ -23,10 +23,10 @@ class OSSIM_DLL ossimNitfGeoPositioningTag : public ossimNitfRegisteredTag
 public:
    ossimNitfGeoPositioningTag();
    virtual ~ossimNitfGeoPositioningTag();
-   virtual ossimString getRegisterTagName()const;
+
    virtual void parseStream(std::istream& in);
    virtual void writeStream(std::ostream& out);
-   virtual ossim_uint32 getSizeInBytes()const;
+
    virtual void clearFields();
 
    /**
diff --git a/include/ossim/support_data/ossimNitfHistoaTag.h b/include/ossim/support_data/ossimNitfHistoaTag.h
new file mode 100644
index 0000000..8463095
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfHistoaTag.h
@@ -0,0 +1,713 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description: HISTOA tag class declaration.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimNitfHistoaTag.h 22013 2012-12-19 17:37:20Z dburken $
+
+#ifndef ossimNitfHistoaTag_HEADER
+#define ossimNitfHistoaTag_HEADER 1
+
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+#include <vector>
+
+/**
+ * All comments in this document were taken from the online resource found at:
+ *
+ * http://www.gwg.nga.mil/ntb/baseline/docs/stdi0002/
+ *
+ * Reference: HISTOA section (currently in Appendix L)
+ * 
+ * The purpose of the Softcopy History Tagged Record Extension, HISTOA, is to
+ * provide a history of the softcopy processing functions that have been applied to NSIF
+ * imagery. It is meant to describe previous processing actions and the current state of the
+ * imagery that was distributed within the intelligence and imagery user community. To be
+ * effective, HISTOA needs to be applied to the NSIF product as early as practical and must
+ * be updated each time the image is processed and saved by a softcopy processing system.
+ * This will allow the user to know with confidence the complete history of the imagery.
+ * HISTOA may be created as the NSIF image is created, or when the imagery is first
+ * modified.
+ */
+class OSSIM_DLL ossimNitfHistoaProcessingEvent
+{
+public:
+   enum
+   {
+      PDATE_SIZE     = 14,
+      PSITE_SIZE     = 10,
+      PAS_SIZE       = 10,
+      NIPCOM_SIZE    = 1,
+      IPCOM_SIZE     = 80,
+      IBPP_SIZE      = 2,
+      IPVTYPE_SIZE   = 3,
+      INBWC_SIZE     = 10,
+      DISP_FLAG_SIZE = 1,
+      ROT_FLAG_SIZE  = 1,
+      ROT_ANGLE_SIZE = 8,
+      ASYM_FLAG_SIZE = 1,
+      ZOOMROW_SIZE   = 7,
+      ZOOMCOL_SIZE   = 7,
+      PROJ_FLAG_SIZE = 1,
+      SHARP_FLAG_SIZE= 1,
+      SHARPFAM_SIZE  = 2,
+      SHARPMEM_SIZE  = 2,
+      MAG_FLAG_SIZE  = 1,
+      MAG_LEVEL_SIZE = 7,
+      DRA_FLAG_SIZE  = 1,
+      DRA_MULT_SIZE  = 7,
+      DRA_SUB_SIZE   = 5,
+      TTC_FLAG_SIZE  = 1,
+      TTCFAM_SIZE    = 2,
+      TTCMEM_SIZE    = 2,
+      DEVLUT_FLAG_SIZE = 1,
+      OBPP_SIZE      = 2,
+      OPVTYPE_SIZE   = 3,
+      OUTBWC_SIZE    = 10
+   };
+   ossimNitfHistoaProcessingEvent();
+   ossim_uint32 getSizeInBytes()const;
+   void parseStream(std::istream& in);
+   void writeStream(std::ostream& out);
+
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix=std::string()) const;
+   void clearFields();
+   
+private:
+   
+   /**
+    * Field: PDATE
+    *
+    * This field shall contain the date and time (UTC) on which the processing event occurred. The
+    * valid form of the field is CCYYMMDDhhmmss, where CC is the first two digits of the year (00
+    * to 99), YY is the last two digits of the year (00 to 99), MM is the month (01 to 12), DD is
+    * the day of the month (01 to 31), hh is the hour (00 to 23), mm is the minute (00 to 59), and
+    * ss is the second (00 to 59). UTC (Zulu) is assumed to be the time zone designator to express
+    * the time of day. This field can be used in conjunction with the FDT field in the NSIF file
+    * header to determine if the History Tag has been updated each time the image was processed and
+    * saved. If the PDATE field and the FDT field are identical, the History Tag has been properly
+    * updated. If the fields are not identical, then the History Tag has not been properly updated
+    * and the data may not be accurate or timely.
+    */
+   char m_pdate[PDATE_SIZE+1];
+
+   /**
+    * Field: PSITE
+    *
+    * This field shall contain the name of the site or segment that performed the processing event.
+    * This 10 character alphanumeric field is free form text. Examples of PSITE entries are FOS,
+    * JWAC, or CENTCOM.
+    */
+   char m_psite[PSITE_SIZE+1];
+   
+   /**
+    * Field: PAS
+    *
+    * This field shall contain the processing application software used to perform the processing
+    * steps cited in the event (e.g. IDEX, VITEC, or DIEPS). The version number of the application
+    * would also be helpful to include in this field.
+    */
+   char m_pas[PAS_SIZE+1];
+   
+   /**
+    * Field: NIPCOM
+    *
+    * This field shall contain the valid number of image processing comments for this processing
+    * event. The valid field codes are 0 to 9.
+    */
+   char m_nIpcom[NIPCOM_SIZE+1];
+   
+   /**
+    * Field IPCOM
+    *
+    * This field shall contain the first line of comment text. The fields IPCOM1 to IPCOMn, if
+    * present shall contain free form alphanumeric text. They are intended for use as a single
+    * comment block and shall be used that way. This field shall be omitted if the value in NIPCOM
+    * field is zero. The comment field shall be used to clarify or indicate special processing not
+    * accounted for in the Processing Event Fields. Reasons for populating this field would be to
+    * vindicate alternate processing for multi-spectral imagery, to indicate the order of S/C
+    * processing steps contained within a single processing event, or to inform downstream users of
+    * potential problems with the image.
+    */
+   std::vector<std::string> m_comment;
+   
+   /**
+    * Field: IBPP
+    *
+    * This field shall contain the number of significant bits for each pixel before the processing
+    * functions denoted in the processing event have been performed and before compression. This
+    * type of pixel depth description is consistent with the ABPP field within the NSIF image
+    * subheader. For example, if an 11-bpp word is stored in 16 bits, this field would contain 11 and
+    * the NBPP field in the NSIF image subheader would contain 16. The valid IBPP field codes are
+    * 01 to 64, indicating 1 to 64 bpp.
+    */
+   char m_ibpp[IBPP_SIZE+1];
+   
+   /**
+    * Field IPVTYPE
+    *
+    * This field shall contain an indicator of the type of computer representation used for the value
+    * of each pixel before the processing functions denoted in the processing events have been
+    * performed and before compression. Valid entries are INT for integer, SI for 2’s complement
+    * signed integer, R for real, and C for complex. The databits of INT and SI values shall appear in
+    * the file in order of significance, beginning with the most significant bit (MSB) and ending with
+    * the least significant bit (LSB). INT and SI data types shall be limited to 16 bits. R values
+    * shall be represented according to IEEE 32-bit floating-point representation (IEEE754). C values
+    * shall be represented with the Real and Imaginary parts each represented in IEEE 32-bit floating
+    * point representation (IEEE754) and appearing adjacent four-byte blocks, first Real, then
+    * Imaginary. B (bi-level) pixel values shall be represented as single bits with value 1 or 0.
+    */
+   char m_ipvType[IPVTYPE_SIZE+1];
+   
+   /**
+    * Field INBWC
+    *
+    * This field shall indicate the type of bandwidth compression or expansion that has been applied
+    * to the image prior to any enhancements denoted in the processing event. The valid field codes to
+    * describe each type of compression are 5 byte character strings. The first two characters
+    * indicate the type of compression such as DCT or DPCM. The next two characters indicate either
+    * the bit rate or the quality level. The last character indicates if the process is compression
+    * or an expansion. Compression is denoted by a C, an E denotes expansion, and 0 indicates that
+    * neither process occurred. The types of compression are indicated by the following codes:
+    * Value Definition
+    * DP43 DPCM (Differential Pulse Coded Modulation) – 4.3 bpp
+    * DC13 DCT (Discrete Cosine Transform – 2.3 bpp
+    * DC23 DCT (Discrete Cosine Transform) – 2.3 bpp
+    * NJNL NSIF JPEG – Lossless
+    * NJQ0 NSIF JPEG – Quality Level 0
+    * NJQ1 NSIF JPEG – Quality Level 1
+    * NJQ2 NSIF JPEG – Quality Level 2
+    * C11D NSIF Bi-level – 1D
+    * C12S NSIF Bi-level – 2DS
+    * C12H NSIF Bi-level – 2DH
+    * M11D NSIF Bi-level – 1D
+    * M12S NSIF Bi-level with masked blocks – 2DS
+    * M12H NSIF Bi-level with masked blocks – 2DH
+    * C207 NITF ARIDPCM – 0.75 bpp
+    * C214 NITF ARIDPCM – 1.40 bpp
+    * C223 NITF ARIDPCM – 2.30 bpp
+    * C245 NITF ARIDPCM – 4.50 bpp
+    * C3Q0 NSIF Lossy JPEG – Q0 Custom Tables
+    * C3Q1 NSIF Lossy JPEG – Q1 Default Tables
+    * C3Q2 NSIF Lossy JPEG – Q2 Default Tables
+    * C3Q3 NSIF Lossy JPEG – Q2 Default Tables
+    * C3Q4 NSIF Lossy JPEG – Q4 Default Tables
+    * C3Q5 NSIF Lossy JPEG – Q5 Default Tables
+    * M3Q0 NSIF Lossy JPEG with masked blocks – Q0 Custom
+    * M3Q1 NSIF Lossy JPEG with masked blocks – Q1 Default
+    * M3Q2 NSIF Lossy JPEG with masked blocks – Q2 Default
+    * M3Q3 NSIF Lossy JPEG with masked blocks – Q3 Default
+    * M3Q4 NSIF Lossy JPEG with masked blocks – Q4 Default
+    * M3Q5 NSIF Lossy JPEG with masked blocks – Q5 Default
+    * C4LO NSIF Vector Quantization – Lossy
+    * M4LO NSIF Vector Quantization with masked blocks
+    * C5NL NSIF Lossless JPEG
+    * M5NL NSIF Lossless JPEG with masked blocks
+    * NC00 NSIF uncompressed
+    * NM00 NSIF with masked blocks uncompressed
+    * I1Q1 NSIF Downsample JPEG – Q1
+    * I1Q2 NSIF Downsample JPEG – Q2
+    * I1Q3 NSIF Downsample JPEG – Q3
+    * I1Q4 NSIF Downsample JPEG – Q4
+    * I1Q5 NSIF Downsample JPEG – Q5
+    * WVLO Wavelet Lossy
+    * WVNL Wavelet Lossless
+    * JP20 JPEG 2000
+    * NONE No Compression
+    * UNKC Unknown Compression
+    * OTLO Unknown lossy compression – requires mandatory IPCOM entry to explain
+    * technique or source
+    * OTNL Unknown lossless compression – requires mandatory IPCOM entry to explain
+    * technique or source
+    * The entire BWC field is 10 bytes long to allow for the concatenation of up to 2 compression
+    * algorithms. Two consecutive 5 byte character strings shall indicate the application of two
+    * compression algorithms in succession. If only one operation is performed, then the remaining 5
+    * characters are zero. Examples of valid codes for the BWC field are shown below.
+    * The DP43E00000 code indicates that a 4.3 DPCM compressed input image was expanded prior
+    * to NSIF formation.
+    * The DC13E00000 code indicates that 1.3 DCT compressed input image was expanded prior to
+    * NSIF formation.
+    * The NONE000000 code indicates that the input image to the NSIF formation process was
+    * uncompressed.
+    */
+   char m_inbwc[INBWC_SIZE+1];
+   
+   /**
+    * Field DISPLAY_FLAG
+    *
+    * This field shall indicate if the image is “Display-Ready.” The DISP_FLAG field applies only to
+    * System B, System D, and certain other systems. Display-Ready data has had a system-specific
+    * transformation applied to it that is described in appendix A. The valid field codes are 0 to 9
+    * and a blank (BCS 0x20). A value of 0 means that image is not Display-Ready and must be
+    * converted to a displayable format, using the pre-defined mappings for Linlog or PEDF formats.
+    * A value of 1 means that the image is Display-Ready and needs only basic tonal processing and
+    * device compensation for corrects display. Since this field applies to Systems B and D imagery
+    * currently, the field shall be filled with a blank (BCS 0x20) for all other system types. Values
+    * 2 to 9 are reserved for future use and shall not be used at this time. A more detailed
+    * explanation of the Display-Ready transformations is provided in appendix A.
+    */
+   char m_dispFlag[DISP_FLAG_SIZE + 1];
+   
+   /**
+    * Field ROT_FLAG
+    *
+    * This field shall indicate if the image has been rotated. The valid field codes are 0 and 1. A
+    * value or 0 means that the image has not been rotated. A value of 1 means that the image has been
+    * rotated. If this field is equal to 1, then the ROT_ANGLE field must be filled with the angle of
+    * rotation.
+    */
+   char m_rotFlag[ROT_FLAG_SIZE + 1];
+   
+   /**
+    * Field: ROT_ANGLE
+    *
+    * This field shall contain the angel in degrees that the image has been rotated, where a positive
+    * angle denotes clockwise rotation. The valid field codes are 000.0000 to 359.9999. This field is
+    * conditional on the ROT_FLAG field being equal to 1. If the rotation has included an
+    * interpolation, then the interpolation method shall be described in the comment sections.
+    */
+   char m_rotAngle[ROT_ANGLE_SIZE + 1];
+   
+   /**
+    * Field: ASYM_FLAG
+    *
+    * This field shall indicate if asymmetric correction has been applied to the image. This
+    * processing step is only allowed for certain types of EO processing. The valid field codes are
+    * 0 and 1, and a blank (BCS 0x20). A value of 0 means that asymmetric correction has not been
+    * applied to the image. A value of 1 means that asymmetric correction has been applied to the
+    * image. Since this field applies only to certain types of EO imagery, this field shall be filled
+    * with a blank (BCS 0x20) for all other system types. If this field is equal to 1, the ZOOMROW
+    * and ZOOMCOL fields must be filled with the magnification levels in the row (line) and column
+    * (element) directions, respectively.
+    */
+   char m_asymFlag[ASYM_FLAG_SIZE + 1];
+   
+   /**
+    * Field: ZOOMROW
+    *
+    * This field shall contain the level of magnification that was applied to the image in the line or
+    * row direction, if asymmetric correction was applied. The valid field codes are 00.0000 to
+    * 99.9999. The level of magnification is relative to the input image at this processing step. This
+    * field is conditional on the ASYM_FLAG field
+    */
+   char m_zoomRow[ZOOMROW_SIZE + 1];
+   
+   /**
+    * Field: ZOOMCOL
+    *
+    * This field shall contain the level of magnification that was applied to the image in the element
+    * or column direction, if asymmetric correction was applied. The valid field codes are 00.0000 to
+    * 99.9999. The level of magnification is relative to the input image at this processing step. This
+    * field is conditional on the ASYM_FLAG field.
+    */
+   char m_zoomCol[ZOOMCOL_SIZE + 1];
+
+   /**
+    * Field: PROJ_FLAG
+    *
+    * This field shall indicate if the image has been projected from the collection geometry into
+    * geometry more suitable for display. The valid field codes are 0 and 1. A value of 0 means that
+    * no geometric transformation has been applied to the image, meaning it is probably stilled in the
+    * collection geometry. A value of 1 means that the image has been projected into another
+    * geometry. If this field is equal to 1, then a description of the projection or rectification
+    * shall be given in the comment section.
+    */
+   char m_projFlag[PROJ_FLAG_SIZE + 1];
+   
+   /**
+    * Field: SHARP_FLAG
+    *
+    * This field shall indicate if the image has been passed through a sharpening operation. The valid
+    * field codes are 0 and 1. A value of 0 means that no sharpening has been applied to the image. A
+    * value of 1 means that sharpening has been applied to the image. If this field is equal to 1,
+    * then the SHARPFAM and SHARPMEN fields must be filled with the appropriate numbers. Refer to
+    * paragraph 15.5 for a more complete description of the sharpening kernel database.
+    */ 
+   char m_sharpFlag[SHARP_FLAG_SIZE+1];
+   
+   /**
+    * Field: SHARPFAM
+    *
+    * This field shall contain the number of the sharpening family, if a sharpening operation was
+    * applied to the image. The valid field codes are –1, 00 to 99. This field is conditional on the
+    * SHARP_FLAG field. Although the IDEX sharpening family numbers are one-based, many
+    * commercial softcopy systems use a zero-based system for their databases. For example, IDEX
+    * family 5 would be family 4 for many other softcopy systems. If the sharpening kernel is not a
+    * part of the existing group of families and members, a value of – shall be placed in this field
+    * and the nature of the sharpening kernel specified in the comment section. Refer to paragraph
+    * 15-5 for a more complete description of the sharpening kernel database.
+    */
+   char m_sharpFam[SHARPFAM_SIZE+1];
+   
+   /**
+    * Field: SHARPMEM
+    *
+    * This field shall contain the number of the sharpening member, if a sharpening operation was
+    * applied to the image. The valid field codes are –1, 00 to 99. This field is conditional on the
+    * SHARP_FLAG field. If the sharpening kernel is not a part of the existing group of families and
+    * members, a value of –1 shall be placed in this field and the nature of the sharpening kernel
+    * shall be specified in the comment section. Refer to 15.5 for a more complete description of the
+    * sharpening database.
+    */
+   char m_sharpMem[SHARPMEM_SIZE+1];
+   
+   /**
+    * Field MAG_FLAG
+    *
+    * This field shall indicate if the image has been symmetrically (same amount in each direction)
+    * magnified during this processing step. The valid field codes are 0 and 1. A value of 0 means
+    * that the image was not magnified. A value of 1 means that the image has been magnified. If this
+    * field is equal to 1, then the MAG_LEVEL field shall be filled with the level of magnification.
+    */
+   char m_magFlag[MAG_FLAG_SIZE+1];
+   
+   /**
+    * Field MAG_LEVEL
+    *
+    * This field shall contain the level of symmetrical magnification that has been applied to the
+    * image relative to the input image at this processing step. For example, a value of 02.0000 would
+    * indicate a 2X magnification relative to the input image. The valid field codes are 00.0000 to
+    * 99.9999. This field is conditional on the MAG_FLAG field. A value greater than 1 shall
+    * indicate that the image was magnified to a size larger than its previous size and a value less
+    * than 1 shall indicate the image size was decreased. The method of magnification shall be
+    * described in the comment section.
+    */
+   char m_magLevel[MAG_LEVEL_SIZE +1];
+   
+   /**
+    * Field: DRA_FLAG
+    *
+    * This field shall indicate if a dynamic Range Adjustment (DRA) has been applied to the image.
+    * DRA is an affine transformation of the image pixel values of the form Y = DRA_MULT*(X –
+    * DRA_SUB), where X is the input pixel value, DRA_SUB is the DRA subtractor, DRA_MULT
+    * is the DRA multiplier, and Y is the output pixel value. The DRA is said to be spatially
+    * invariant when the DRA subtractor and DRA multiplier do not depend on pixel position. If the DRA
+    * subtractor and DRA multiplier do depend on pixel position, the DRA is said to be spatially
+    * variant. The valid field codes are 0, 1, and 2. A value of 0 means that a DRA has not been
+    * applied to the image. A value of 1 means that a spatially invariant DRA has been applied to the
+    * image. In this case, the DRA_SUB and DRA_MULT fields shall be filled with the appropriate
+    * codes. A value of 2 means that a spatially variant DRA has been applied to the image. In cases
+    * where DRA_FLAG equals 0 or 2, the DRA_SUB and DRA_MULT fields shall not be filled.
+    */
+   char m_draFlag[DRA_FLAG_SIZE+1];
+   
+   /**
+    * Field: DRA_MULT
+    *
+    * This field shall contain the multiplier value of the DRA. The valid field codes are 000.000 to
+    * 999.999. This field is conditional on the DRA_FLAG field being equal to 1.
+    */
+   char m_draMult[DRA_MULT_SIZE+1];
+   
+   /**
+    * Field: DRA_SUB
+    *
+    * This field shall contain the subtractor value of the DRA. The valid field codes are 000.000 to
+    * 999.999. This field is conditional on the DRA_FLAG field being equal to 1.
+    */
+   char m_draSub[DRA_SUB_SIZE+1];
+   
+   /**
+    * Field: TTC_FLAG
+    *
+    * This field shall indicate if a TTC (Tonal Transfer Curve) has been applied to the image. The
+    * valid field codes are 0 and 1. A value of 0 means that a TTC has not been applied to the image.
+    * A value of 1 means that a TTC has been applied to the image. If a TTC has been applied, then
+    * the TTCFAM and TTCNUM fields shall be filled with the appropriate codes. Refer to
+    * paragraph 15-5 for more complete description of the TTC database.
+    */
+   char m_ttcFlag[TTC_FLAG_SIZE+1];
+   
+   /**
+    * Field: TTCFAM
+    *
+    * This field shall contain the number of the TTC family, if a TTC was applied to the image. The
+    * valid field codes are –1, 00 to 99. This field is conditional on the TTC_FLAG field. Although
+    * the IDEXZ TTC family numbers are one-based, many commercial softcopy systems use a zerobased
+    * system for their databases. For example, IDEX family 5 would be family 4 for many
+    * other softcopy systems. If the TTC is not a part of the existing group of families and members,
+    * a value of –1 shall be placed in this field and the nature of the TTC shall be specified in the
+    * comment section. Refer to paragraph 15-5 for a more complete description of the TTC database.
+    */
+   char m_ttcFam[TTCFAM_SIZE+1];
+   
+   /**
+    * Field: TTCMEM
+    *
+    * This field shall contain the number of the TTC member, if a TTC was applied to the image. The
+    * valid field codes are 00 to 99. This field is conditional on the TTC_FLAG field. If the TTC is
+    * not a part of the existing group of families and members, a value of –1 shall be placed in this
+    * field and the nature of the TTC shall be specified in the comment section. Refer to paragraph
+    * 15-5 for a more complete description of the TTC database.
+    */
+   char m_ttcMem[TTCMEM_SIZE+1];
+   
+   /**
+    * Field: DEVLUT_FLAG
+    *
+    * This field shall indicate if device compensation LUT has been applied to the image. The valid
+    * field codes are 0 and 1. A value of 0 means that a device LUT has not been applied to the
+    * image. A value of 1 means that t device LUT has been applied to the image. The nature of the
+    * LUT may be specified in the comment section and should include the device for which the LUT
+    * is applied. If the device is not known, an appropriate method for describing the LUT shall be
+    * given.
+    */
+   char m_devLutFlag[DEVLUT_FLAG_SIZE+1];
+   
+   /**
+    * Field OBPP
+    *
+    * This field shall contain the number of significant bits for each pixel after the processing
+    * functions denoted in the processing event have been performed, but prior to any output
+    * compression. For example, if an 8 bpp System B image is mapped into Display-Ready space
+    * using the proper 8 to 11 bpp transformation (see appendix A), the IBPP field shall contain the
+    * actual number of data pixels, not the word length. For example, if an 11-bpp word were stored
+    * in 16 bits, this field would contain 11. The valid OBPP field codes are 01 to 64, indicating 1
+    * to 64 bpp. In many cases, this field will match the IBPP field.
+    */
+   char m_obpp[OBPP_SIZE+1];
+   
+   /**
+    * Field: OPVTYPE
+    *
+    * This field shall contain an indicator of the type of computer representation used for the value
+    * of each pixel after the processing functions denoted in the processing event have been
+    * performed, but prior to any output compression. Valid entries are INT for integer, B for
+    * bi-level, SI for 2’s complement signed integer, R for real, and C for complex. The data bits of
+    * INT and SI values shall appear in the file in order of significance, beginning with the MSB and
+    * ending with the LSB. INT and SI data types shall be limited to 16 bits. R values shall be
+    * represented according to IEEE 32-bit floating-point representation (IEEE754). C values shall be
+    * represented with the Real and Imaginary parts each 32-bit floating point representation
+    * (IEEE754) and appearing adjacent four-byte blocks, first Real, then Imaginary. B (bi-level)
+    * pixel values shall be represented as single bits with value 1 or 0.
+    */
+   char m_opvType[OPVTYPE_SIZE+1];
+   
+   /**
+    * Field: OUTBWC
+    *
+    * This field shall indicate the type of bandwidth compression or expansion that has been applied
+    * to the image after any enhancements denoted in the processing event. The valid field codes to
+    * describe each type of compression are 5 byte character strings. The first two characters
+    * indicate the type of compression such as DCT or DPCM. The next two characters indicate either
+    * the bit rate or the quality level. The last character indicates if the process is compression
+    * or an expansion. Compression is denoted by a C, an E denotes expansion, and 0 indicates that
+    * neither process occurred. The types of compression are indicated by the same codes used in the
+    * INBWC field and can be found in the field description for INBWC.
+    * The entire BWC field is 10 bytes long to allow for the concatenation of up to 2 compression
+    * algorithms. Two consecutive 5 byte character strings shall indicate the application of two
+    * compression algorithms in succession. If only one operation is performed, then the remaining 5
+    * characters are zero. Examples of valid codes for the BWC field are shown below.
+    * The NJQ1C00000 code indicates that the processed image was saved as a NSIF JPEG lossless
+    * compressed image.
+    * The NJNLC00000 indicates that the processed image was saved as a NSIF JPEG lossless
+    * compressed image.
+    * The C3Q3C00000 code indicates that the processed image was saved as a NSIF JPEG
+    * compressed image at quality level 3.
+    */
+   char m_outBwc[OUTBWC_SIZE+1];
+   
+}; // Matches: class OSSIM_DLL ossimNitfHistoaProcessingEvent
+
+class OSSIM_DLL ossimNitfHistoaTag : public ossimNitfRegisteredTag
+{
+public:
+   enum
+   {
+      SYSTYPE_SIZE    = 20,
+      PC_SIZE         = 12,
+      PE_SIZE         = 4,
+      REMAP_FLAG_SIZE = 1,
+      LUTID_SIZE      = 2,
+      NEVENTS_SIZE    = 2
+   };
+   
+   ossimNitfHistoaTag();
+   
+   /**
+    * 
+    * This will allow the user defined data to parse the stream.
+    * 
+    */
+   virtual void parseStream(std::istream& in);
+   virtual void writeStream(std::ostream& out);
+   
+   virtual ossim_uint32 getSizeInBytes()const;
+   
+//   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.
+    * @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 clearFields();
+protected:
+   /**
+    * Field: SYSTYPE
+    *
+    * This field shall contain the name of the sensor from which the original image was collected. For
+    * national imagery, the valid field codes are SystemA, SystemB, SystemC, and SystemD. These
+    * codes shall not be used to indicate any other airborne or commercial systems and are reserved
+    * solely for the National systems. The codes in the SYSTYPE field shall be left justified and the
+    * remainder of the field filled with blanks to 20 characters. The NTB has requested that this tag be
+    * able to handle other types of airborne and commercial imagery currently supported by NITF.
+    *  Additional valid field codes are listed below:
+    * ASARS-2 ASARS System
+    * GHR Global Hawk Radar
+    * SYERS-EO SYERS Electro-Optical System
+    * SYERS-MSI SYERS Multispectral System
+    * SYERS-IR SYERS Infrared System
+    * DSR Dark Star Radar
+    * TSAR TESAR
+    * TBD Other
+    */
+   char m_systype[SYSTYPE_SIZE+1];
+   
+   /**
+    * Field: PC
+    *
+    * This field shall contain an alphanumeric string that indicates if bandwidth
+    * compression/expansion was applied to the image prior to NITF image creation. This field
+    * should be used in conjunction with the PE field to determine the state of the image prior to
+    * NITF formation. The valid field codes for the PC field is 4 byte character strings. The first two
+    * characters indicate the type of compression such as DCT or DPCM. The next two characters
+    * indicate either the bit rate or the quality level. The types of compression are indicated by the
+    * following codes:
+    * Value Definition
+    * DP43 DPCM (Differential Pulse Coded Modulation) – 4.3 bpp
+    * DC13 DCT (Discrete Cosine Transform –1.3 bpp
+    * DC23 DCT (Discrete Cosine Transform) – 2.3 bpp
+    * NJNL NSIF JPEG – Lossless
+    * NJQ0 NSIF JPEG – Quality Level 0
+    * NJQ1 NSIF JPEG – Quality Level 1
+    * NJQ2 NSIF JPEG – Quality Level 2
+    * C11D NSIF Bi-level – 1D
+    * C12S NSIF Bi-level – 2DS
+    * C12H NSIF Bi-level – 2DH
+    * M11D NSIF Bi-level – 1D
+    * M12S NSIF Bi-level with masked blocks – 2DS
+    * M12H NSIF Bi-level with masked blocks – 2DH
+    * C207 NITF ARIDPCM – 0.75 bpp
+    * C214 NITF ARIDPCM – 1.40 bpp
+    * C223 NITF ARIDPCM – 2.30 bpp
+    * C245 NITF ARIDPCM – 4.50 bpp
+    * C3Q0 NSIF Lossy JPEG – Q0 Custom Tables
+    * C3Q1 NSIF Lossy JPEG – Q1 Default Tables
+    * C3Q2 NSIF Lossy JPEG – Q2 Default Tables
+    * C3Q3 NSIF Lossy JPEG – Q2 Default Tables
+    * C3Q4 NSIF Lossy JPEG – Q4 Default Tables
+    * C3Q5 NSIF Lossy JPEG – Q5 Default Tables
+    * M3Q0 NSIF Lossy JPEG with masked blocks – Q0 Custom
+    * M3Q1 NSIF Lossy JPEG with masked blocks – Q1 Default
+    * M3Q2 NSIF Lossy JPEG with masked blocks – Q2 Default
+    * M3Q3 NSIF Lossy JPEG with masked blocks – Q3 Default
+    * M3Q4 NSIF Lossy JPEG with masked blocks – Q4 Default
+    * M3Q5 NSIF Lossy JPEG with masked blocks – Q5 Default
+    * C4LO NSIF Vector Quantization – Lossy
+    * M4LO NSIF Vector Quantization with masked blocks
+    * C5NL NSIF Lossless JPEG
+    * M5NL NSIF Lossless JPEG with masked blocks
+    * NC00 NSIF uncompressed
+    * NM00 NSIF with masked blocks uncompressed
+    * I1Q1 NSIF Downsample JPEG – Q1
+    * I1Q2 NSIF Downsample JPEG – Q2
+    * I1Q3 NSIF Downsample JPEG – Q3
+    * I1Q4 NSIF Downsample JPEG – Q4
+    * I1Q5 NSIF Downsample JPEG – Q5
+    * WVLO Wavelet Lossy
+    * WVNL Wavelet Lossless
+    * JP20 JPEG 2000
+    * NONE No Compression
+    * UNKC Unknown Compression
+    * The entire PC field is 12 bytes long to allow for the concatenation of up to 3 compression
+    * algorithms. Consecutive 4 byte character strings shall indicate the application of two or three
+    * compression algorithms in succession. If only one compression algorithm is applied then the
+    * last eight characters are zero. If the NSIF creator does not know where the image came from or
+    * what processing has been applied to it, then the code for unknown compression (UNKC) shall
+    * be used.
+    * Examples of valid codes for the PC field are shown below.
+    * The DP43DC130000 code indicates that a concatenation of the 4.3 DPCM and the 1.3 DCT
+    * compression and expansion was applied to the image prior to its NSIF formation.
+    * The NONE00000000 code indicates that no compression was applied to the image prior to its
+    * NSIF formation.
+    */
+   char m_pc[PC_SIZE+1];
+   
+   /**
+    * Field: PE
+    *
+    * This field shall contain an alphanumeric string that indicates if any enhancements were applied
+    * to the image prior to NSIF image creation. This field should be used in conjunction with the PC
+    * field to determine the state of the image prior to NSIF formation. The valid field codes for the
+    * PC field are given below
+    * EH08 Enhanced 8 bpp from IDEX
+    * EH11 Enhanced 11 bpp from IDEX
+    * UE08 8 bpp data with DRA but no enhancements from IDEX
+    * EU11 Unenhanced 22 bpp from IDEX
+    * DGHC Digitized Hardcopy
+    * UNKP Unknown Processing
+    * NONE No prior processing
+    * The first four codes explicitly define the types of ODS (Output Data Server) products that are
+    * available for NSIF formation. Additional codes may be added for airborne systems. If the NSIF
+    * creator does not know where the image came from or what processing has been applied to it,
+    * then the code for unknown processing (UNKP) shall be used.
+    */
+   char m_pe[PE_SIZE+1];
+   
+   /**
+    * Field: REMAP_FLAG
+    *
+    * This field shall indicate whether or not a system specific remap has been applied to the image.
+    * The valid field codes are 0 – 9, and a blank (BCS 0x20), but 2 – 9 are reserved for future use. A
+    * value of 0 means that no systems specific remap has been applied. A value of 1 means that the
+    * System C specific 16 – 12 bit remap has been applied to the System C image. If the image is not
+    * a System C image, this field does not apply at this time and should be filled with a blank.
+    * Values from 2 – 9 are reserved for future use and shall not be used at this time.
+    */
+   char m_remapFlag[REMAP_FLAG_SIZE+1];
+   
+   /**
+    * Field: LUTID
+    *
+    * This field shall contain the DMID (Data Mapping ID) for Systems B and D imagery. The
+    * DMID is contained in IMDAT records 97 and 98 in the ESD (Exploitation Support Data). This
+    * information is also referenced in IF200EAA. The valid field codes are 07, 08, and 12 – 64. A
+    * value of 07 and 08 indicates that the image is PEDF (Piecewise Extended Density Format). A
+    * value between 12 and 64 indicates that the image is a Linlog formatted image. Numbers
+    * between 01 and 06, 09, 10, and 11 are reserved and should not be used at this time. There are no
+    * valid DMID values greater than 64. NSIF users to help determine what type of processing
+    * should be applied to the image can use this field. For all other systems, this field should be filled
+    * with 00.
+    */
+   char m_lutid[LUTID_SIZE+1];
+   
+   /**
+    * Field: NEVENTS
+    *
+    * This field shall contain the number of processing events associated with the image. The tag is
+    * designed to record up to 99 separate processing events. The valid field codes are 01 to 99. The
+    * processing events are listed in chronological order, starting with the first event and ending with
+    * the most recent processing event. At a minimum, the first processing event shall be the
+    * processing immediately following the generation of the NSIF formatted image; however, if
+    * practical, the originator of the NSIF image can create the HISTOA TRE earlier - with the
+    * creation of the NSIF formatted image. In that instance, the first processing event would be the
+    * creation of the NSIF formatted image. Each successive processing event is to record what
+    * transformations have been applied to the image, once the image has been processed and saved.
+    */
+   char m_nEvents[NEVENTS_SIZE+1];
+   
+   std::vector<ossimNitfHistoaProcessingEvent> m_eventList;
+   
+}; // Matches: class OSSIM_DLL ossimNitfHistoaTag
+
+#endif /* #ifndef ossimNitfHistoaTag_HEADER */
diff --git a/include/ossim/support_data/ossimNitfIchipbTag.h b/include/ossim/support_data/ossimNitfIchipbTag.h
index 747230b..ba00cfe 100644
--- a/include/ossim/support_data/ossimNitfIchipbTag.h
+++ b/include/ossim/support_data/ossimNitfIchipbTag.h
@@ -11,9 +11,9 @@
 // http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
 //
 //----------------------------------------------------------------------------
-// $Id: ossimNitfIchipbTag.h 15766 2009-10-20 12:37:09Z gpotts $
+// $Id: ossimNitfIchipbTag.h 22013 2012-12-19 17:37:20Z dburken $
 #ifndef ossimNitfIchipbTag_HEADER
-#define ossimNitfIchipbTag_HEADER
+#define ossimNitfIchipbTag_HEADER 1
 
 #include <ossim/base/ossimConstants.h>
 #include <ossim/support_data/ossimNitfRegisteredTag.h>
@@ -67,9 +67,6 @@ public:
    /** default constructor */
    ossimNitfIchipbTag();
 
-   /** @return "ICHIPB" as an ossimString. */
-   virtual ossimString getRegisterTagName() const;
-  
    /**
     * Parse method.
     *
@@ -84,9 +81,6 @@ public:
     */
    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.
     */
diff --git a/include/ossim/support_data/ossimNitfImageHeaderV2_1.h b/include/ossim/support_data/ossimNitfImageHeaderV2_1.h
index bac74a1..bcdee68 100644
--- a/include/ossim/support_data/ossimNitfImageHeaderV2_1.h
+++ b/include/ossim/support_data/ossimNitfImageHeaderV2_1.h
@@ -8,7 +8,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfImageHeaderV2_1.h 18413 2010-11-11 19:56:22Z gpotts $
+// $Id: ossimNitfImageHeaderV2_1.h 20123 2011-10-11 17:55:44Z dburken $
 
 #ifndef ossimNitfImageHeaderV2_1_HEADER
 #define ossimNitfImageHeaderV2_1_HEADER
@@ -103,6 +103,20 @@ public:
    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;
diff --git a/include/ossim/support_data/ossimNitfImageHeaderV2_X.h b/include/ossim/support_data/ossimNitfImageHeaderV2_X.h
index daff3e2..b85b0fd 100644
--- a/include/ossim/support_data/ossimNitfImageHeaderV2_X.h
+++ b/include/ossim/support_data/ossimNitfImageHeaderV2_X.h
@@ -112,6 +112,20 @@ public:
   
    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;
@@ -120,6 +134,8 @@ public:
    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;
@@ -128,8 +144,10 @@ public:
    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;
@@ -141,6 +159,13 @@ public:
    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:
diff --git a/include/ossim/support_data/ossimNitfJ2klraTag.h b/include/ossim/support_data/ossimNitfJ2klraTag.h
index 6480fe7..acfc6fb 100644
--- a/include/ossim/support_data/ossimNitfJ2klraTag.h
+++ b/include/ossim/support_data/ossimNitfJ2klraTag.h
@@ -43,9 +43,6 @@ public:
    
    /** default constructor */
    ossimNitfJ2klraTag();
-
-   /** @return "J2KLRA" as an ossimString. */
-   virtual ossimString getRegisterTagName() const;
   
    /**
     * Parse method.
diff --git a/include/ossim/support_data/ossimNitfLocalCartographicTag.h b/include/ossim/support_data/ossimNitfLocalCartographicTag.h
index b124eca..90f1676 100644
--- a/include/ossim/support_data/ossimNitfLocalCartographicTag.h
+++ b/include/ossim/support_data/ossimNitfLocalCartographicTag.h
@@ -7,10 +7,10 @@ class ossimNitfLocalCartographicTag : public ossimNitfRegisteredTag
 public:
    ossimNitfLocalCartographicTag();
    virtual ~ossimNitfLocalCartographicTag();
-   virtual ossimString getRegisterTagName()const;
+
    virtual void parseStream(std::istream& in);
    virtual void writeStream(std::ostream& out);
-   virtual ossim_uint32 getSizeInBytes()const;
+
    virtual void clearFields();
 
 
diff --git a/include/ossim/support_data/ossimNitfLocalGeographicTag.h b/include/ossim/support_data/ossimNitfLocalGeographicTag.h
index e93a4c4..4b0cf85 100644
--- a/include/ossim/support_data/ossimNitfLocalGeographicTag.h
+++ b/include/ossim/support_data/ossimNitfLocalGeographicTag.h
@@ -9,7 +9,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfLocalGeographicTag.h 9094 2006-06-13 19:12:40Z dburken $
+// $Id: ossimNitfLocalGeographicTag.h 22013 2012-12-19 17:37:20Z dburken $
 #ifndef ossimNitfLocalGeographicTag_HEADER
 #define ossimNitfLocalGeographicTag_HEADER
 #include <ossim/support_data/ossimNitfRegisteredTag.h>
@@ -19,10 +19,9 @@ class OSSIM_DLL ossimNitfLocalGeographicTag : public ossimNitfRegisteredTag
 public:
    ossimNitfLocalGeographicTag();
    virtual ~ossimNitfLocalGeographicTag();
-   virtual ossimString getRegisterTagName()const;
+
    virtual void parseStream(std::istream& in);
    virtual void writeStream(std::ostream& out);
-   virtual ossim_uint32 getSizeInBytes()const;
 
    virtual void clearFields();
 
diff --git a/include/ossim/support_data/ossimNitfMstgtaTag.h b/include/ossim/support_data/ossimNitfMstgtaTag.h
index 3845ee1..b1e8e4a 100644
--- a/include/ossim/support_data/ossimNitfMstgtaTag.h
+++ b/include/ossim/support_data/ossimNitfMstgtaTag.h
@@ -15,7 +15,7 @@
 // $Id
 
 #ifndef ossimNitfMstgtaTag_HEADER
-#define ossimNitfMstgtaTag_HEADER
+#define ossimNitfMstgtaTag_HEADER 1
 
 #include <ossim/support_data/ossimNitfRegisteredTag.h>
 
@@ -46,21 +46,12 @@ public:
    /** @brief destructor */
    virtual ~ossimNitfMstgtaTag();
 
-   /**
-    * @brief Method to return tag name.
-    * @return "MSTGTA" as an ossimString.
-    */
-   virtual ossimString getRegisterTagName()const;
-
    /** @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);
 
-   /** @return Byte size of this tag. */
-   virtual ossim_uint32 getSizeInBytes()const;
-
    /** @brief Method to clear all fields including null terminating. */
    virtual void clearFields();
 
diff --git a/include/ossim/support_data/ossimNitfPiaimcTag.h b/include/ossim/support_data/ossimNitfPiaimcTag.h
index 83e9f6c..df30dce 100644
--- a/include/ossim/support_data/ossimNitfPiaimcTag.h
+++ b/include/ossim/support_data/ossimNitfPiaimcTag.h
@@ -15,7 +15,7 @@
 // http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
 //
 //----------------------------------------------------------------------------
-// $Id: ossimNitfPiaimcTag.h 14241 2009-04-07 19:59:23Z dburken $
+// $Id: ossimNitfPiaimcTag.h 22013 2012-12-19 17:37:20Z dburken $
 #ifndef ossimNitfPiaimcTag_HEADER
 #define ossimNitfPiaimcTag_HEADER
 
@@ -54,9 +54,6 @@ public:
    
    /** default constructor */
    ossimNitfPiaimcTag();
-
-   /** @return "PIAIMC" as an ossimString. */
-   virtual ossimString getRegisterTagName() const;
   
    /**
     * Parse method.
@@ -72,9 +69,6 @@ public:
     */
    virtual void writeStream(std::ostream& out);
    
-   /** @return The size of this record in bytes (362) within a nitf file. */
-   virtual ossim_uint32 getSizeInBytes()const;
-   
    /**
     * Clears all string fields within the record to some default nothingness.
     */
diff --git a/include/ossim/support_data/ossimNitfProjectionParameterTag.h b/include/ossim/support_data/ossimNitfProjectionParameterTag.h
index 21c86e2..283aaea 100644
--- a/include/ossim/support_data/ossimNitfProjectionParameterTag.h
+++ b/include/ossim/support_data/ossimNitfProjectionParameterTag.h
@@ -8,7 +8,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfProjectionParameterTag.h 14586 2009-05-20 22:45:03Z dburken $
+// $Id: ossimNitfProjectionParameterTag.h 22013 2012-12-19 17:37:20Z dburken $
 
 #ifndef ossimNitfProjectionParameterTag_HEADER
 #define ossimNitfProjectionParameterTag_HEADER
@@ -20,7 +20,7 @@ class OSSIM_DLL ossimNitfProjectionParameterTag : public ossimNitfRegisteredTag
 public:
    ossimNitfProjectionParameterTag();
    virtual ~ossimNitfProjectionParameterTag();
-   virtual ossimString getRegisterTagName()const;
+
    virtual void parseStream(std::istream& in);
    virtual void writeStream(std::ostream& out);
 
diff --git a/include/ossim/support_data/ossimNitfRegisteredTag.h b/include/ossim/support_data/ossimNitfRegisteredTag.h
index e34a173..54fd1aa 100644
--- a/include/ossim/support_data/ossimNitfRegisteredTag.h
+++ b/include/ossim/support_data/ossimNitfRegisteredTag.h
@@ -9,41 +9,85 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfRegisteredTag.h 18413 2010-11-11 19:56:22Z gpotts $
+// $Id: ossimNitfRegisteredTag.h 22013 2012-12-19 17:37:20Z dburken $
 #ifndef ossimNitfRegisteredTag_HEADER
-#define 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();
    
    /**
-    * 
-    * This will return the name of the registered tag for this
-    * user defined header.
-    * 
+    * @brief This will return the name of the registered tag for this user
+    * defined header.
+    *
+    * @note Deprecated - Use getTagName()
     */
-   virtual ossimString getRegisterTagName()const=0;
+   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 ossim_uint32 getSizeInBytes()const=0;
-
    virtual void setProperty(ossimRefPtr<ossimProperty> property);
    virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
    virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
@@ -71,7 +115,8 @@ public:
    virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix)const;
    
 protected:
-   ossimString theRegisteredTagName;
+   std::string  m_tagName;
+   ossim_uint32 m_tagLength;
    
 TYPE_DATA
 };
diff --git a/include/ossim/support_data/ossimNitfRpcATag.h b/include/ossim/support_data/ossimNitfRpcATag.h
index 35bc3da..f95f166 100644
--- a/include/ossim/support_data/ossimNitfRpcATag.h
+++ b/include/ossim/support_data/ossimNitfRpcATag.h
@@ -11,9 +11,9 @@
 // Rational Polynomial Coefficient extension.
 //
 //********************************************************************
-// $Id: ossimNitfRpcATag.h 9094 2006-06-13 19:12:40Z dburken $
+// $Id: ossimNitfRpcATag.h 22013 2012-12-19 17:37:20Z dburken $
 #ifndef ossimNitfRpcATag_HEADER
-#define ossimNitfRpcATag_HEADER
+#define ossimNitfRpcATag_HEADER 1
 
 #include <ossim/support_data/ossimNitfRpcBase.h>
 
@@ -26,9 +26,6 @@ class OSSIM_DLL ossimNitfRpcATag : public ossimNitfRpcBase
 public:
    
    ossimNitfRpcATag();
-
-   /** @return "RPC00A" as an ossimString. */
-   virtual ossimString getRegisterTagName() const;
    
 protected:
    
diff --git a/include/ossim/support_data/ossimNitfRpcBTag.h b/include/ossim/support_data/ossimNitfRpcBTag.h
index 70b37c2..f792086 100644
--- a/include/ossim/support_data/ossimNitfRpcBTag.h
+++ b/include/ossim/support_data/ossimNitfRpcBTag.h
@@ -9,9 +9,9 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfRpcBTag.h 9094 2006-06-13 19:12:40Z dburken $
+// $Id: ossimNitfRpcBTag.h 22013 2012-12-19 17:37:20Z dburken $
 #ifndef ossimNitfRpcBTag_HEADER
-#define ossimNitfRpcBTag_HEADER
+#define ossimNitfRpcBTag_HEADER 1
 
 #include <ossim/support_data/ossimNitfRpcBase.h>
 
@@ -24,9 +24,6 @@ class OSSIM_DLL ossimNitfRpcBTag : public ossimNitfRpcBase
 public:
    ossimNitfRpcBTag();
 
-   /** @return "RPC00B" as an ossimString. */
-   virtual ossimString getRegisterTagName() const;
-
 TYPE_DATA   
 };
 
diff --git a/include/ossim/support_data/ossimNitfRpcBase.h b/include/ossim/support_data/ossimNitfRpcBase.h
index ee91925..c83ef17 100644
--- a/include/ossim/support_data/ossimNitfRpcBase.h
+++ b/include/ossim/support_data/ossimNitfRpcBase.h
@@ -13,9 +13,9 @@
 // See: http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
 //
 //********************************************************************
-// $Id: ossimNitfRpcBase.h 14576 2009-05-20 13:58:45Z dburken $
+// $Id: ossimNitfRpcBase.h 22013 2012-12-19 17:37:20Z dburken $
 #ifndef ossimNitfRpcBase_HEADER
-#define ossimNitfRpcBase_HEADER
+#define ossimNitfRpcBase_HEADER 1
 #include <ossim/support_data/ossimNitfRegisteredTag.h>
 
 class OSSIM_DLL ossimNitfRpcBase : public ossimNitfRegisteredTag
@@ -65,9 +65,6 @@ class OSSIM_DLL ossimNitfRpcBase : public ossimNitfRegisteredTag
    */
   virtual void writeStream(std::ostream& out);
 
-  /** @return The size of this record in bytes (1041) within a nitf file. */
-  virtual ossim_uint32 getSizeInBytes()const;
-
   /**
    * Clears all string fields within the record to some default nothingness.
    */
diff --git a/include/ossim/support_data/ossimNitfSensraTag.h b/include/ossim/support_data/ossimNitfSensraTag.h
index 9c4342f..5e159ab 100644
--- a/include/ossim/support_data/ossimNitfSensraTag.h
+++ b/include/ossim/support_data/ossimNitfSensraTag.h
@@ -9,7 +9,7 @@
 // Description: Nitf support class for SENSRA - Sensor parameters extension.
 // 
 //********************************************************************
-// $Id: ossimNitfSensraTag.h 14659 2009-06-05 17:37:39Z dburken $
+// $Id: ossimNitfSensraTag.h 22013 2012-12-19 17:37:20Z dburken $
 #ifndef ossimNitfSensraTag_HEADER
 #define ossimNitfSensraTag_HEADER
 #include <ossim/support_data/ossimNitfRegisteredTag.h>
@@ -50,10 +50,10 @@ public:
 
    ossimNitfSensraTag();
    virtual ~ossimNitfSensraTag();
-   virtual ossimString getRegisterTagName()const;
+
    virtual void parseStream(std::istream& in);
    virtual void writeStream(std::ostream& out);
-   virtual ossim_uint32 getSizeInBytes()const;
+
    virtual void clearFields();
 
    /**
diff --git a/include/ossim/support_data/ossimNitfStdidcTag.h b/include/ossim/support_data/ossimNitfStdidcTag.h
index a555e85..2eb681c 100644
--- a/include/ossim/support_data/ossimNitfStdidcTag.h
+++ b/include/ossim/support_data/ossimNitfStdidcTag.h
@@ -11,9 +11,9 @@
 // See:  STDI-000_v2.1 Table 7-3 for detailed description.
 // 
 //********************************************************************
-// $Id: ossimNitfStdidcTag.h 14241 2009-04-07 19:59:23Z dburken $
+// $Id: ossimNitfStdidcTag.h 22013 2012-12-19 17:37:20Z dburken $
 #ifndef ossimNitfStdidcTag_HEADER
-#define ossimNitfStdidcTag_HEADER
+#define ossimNitfStdidcTag_HEADER 1
 #include <ossim/support_data/ossimNitfRegisteredTag.h>
 
 class OSSIM_DLL ossimNitfStdidcTag : public ossimNitfRegisteredTag
@@ -46,10 +46,10 @@ public:
       
    ossimNitfStdidcTag();
    virtual ~ossimNitfStdidcTag();
-   virtual ossimString getRegisterTagName()const;
+
    virtual void parseStream(std::istream& in);
    virtual void writeStream(std::ostream& out);
-   virtual ossim_uint32 getSizeInBytes()const;
+
    virtual void clearFields();
 
   // The set methods below taking ossimString args will truncate and
diff --git a/include/ossim/support_data/ossimNitfUnknownTag.h b/include/ossim/support_data/ossimNitfUnknownTag.h
index 0f03008..374c7fd 100644
--- a/include/ossim/support_data/ossimNitfUnknownTag.h
+++ b/include/ossim/support_data/ossimNitfUnknownTag.h
@@ -12,9 +12,9 @@
 // the tag factories.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimNitfUnknownTag.h 14241 2009-04-07 19:59:23Z dburken $
+// $Id: ossimNitfUnknownTag.h 22013 2012-12-19 17:37:20Z dburken $
 #ifndef ossimNitfUnknownTag_HEADER
-#define ossimNitfUnknownTag_HEADER
+#define ossimNitfUnknownTag_HEADER 1
 
 #include <ossim/support_data/ossimNitfRegisteredTag.h>
 
@@ -26,13 +26,6 @@ public:
 
    /** destructor */
    virtual ~ossimNitfUnknownTag();
-
-   /**
-    * @return "tagname" as an ossimString.
-    *
-    * @note: This has to be set by maker as the tag is not in any factory.
-    */
-   virtual ossimString getRegisterTagName() const;
   
    /**
     * Parse method.
@@ -50,13 +43,6 @@ public:
    virtual void writeStream(std::ostream& out);
    
    /**
-    * @return The size of this record in bytes within a nitf file.
-    *
-    * @ote: This has to be set by maker as the tag is not in any factory.
-    */
-   virtual ossim_uint32 getSizeInBytes()const;
-   
-   /**
     * Clears all string fields within the record to some default nothingness.
     */
    virtual void clearFields();
@@ -68,13 +54,6 @@ public:
    virtual std::ostream& print(std::ostream& out,
                                const std::string& prefix=std::string()) const;
 
-      /**
-    * @param tagName Name of tag.
-    *
-    * @note Users should set tag name as this is an unknown tag.
-    */
-   void setTagName(const ossimString& tagName);
-
    /**
     * @param length Length of tag.
     *
@@ -84,7 +63,7 @@ public:
     * exist it will be deleted by this method.
     * Subsequent "parseStream" calls will allocate theTagData as needed.
     */
-   void setTagLength(ossim_uint32 length);
+   virtual void setTagLength(ossim_uint32 length);
    
 protected:
 
@@ -93,13 +72,10 @@ protected:
     */
    bool tagDataIsAscii() const;
 
-   ossimString  theTagName;
-   ossim_uint32 theTagLength;
-
    /**
     * Holds entire tag data(theTagLength) plus one byte for null terminator.
     */
-   char*        theTagData;
+   char* m_tagData;
    
 TYPE_DATA   
 };
diff --git a/include/ossim/support_data/ossimNitfUse00aTag.h b/include/ossim/support_data/ossimNitfUse00aTag.h
index 85b6068..cdbcfb9 100644
--- a/include/ossim/support_data/ossimNitfUse00aTag.h
+++ b/include/ossim/support_data/ossimNitfUse00aTag.h
@@ -10,7 +10,7 @@
 // Exploitation Usability extension.
 // 
 //********************************************************************
-// $Id: ossimNitfUse00aTag.h 14241 2009-04-07 19:59:23Z dburken $
+// $Id: ossimNitfUse00aTag.h 22013 2012-12-19 17:37:20Z dburken $
 #ifndef ossimNitfUse00aTag_HEADER
 #define ossimNitfUse00aTag_HEADER
 
@@ -52,10 +52,10 @@ public:
    
    ossimNitfUse00aTag();
    virtual ~ossimNitfUse00aTag();
-   virtual ossimString getRegisterTagName()const;
+
    virtual void parseStream(std::istream& in);
    virtual void writeStream(std::ostream& out);
-   virtual ossim_uint32 getSizeInBytes()const;
+
    virtual void clearFields();
    
   // The set methods below taking ossimString args will truncate and
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/include/ossim/support_data/ossimNmeaMessageSequencer.h b/include/ossim/support_data/ossimNmeaMessageSequencer.h
new file mode 100644
index 0000000..989e1bc
--- /dev/null
+++ b/include/ossim/support_data/ossimNmeaMessageSequencer.h
@@ -0,0 +1,27 @@
+#ifndef ossimNmeaMessageSequencer_HEADER
+#define ossimNmeaMessageSequencer_HEADER
+#include <ossim/support_data/ossimNmeaMessage.h>
+#include <ossim/base/ossimFilename.h>
+#include <string>
+
+class OSSIM_DLL ossimNmeaMessageSequencer 
+{
+public:
+   ossimNmeaMessageSequencer();
+   ossimNmeaMessageSequencer(const ossimFilename& file);
+   ossimNmeaMessageSequencer(const std::string& str);
+   ~ossimNmeaMessageSequencer();
+   
+   void initialize(const ossimFilename& file);
+   void initialize(const std::string& str);
+   
+   virtual bool next(ossimNmeaMessage& msg);
+   
+   virtual void reset();
+   virtual bool valid()const;
+   
+protected:
+   void destroy();
+   std::istream* m_inputStream;
+};
+#endif
diff --git a/include/ossim/support_data/ossimPpjFrameSensorFile.h b/include/ossim/support_data/ossimPpjFrameSensorFile.h
new file mode 100644
index 0000000..7912f8c
--- /dev/null
+++ b/include/ossim/support_data/ossimPpjFrameSensorFile.h
@@ -0,0 +1,68 @@
+#ifndef ossimPpjFrameSensorFile_HEADER
+#define ossimPpjFrameSensorFile_HEADER
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimXmlDocument.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/matrix/newmat.h>
+#include <ossim/base/ossimEcefPoint.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDpt3d.h>
+#include <iostream>
+
+class OSSIM_DLL ossimPpjFrameSensorFile : public ossimObject
+{
+public:
+   enum PointType
+   {
+      UNKNOWN_POINT_TYPE = 0,
+      BASIC_POINT_TYPE   = 1
+   };
+   class OSSIM_DLL PointMap
+   {
+   public:
+      PointType      m_type;
+      ossimDpt3d     m_point;
+      ossimDpt       m_pixelPoint;
+   };
+   typedef std::vector<PointMap> PointMapList;
+   typedef std::vector<ossim_float64> DoubleArrayType;
+   ossimPpjFrameSensorFile();
+
+   virtual bool readFile(const ossimFilename& file);
+   virtual bool readStream(std::istream& is); 
+
+   const ossimString&     getBaseName()const;
+   ossim_int64            getImageNumber()const;
+   const ossimDpt&        getPrincipalPoint()const;
+   const ossimGpt&        getPlatformPosition()const;
+   const NEWMAT::Matrix&  getExtrinsic()const;
+   const NEWMAT::Matrix&  getIntrinsic()const;
+   const ossimDpt&        getImageSize()const;
+   const DoubleArrayType& getRadialDistortion()const;
+   const DoubleArrayType& getTangentialDistortion()const;
+
+   double getAverageProjectedHeight()const;
+protected:
+   void reset();
+   ossimPpjFrameSensorFile(const ossimPpjFrameSensorFile& src);
+   ossimPpjFrameSensorFile& operator =(const ossimPpjFrameSensorFile& src);
+
+   ossimGpt                      m_platformPosition;
+   ossimFilename                 m_filename;
+   ossimString                   m_fileBaseName;
+   ossim_int64                   m_imageNumber;
+   ossimRefPtr<ossimXmlDocument> m_ppjXml;
+   ossimDpt                      m_imageSize;
+   ossimDpt                      m_principalPoint;
+   NEWMAT::Matrix                m_extrinsicMatrix;
+   NEWMAT::Matrix                m_intrinsicMatrix;
+   DoubleArrayType               m_radialDistortion;
+   DoubleArrayType               m_tangentialDistortion;
+
+   PointMapList                  m_pointMapList;
+   double                        m_averageProjectedHeight;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimQuickbirdMetaData.h b/include/ossim/support_data/ossimQuickbirdMetaData.h
index 1e9b459..f0a781a 100644
--- a/include/ossim/support_data/ossimQuickbirdMetaData.h
+++ b/include/ossim/support_data/ossimQuickbirdMetaData.h
@@ -12,18 +12,18 @@
 // $Id: ossimQuickbirdMetaData.h 14412 2009-04-27 16:58:46Z dburken $
 
 #ifndef ossimQuickbirdMetaData_HEADER
-#define ossimQuickbirdMetaData_HEADER
-
-#include <iosfwd>
+#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:
@@ -100,31 +100,28 @@ public:
                       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;
+   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;
-   
-   /*ossim_uint32  theNumBands;*/
-   /*ossimString   theBandName;*/
-  /*ossim_uint32  theNumBands;*/
+   ossimString         theBandNameList;
+   ossimIpt            theImageSize;
 
 TYPE_DATA
 };
diff --git a/include/ossim/support_data/ossimQuickbirdTile.h b/include/ossim/support_data/ossimQuickbirdTile.h
index f45fc79..60c309c 100644
--- a/include/ossim/support_data/ossimQuickbirdTile.h
+++ b/include/ossim/support_data/ossimQuickbirdTile.h
@@ -7,7 +7,7 @@
 // Description:
 //
 //*******************************************************************
-//  $Id: ossimQuickbirdTile.h 17815 2010-08-03 13:23:14Z dburken $
+//  $Id: ossimQuickbirdTile.h 19682 2011-05-31 14:21:20Z dburken $
 #ifndef ossimQuickbirdTil_HEADER
 #define ossimQuickbirdTil_HEADER
 #include <map>
@@ -105,9 +105,9 @@ public:
    bool getInfo(ossimQuickbirdTileInfo& result,
                 const ossimFilename& filename)const;
 
-   const std::map<ossimString, ossimQuickbirdTileInfo>& getMap() const { return theTileMap; }
+   const std::map<std::string, ossimQuickbirdTileInfo>& getMap() const { return theTileMap; }
    
-   typedef std::map<ossimString, ossimQuickbirdTileInfo> TileMap;
+   typedef std::map<std::string, ossimQuickbirdTileInfo> TileMap;
 
 protected:
 
diff --git a/include/ossim/support_data/ossimRpfComponentIdLut.h b/include/ossim/support_data/ossimRpfComponentIdLut.h
new file mode 100644
index 0000000..9650e76
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfComponentIdLut.h
@@ -0,0 +1,51 @@
+//----------------------------------------------------------------------------
+// File:     ossimRpfComponentIdLut.h
+// 
+// License:  See top level LICENSE.txt file.
+//
+// Author:   David Burken
+//
+// Description: See class description.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimRpfComponentIdLut.h 20324 2011-12-06 22:25:23Z dburken $
+
+#ifndef ossimRpfComponentIdLut_HEADER
+#define ossimRpfComponentIdLut_HEADER 1
+
+#include <ossim/base/ossimLookUpTable.h>
+#include <ossim/support_data/ossimRpfConstants.h>
+
+/**
+ * @class ossimRpfComponentIdLut
+ *
+ * @brief Lookup table for RPF section/component ID's.
+ * 
+ * Used to convert from RPF section/component ID's to strings and vice versa.
+ * See MIL-STD-2411-1, section 5.1.1 for detailed information. Defines located
+ * in ossimRpfConstants.h.  This class is a singleton, only one of them so all
+ * callers must go through the instance method like:
+ * ossimRpfComponentIdLut::instance()->getEntryString(id);
+ */
+class OSSIMDLLEXPORT ossimRpfComponentIdLut : public ossimLookUpTable
+{
+public:
+
+   /** @return The static instance of an ossimRpfComponentIdLut object. */
+   static ossimRpfComponentIdLut* instance();
+
+   /** @brief destructor */
+   virtual ~ossimRpfComponentIdLut();
+
+   /** @return Keyword: ("rpf_component_id", "") */
+   virtual ossimKeyword getKeyword() const;
+   
+private:
+   /** @brief Hidden from use constructor. */
+   ossimRpfComponentIdLut();
+
+   /** @brief The single instance of this class. */
+   static ossimRpfComponentIdLut* theInstance;
+};
+
+#endif /* #ifndef ossimRpfComponentIdLut_HEADER */
diff --git a/include/ossim/support_data/ossimRpfFrame.h b/include/ossim/support_data/ossimRpfFrame.h
index 5bc255c..0629955 100644
--- a/include/ossim/support_data/ossimRpfFrame.h
+++ b/include/ossim/support_data/ossimRpfFrame.h
@@ -10,13 +10,10 @@
 //              rpf file.
 //
 //********************************************************************
-// $Id: ossimRpfFrame.h 16997 2010-04-12 18:53:48Z dburken $
+// $Id: ossimRpfFrame.h 20324 2011-12-06 22:25:23Z dburken $
 
 #ifndef ossimRpfFrame_HEADER
-#define ossimRpfFrame_HEADER
-
-#include <iosfwd>
-#include <vector>
+#define ossimRpfFrame_HEADER 1
 
 #include <ossim/base/ossimReferenced.h>
 #include <ossim/base/ossimRefPtr.h>
@@ -24,6 +21,9 @@
 #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;
@@ -94,6 +94,13 @@ public:
       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();
@@ -103,6 +110,7 @@ private:
    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
@@ -191,6 +199,9 @@ private:
     */
    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/ossimRpfHeader.h b/include/ossim/support_data/ossimRpfHeader.h
index c6ff162..502fccd 100644
--- a/include/ossim/support_data/ossimRpfHeader.h
+++ b/include/ossim/support_data/ossimRpfHeader.h
@@ -9,9 +9,9 @@
 // Description: Rpf support class
 // 
 //********************************************************************
-// $Id: ossimRpfHeader.h 16997 2010-04-12 18:53:48Z dburken $
+// $Id: ossimRpfHeader.h 22013 2012-12-19 17:37:20Z dburken $
 #ifndef ossimRpfHeader_HEADER
-#define ossimRpfHeader_HEADER
+#define ossimRpfHeader_HEADER 1
 
 #include <iosfwd>
 #include <ossim/base/ossimConstants.h>
@@ -49,12 +49,6 @@ public:
 
    virtual ~ossimRpfHeader();
 
-   /*!
-    * This will return the name of the registered tag for this
-    * user defined header.
-    */
-   virtual ossimString getRegisterTagName()const;
-
    /**
     * @brief Parse method.
     *
@@ -81,8 +75,6 @@ public:
    std::ostream& print(std::ostream& out,
                        const std::string& prefix=std::string()) const;
 
-   virtual ossim_uint32 getSizeInBytes()const;
-   
    virtual ossimByteOrder getByteOrder()const;
    
    const ossimRpfLocationSection* getLocationSection() const;
diff --git a/include/ossim/support_data/ossimRpfReplaceUpdateRecord.h b/include/ossim/support_data/ossimRpfReplaceUpdateRecord.h
new file mode 100644
index 0000000..6a0d627
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfReplaceUpdateRecord.h
@@ -0,0 +1,117 @@
+//----------------------------------------------------------------------------
+//
+// File:     ossimRpfReplaceUpdateRecord.h
+// 
+// License:  See top level LICENSE.txt file.
+// 
+// Author:   David Burken
+//
+// Description: See class description.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimRpfReplaceUpdateRecord.h 20324 2011-12-06 22:25:23Z dburken $
+
+#ifndef ossimRpfReplaceUpdateRecord_HEADER
+#define ossimRpfReplaceUpdateRecord_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <iosfwd>
+
+/**
+ * @class ossimRpfReplaceUpdateRecord
+ * @brief RPF replace/update section subheader record.
+ * See MIL-STD-2411 for detailed information.
+ */
+class ossimRpfReplaceUpdateRecord
+{
+public:
+
+   /** @brief Convenience output operator. */
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimRpfReplaceUpdateRecord& data);
+
+   /** @brief default constructor */
+   ossimRpfReplaceUpdateRecord();
+
+   /** @brief copy constructor */
+   ossimRpfReplaceUpdateRecord(const ossimRpfReplaceUpdateRecord& obj);
+
+   /** @brief assignment operator */
+   const ossimRpfReplaceUpdateRecord& operator=(const ossimRpfReplaceUpdateRecord& rhs);
+
+   /**
+    * @brief Method to parse the record.
+    * Note no byte swapping required for this record.
+    * @param in Stream sitting at record.
+    */
+   ossimErrorCode parseStream(std::istream& in);
+
+   /**
+    * @brief Write method.
+    * Note no byte swapping required for this record.
+    * @param out Stream to write to.
+    */
+   void writeStream(std::ostream& out);
+
+   /** @brief Clears fields. */
+   void clearFields();
+
+  /**
+    * @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.
+    * @param recordNumber This is added to key.  See below.
+    * e.g. Where prefix = "nitf.rpf.",  recordNumber = 0 and key is "new_file"
+    * key becomes: "nitf.rpf.replace_update_record0.new_file:"
+    * @return output stream.
+    */
+ 
+   std::ostream& print( std::ostream& out,
+                        const std::string& prefix=std::string(),
+                        ossim_uint32 recordNumber=0) const;
+
+   /**
+    * @brief Gets new file field.
+    * @param file Set by this.
+    */
+   void getNewFilename(std::string& file) const;
+
+   /**
+    * @brief Gets old file field.
+    * @param file Set by this.
+    */
+   void getOldFilename(std::string& file) const;
+
+   /** @return The update status field. */
+   ossim_uint8 getUpdateStatus() const;
+
+   /**
+    * @brief Sets old file name 12 byte field.
+    * @param file
+    */
+   void setNewFilename(const std::string& file);
+
+   /**
+    * @brief Sets new file name 12 byte field.
+    * @param file
+    */
+   void setOldFilename(const std::string& file);
+
+   /** @return Sets the update status field. */
+   void setUpdateStatus(ossim_uint8 status);
+   
+private:
+   
+   /** This is a 12 byte asci field. */
+   char m_newFile[13];
+
+   /** This is a 12 byte asci field. */
+   char m_oldFile[13];
+
+   /** This is a 1 byte unsigned integer. */
+   ossim_uint8 m_updateStatus;
+};
+
+#endif /* #ifndef ossimRpfReplaceUpdateRecord_HEADER */
diff --git a/include/ossim/support_data/ossimRpfReplaceUpdateSectionSubheader.h b/include/ossim/support_data/ossimRpfReplaceUpdateSectionSubheader.h
new file mode 100644
index 0000000..f756477
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfReplaceUpdateSectionSubheader.h
@@ -0,0 +1,101 @@
+//----------------------------------------------------------------------------
+//
+// File:     ossimRpfReplaceUpdateSectionSubheader.h
+// 
+// License:  See top level LICENSE.txt file.
+// 
+// Author:   David Burken
+//
+// Description: See class description.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimRpfReplaceUpdateSectionSubheader.h 20324 2011-12-06 22:25:23Z dburken $
+
+#ifndef ossimRpfReplaceUpdateSubheader_Header
+#define ossimRpfReplaceUpdateSubheader_Header 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimReferenced.h>
+#include <iosfwd>
+
+/**
+ * @class ossimRpfReplaceUpdateSectionSubheader
+ * @brief RPF replace/update section subheader record.
+ * See MIL-STD-2411 for detailed information.
+ */
+class ossimRpfReplaceUpdateSectionSubheader : public ossimReferenced
+{
+public:
+
+   /** @brief Convenience output operator. */
+   friend std::ostream& operator<<(std::ostream& out,
+                                   const ossimRpfReplaceUpdateSectionSubheader& data);
+
+   /** @brief default constructor */
+   ossimRpfReplaceUpdateSectionSubheader();
+
+   /** @brief copy constructor */
+   ossimRpfReplaceUpdateSectionSubheader(const ossimRpfReplaceUpdateSectionSubheader& obj);
+
+   /** @brief assignment operator */
+   const ossimRpfReplaceUpdateSectionSubheader& operator=(
+      const ossimRpfReplaceUpdateSectionSubheader& rhs);
+
+   /** @brief virtual destructor */
+   virtual ~ossimRpfReplaceUpdateSectionSubheader();
+
+   /**
+    * @brief Method to parse the record.
+    * @param in Stream sitting at record.
+    * @param byteOrder Byte order of system.
+    */   
+   ossimErrorCode parseStream(std::istream& in, ossimByteOrder byteOrder);
+
+   /**
+    * @brief Write method.
+    *
+    * Note always writes out in big endian at this point.
+    *
+    * @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;
+
+   /** @return Offset to first record. */
+   ossim_uint32 getOffset() const;
+
+   /** @return Number of records. */
+   ossim_uint16 getNumberOfRecords() const;
+
+   /** @return Length of one record. */
+   ossim_uint16 getRecordLength() const;
+
+   /**
+    * @brief Sets number of records.
+    * @param count
+    */
+   void setNumberOfRecords(ossim_uint16 count);
+
+   void setRecordLength(ossim_uint16 length);
+   void clearFields();
+   
+private:
+   ossim_uint32  m_tableOffset;
+   ossim_uint16  m_numberOfRecords;
+   ossim_uint16  m_recordLength;
+};
+
+
+
+#endif /* #ifndef ossimRpfReplaceUpdateSubheader_Header */
diff --git a/include/ossim/support_data/ossimRpfReplaceUpdateTable.h b/include/ossim/support_data/ossimRpfReplaceUpdateTable.h
new file mode 100644
index 0000000..baade7b
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfReplaceUpdateTable.h
@@ -0,0 +1,68 @@
+//----------------------------------------------------------------------------
+//
+// File:     ossimRpfReplaceUpdateTable.h
+// 
+// License:  See top level LICENSE.txt file.
+// 
+// Author:   David Burken
+//
+// Description: See class description.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimRpfReplaceUpdateTable.h 20328 2011-12-07 17:43:24Z dburken $
+
+#ifndef ossimRpfReplaceUpdateTable_HEADER
+#define ossimRpfReplaceUpdateTable_HEADER 1
+
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimRpfReplaceUpdateRecord.h>
+#include <iosfwd>
+#include <string>
+#include <vector>
+
+/**
+ * @class ossimRpfReplaceUpdateTable
+ * @brief Holds a table of RPF replace/update section subheader records.
+ * See MIL-STD-2411 for detailed information.
+ */
+class OSSIM_DLL ossimRpfReplaceUpdateTable : public ossimReferenced
+{
+public:
+
+   /** @brief default constructor */
+   ossimRpfReplaceUpdateTable();
+
+   /** @brief copy constructor */
+   ossimRpfReplaceUpdateTable(const ossimRpfReplaceUpdateTable& obj);
+
+   /** @brief assignment operator */
+   const ossimRpfReplaceUpdateTable& operator=(const ossimRpfReplaceUpdateTable& rhs);
+
+   /**
+    * @brief Method to add a record.
+    * @param record to add.
+    */
+   void addRecord(const ossimRpfReplaceUpdateRecord& record);
+
+   /** @brief Clears the table. */
+   void clear();
+
+   /**
+    * @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.rpf." and key is "new_file" key becomes:
+    * "nitf.rpf.replace_update_record0.new_file:
+    * @return output stream.
+    */
+   std::ostream& print( std::ostream& out,
+                        const std::string& prefix=std::string() ) const;
+   
+private:
+
+   std::vector<ossimRpfReplaceUpdateRecord> m_table;
+};
+
+#endif /* #ifndef ossimRpfReplaceUpdateTable_HEADER */
diff --git a/include/ossim/support_data/ossimRpfTocEntry.h b/include/ossim/support_data/ossimRpfTocEntry.h
index b1b4cb6..9debe6c 100644
--- a/include/ossim/support_data/ossimRpfTocEntry.h
+++ b/include/ossim/support_data/ossimRpfTocEntry.h
@@ -9,22 +9,22 @@
 // Description: Rpf support class
 // 
 //********************************************************************
-// $Id: ossimRpfTocEntry.h 18362 2010-11-01 15:20:47Z dburken $
+// $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>
 
-#include <vector>
-#include <iosfwd>
-
 class ossimIrect;
 
-class OSSIM_DLL ossimRpfTocEntry
+class OSSIMDLLEXPORT ossimRpfTocEntry
 {
 public:
    friend std::ostream& operator <<(std::ostream& out,
@@ -106,6 +106,7 @@ 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;
 };
 
diff --git a/include/ossim/support_data/ossimSrcRecord.h b/include/ossim/support_data/ossimSrcRecord.h
index 6836054..442acbd 100644
--- a/include/ossim/support_data/ossimSrcRecord.h
+++ b/include/ossim/support_data/ossimSrcRecord.h
@@ -5,7 +5,7 @@
 //   AUTHOR: Oscar Kramer
 //
 //*************************************************************************************************
-//  $Id$
+//  $Id: ossimSrcRecord.h 2788 2011-06-29 13:20:37Z oscar.kramer $
 #ifndef ossimSrcRecord_HEADER
 #define ossimSrcRecord_HEADER
 
@@ -29,8 +29,19 @@
 //!   image0.hist: <full/path/to/histogram.his>
 //!   image0.hist-op: auto-minmax | std-stretch N  (N=1|2|3)
 //!   image0.support: <path_to_support_files>
-//!   image0.rgb: R,G,rgbB  (unsigned integers starting with 1)
-//!
+//!   image0.rgb: R,G,B  (unsigned integers starting with 1)
+//!   image0.mask: <filename>
+//!   image0.opacity: <double>
+//!   image0.replacement_mode: <REPLACE_BAND_IF_TARGET | 
+//!                             REPLACE_BAND_IF_PARTIAL_TARGET | 
+//!                             REPLACE_ALL_BANDS_IF_ANY_TARGET | 
+//!                             REPLACE_ALL_BANDS_IF_PARTIAL_TARGET | 
+//!                             REPLACE_ONLY_FULL_TARGETS>
+//!   image0.clamp.min: <double>
+//!   image0.clamp.max: <double>
+//!   image0.clip.min: <double>
+//!   image0.clip.max: <double>
+//! 
 //!   vector0.file: <image_filename>  
 //!   vector0.entry: <image_index_in_multi_image_file> (unsigned integer)
 //!   vector0.query: <select query>
@@ -55,7 +66,7 @@ public:
    {
    public:
       PixelFlipParams() : 
-         replacementMode("none"), 
+         replacementMode(""), 
          clampMin(ossim::nan()), clampMax(ossim::nan()),
          clipMin(ossim::nan()), clipMax(ossim::nan()) {}
 
@@ -68,7 +79,7 @@ public:
    ossimSrcRecord();
       
    //! Constructs given an in-memory KWL and record index.
-   ossimSrcRecord(const ossimKeywordlist& kwl, ossim_uint32 index=0);
+   ossimSrcRecord(const ossimKeywordlist& kwl, ossim_uint32 index=0, ossimString prefix_str="image");
    
    //! @brief Initializes record from an in-memory KWL and prefix.
    //!
diff --git a/include/ossim/support_data/ossimTiffInfo.h b/include/ossim/support_data/ossimTiffInfo.h
index 7cf04ab..27cdb89 100644
--- a/include/ossim/support_data/ossimTiffInfo.h
+++ b/include/ossim/support_data/ossimTiffInfo.h
@@ -9,9 +9,9 @@
 // Description: TIFF Info object.
 // 
 //----------------------------------------------------------------------------
-// $Id$
+// $Id: ossimTiffInfo.h 2673 2011-06-06 14:57:24Z david.burken $
 #ifndef ossimTiffInfo_HEADER
-#define ossimTiffInfo_HEADER
+#define ossimTiffInfo_HEADER 1
 
 #include <ossim/base/ossimConstants.h>
 #include <ossim/support_data/ossimInfoBase.h>
@@ -56,6 +56,7 @@ public:
       OTIFFTAG_BITSPERSAMPLE              = 258,
       OTIFFTAG_COMPRESSION                = 259,
       OTIFFTAG_PHOTOMETRIC                = 262,
+      OTIFFTAG_FILLORDER                  = 266,
       OTIFFTAG_IMAGEDESCRIPTION           = 270,
       OTIFFTAG_MODEL                      = 272,
       OTIFFTAG_STRIPOFFSETS               = 273,
@@ -69,8 +70,10 @@ public:
       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,
@@ -120,6 +123,7 @@ public:
       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,
@@ -230,11 +234,11 @@ public:
     * 
     * @return std::ostream&
     */
-   virtual std::ostream& print(std::ifstream& inStr,
+   virtual std::ostream& print(std::istream& inStr,
                                std::ostream& outStr) const;
 
    /**
-    *  @brief extracts geometry info to keyword list.  This method assumes
+    *  @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
@@ -247,13 +251,14 @@ public:
     */
    bool getImageGeometry(ossimKeywordlist& geomKwl,
                          ossim_uint32 entryIndex) const;
+
    /**
-    *  @brief extracts geometry info from stream to keyword list.
+    *  @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 that the str should be position at start of tiff portion. This
+    *  @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.
     *
@@ -264,11 +269,61 @@ public:
     *
     *  @param entryIndex Entry to get geometry from. 
     */
-   bool getImageGeometry(std::ifstream& str,
+   bool getImageGeometry(std::istream& str,
                          ossimKeywordlist& geomKwl,
                          ossim_uint32 entryIndex) const;
 
-   /** @brief Prints geo keys. */
+   /**
+    * @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,
@@ -279,15 +334,31 @@ public:
                               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::ifstream& str) const;
+   void readShort(ossim_uint16& s, std::istream& str) const;
    
    /** Initializes l reference.  Does byte swapping as needed. */
-   void readLong(ossim_uint32& l, std::ifstream& str) const;
+   void readLong(ossim_uint32& l, std::istream& str) const;
    
    /** Initializes l reference.  Does byte swapping as needed. */
-   void readLongLong(ossim_uint64& l, std::ifstream& str) const;
+   void readLongLong(ossim_uint64& l, std::istream& str) const;
    
    /** Attempts to parse the pcs code (3072). */
    void parsePcsCode(int code);
@@ -307,7 +378,7 @@ private:
     *
     * @return true if stream is good, false if not.
     */
-   bool getOffset(std::streamoff& offset, std::ifstream& str,
+   bool getOffset(std::streamoff& offset, std::istream& str,
                   ossim_uint16 version) const;
    
    /**
@@ -316,7 +387,7 @@ private:
     *
     * @return true if stream is good, false if not.
     */
-   bool getValue(ossim_uint64& val, std::ifstream& str, WordType type,
+   bool getValue(ossim_uint64& val, std::istream& str, WordType type,
                  ossim_uint16 version) const;
    
    ossim_uint64 getArraySizeInBytes(ossim_uint64 length,
@@ -330,7 +401,7 @@ private:
    /**
     * Eats the value field.  Either 4 or 8 bytes depending on the version.
     */
-   void eatValue(std::ifstream& str, ossim_uint16 version) const;
+   void eatValue(std::istream& str, ossim_uint16 version) const;
    
    void swapBytes(ossim_uint8* v, ossim_uint16 type, ossim_uint64 count) const;
    
@@ -454,19 +525,36 @@ private:
                   std::vector<ossim_float64>& floats) const;
 
    /**
-    * @brief Gets the datum code matching gcs code from the keyword list as a
+    * @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 getGcsDatumCode(const ossimString& gtiffPrefix,
-                        const ossimKeywordlist& gtiffKwl,
-                        ossimString& datumCode) const;
+   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.
@@ -499,6 +587,17 @@ private:
                        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.
@@ -561,43 +660,106 @@ private:
    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;
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/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/ossimBatchTest.h b/include/ossim/util/ossimBatchTest.h
new file mode 100644
index 0000000..3dbefa8
--- /dev/null
+++ b/include/ossim/util/ossimBatchTest.h
@@ -0,0 +1,150 @@
+//----------------------------------------------------------------------------
+//
+// 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);
+
+   // Turns everything off.
+   void disableAllKwl(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_allIsDisabled;
+   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/ossimElevUtil.h b/include/ossim/util/ossimChipperUtil.h
similarity index 63%
rename from include/ossim/util/ossimElevUtil.h
rename to include/ossim/util/ossimChipperUtil.h
index 9e0cddf..c36e994 100644
--- a/include/ossim/util/ossimElevUtil.h
+++ b/include/ossim/util/ossimChipperUtil.h
@@ -1,5 +1,7 @@
 //----------------------------------------------------------------------------
 //
+// File: ossimChipperUtil.h
+// 
 // License:  LGPL
 // 
 // See LICENSE.txt file in the top level directory for more details.
@@ -8,17 +10,14 @@
 //
 // Description:
 // 
-// Utility class to orthorectify imagery with an added slant toward doing
-// digital elevation model(DEM) operations.
+// Utility class to for chipping out images. , orthorectifying imagery with an added slant
+// toward doing digital elevation model(DEM) operations.
 // 
 //----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimElevUtil_HEADER
-#define ossimElevUtil_HEADER 1
+// $Id: ossimChipperUtil.h 22257 2013-05-01 19:21:35Z dburken $
 
-#include <map>
-#include <vector>
+#ifndef ossimChipperUtil_HEADER
+#define ossimChipperUtil_HEADER 1
 
 #include <ossim/base/ossimConstants.h>
 #include <ossim/base/ossimReferenced.h>
@@ -27,6 +26,8 @@
 #include <ossim/imaging/ossimSingleImageChain.h>
 #include <ossim/projection/ossimMapProjection.h>
 
+#include <map>
+#include <vector>
 
 // Forward class declarations:
 class ossimArgumentParser;
@@ -34,11 +35,13 @@ class ossimDpt;
 class ossimFilename;
 class ossimGpt;
 class ossimImageFileWriter;
+class ossimImageGeometry;
+class ossimImageViewAffineTransform;
 class ossimIrect;
 class ossimKeywordlist;
 
 /**
- * @brief ossimElevUtil class.
+ * @brief ossimChipperUtil class.
  *
  * This is a utility class to orthorectify imagery with an added slant toward
  * doing digital elevation model(DEM) operations.
@@ -51,40 +54,36 @@ class ossimKeywordlist;
  * @note "bumpshade" and "hillshade" intermixed throughout.  The class to do
  * a hillshade is the ossimBumpShadeTileSource.
  */
-class OSSIM_DLL ossimElevUtil : public ossimReferenced
+class OSSIM_DLL ossimChipperUtil : public ossimReferenced
 {
 public:
 
    /** emumerated operations */
-   enum ossimDemOperation
+   enum ossimChipperOperation
    {
-      OSSIM_DEM_OP_UNKNOWN      = 0,
-      OSSIM_DEM_OP_HILL_SHADE   = 1,
-      OSSIM_DEM_OP_COLOR_RELIEF = 2,
-      OSSIM_DEM_OP_ORTHO        = 3
+      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
    };
 
    /** emumerated output projections */
-   enum ossimDemOutputProjection
+   enum ossimChipperOutputProjection
    {
-      OSSIM_DEM_PROJ_UNKNOWN    = 0,
-      OSSIM_DEM_PROJ_GEO        = 1,
-      OSSIM_DEM_PROJ_GEO_SCALED = 2,
-      OSSIM_DEM_PROJ_INPUT      = 3,
-      OSSIM_DEM_PROJ_UTM        = 4
+      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 */
-   ossimElevUtil();
+   ossimChipperUtil();
 
    /** virtual destructor */
-   virtual ~ossimElevUtil();
-
-   /**
-    * @brief Adds application arguments to the argument parser.
-    * @param ap Parser to add to.
-    */
-   void addArguments(ossimArgumentParser& ap);
+   virtual ~ossimChipperUtil();
 
    /**
     * @brief Initial method to be ran prior to execute.
@@ -114,13 +113,18 @@ public:
 
    /**
     * @brief Gets the output file name.
-    * @param f Filename to initialize.
-    * @return The output file name.
+    * @param f Initialized by this with the filename.
     */
    void getOutputFilename(ossimFilename& f) const;
 
 private:
 
+   /**
+    * @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();
    
@@ -166,6 +170,14 @@ private:
     * @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.
@@ -205,6 +217,18 @@ private:
    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.
     */
@@ -220,6 +244,15 @@ private:
    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.
     */
@@ -234,6 +267,20 @@ private:
    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.
     */
@@ -248,16 +295,22 @@ private:
    void getMetersPerPixel(ossimSingleImageChain* chain, ossimDpt& gsd);
 
    /**
-    * @brief Gets the origin for projection.
+    * @brief Gets value of key "central_meridan" if set, nan if not.
     *
-    * This is conditional.  If keywords origin_latitude or central_meridan are
-    * set from optional args those are used; else, the scene center is use.
+    * @return Value as a double or nan if keyord is not set.
     * 
-    * @param gpt Point to initialize.
+    * @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 error.
+    * @note Throws ossimException on range error.
     */
-   void getOrigin(ossimGpt& gpt);
+   ossim_float64 getOriginLatitude() const;
 
    /**
     * @brief Loops through all layers to get the scene center ground point.
@@ -303,6 +356,11 @@ private:
    /** @brief Combines dems(m_demLayer) and images(m_imgLayer). */
    ossimRefPtr<ossimImageSource> combineLayers();
 
+   /** @brief Combines two images into a two color multi view chain.
+    * @return ossimRefPtr with pointer to ossimImageSource.  Can be null.
+    */
+   ossimRefPtr<ossimImageSource> combine2CmvLayers();
+
    /**
     * @brief Creates ossimIndexToRgbLutFilter and connects to source.
     * @param Source to connect to.
@@ -315,18 +373,29 @@ private:
    /**
     * @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) const;
+      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;
+   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.
@@ -339,7 +408,7 @@ private:
     *
     * @note Throws ossimException on error.
     */
-   void getAreaOfInterest(const ossimImageSource* source, ossimIrect& rect) const;
+   void getAreaOfInterest( ossimImageSource* source, ossimIrect& rect ) const;
 
    /**
     * @brief Method to calculate and initialize scale and area of interest
@@ -356,6 +425,19 @@ private:
    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;
 
@@ -376,9 +458,6 @@ private:
    /** @return true if file extension is "src" */
    bool isSrcFile(const ossimFilename& file) const;
 
-   /** @return true if scale to eight bit option is set; false, if not. */
-   bool scaleToEightBit() const;
-
    /** @brief Initializes m_srcKwl if option was set. */
    void initializeSrcKwl();
 
@@ -395,10 +474,71 @@ private:
     * @return The enumerated output projection type.
     * @note This does not cover SRS keyword which could be any type of projection.
     */
-   ossimDemOutputProjection getOutputProjectionType() const;
+   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 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 True if any input has a sensor model input, false if all input
+    * projections are map projections.
+    */
+   bool hasSensorModelInput() const;
+
+   /**
+    * @brief Adds application arguments to the argument parser.
+    * @param ap Parser to add to.
+    */
+   void addArguments(ossimArgumentParser& ap);
+   
+   /** @brief Initializes arg parser and outputs usage. */
+   void usage(ossimArgumentParser& ap);
 
    /** Enumerated operation to perform. */
-   ossimDemOperation m_operation;
+   ossimChipperOperation m_operation;
    
    /** Hold all options passed into intialize except writer props. */
    ossimRefPtr<ossimKeywordlist> m_kwl;
@@ -406,8 +546,18 @@ private:
    /** Hold contents of src file if --src is used. */
    ossimRefPtr<ossimKeywordlist> m_srcKwl;
 
-   /** The output (view) projection. */
-   ossimRefPtr<ossimMapProjection> m_outputProjection;
+   /**
+    * 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;
@@ -416,4 +566,4 @@ private:
    std::vector< ossimRefPtr<ossimSingleImageChain> > m_imgLayer;
 };
 
-#endif /* #ifndef ossimElevUtil_HEADER */
+#endif /* #ifndef ossimChipperUtil_HEADER */
diff --git a/include/ossim/util/ossimFileWalker.h b/include/ossim/util/ossimFileWalker.h
new file mode 100644
index 0000000..4621a28
--- /dev/null
+++ b/include/ossim/util/ossimFileWalker.h
@@ -0,0 +1,227 @@
+//----------------------------------------------------------------------------
+//
+// 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/ossimCallback1.h>
+#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 ossimFileWalker
+ *
+ * Utility class to walk through directories and get a list of files to
+ * process. For each file found the callback is excecuted.  Mechanisms are in
+ * place to filter files and to call back  to a processFile method.  This
+ * requires a callback method to process files from the user.  The callback is
+ * set via registerProcessFileCallback method.  Internally the processFile
+ * calls are placed in a job queue.
+ *
+ * Typical usage (snip from ossimTiledElevationDatabase):
+ *
+ * ossimFileWalker* fw = new ossimFileWalker();
+ * fw->initializeDefaultFilterList();
+ * ossimCallback1<const ossimFilename&, bool&, bool>* cb =
+ * new ProcessFileCB(this, &ossimTiledElevationDatabase::processFile);
+ * fw->registerProcessFileCallback(cb);
+ * 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);
+
+   // void walk(const ossimFilename& root);
+
+   /**
+    * @brief Registers callback method to process a file.
+    *
+    * @param cb Callback to register.
+    *
+    * @see m_processFileCallBackPtr for documentation on template interface.
+    */   
+   void registerProcessFileCallback(ossimCallback1<const ossimFilename&>* cb);
+
+   /** @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 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 callback and file.
+       * @param cb Callback to method to process a file.
+       * @param file The file to process.
+       */
+      ossimFileWalkerJob(ossimCallback1<const ossimFilename&>* cb,
+                         const ossimFilename& file);
+      /**
+       * @brief Defines pure virtual ossimJob::start.
+       *
+       * This executes the call to m_processFileCallBackPtr.
+       */
+      virtual void start();
+      
+   private:
+      ossimCallback1<const ossimFilename&>* m_processFileCallBackPtr;
+      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 f is stagagble, 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.
+    */
+   ossimCallback1<const ossimFilename&>* m_processFileCallBackPtr;
+   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/ossimImageUtil.h b/include/ossim/util/ossimImageUtil.h
new file mode 100644
index 0000000..43b6be2
--- /dev/null
+++ b/include/ossim/util/ossimImageUtil.h
@@ -0,0 +1,399 @@
+//----------------------------------------------------------------------------
+// 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/ossimKeywordlist.h>
+#include <ossim/base/ossimPropertyInterface.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>
+
+class ossimArgumentParser;
+class ossimFileWalker;
+class ossimGpt;
+
+/**
+ * @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:
+
+   /** default constructor */
+   ossimImageUtil();
+
+   /** virtual destructor */
+   virtual ~ossimImageUtil();
+
+   /**
+    * @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.
+    *
+    * 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.
+    */
+   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 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 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 );
+
+private:
+
+   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 );
+
+   void createHistogram(ossimRefPtr<ossimImageHandler>& ih);
+
+   void createHistogram(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 );
+
+   
+   /** Holds all options passed into intialize except writer props. */
+   ossimRefPtr<ossimKeywordlist> m_kwl;
+
+   ossimFileWalker*   m_fileWalker;
+   OpenThreads::Mutex m_mutex;
+
+   ossim_int32 m_errorStatus;
+};
+
+#endif /* #ifndef ossimImageUtil_HEADER */
diff --git a/include/ossim/util/ossimInfo.h b/include/ossim/util/ossimInfo.h
index 2af1f8c..368b090 100644
--- a/include/ossim/util/ossimInfo.h
+++ b/include/ossim/util/ossimInfo.h
@@ -12,7 +12,7 @@
 // See class doxygen descriptions below for more.
 // 
 //----------------------------------------------------------------------------
-// $Id$
+// $Id: ossimInfo.h 22187 2013-03-07 20:29:00Z dburken $
 
 #ifndef ossimInfo_HEADER
 #define ossimInfo_HEADER 1
@@ -59,9 +59,8 @@ public:
     * all options and put in keyword list m_kwl.
     * 
     * @param ap Arg parser to initialize from.
+    *
     * @return true, indicating process should continue with execute.
-    * @note A throw with an error message of "usage" is used to get out when
-    * a usage is printed.
     */
    bool initialize(ossimArgumentParser& ap);
 
@@ -85,7 +84,36 @@ public:
    ossim_uint32 executeImageOptions(const ossimFilename& file);
 
    /**
-    * @brief Opens image.
+    * @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.
+    *
+    * This method opens and closes "file" under the hood so if an image is
+    * open and it's not the same as "file" it will be closed by this call.
+    * On exite the image will be closed.
+    *
+    * @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);
+   
+   /**
+    * @brief Opens image handler and stores in m_img data member.
     * @param Image to open.
     * @note Throws ossimException if image cannot be opened.
     */
@@ -104,6 +132,17 @@ public:
    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.
@@ -176,7 +215,58 @@ public:
     *
     * @return true if entry info was saved to keyword list false if not.
     */
-   bool getImageGeometryInfo(ossim_uint32 entry, ossimKeywordlist& kwl, bool dnoFlag);
+   bool getImageGeometryInfo( ossim_uint32 entry, 
+                              ossimKeywordlist& kwl, 
+                              bool dnoFlag );
+
+   void getCenterImage(ossimKeywordlist& kwl);
+   void getCenterImage(ossim_uint32 entry, ossimKeywordlist& kwl);
+   void getCenterGround(ossimKeywordlist& kwl);
+   void getCenterGround(ossim_uint32 entry, ossimKeywordlist& kwl);
+
+   /**
+    * @brief Populates keyword list with up_is_up_rotation.
+    *
+    * @param kwl Keyword list to populate.
+    *
+    * This requires open image.
+    */
+   void getUpIsUpAngle(ossimKeywordlist& kwl);
+
+   /**
+    * @brief Populates keyword list with up_is_up_rotation.
+    *
+    * @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 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.
@@ -294,18 +384,36 @@ public:
     */
    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;
 
@@ -320,7 +428,128 @@ public:
    void getRadiometry(ossimScalarType scalar, 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_rotation.
+    * @param kwl Keyword list to populate.
+    */
+   void getUpIsUpAngle( ossimImageHandler* ih,
+                        ossimKeywordlist& kwl ) const;
+
+   /**
+    * @brief Populates keyword list with up_is_up_rotation.
+    * @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 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;
+
+   /** @return true if current open image entry is an overview. */
+   bool isImageEntryOverview( const ossimImageHandler* ih ) 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);
 
diff --git a/include/ossim/vec/ossimVpfFeatureClassSchema.h b/include/ossim/vec/ossimVpfFeatureClassSchema.h
index 2ce9e1a..b91812a 100644
--- a/include/ossim/vec/ossimVpfFeatureClassSchema.h
+++ b/include/ossim/vec/ossimVpfFeatureClassSchema.h
@@ -5,7 +5,7 @@
 // Author: Garrett Potts (gpotts at imagelinks.com)
 //
 //********************************************************************
-// $Id: ossimVpfFeatureClassSchema.h 9967 2006-11-29 02:01:23Z gpotts $
+// $Id: ossimVpfFeatureClassSchema.h 20936 2012-05-18 14:45:00Z oscarkramer $
 #ifndef ossimVpfFeatureClassSchema_HEADER
 #define ossimVpfFeatureClassSchema_HEADER
 #include <iostream>
@@ -60,7 +60,7 @@ public:
 protected:
    ossimVpfCoverage* theCoverage;
    ossimFilename     theSchemaTableName;
-   std::map<ossimString, ossimVpfFeatureClassSchemaNode> theFeatureClassMap;
+   std::map<ossimString, ossimVpfFeatureClassSchemaNode, ossimStringLtstr> theFeatureClassMap;
    
    bool validateColumnNames()const;
    void setFeatureClassMapping();
diff --git a/include/ossim/video/ossimVideoGeometry.h b/include/ossim/video/ossimVideoGeometry.h
new file mode 100644
index 0000000..c3b20e0
--- /dev/null
+++ b/include/ossim/video/ossimVideoGeometry.h
@@ -0,0 +1,72 @@
+//*************************************************************************************************
+// OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+//  AUTHOR: Oscar Kramer
+//
+//*************************************************************************************************
+//  $Id: ossimVideoGeometry.h 2689 2011-06-08 16:15:26Z oscar.kramer $
+#ifndef ossimVideoGeometry_HEADER
+#define ossimVideoGeometry_HEADER
+
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/video/ossimVideoSource.h>
+
+class ossimPolygon;
+class ossimDrect;
+class ossimImageGeometry;
+class ossimVideoSource;
+
+//*************************************************************************************************
+//  CLASS DESCRIPTION: 
+//! Pure virtual base class for all video data. 
+//*************************************************************************************************
+class OSSIMDLLEXPORT ossimVideoGeometry : public ossimReferenced
+{
+public:
+   //! Provides platform position in lat, lon, hgt given frame time in seconds since start of 
+   //! sequence. Returns TRUE if point valid.
+   virtual bool sensorPosition(const double& t, ossimGpt& gpt) const = 0;
+
+   //! Provides platform attitude in degrees given frame time in seconds since start of sequence
+   //! sequence. Returns TRUE if parameters valid. The coordinate system is defined by the derived 
+   //! class (can represent for example Euler rotations about an ECF, ENU or roll, pitch, heading)
+   virtual bool sensorAttitude(const double& t, 
+                               double& X_deg, 
+                               double& Y_deg, 
+                               double& Z_deg) const = 0;
+
+   //! Provides focal length in meters given frame time in seconds since start of
+   //! sequence. Returns TRUE if parameters valid.
+   virtual bool sensorFocalLength(const double& t, double& focal_len_meters) const = 0;
+
+   //! Provides scene center position in lat, lon, hgt given frame time in seconds since start of 
+   //! sequence. Returns TRUE if point valid.
+   virtual bool frameCenter(const double& t, ossimGpt& centerGpt) const = 0;
+
+   //! Provides scene corner points in lat, lon given frame time in seconds since start of sequence.
+   //! Returns TRUE if polygon valid.
+   virtual bool frameBoundingPoly(const double& t, ossimPolygon& geo_poly) const = 0;
+
+   //! Provides the bounding rect that covers all frames in the full video.
+   //! Returns TRUE if rect valid.
+   virtual bool videoBoundingRect(ossimDrect& geo_rect) const = 0;
+
+   //! Access method returns number of pixels in a frame.
+   virtual const ossimIpt& frameSize() const = 0;
+
+   //! Provides an image geometry object for frame at specified time in seconds since start of 
+   //! sequence. Returns TRUE if point valid.
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry(const double& t) = 0;
+
+protected:
+   ossimVideoGeometry(ossimVideoSource* video) : m_video (video) {}
+   ossimVideoGeometry() {}
+
+   ossimRefPtr<ossimVideoSource> m_video;
+};
+#endif
diff --git a/include/ossim/video/ossimVideoHandler.h b/include/ossim/video/ossimVideoHandler.h
new file mode 100644
index 0000000..b7fb491
--- /dev/null
+++ b/include/ossim/video/ossimVideoHandler.h
@@ -0,0 +1,87 @@
+//**************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer, GeoEye Inc.
+//
+// DESCRIPTION: 
+// 
+//**************************************************************************************************
+//  $Id: ossimVideoHandler.h 2650 2011-05-27 16:53:41Z oscar.kramer $
+
+#ifndef ossimVideoHandler_HEADER
+#define ossimVideoHandler_HEADER
+
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/video/ossimVideoSource.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/video/ossimVideoGeometry.h>
+
+//*************************************************************************************************
+//! Pure virtual base class for all video file handlers -- analogous to ossimImageHandler. 
+//*************************************************************************************************
+class OSSIMDLLEXPORT ossimVideoHandler : public ossimVideoSource
+{
+public:
+   
+   //*************************************************************************************************
+   // The following are first declared here in ossimVideoHandler
+   //*************************************************************************************************
+   //! Returns TRUE if video file named is successfully opened.
+   virtual bool open(const ossimFilename& videoFile);
+   
+   //! Returns TRUE if video file at m_videoFilename is successfully opened.
+   virtual bool open() = 0;
+
+   //! Closes video file.
+   virtual void close() = 0;
+
+   //! Returns TRUE if video file is open.
+   virtual bool isOpen() const = 0;
+
+   //! Returns filename of previously opened video file.
+   const ossimFilename& filename() const { return m_videoFilename; }
+
+   //**********************************************************************************************
+   // The following are implementations of ossimVideoSource virtuals:
+   //**********************************************************************************************
+   //!  For rewinding all active streams to beginning.
+   virtual void rewind();
+
+   //! Seeks to the frame at time specified, according to the seekType (relative to active frame or
+   //! absolute time from start of video).
+   virtual bool seek(ossim_float64 reference_time_sec, SeekType seekType) = 0;
+
+   //! Access to video geometry object.
+   virtual const ossimRefPtr<ossimVideoGeometry> getVideoGeometry() const {return m_videoGeometry;}
+
+   //! Time in seconds from start of video of the current active frame, or NAN if no active frame.
+   ossim_float64 currentFrameTime() const { return m_currentFrameTime; }
+   
+   //! Nominal frames per second.
+   ossim_float64 videoFrameRate() const { return m_frameRate; };
+   
+   //! Total length of video in seconds.
+   ossim_float64 duration() const { return m_videoDuration; }
+
+   //**********************************************************************************************
+   // The following are implementations of ossimConnectableObject virtuals:
+   //**********************************************************************************************
+   //! This object does not accept inputs.
+   virtual bool canConnectMyInputTo(ossim_int32, const ossimConnectableObject*) const {return false;}
+
+protected:
+   //! Default constructor.
+   ossimVideoHandler();
+
+   ossimFilename                       m_videoFilename;
+   ossimRefPtr<ossimVideoGeometry>     m_videoGeometry;
+   ossim_float64                       m_currentFrameTime; //!< in seconds from start of video
+   mutable ossim_float64               m_videoDuration;    //!< in seconds
+   ossim_float64                       m_frameRate;        //!< in frames per second
+
+   TYPE_DATA
+};
+#endif
diff --git a/include/ossim/video/ossimVideoImageHandler.h b/include/ossim/video/ossimVideoImageHandler.h
new file mode 100644
index 0000000..5db5641
--- /dev/null
+++ b/include/ossim/video/ossimVideoImageHandler.h
@@ -0,0 +1,77 @@
+//*************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+//  AUTHOR: Oscar Kramer, GeoEye Analytics.
+//
+//*************************************************************************************************
+//  $Id$
+#ifndef ossimVideoImageHandler_HEADER
+#define ossimVideoImageHandler_HEADER
+
+#include <ossim/video/ossimVideoHandler.h>
+#include <ossim/video/ossimVideoGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimRefPtr.h>
+
+//*************************************************************************************************
+//  CLASS DESCRIPTION: 
+//! OSSIM Image handler for video frames.
+//
+//! Notes on video handling in OSSIM:
+//! - Currently, video is treated as a single file with multiple entries. Each entry corresponds
+//!   to a single video frame. The number of entries = the number of frames.
+//*************************************************************************************************
+class OSSIMDLLEXPORT ossimVideoImageHandler : public ossimImageHandler
+{
+public:
+   virtual bool open() = 0;
+   virtual bool isOpen() const = 0;
+   virtual void close();
+   
+   //! Common initialization code for all construction methods.
+   virtual void initialize() = 0;
+
+   // Returns list of all frames available in the video.
+   virtual void getEntryList(std::vector<ossim_uint32>& entryList) const;
+
+      //! Sets the currently active frame number as count from start of video
+   //! Returns false if frame count is outside of allowable range.
+   virtual bool setCurrentEntry(ossim_uint32 frame_number);
+
+   virtual ossim_uint32 getCurrentEntry() const;
+   virtual ossim_uint32 getNumberOfEntries() 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 getNumberOfSamples(); }
+   virtual ossim_uint32 getImageTileHeight() const { return getNumberOfLines(); }
+
+   //! Currently assuming all videos are RGB.
+   virtual ossim_uint32    getNumberOfInputBands()  const { return 3; } 
+   virtual ossim_uint32    getNumberOfOutputBands() const { return 3; } 
+   virtual ossimScalarType getOutputScalarType()    const { return OSSIM_UINT8; }
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect, ossim_uint32 resLevel=0) = 0;
+
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   //**********************************************************************************************
+   // New methods declared first in this class:
+   //**********************************************************************************************
+   ossimRefPtr<ossimVideoHandler>  getVideo()         const { return m_video;         }
+   ossimRefPtr<ossimVideoGeometry> getVideoGeometry() const { return m_videoGeometry; }
+
+protected:
+   ossimVideoImageHandler();
+
+   ossimRefPtr<ossimVideoHandler>   m_video;
+   ossimRefPtr<ossimVideoGeometry>  m_videoGeometry;
+   int                              m_currentFrameNumber;  //!< This is the currently active entry
+   ossimRefPtr<ossimImageData>      m_tile;
+
+   TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/video/ossimVideoImageSource.h b/include/ossim/video/ossimVideoImageSource.h
new file mode 100644
index 0000000..2a817a2
--- /dev/null
+++ b/include/ossim/video/ossimVideoImageSource.h
@@ -0,0 +1,78 @@
+//*************************************************************************************************
+// OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+//  AUTHOR: Oscar Kramer
+//
+//*************************************************************************************************
+//  $Id: ossimVideoImageSource.h 2695 2011-06-08 21:12:15Z oscar.kramer $
+#ifndef ossimVideoImageSource_HEADER
+#define ossimVideoImageSource_HEADER
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimImageSource.h>
+
+class ossimVideoSource;
+class ossimVideoGeometry;
+
+//*************************************************************************************************
+//  CLASS DESCRIPTION: 
+//! Contains class declaration for ossimVideoImageSource. This is the ossimImageSource-derived
+//! class representing a single frame in a video stream.
+//*************************************************************************************************
+class OSSIMDLLEXPORT ossimVideoImageSource : public ossimImageSource
+{
+public:
+   //! Sets the time stamp (in seconds from start of video) for the frame of interest. This will 
+   //! necessarily change the image geometry. 
+   //! Returns false if frame time is outside of allowable range.
+   virtual bool setFrameTime(const double& t);
+
+   //! Changes the frame to the new index (frame count from start of video). This will necessarily
+   //! change the image geometry. 
+   //! Returns false if frame count is outside of allowable range.
+   //virtual bool setFrameNumber(ossim_uint32 frame_number);
+
+   virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const;
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const;
+   virtual ossim_uint32 getImageTileWidth() const { return getNumberOfSamples(); }
+   virtual ossim_uint32 getImageTileHeight() const { return getNumberOfLines(); }
+
+   //! Currently assuming all videos are 8-bit RGB.
+   virtual ossim_uint32    getNumberOfInputBands()  const { return 3; } 
+   virtual ossim_uint32    getNumberOfOutputBands() const { return 3; } 
+   virtual ossimScalarType getOutputScalarType()    const { return OSSIM_UINT8; }
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect, ossim_uint32 resLevel=0)=0;
+
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   //! From ossimConnectableObject base class. Returns true if object is an ossimVideoSource.
+   virtual bool canConnectMyInputTo(ossim_int32 index, const ossimConnectableObject* object) const;
+
+   //! Video frames have no overviews, only full-res.
+   virtual ossim_uint32 getNumberOfDecimationLevels() const { return 1; }
+   virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt& result) const;
+   virtual void getDecimationFactors(std::vector<ossimDpt>& decimations) const;
+
+protected:
+   //! Constructor used when accessing a common video object (versus instantiating a new video for
+   //! each frame.
+   ossimVideoImageSource(ossimVideoSource* video, 
+                          const double& frame_time_seconds = 0);
+
+   ossimVideoImageSource();
+   virtual void initialize();
+
+   double                        m_frameTime;  //!< seconds from start of video
+   ossimIrect                    m_frameRect; //!< Always (0,0) based
+   ossimRefPtr<ossimImageData>   m_tile;
+
+   TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/video/ossimVideoSource.h b/include/ossim/video/ossimVideoSource.h
new file mode 100644
index 0000000..c68bfcd
--- /dev/null
+++ b/include/ossim/video/ossimVideoSource.h
@@ -0,0 +1,102 @@
+//**************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer, GeoEye Inc.
+//
+// DESCRIPTION: 
+// 
+//**************************************************************************************************
+//  $Id: ossimVideoSource.h 2695 2011-06-08 21:12:15Z oscar.kramer $
+
+#ifndef ossimVideoSource_HEADER
+#define ossimVideoSource_HEADER
+
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimSource.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIpt.h>
+
+class ossimVideoGeometry;
+class ossimVideoImageHandler;
+
+//*************************************************************************************************
+//! Pure virtual base class for all video sources -- analogous to ossimImageSource. 
+//*************************************************************************************************
+class OSSIMDLLEXPORT ossimVideoSource : public ossimSource
+{
+public:
+   
+   enum SeekType
+   {
+      SEEK_NONE     = 0,
+      SEEK_RELATIVE = 1,
+      SEEK_ABSOLUTE = 2
+   };
+
+   //**********************************************************************************************
+   // The following are first declared in ossimVideoSource (and derived types).
+   // Generally implemented as pass-through calls to this objects video source input.
+   //**********************************************************************************************
+   //!  For rewinding all active streams to beginning.
+   virtual void rewind();
+
+   //! Seeks to the frame at time specified, according to the seekType (relative to active frame or
+   //! absolute time from start of video). Returns TRUE if successful. 
+   virtual bool seek(ossim_float64 reference_time_sec, SeekType seekType);
+
+   //! Seeks to start of next frame. Returns TRUE if successful.
+   virtual bool nextFrame();
+
+   //! Total length of video in seconds.
+   virtual ossim_float64 duration() const;
+
+   //! Total number of frames in video.
+   virtual ossim_uint32 getNumberOfFrames() const;
+
+   //! Time in seconds from start of video of the current active frame, or NAN if no active frame.
+   virtual ossim_float64 currentFrameTime() const;
+   
+   //! Nominal frames per second.
+   virtual ossim_float64 videoFrameRate() const;
+   
+   //! Utility method for computing frame number from frame time.
+   //! @return  Returns frame number corresponding to the time (sec) from start of video or -1 if
+   //! time is outside valid window.
+   int computeFrameNumber(double seconds_from_start) const;
+
+   //! Utility method for computing frame time from frame number.
+   //! @return  Returns frame time (sec) from start of video corresponding to the frame count, 
+   //! or NaN if frame count is invalid.
+   double computeFrameTime(ossim_uint32 frame_count)  const;
+
+   //! Access to video geometry object.
+   virtual const ossimRefPtr<ossimVideoGeometry> getVideoGeometry() const;
+
+   //! Access to current active frame.
+   virtual const ossimRefPtr<ossimVideoImageHandler> getCurrentFrame() const;
+
+   //! Nominal size of a frame in pixels
+   const ossimIpt& frameSize() const { return m_frameSize; }
+
+   //**********************************************************************************************
+   // The following are implementations of ossimConnectableObject virtuals:
+   //**********************************************************************************************
+   //! Connections only to other video sources are allowed.
+   virtual bool canConnectMyInputTo(ossim_int32 index, const ossimConnectableObject* object) const;
+   
+   //! Presently can only connect into an image chain via an ossimVideoImageSource bridge, or
+   //! to another video source for video chains. Returns TRUE if connection possible.
+   virtual bool canConnectMyOutputTo(ossim_int32 index, const ossimConnectableObject* object) const;
+   
+protected:
+   //! Default constructor.
+   ossimVideoSource();
+
+   ossimIpt m_frameSize;        //!< in pixels
+
+   TYPE_DATA
+
+};
+#endif
diff --git a/include/ossim/vpfutil/vpfdisp.h b/include/ossim/vpfutil/vpfdisp.h
index 9b471a7..c97151c 100644
--- a/include/ossim/vpfutil/vpfdisp.h
+++ b/include/ossim/vpfutil/vpfdisp.h
@@ -18,7 +18,7 @@ void vpf_display_record( row_type row,
 
 
 void display_attributes( int fc,
-			 long int row,
+			 ossim_int32 row,
 			 library_type *library,
 			 FILE *fp );
 
diff --git a/include/ossim/vpfutil/vpfdraw.h b/include/ossim/vpfutil/vpfdraw.h
index 1e5ad3a..0eb688d 100644
--- a/include/ossim/vpfutil/vpfdraw.h
+++ b/include/ossim/vpfutil/vpfdraw.h
@@ -8,13 +8,13 @@ extern "C" {
 #endif
 
 int draw_edge_row( row_type row, vpf_table_type table );
-int draw_edge( long int rownum, vpf_table_type table );
+int draw_edge( ossim_int32 rownum, vpf_table_type table );
 
 int draw_point_row( row_type row, vpf_table_type table );
-int draw_point( long int rownum, vpf_table_type table );
+int draw_point( ossim_int32 rownum, vpf_table_type table );
 
 int draw_text_row( row_type row, vpf_table_type table );
-int draw_text( long int rownum, vpf_table_type table );
+int draw_text( ossim_int32 rownum, vpf_table_type table );
 
 void screen_bounds( double x1, double y1, double x2, double y2,
 		    int *xmin, int *ymin, int *xmax, int *ymax );
@@ -29,7 +29,7 @@ void draw_face_row( row_type row,
 		    color_type c2,
 		    color_type c3,
 		    color_type c4 );
-void draw_face( long int face_id,
+void draw_face( ossim_int32 face_id,
 		vpf_table_type facetable,
 		vpf_table_type ringtable,
 		vpf_table_type edgetable,
@@ -40,11 +40,11 @@ void draw_face( long int face_id,
 		color_type c3,
 		color_type c4 );
 
-long int next_polygon_edge( edge_rec_type *edge_rec,
-			    long int *prevnode,
-			    long int face_id );
+ossim_int32 next_polygon_edge( edge_rec_type *edge_rec,
+			    ossim_int32 *prevnode,
+			    ossim_int32 face_id );
 
-void outline_face( long int face_id,
+void outline_face( ossim_int32 face_id,
 		   vpf_table_type facetable,
 		   vpf_table_type ringtable,
 		   vpf_table_type edgetable,
@@ -52,7 +52,7 @@ void outline_face( long int face_id,
 		   int inner );
 
 
-void outline_face_table( long int face_id,
+void outline_face_table( ossim_int32 face_id,
 			 char *fname,
 			 int color,
 			 int inner );
diff --git a/include/ossim/vpfutil/vpfio.h b/include/ossim/vpfutil/vpfio.h
index 560169f..1d7ce35 100644
--- a/include/ossim/vpfutil/vpfio.h
+++ b/include/ossim/vpfutil/vpfio.h
@@ -17,7 +17,7 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
-
+#include <ossim/base/ossimConstants.h>
 /* These are all the metacharacters used to parse out input text files */
 
 #define	 	COMPONENT_SEPERATOR	';'
@@ -47,7 +47,7 @@ extern "C" {
 	     fread(tobuffer,sizeof(short int),count,fromtable)
 
 #define   Read_Vpf_Int(tobuffer,fromtable,count)\
-	     fread(tobuffer,sizeof(long int),count,fromtable)
+	     fread(tobuffer,sizeof(ossim_int32),count,fromtable)
 
 #define   Read_Vpf_Float(tobuffer,fromtable,count)\
 	     fread(tobuffer,sizeof(float),count,fromtable)
@@ -78,7 +78,7 @@ extern "C" {
 	     fwrite(tobuffer,sizeof(short int),count,fromfile)
 
 #define   Write_Vpf_Int(tobuffer,fromfile,count)\
-	     fwrite(tobuffer,sizeof(long int),count,fromfile)
+	     fwrite(tobuffer,sizeof(ossim_int32),count,fromfile)
 
 #define   Write_Vpf_Float(tobuffer,fromfile,count)\
 	     fwrite(tobuffer,sizeof(float),count,fromfile)
@@ -183,9 +183,9 @@ typedef enum {
 
 /*  subroutines */
 
-long int VpfRead ( void *to, VpfDataType type, long int count, FILE *from ) ;
+ossim_int32 VpfRead ( void *to, VpfDataType type, ossim_int32 count, FILE *from ) ;
 
-long int VpfWrite( void *from, VpfDataType type, long int count, FILE *to );
+ossim_int32 VpfWrite( void *from, VpfDataType type, ossim_int32 count, FILE *to );
 
 #ifdef __cplusplus
 }
diff --git a/include/ossim/vpfutil/vpfprim.h b/include/ossim/vpfutil/vpfprim.h
index 20424aa..04caaa4 100644
--- a/include/ossim/vpfutil/vpfprim.h
+++ b/include/ossim/vpfutil/vpfprim.h
@@ -13,56 +13,56 @@ extern "C" {
 
 /* VPF edge record internal structure */
 typedef struct {
-   long int id;
-   long int start;
-   long int end;
-   long int right;
-   long int left;
-   long int rightfwd;
-   long int leftfwd;
+   ossim_int32 id;
+   ossim_int32 start;
+   ossim_int32 end;
+   ossim_int32 right;
+   ossim_int32 left;
+   ossim_int32 rightfwd;
+   ossim_int32 leftfwd;
    char dir;
-   long int npts;
+   ossim_int32 npts;
    coordinate_type *coord;
    /* New as of 2/18/92 for coordinate arrays too large for memory */
    FILE *fp;
-   long int startpos, pos, current_coordinate;
+   ossim_int32 startpos, pos, current_coordinate;
    char coord_type;
 } edge_rec_type;
 
 
 /* "static" part of the edge record (non-variable) */
 typedef struct {
-   long int id;
-   long int start;
-   long int end;
-   long int right;
-   long int left;
-   long int rightfwd;
-   long int leftfwd;
+   ossim_int32 id;
+   ossim_int32 start;
+   ossim_int32 end;
+   ossim_int32 right;
+   ossim_int32 left;
+   ossim_int32 rightfwd;
+   ossim_int32 leftfwd;
    char dir;
-   long int npts;
+   ossim_int32 npts;
 } edge_static_type;
 
 
 /* VPF face record structure */
 typedef struct {
-   long int id;
-   long int ring;
+   ossim_int32 id;
+   ossim_int32 ring;
 } face_rec_type;
 
 
 /* VPF ring record structure */
 typedef struct {
-   long int id;
-   long int face;
-   long int edge;
+   ossim_int32 id;
+   ossim_int32 face;
+   ossim_int32 edge;
 } ring_rec_type;
 
 
 /* VPF entity node record internal structure */
 typedef struct {
-   long int id;
-   long int face;
+   ossim_int32 id;
+   ossim_int32 face;
    float x;
    float y;
 } point_rec_type;
@@ -82,7 +82,7 @@ typedef struct {
 
 edge_rec_type create_edge_rec( row_type row, vpf_table_type edge_table );
 
-edge_rec_type read_edge( long int id,
+edge_rec_type read_edge( ossim_int32 id,
 			 vpf_table_type edge_table );
 
 edge_rec_type read_next_edge( vpf_table_type edge_table );
@@ -90,26 +90,26 @@ edge_rec_type read_next_edge( vpf_table_type edge_table );
 /* New as of 2/18/92 for coordinate arrays too large for memory */
 coordinate_type first_edge_coordinate( edge_rec_type *edge_rec );
 coordinate_type next_edge_coordinate( edge_rec_type *edge_rec );
-coordinate_type get_edge_coordinate( long int n,
+coordinate_type get_edge_coordinate( ossim_int32 n,
 				     edge_rec_type *edge_rec );
 /***/
 
-face_rec_type read_face( long int id,
+face_rec_type read_face( ossim_int32 id,
 			 vpf_table_type face_table );
 
 face_rec_type read_next_face( vpf_table_type face_table );
 
-ring_rec_type read_ring( long int id,
+ring_rec_type read_ring( ossim_int32 id,
 			 vpf_table_type ring_table );
 
 ring_rec_type read_next_ring( vpf_table_type ring_table );
 
-point_rec_type read_point( long int id,
+point_rec_type read_point( ossim_int32 id,
 			   vpf_table_type point_table );
 
 point_rec_type read_next_point( vpf_table_type point_table );
 
-anno_rec_type read_anno( long int id,
+anno_rec_type read_anno( ossim_int32 id,
 			 vpf_table_type anno_table );
 
 anno_rec_type read_next_anno( vpf_table_type anno_table );
diff --git a/include/ossim/vpfutil/vpfrelat.h b/include/ossim/vpfutil/vpfrelat.h
index 6813205..86c136e 100644
--- a/include/ossim/vpfutil/vpfrelat.h
+++ b/include/ossim/vpfutil/vpfrelat.h
@@ -29,7 +29,7 @@ typedef struct {
 linked_list_type fcs_relate_list( char *fcname, char *start_table,
 				  char *end_table, vpf_table_type fcs );
 
-long int related_row( void *keyval1,
+ossim_int32 related_row( void *keyval1,
 		      vpf_table_type table2, char *key2,
 		      int sort_flag );
 
@@ -42,11 +42,11 @@ linked_list_type related_rows( void *keyval1,
 fcrel_type select_feature_class_relate( int fcnum, library_type *library,
 					char *start_table, char *end_table );
 
-long int fc_row_number( row_type row, fcrel_type fcrel, long int tile );
+ossim_int32 fc_row_number( row_type row, fcrel_type fcrel, ossim_int32 tile );
 
 linked_list_type fc_row_numbers( row_type row,
 				 fcrel_type fcrel,
-				 long int tile,
+				 ossim_int32 tile,
 				 ThematicIndex *idx );
 
 void deselect_feature_class_relate( fcrel_type *fcrel );
diff --git a/include/ossim/vpfutil/vpftable.h b/include/ossim/vpfutil/vpftable.h
index 9573fbe..e7fba11 100644
--- a/include/ossim/vpfutil/vpftable.h
+++ b/include/ossim/vpfutil/vpftable.h
@@ -51,7 +51,7 @@ typedef char date_type[21] ;	/* Include null end of string */
 typedef union {
    char 	  *Char ;
    short int	  Short ;
-   long int       Int ;
+   ossim_int32       Int ;
    float	  Float ;
    double	  Double ;
    date_type	  Date ;
@@ -66,7 +66,7 @@ typedef struct {
    char vdt[13];         /* Value description table name */
    char *tdx;	 	 /* Thematic index file name */
    char type;            /* Data type - T,I,F,K,D */
-   long int  count;      /* Number of items in this column (-1 =>variable)*/
+   ossim_int32  count;      /* Number of items in this column (-1 =>variable)*/
    null_field nullval ;  /* This is used for the converter */
    char *narrative;      /* Name of a narrative table describing the field*/
 } header_cell, *header_type;
@@ -85,7 +85,7 @@ typedef enum { Read, Write } file_mode ;
 /* Each column in a table row has a count and a pointer to the data */
 /*      and a null value default */
 typedef struct {
-   long int count;
+   ossim_int32 count;
    void *ptr;
 } column_type;
 
@@ -95,15 +95,15 @@ typedef column_type *row_type;
 /* Index for variable width tables.          */
 /* One index cell for each row in the table. */
 typedef struct {
-   unsigned long int pos;
-   unsigned long int length;
+   ossim_uint32 pos;
+   ossim_uint32 length;
 } index_cell, *index_type;
 
 /* VPF table structure: */
 typedef struct {
    char           name[13];        /* Name of the VPF table */
    char           *path;           /* Directory path to the table */
-   long int       nfields;         /* Number of fields */
+   ossim_int32       nfields;         /* Number of fields */
    char           description[81]; /* Table description */
    char           narrative[13];   /* Table narrative file name */
    header_type    header;          /* Table header structure */
@@ -111,10 +111,10 @@ typedef struct {
    index_type     index;           /* Index structure */
    storage_type   xstorage;        /* Flag indicating where index stored */
    FILE           *fp;             /* Table file pointer */
-   long int       nrows;           /* Number of rows in the table */
+   ossim_int32       nrows;           /* Number of rows in the table */
    row_type       *row;            /* Array of table rows */
-   long int       reclen;          /* Table record length (-1 => variable */
-   long int       ddlen;           /* Data definition string length */
+   ossim_int32       reclen;          /* Table record length (-1 => variable */
+   ossim_int32       ddlen;           /* Data definition string length */
    char           *defstr ;        /* rdf, definition string */
    storage_type   storage;         /* Flag indicating table storage method */
    file_mode	  mode ;	   /* Table is either reading or writing */
@@ -207,13 +207,13 @@ int is_vpf_null_double( double num );
 typedef union {
    unsigned char f1;
    unsigned short int f2;
-   unsigned long int f3;
+   ossim_uint32 f3;
 } key_field;
 
 /* id triplet internal storage type */
 typedef struct {
    unsigned char type;
-   long int id, tile, exid;
+   ossim_int32 id, tile, exid;
 } id_triplet_type;
 
 typedef enum { idle_state, name_state, type_state,
@@ -221,28 +221,28 @@ typedef enum { idle_state, name_state, type_state,
 
 /* Functions: */
 
-char *get_string(long int *ind,char *src,char delimit);
-char  get_char  (long int *ind,char *src);
-long int   get_number(long int *ind,char *src,char delemit);
+char *get_string(ossim_int32 *ind,char *src,char delimit);
+char  get_char  (ossim_int32 *ind,char *src);
+ossim_int32   get_number(ossim_int32 *ind,char *src,char delemit);
 
-long int   parse_data_def( vpf_table_type *table );
+ossim_int32   parse_data_def( vpf_table_type *table );
 
 char      *read_text_defstr( FILE *infile, FILE *outerr );
 
-long int  index_length( long int row_number,
+ossim_int32  index_length( ossim_int32 row_number,
 		        vpf_table_type table );
 
-long int  index_pos( long int row_number,
+ossim_int32  index_pos( ossim_int32 row_number,
 		     vpf_table_type table );
 #if 0
-long int row_offset( int field,
+ossim_int32 row_offset( int field,
 		     row_type row,
 		     vpf_table_type table);
 #endif
 
 row_type  read_next_row( vpf_table_type table );
 
-row_type  read_row( long int row_number,
+row_type  read_row( ossim_int32 row_number,
 		    vpf_table_type table );
 
 vpf_table_type vpf_open_table( const char *tablename,
@@ -250,50 +250,50 @@ vpf_table_type vpf_open_table( const char *tablename,
 			       const char *mode,
 			       char *defstr );   /* rdf added */
 
-row_type get_row( long int row_number,
+row_type get_row( ossim_int32 row_number,
 		  vpf_table_type table );
 
 void free_row( row_type row, vpf_table_type table );
 
-long int table_pos( const char *field_name,
+ossim_int32 table_pos( const char *field_name,
                     vpf_table_type table );
 
-void *get_table_element( long int field_number,
+void *get_table_element( ossim_int32 field_number,
 			 row_type row,
 			 vpf_table_type table,
 			 void *value,
-			 long int  *count );
+			 ossim_int32  *count );
 
 void *named_table_element( char *field_name,
-			   long int  row_number,
+			   ossim_int32  row_number,
 			   vpf_table_type table,
 			   void *value,
-			   long int  *count );
+			   ossim_int32  *count );
 
-void *table_element( long int field_number,
-		     long int  row_number,
+void *table_element( ossim_int32 field_number,
+		     ossim_int32  row_number,
 		     vpf_table_type table,
 		     void *value,
-		     long int  *count );
+		     ossim_int32  *count );
 
 void vpf_close_table( vpf_table_type *table );
 
 void vpf_dump_table( char *tablename, char *outname );
 
-long int is_vpf_table( const char *fname );
+ossim_int32 is_vpf_table( const char *fname );
 
 /* Write functions */
 
-long int write_next_row( row_type row, vpf_table_type *table );
+ossim_int32 write_next_row( row_type row, vpf_table_type *table );
 
 row_type create_row( vpf_table_type table );
 
-void nullify_table_element( long int field, row_type row,
+void nullify_table_element( ossim_int32 field, row_type row,
 			    vpf_table_type table );
 
-long int put_table_element( long int field, row_type row,
+ossim_int32 put_table_element( ossim_int32 field, row_type row,
 			    vpf_table_type table,
-			    void *value, long int count );
+			    void *value, ossim_int32 count );
 void vpf_dump_table( char *tablename, char *outname );
 void vpf_dump_doc_table( char *tablename, char *outname );
 
diff --git a/include/ossim/vpfutil/vpftidx.h b/include/ossim/vpfutil/vpftidx.h
index 223704b..de5659f 100644
--- a/include/ossim/vpfutil/vpftidx.h
+++ b/include/ossim/vpfutil/vpftidx.h
@@ -39,14 +39,15 @@ extern "C" {
 #endif
    
 #include <ossim/vpfutil/set.h>
-
+#include <ossim/base/ossimConstants.h>
+   
 typedef struct {			/* Total of 40 bytes */
-  long int	nbytes ,		/* 40 + directory length */
+  ossim_int32	nbytes ,		/* 40 + directory length */
                 nbins ,			/* Directory size */
                 table_nrows ;		/* Num rows in original table */
   char		index_type ,		/* T = thematic, G = gazetteer */
         	column_type ;		/* T, I, R, S, F, K */
-  long int      type_count ;		/* usually 1, but more for T */
+  ossim_int32      type_count ;		/* usually 1, but more for T */
   char 		id_data_type ,		/* I if > 32767, else S */
                 vpf_table_name[12] ,
                 vpf_column_name[25] ,	/* 16 bytes + 9 for TILE_ID */
@@ -55,7 +56,7 @@ typedef struct {			/* Total of 40 bytes */
 
 #define         THEMATIC_INDEX_HEADER_SIZE    60
 
-#define         DIRECTORY_SIZE                (sizeof(long int)*2)
+#define         DIRECTORY_SIZE                (sizeof(ossim_int32)*2)
 
 #define		MAX_ID		32767	/* Threshold between S and I ids */
 
@@ -63,12 +64,12 @@ typedef struct {			/* length = sizeof (datatype) + */
   union {				/* 	    8 * nbins           */
     char	cval ,
                 *strval ;
-    long int	ival ;
+    ossim_int32	ival ;
     short int	sval ;
     float	fval ;
     double 	dval ;
   } value ;
-  long int	start_offset ,
+  ossim_int32	start_offset ,
                 num_items ;		/* For each value, count the ids */
   /* Store the row ids here */
 /*  char    	*ids ;*/			/* depending on id_data_type, this */
@@ -100,40 +101,40 @@ set_type 	read_gazetteer_index (char * vpfname, char * query_str ) ;
 set_type 	search_gazetteer_index (ThematicIndex *idx,
 					char * query_str ) ;
 
-long int 	read_gazetteer_index_directory (
+ossim_int32 	read_gazetteer_index_directory (
 						ThematicIndexDirectory ** gid,
 						ThematicIndexHeader     * gi,
 						FILE * idx_fp);
 
 
 
-long int	write_thematic_index_header ( ThematicIndexHeader h ,
+ossim_int32	write_thematic_index_header ( ThematicIndexHeader h ,
 					      FILE *fp ) ;
 
-long int	read_thematic_index_header ( ThematicIndexHeader *h ,
+ossim_int32	read_thematic_index_header ( ThematicIndexHeader *h ,
 					     FILE *fp ) ;
 
-long int	write_thematic_index_directory ( 
+ossim_int32	write_thematic_index_directory ( 
 				       ThematicIndexHeader h ,
 				       ThematicIndexDirectory *d,
-				       long int size,
+				       ossim_int32 size,
 				       FILE *fp ) ;
 
-long int	write_gazetteer_index_directory ( 
+ossim_int32	write_gazetteer_index_directory ( 
 				       ThematicIndexHeader h ,
 				       ThematicIndexDirectory *d,
-				       long int size,
+				       ossim_int32 size,
 				       FILE *fp ) ;
 
 
 
-long int        create_thematic_index ( char indextype,
+ossim_int32        create_thematic_index ( char indextype,
 		 	                char *tablename,
                                         char *idxname ,
 				        char *columnname,
 				        char *idx_set );
 
-long int        create_gazetteer_index (char *tablename,
+ossim_int32        create_gazetteer_index (char *tablename,
 				        char *idx_fname ,
 				        char *columnname,
 				        char *idx_set);
diff --git a/jars/ant-contrib.jar b/jars/ant-contrib.jar
deleted file mode 100644
index c8a9467..0000000
Binary files a/jars/ant-contrib.jar and /dev/null differ
diff --git a/jars/cpptasks.jar b/jars/cpptasks.jar
deleted file mode 100644
index 3bce6b2..0000000
Binary files a/jars/cpptasks.jar and /dev/null differ
diff --git a/projects/vs/README.txt b/projects/vs/README.txt
deleted file mode 100644
index b869b84..0000000
--- a/projects/vs/README.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-------------------OSSIM VS2005 Solution--------------------
-Maintained By: David A. Horner - (http://dave.thehorners.com)
------------------------------------------------------------
-The solution and project files in this folder are generated with
-the updatesolution program.  The projects assume certain libraries
-exist one directory above the ossim tree.  If your build environment
-does not match this, you'll need to regenerate solution/projects with
-updatesolution.
-
-There is a README.txt in updatesolution with more details.
-
---Dave H.
\ No newline at end of file
diff --git a/projects/vs/apps/adrg_header_dump/adrg_header_dump.vcproj b/projects/vs/apps/adrg_header_dump/adrg_header_dump.vcproj
deleted file mode 100644
index 281f73c..0000000
--- a/projects/vs/apps/adrg_header_dump/adrg_header_dump.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-adrg-dump"
-	ProjectGUID="{E93030A2-DACF-4F95-A5B2-BABB39C28582}"
-	RootNamespace="adrg_header_dump"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-adrg-dump\ossim-adrg-dump.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/applanix2ogeom/applanix2ogeom.vcproj b/projects/vs/apps/applanix2ogeom/applanix2ogeom.vcproj
deleted file mode 100644
index 6226bd1..0000000
--- a/projects/vs/apps/applanix2ogeom/applanix2ogeom.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-applanix2ogeom"
-	ProjectGUID="{E8C6DC15-B9FC-4C35-BE01-6C9FBDFE298F}"
-	RootNamespace="applanix2ogeom"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-applanix2ogeom\ossim-applanix2ogeom.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/band_merge/band_merge.vcproj b/projects/vs/apps/band_merge/band_merge.vcproj
deleted file mode 100644
index ae2ef55..0000000
--- a/projects/vs/apps/band_merge/band_merge.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-band-merge"
-	ProjectGUID="{61D98F3F-655D-4895-8637-5ED6904A0933}"
-	RootNamespace="band_merge"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-band-merge\ossim-band-merge.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/bilsplitter/bilsplitter.vcproj b/projects/vs/apps/bilsplitter/bilsplitter.vcproj
deleted file mode 100644
index 188daa1..0000000
--- a/projects/vs/apps/bilsplitter/bilsplitter.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="bilsplitter"
-	ProjectGUID="{1EED8094-84D3-4C9E-A984-F17C710D8DEC}"
-	RootNamespace="bilsplitter"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\bilsplitter\bilsplitter.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/bmvstager/bmvstager.vcproj b/projects/vs/apps/bmvstager/bmvstager.vcproj
deleted file mode 100644
index 81caa2c..0000000
--- a/projects/vs/apps/bmvstager/bmvstager.vcproj
+++ /dev/null
@@ -1,204 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="bmvstager"
-	ProjectGUID="{137A7066-1690-4EE3-A978-F3058D714C99}"
-	RootNamespace="bmvstager"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\bmvstager\bmvstager.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\bmvstager\ossimArrayHolder.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\bmvstager\ossimBmvStager.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\bmvstager\ossimBmvStager.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\bmvstager\ossimBmvUtil.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\bmvstager\ossimBmvUtil.h"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/btoa/btoa.vcproj b/projects/vs/apps/btoa/btoa.vcproj
deleted file mode 100644
index 5cea020..0000000
--- a/projects/vs/apps/btoa/btoa.vcproj
+++ /dev/null
@@ -1,265 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-btoa"
-	ProjectGUID="{59B96356-CDCB-47C9-AA25-E7AEED6CCC38}"
-	RootNamespace="btoa"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(OSSIM_HOME)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="0"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				WholeProgramOptimization="false"
-				AdditionalIncludeDirectories=""$(nspire-tinyxml)";"$(VMQPM_HOME)\include";"$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include";"$(OSSIM_HOME)\..\aeOssim\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="ossimd.lib"
-				OutputFile="$(OutDir)\bin\Debug\$(ProjectName).exe"
-				LinkIncremental="0"
-				AdditionalLibraryDirectories=""$(OSSIM_HOME)\lib";"$(OSSIM_DEPENDENCIES)\lib";$(NOINHERIT)"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="0"
-				EnableCOMDATFolding="0"
-				LinkTimeCodeGeneration="0"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-btoa\ossim-btoa.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/chgkwval/chgkwval.vcproj b/projects/vs/apps/chgkwval/chgkwval.vcproj
deleted file mode 100644
index 97e4c34..0000000
--- a/projects/vs/apps/chgkwval/chgkwval.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-chgkwval"
-	ProjectGUID="{BD1A2D57-D3E2-4431-9108-8AEC23073228}"
-	RootNamespace="chgkwval"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-chgkwval\ossim-chgkwval.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/cibcadrg/cibcadrg.vcproj b/projects/vs/apps/cibcadrg/cibcadrg.vcproj
deleted file mode 100644
index f79bb2c..0000000
--- a/projects/vs/apps/cibcadrg/cibcadrg.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="cibcadrg"
-	ProjectGUID="{3C048E84-791F-4CAD-B827-8F8ED4FA3BB8}"
-	RootNamespace="cibcadrg"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\3rdParty\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\OpenThreads\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\3rdParty\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\OpenThreads\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\cibcadrg\cibcadrg.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/cibcadrg_ovr/cibcadrg_ovr.vcproj b/projects/vs/apps/cibcadrg_ovr/cibcadrg_ovr.vcproj
deleted file mode 100644
index ebb24b0..0000000
--- a/projects/vs/apps/cibcadrg_ovr/cibcadrg_ovr.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="cibcadrg_ovr"
-	ProjectGUID="{268835FF-07F2-4E1E-958B-148DE1FDBE2F}"
-	RootNamespace="cibcadrg_ovr"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\cibcadrg_ovr\cibcadrg_ovr.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/cibcadrg_split/cibcadrg_split.vcproj b/projects/vs/apps/cibcadrg_split/cibcadrg_split.vcproj
deleted file mode 100644
index a4efc06..0000000
--- a/projects/vs/apps/cibcadrg_split/cibcadrg_split.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="cibcadrg_split"
-	ProjectGUID="{FF505705-E1E0-4277-ACDC-BEA39D31630C}"
-	RootNamespace="cibcadrg_split"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\cibcadrg_split\cibcadrg_split.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/cmm/cmm.vcproj b/projects/vs/apps/cmm/cmm.vcproj
deleted file mode 100644
index 1e85a45..0000000
--- a/projects/vs/apps/cmm/cmm.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-cmm"
-	ProjectGUID="{E4EA0212-AF69-4F7B-AF2C-F9BF78A14D49}"
-	RootNamespace="cmm"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-cmm\ossim-cmm.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/computeSrtmStats/computeSrtmStats.vcproj b/projects/vs/apps/computeSrtmStats/computeSrtmStats.vcproj
deleted file mode 100644
index e3d7a19..0000000
--- a/projects/vs/apps/computeSrtmStats/computeSrtmStats.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-computeSrtmStats"
-	ProjectGUID="{DD898D1F-179B-4596-8CB9-807F8C378224}"
-	RootNamespace="computeSrtmStats"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-computeSrtmStats\ossim-computeSrtmStats.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/correl/correl.vcproj b/projects/vs/apps/correl/correl.vcproj
deleted file mode 100644
index dc84003..0000000
--- a/projects/vs/apps/correl/correl.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-correl"
-	ProjectGUID="{B2E12B9C-C11B-4CDD-8BEF-D49FC632A0FF}"
-	RootNamespace="correl"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-correl\ossim-correl.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/create_cg/create_cg.vcproj b/projects/vs/apps/create_cg/create_cg.vcproj
deleted file mode 100644
index d37d033..0000000
--- a/projects/vs/apps/create_cg/create_cg.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-create-cg"
-	ProjectGUID="{0426DFE2-C299-49F7-9EDF-93D3B48C2A91}"
-	RootNamespace="create_cg"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-create-cg\ossim-create-cg.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/create_histo/create_histo.vcproj b/projects/vs/apps/create_histo/create_histo.vcproj
deleted file mode 100644
index 1e4c9c1..0000000
--- a/projects/vs/apps/create_histo/create_histo.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-create-histo"
-	ProjectGUID="{6573A4DB-6D23-4908-9D18-FC32BCBD2C57}"
-	RootNamespace="create_histo"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-create-histo\ossim-create-histo.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/datums/datums.vcproj b/projects/vs/apps/datums/datums.vcproj
deleted file mode 100644
index a55f57b..0000000
--- a/projects/vs/apps/datums/datums.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="datums"
-	ProjectGUID="{70BD4688-1DAF-4D85-93F7-9EBC79E92C7D}"
-	RootNamespace="datums"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\datums\datums.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/deg2rad/deg2rad.vcproj b/projects/vs/apps/deg2rad/deg2rad.vcproj
deleted file mode 100644
index 02b4247..0000000
--- a/projects/vs/apps/deg2rad/deg2rad.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="deg2rad"
-	ProjectGUID="{41CDBC5A-93F3-4F93-B8CF-0DEF7837FAD6}"
-	RootNamespace="deg2rad"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\deg2rad\deg2rad.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/deminfo/deminfo.vcproj b/projects/vs/apps/deminfo/deminfo.vcproj
deleted file mode 100644
index 434bff2..0000000
--- a/projects/vs/apps/deminfo/deminfo.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-deminfo"
-	ProjectGUID="{1917B3E3-2D35-451B-9D18-AC00F3A72C95}"
-	RootNamespace="deminfo"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-deminfo\ossim-deminfo.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/dtedChecker/dtedChecker.vcproj b/projects/vs/apps/dtedChecker/dtedChecker.vcproj
deleted file mode 100644
index cb0b31a..0000000
--- a/projects/vs/apps/dtedChecker/dtedChecker.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="dtedChecker"
-	ProjectGUID="{2DF6ECD6-4C57-474A-B2D2-966744178AF1}"
-	RootNamespace="dtedChecker"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\dtedChecker\dtedChecker.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/dtedInfo/dtedInfo.vcproj b/projects/vs/apps/dtedInfo/dtedInfo.vcproj
deleted file mode 100644
index 018f8e2..0000000
--- a/projects/vs/apps/dtedInfo/dtedInfo.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="dtedInfo"
-	ProjectGUID="{D56A0042-0AD6-4454-B6F5-927B50784175}"
-	RootNamespace="dtedInfo"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\jpeg-6b";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\jpeg-6b";"$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\dtedInfo\dtedInfo.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/dtedList/dtedList.vcproj b/projects/vs/apps/dtedList/dtedList.vcproj
deleted file mode 100644
index 01c8b77..0000000
--- a/projects/vs/apps/dtedList/dtedList.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="dtedList"
-	ProjectGUID="{7F236FF3-3858-4758-B2EA-6DA3332F0F37}"
-	RootNamespace="dtedList"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\dtedList\dtedList.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/dumpnitf/dumpnitf.vcproj b/projects/vs/apps/dumpnitf/dumpnitf.vcproj
deleted file mode 100644
index 55692b7..0000000
--- a/projects/vs/apps/dumpnitf/dumpnitf.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="dumpnitf"
-	ProjectGUID="{1FD1A965-2A00-4D4D-B38D-9602F7C1DE57}"
-	RootNamespace="dumpnitf"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\jpeg-6b";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\jpeg-6b";"$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\dumpnitf\dumpnitf.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/dumpocg/dumpocg.vcproj b/projects/vs/apps/dumpocg/dumpocg.vcproj
deleted file mode 100644
index 6260ed3..0000000
--- a/projects/vs/apps/dumpocg/dumpocg.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-dump-ocg"
-	ProjectGUID="{CE06E825-AC3D-4490-A6B2-00C0F8CCB521}"
-	RootNamespace="dumpocg"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-dump-ocg\ossim-dump-ocg.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/ecg2ocg/ecg2ocg.vcproj b/projects/vs/apps/ecg2ocg/ecg2ocg.vcproj
deleted file mode 100644
index ef08a93..0000000
--- a/projects/vs/apps/ecg2ocg/ecg2ocg.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-ecg2ocg"
-	ProjectGUID="{866D643C-C1CE-44D8-8609-CD041B42DD7D}"
-	RootNamespace="ecg2ocg"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-ecg2ocg\ossim-ecg2ocg.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/extract_vertices/extract_vertices.vcproj b/projects/vs/apps/extract_vertices/extract_vertices.vcproj
deleted file mode 100644
index 403b192..0000000
--- a/projects/vs/apps/extract_vertices/extract_vertices.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-extract-vertices"
-	ProjectGUID="{0732B45E-0FD1-415D-A177-8D5E2763F812}"
-	RootNamespace="extract_vertices"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-extract-vertices\ossim-extract-vertices.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/factory_dump/factory_dump.vcproj b/projects/vs/apps/factory_dump/factory_dump.vcproj
deleted file mode 100644
index 67e7765..0000000
--- a/projects/vs/apps/factory_dump/factory_dump.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="factory_dump"
-	ProjectGUID="{3CA07FBD-AABE-487F-97FF-323CAE6104DD}"
-	RootNamespace="factory_dump"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\factory_dump\factory_dump.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/foo/foo.vcproj b/projects/vs/apps/foo/foo.vcproj
deleted file mode 100644
index aa8191f..0000000
--- a/projects/vs/apps/foo/foo.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-foo"
-	ProjectGUID="{77D870A2-2587-43E1-8F96-4BE0E9A775B0}"
-	RootNamespace="foo"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-foo\foo.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/ft2mtrs/ft2mtrs.vcproj b/projects/vs/apps/ft2mtrs/ft2mtrs.vcproj
deleted file mode 100644
index aff370c..0000000
--- a/projects/vs/apps/ft2mtrs/ft2mtrs.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ft2mtrs"
-	ProjectGUID="{05FB3A52-3899-43F0-9525-9D4ACD8E3A80}"
-	RootNamespace="ft2mtrs"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ft2mtrs\ft2mtrs.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/icp/icp.vcproj b/projects/vs/apps/icp/icp.vcproj
deleted file mode 100644
index 6e09941..0000000
--- a/projects/vs/apps/icp/icp.vcproj
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-icp"
-	ProjectGUID="{E22B63A1-8695-49DA-BE68-CA05A876CA63}"
-	RootNamespace="icp"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="ossim.lib"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(OSSIM_DEPENDENCIES)\jpeg-6b";"$(OSSIM_DEPENDENCIES)\lib";"$(OSSIM_HOME)\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-icp\ossim-icp.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/igen/igen.vcproj b/projects/vs/apps/igen/igen.vcproj
deleted file mode 100644
index 10cecbe..0000000
--- a/projects/vs/apps/igen/igen.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-igen"
-	ProjectGUID="{4E273D09-8A25-4BD1-AAD8-19814DC81623}"
-	RootNamespace="igen"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\jpeg-6b";"$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-igen\ossim-igen.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/image_info/image_info.vcproj b/projects/vs/apps/image_info/image_info.vcproj
deleted file mode 100644
index 42cabff..0000000
--- a/projects/vs/apps/image_info/image_info.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="image_info"
-	ProjectGUID="{EC37A1F7-6C99-4A36-A46E-7FC1E4D9C865}"
-	RootNamespace="image_info"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\jpeg-6b";"$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\image_info\image_info.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/imagebounds/imagebounds.vcproj b/projects/vs/apps/imagebounds/imagebounds.vcproj
deleted file mode 100644
index 27a5ca2..0000000
--- a/projects/vs/apps/imagebounds/imagebounds.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="imagebounds"
-	ProjectGUID="{4DCA887A-118D-48CD-BC70-53BE70501A01}"
-	RootNamespace="imagebounds"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\imagebounds\imagebounds.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/img2md/img2md.vcproj b/projects/vs/apps/img2md/img2md.vcproj
deleted file mode 100644
index 876af1e..0000000
--- a/projects/vs/apps/img2md/img2md.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-img2md"
-	ProjectGUID="{8AECEB95-7D53-4547-8D27-7D5F11658925}"
-	RootNamespace="img2md"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(InputDir)..\..\..\..\ossim_dependencies\jpeg-6b";"$(InputDir)..\..\..\..\ossim_dependencies\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-img2md\ossim-img2md.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/img2rr/img2rr.vcproj b/projects/vs/apps/img2rr/img2rr.vcproj
deleted file mode 100644
index 401673a..0000000
--- a/projects/vs/apps/img2rr/img2rr.vcproj
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-img2rr"
-	ProjectGUID="{7701109C-8ADB-4DFF-89E3-F17AF4364A71}"
-	RootNamespace="img2rr"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\3rdParty\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\OpenThreads\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="ossim.lib"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(OSSIM_DEPENDENCIES)\lib";"$(OSSIM_HOME)\lib";"$(OSSIM_DEPENDENCIES)\jpeg-6";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-img2rr\ossim-img2rr.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/modopt/modopt.vcproj b/projects/vs/apps/modopt/modopt.vcproj
deleted file mode 100644
index 55863e0..0000000
--- a/projects/vs/apps/modopt/modopt.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-modopt"
-	ProjectGUID="{85478E95-DE49-4A21-B10B-B8F3592B42BA}"
-	RootNamespace="modopt"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\jpeg-6b";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype";"$(InputDir)..\..\..\..\ossim_dependencies\src\OpenSceneGraph-2.8.1\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-modopt\ossim-modopt.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/mosaic/mosaic.vcproj b/projects/vs/apps/mosaic/mosaic.vcproj
deleted file mode 100644
index e1d0036..0000000
--- a/projects/vs/apps/mosaic/mosaic.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="mosaic"
-	ProjectGUID="{ED078EC0-0508-4205-9202-82D729DE0A9F}"
-	RootNamespace="mosaic"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\mosaic\mosaic.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/mtrs2ft/mtrs2ft.vcproj b/projects/vs/apps/mtrs2ft/mtrs2ft.vcproj
deleted file mode 100644
index f33d645..0000000
--- a/projects/vs/apps/mtrs2ft/mtrs2ft.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="mtrs2ft"
-	ProjectGUID="{E780740B-ED79-4B24-AAB1-25C820FA6850}"
-	RootNamespace="mtrs2ft"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\jpeg-6b";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\mtrs2ft\mtrs2ft.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/mtrsPerDeg/mtrsPerDeg.vcproj b/projects/vs/apps/mtrsPerDeg/mtrsPerDeg.vcproj
deleted file mode 100644
index 08a8963..0000000
--- a/projects/vs/apps/mtrsPerDeg/mtrsPerDeg.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="mtrsPerDeg"
-	ProjectGUID="{681AE3B5-41DC-496B-8B84-0408F6E515F3}"
-	RootNamespace="mtrsPerDeg"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\jpeg-6b";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\mtrsPerDeg\mtrsPerDeg.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/ogeom2ogeom/ogeom2ogeom.vcproj b/projects/vs/apps/ogeom2ogeom/ogeom2ogeom.vcproj
deleted file mode 100644
index 1f196d3..0000000
--- a/projects/vs/apps/ogeom2ogeom/ogeom2ogeom.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-ogeom2ogeom"
-	ProjectGUID="{0297CB73-BA00-49A5-BCD1-C9667C6AEDC6}"
-	RootNamespace="ogeom2ogeom"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\jpeg-6b";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype";"$(InputDir)..\..\..\..\ossim_dependencies\src\OpenSceneGraph-2.8.1\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-ogeom2ogeom\ossim-ogeom2ogeom.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/orthoigen/orthoigen.vcproj b/projects/vs/apps/orthoigen/orthoigen.vcproj
deleted file mode 100644
index 20aa182..0000000
--- a/projects/vs/apps/orthoigen/orthoigen.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-orthoigen"
-	ProjectGUID="{99824386-DE31-4657-B75F-65AF6441843D}"
-	RootNamespace="orthoigen"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\jpeg-6b";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype";"$(InputDir)..\..\..\..\ossim_dependencies\src\OpenSceneGraph-2.8.1\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-orthoigen\ossim-orthoigen.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/ossim-info/ossim-info.vcproj b/projects/vs/apps/ossim-info/ossim-info.vcproj
deleted file mode 100644
index 1e369e2..0000000
--- a/projects/vs/apps/ossim-info/ossim-info.vcproj
+++ /dev/null
@@ -1,264 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-info"
-	ProjectGUID="{651D7032-09F8-4516-B0A2-793E1CB5892E}"
-	RootNamespace="ccfinfo"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;NOMINMAX"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="ossim.lib"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(OSSIM_DEPENDENCIES)\lib";"$(OSSIM_HOME)\lib";$(NOINHERIT)"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(OSSIM_HOME)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="0"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				WholeProgramOptimization="false"
-				AdditionalIncludeDirectories=""$(OSSIM_HOME)\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;_CONSOLE;NOMINMAX"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="ossimd.lib"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(OSSIM_DEPENDENCIES)\lib";"$(OSSIM_HOME)\lib";$(NOINHERIT)"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="0"
-				EnableCOMDATFolding="0"
-				LinkTimeCodeGeneration="0"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-info\ossim-info.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/ossim_height/ossim_height.vcproj b/projects/vs/apps/ossim_height/ossim_height.vcproj
deleted file mode 100644
index 0b74745..0000000
--- a/projects/vs/apps/ossim_height/ossim_height.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-height"
-	ProjectGUID="{CEFCF534-79BD-49C1-AF0E-184A5D05D051}"
-	RootNamespace="ossim_height"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-height\ossim-height.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/ossim_shapeidx/ossim_shapeidx.vcproj b/projects/vs/apps/ossim_shapeidx/ossim_shapeidx.vcproj
deleted file mode 100644
index 9a33657..0000000
--- a/projects/vs/apps/ossim_shapeidx/ossim_shapeidx.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="ossim_shapeidx"
-	ProjectGUID="{639CC7A0-F37E-4F49-B7C9-3130538BDC71}"
-	RootNamespace="ossim_shapeidx"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\3rdParty\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\OpenSceneGraph-2.4.0\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\freetype-2.3.5\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim_shapeidx\ossim_shapeidx.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/pasta/pasta.vcproj b/projects/vs/apps/pasta/pasta.vcproj
deleted file mode 100644
index 0ab2cc8..0000000
--- a/projects/vs/apps/pasta/pasta.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="pasta"
-	ProjectGUID="{54CF365E-905F-4336-89AF-22F4B18A3333}"
-	RootNamespace="pasta"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\pasta\pasta.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/pathFinder/pathFinder.vcproj b/projects/vs/apps/pathFinder/pathFinder.vcproj
deleted file mode 100644
index 72308d3..0000000
--- a/projects/vs/apps/pathFinder/pathFinder.vcproj
+++ /dev/null
@@ -1,251 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="pathFinder"
-	ProjectGUID="{5F4DB45D-BB88-46CB-A3E2-7689D29ADE1A}"
-	RootNamespace="pathFinder"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\bui.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\bui.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\ctrlFrame.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\ctrlFrame.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\ctrlID.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\evtID.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\imgApp.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\imgApp.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\imgCanvas.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\imgCanvas.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\imgFrame.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\imgFrame.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\pf.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\pf.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\sm.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\sm.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\String.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\pathFinder\String.h"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/pixelflip/pixelflip.vcproj b/projects/vs/apps/pixelflip/pixelflip.vcproj
deleted file mode 100644
index d99a950..0000000
--- a/projects/vs/apps/pixelflip/pixelflip.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-pixelflip"
-	ProjectGUID="{A6A84A69-E8A4-4A7B-85FC-CD429FD0C116}"
-	RootNamespace="pixelflip"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-pixelflip\ossim-pixelflip.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/prune/prune.vcproj b/projects/vs/apps/prune/prune.vcproj
deleted file mode 100644
index 630d6cf..0000000
--- a/projects/vs/apps/prune/prune.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-prune"
-	ProjectGUID="{A3F96295-A2AD-4D4C-9116-2F4EA7E07E59}"
-	RootNamespace="prune"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-prune\ossim-prune.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/rad2deg/rad2deg.vcproj b/projects/vs/apps/rad2deg/rad2deg.vcproj
deleted file mode 100644
index ed9ff39..0000000
--- a/projects/vs/apps/rad2deg/rad2deg.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="rad2deg"
-	ProjectGUID="{31FE01E0-52D2-4760-8E82-6EE6DCE0764D}"
-	RootNamespace="rad2deg"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\rad2deg\rad2deg.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/rejout/rejout.vcproj b/projects/vs/apps/rejout/rejout.vcproj
deleted file mode 100644
index b5b9d2f..0000000
--- a/projects/vs/apps/rejout/rejout.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-rejout"
-	ProjectGUID="{AEADE3C4-7FD5-452D-BBE3-5F55B9F6F906}"
-	RootNamespace="rejout"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-rejout\ossim-rejout.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/roadFind/roadFind.vcproj b/projects/vs/apps/roadFind/roadFind.vcproj
deleted file mode 100644
index ec94138..0000000
--- a/projects/vs/apps/roadFind/roadFind.vcproj
+++ /dev/null
@@ -1,235 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="roadFind"
-	ProjectGUID="{85C3C9C2-AD19-4E74-9BF7-F3C851C043A8}"
-	RootNamespace="roadFind"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\roadFind\ossimRoadFindController.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\roadFind\ossimRoadFindController.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\roadFind\RoadFindApp.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\roadFind\RoadFindApp.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\roadFind\RoadFindFrame.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\roadFind\RoadFindFrame.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\roadFind\RoadFindProcess.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\roadFind\RoadFindProcess.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\roadFind\ScrolledImageSourceWindow.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\roadFind\ScrolledImageSourceWindow.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\roadFind\sm.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\roadFind\sm.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\roadFind\StatusBarHandler.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\src\apps\roadFind\StatusBarHandler.h"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/rpc2ogeom/rpc2ogeom.vcproj b/projects/vs/apps/rpc2ogeom/rpc2ogeom.vcproj
deleted file mode 100644
index 9f5879c..0000000
--- a/projects/vs/apps/rpc2ogeom/rpc2ogeom.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="rpc2ogeom"
-	ProjectGUID="{F065DEC2-9A11-4945-A63A-D4940781DE48}"
-	RootNamespace="rpc2ogeom"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\rpc2ogeom\rpc2ogeom.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/senint/senint.vcproj b/projects/vs/apps/senint/senint.vcproj
deleted file mode 100644
index c86febb..0000000
--- a/projects/vs/apps/senint/senint.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-senint"
-	ProjectGUID="{3736AD79-6962-4088-B320-06CA7CF62969}"
-	RootNamespace="senint"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-senint\ossim-senint.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/shpbuilder/shpbuilder.vcproj b/projects/vs/apps/shpbuilder/shpbuilder.vcproj
deleted file mode 100644
index 2b2b2dc..0000000
--- a/projects/vs/apps/shpbuilder/shpbuilder.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="shpbuilder"
-	ProjectGUID="{706F5371-E47E-4799-90C7-8ABD165D4806}"
-	RootNamespace="shpbuilder"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\3rdParty\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\OpenSceneGraph-2.4.0\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\freetype-2.3.5\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\shpbuilder\shpbuilder.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/shpcutter/shpcutter.vcproj b/projects/vs/apps/shpcutter/shpcutter.vcproj
deleted file mode 100644
index 2e8d5f5..0000000
--- a/projects/vs/apps/shpcutter/shpcutter.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="shpcutter"
-	ProjectGUID="{3788A401-3D26-460A-9F68-FBF54EAD60E3}"
-	RootNamespace="shpcutter"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\3rdParty\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\OpenSceneGraph-2.4.0\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\freetype-2.3.5\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\shpcutter\shpcutter.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/shpdump/shpdump.vcproj b/projects/vs/apps/shpdump/shpdump.vcproj
deleted file mode 100644
index 3ec26c6..0000000
--- a/projects/vs/apps/shpdump/shpdump.vcproj
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="shpdump"
-	ProjectGUID="{67F9312B-1998-4ABC-8267-496D762E4E76}"
-	RootNamespace="shpdump"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\3rdParty\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\OpenSceneGraph-2.4.0\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\freetype-2.3.5\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\shpdump\shpdump.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/space_imaging/space_imaging.vcproj b/projects/vs/apps/space_imaging/space_imaging.vcproj
deleted file mode 100644
index f8a11f0..0000000
--- a/projects/vs/apps/space_imaging/space_imaging.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-space-imaging"
-	ProjectGUID="{F2D3BF85-3518-4353-A86C-F79216D6547B}"
-	RootNamespace="space_imaging"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-space-imaging\ossim-space-imaging.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/swapbytes/swapbytes.vcproj b/projects/vs/apps/swapbytes/swapbytes.vcproj
deleted file mode 100644
index e3a45b9..0000000
--- a/projects/vs/apps/swapbytes/swapbytes.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-swapbytes"
-	ProjectGUID="{CEBD0DDB-593F-489A-9356-47044E4A2F25}"
-	RootNamespace="swapbytes"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-swapbytes\ossim-swapbytes.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/tfw2ogeom/tfw2ogeom.vcproj b/projects/vs/apps/tfw2ogeom/tfw2ogeom.vcproj
deleted file mode 100644
index c3a7474..0000000
--- a/projects/vs/apps/tfw2ogeom/tfw2ogeom.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim-tfw2ogeom"
-	ProjectGUID="{32DB2003-4C34-4362-9740-3F4361E85F99}"
-	RootNamespace="tfw2ogeom"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\ossim-tfw2ogeom\ossim-tfw2ogeom.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/toc_dump/toc_dump.vcproj b/projects/vs/apps/toc_dump/toc_dump.vcproj
deleted file mode 100644
index ba94274..0000000
--- a/projects/vs/apps/toc_dump/toc_dump.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="toc_dump"
-	ProjectGUID="{5DB17D9D-8E9D-40B3-AF3A-89BB6514A221}"
-	RootNamespace="toc_dump"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\src\OpenSceneGraph-2.6.1\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\bin\$(ProjectName).exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\toc_dump\toc_dump.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/toc_render/toc_render.vcproj b/projects/vs/apps/toc_render/toc_render.vcproj
deleted file mode 100644
index 826070d..0000000
--- a/projects/vs/apps/toc_render/toc_render.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="toc_render"
-	ProjectGUID="{E0423656-7382-4555-B263-62F7BCED344B}"
-	RootNamespace="toc_render"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\toc_render\toc_render.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/utm2geo/utm2geo.vcproj b/projects/vs/apps/utm2geo/utm2geo.vcproj
deleted file mode 100644
index 147754f..0000000
--- a/projects/vs/apps/utm2geo/utm2geo.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="utm2geo"
-	ProjectGUID="{CFD3CCCE-8304-49E4-A2F0-EB5FB568D58A}"
-	RootNamespace="utm2geo"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\utm2geo\utm2geo.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/vec2ras/vec2ras.vcproj b/projects/vs/apps/vec2ras/vec2ras.vcproj
deleted file mode 100644
index e7707cd..0000000
--- a/projects/vs/apps/vec2ras/vec2ras.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="vec2ras"
-	ProjectGUID="{E1AB3F4B-A449-4AFB-AF29-059F822658FC}"
-	RootNamespace="vec2ras"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\vec2ras\vec2ras.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/apps/vector2kwl/vector2kwl.vcproj b/projects/vs/apps/vector2kwl/vector2kwl.vcproj
deleted file mode 100644
index 11ad86a..0000000
--- a/projects/vs/apps/vector2kwl/vector2kwl.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="vector2kwl"
-	ProjectGUID="{591A4CD7-0500-46AB-BFCA-041F58964FC0}"
-	RootNamespace="vector2kwl"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\src\apps\vector2kwl\vector2kwl.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/ossim/ossim.vcproj b/projects/vs/ossim/ossim.vcproj
deleted file mode 100644
index 1771f89..0000000
--- a/projects/vs/ossim/ossim.vcproj
+++ /dev/null
@@ -1,6399 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossim"
-	ProjectGUID="{3C21B2D0-9488-42F1-9F1E-C59B2054CEB4}"
-	RootNamespace="ossim"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;OSSIMMAKINGDLL;_FILE_OFFSET_BITS=64;_LARGE_FILES;HAVE_CONFIG_H;SHAPELIB_DLLEXPORT"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="libjpeg.lib geotiff.lib libtiff.lib freetype239.lib OpenThreads.lib zlib1.lib"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(OSSIM_DEPENDENCIES)\lib";$(NOINHERIT)"
-				IgnoreDefaultLibraryNames="LIBCMT;msvcrt"
-				GenerateDebugInformation="true"
-				SubSystem="0"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine="if not exist "$(ProjectDir)..\..\..\include\ossim\ossimConfig.h" copy "$(ProjectDir)..\..\..\include\ossim\ossimConfig.h.vc"  "$(ProjectDir)..\..\..\include\ossim\ossimConfig.h"&#x0D;&#x0A;cd $(ProjectDir)&#x0D;&#x0A;cd ..&#x0D;&#x0A;cd ..&#x0D;&#x0A;cd ..&#x0D;&#x0A;cd src&#x0D;&#x0A;cd ossim&#x0D;&#x0A;echo Compiling version-config.cpp&#x0D;&#x0A;&#x0D;&#x0A;cl /I"..\..\include"  version-config.cpp&#x0D;&#x0A;&#x0D;&#x0A;echo Gen [...]
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				WholeProgramOptimization="false"
-				AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;OSSIMMAKINGDLL;_FILE_OFFSET_BITS=64;_LARGE_FILES;HAVE_CONFIG_H"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-				OmitDefaultLibName="false"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="libjpeg.lib geotiff.lib libtiff.lib freetype239.lib OpenThreads.lib zlib1.lib"
-				OutputFile="$(OutDir)\bin\$(ProjectName).dll"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(OSSIM_DEPENDENCIES)\lib";$(NOINHERIT)"
-				IgnoreDefaultLibraryNames="libcmt"
-				GenerateDebugInformation="false"
-				SubSystem="0"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				LinkTimeCodeGeneration="0"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				ImportLibrary="..\..\..\lib\$(ProjectName).lib"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				CommandLine=""
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(ProjectDir)..\..\..\"
-			IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine="if not exist "$(ProjectDir)..\..\..\include\ossim\ossimConfig.h" copy "$(ProjectDir)..\..\..\include\ossim\ossimConfig.h.vc"  "$(ProjectDir)..\..\..\include\ossim\ossimConfig.h"&#x0D;&#x0A;cd $(ProjectDir)&#x0D;&#x0A;cd ..&#x0D;&#x0A;cd ..&#x0D;&#x0A;cd ..&#x0D;&#x0A;cd src&#x0D;&#x0A;cd ossim&#x0D;&#x0A;echo Compiling version-config.cpp&#x0D;&#x0A;&#x0D;&#x0A;cl /I"..\..\include"  version-config.cpp&#x0D;&#x0A;&#x0D;&#x0A;echo Gen [...]
-				ExcludedFromBuild="true"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				WholeProgramOptimization="false"
-				AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\include";"$(OSSIM_DEPENDENCIES)\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;_USRDLL;OSSIMMAKINGDLL;_FILE_OFFSET_BITS=64;_LARGE_FILES;HAVE_CONFIG_H"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="libjpeg.lib geotiff.lib libtiff.lib freetype239.lib OpenThreads.lib zlib1.lib"
-				OutputFile="..\..\..\bin\$(ProjectName)d.dll"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(OSSIM_DEPENDENCIES)\lib";$(NOINHERIT)"
-				IgnoreDefaultLibraryNames="LIBCMT;msvcrt"
-				GenerateDebugInformation="true"
-				SubSystem="0"
-				LinkTimeCodeGeneration="0"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				ImportLibrary="..\..\..\lib\$(ProjectName)d.lib"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				CommandLine=""
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Header Files"
-			>
-			<File
-				RelativePath="..\..\..\include\ossim\kbool\_dl_itr.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\kbool\_dl_itr.inc"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\kbool\_lnk_itr.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\kbool\_lnk_itr.inc"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\kbool\bool_globals.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\kbool\booleng.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\matrix\controlw.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\datum.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\gdfontg.inc"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\gdfontl.inc"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\gdfontmb.inc"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\gdfonts.inc"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\gdfontt.inc"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\kbool\graph.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\kbool\graphlst.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\matrix\include.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\kbool\line.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\kbool\link.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\linklist.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\kbool\lpoint.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\machine.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\mapgraph.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\matrix\myexcept.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\matrix\newmat.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\matrix\newmatap.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\matrix\newmatio.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\matrix\newmatnl.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\matrix\newmatrc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\matrix\newmatrm.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\kbool\node.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossim2dBilinearTransform.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossim2dLinearRegression.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossim2dTo2dIdentityTransform.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossim2dTo2dShiftTransform.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossim2dTo2dTransform.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossim2dTo2dTransformFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossim2dTo2dTransformFactoryBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossim2dTo2dTransformRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossim3x3ConvolutionFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimActiveEdgeTable.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimAdjMapModel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimAdjustableParameterInfo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimAdjustableParameterInterface.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimAdjustmentInfo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAdrgHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAdrgTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimAffineProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimAffineTransform.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimAigBounds.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimAigDataFileHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimAigHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimAigIndexFileHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimAigStatistics.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimAlbersProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAnnotationEllipseObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAnnotationFontObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAnnotationGdBitmapFont.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAnnotationLineObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAnnotationMapGridSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAnnotationMultiEllipseObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAnnotationMultiLineObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAnnotationMultiPolyLineObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAnnotationMultiPolyObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAnnotationObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAnnotationObjectFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAnnotationPolyObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAnnotationSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAOD.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAppFixedTileCache.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimApplanixEcefModel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimApplanixEOFile.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimApplanixUtmModel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimApplicationUsage.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAppTileCache.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimArcInfoGridWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimArgumentParser.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAtbController.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAtbMatchPoint.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAtbPointSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAtCorrGridRemapper.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAtCorrKeywords.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimAtCorrRemapper.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimAuxFileHandler.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimAxes.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimAzimEquDistProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimBandAverageFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimBandClipFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimBandMergeSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimBandSelector.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimBaseObjectFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimBilinearProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimBilSplitter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimBlendMosaic.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimBngProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimBonneProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimBooleanProperty.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimBrightnessContrastSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimBrightnessMatch.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimBuckeyeSensor.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimBumpShadeTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimCacheTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimCadrgProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimCassiniProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimCastTileSourceFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimCcfHead.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimCcfInfo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimCcfTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimCibCadrgTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimClosestToCenterCombiner.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimCmyVector.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimCoarseGridModel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimColorNormalizedFusion.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimColorProperty.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimColumnVector3d.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimColumnVector4d.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimCommon.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\ossimConfig.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimConnectableContainer.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimConnectableContainerInterface.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimConnectableDisplayListener.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimConnectableObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimConnectableObjectListener.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimConnectionEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimConstants.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimContainerEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimContainerProperty.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimConvolutionFilter1D.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimConvolutionSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimCplUtil.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimCsvFile.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimCustomEditorWindow.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimCustomEditorWindowFactoryBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimCustomEditorWindowRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimCylEquAreaProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDataObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDate.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDateProperty.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDatum.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDatumFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDatumFactoryInterface.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDatumFactoryRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDblGrid.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimDemGrid.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimDemHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimDemInfo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimDemPoint.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimDemProfile.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimDemStats.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimDemUtil.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDirectory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDirectoryData.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDirectoryTree.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimDiscrete3x3HatFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimDiscreteConvolutionKernel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimDiscreteNearestNeighbor.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDisplayEventListener.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDisplayInterface.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDisplayListEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDisplayRefreshEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDms.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimDoqq.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimDoqqTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDoubleGridProperty.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDpt.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDpt3d.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDrect.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimDtedAcc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimDtedDsi.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimDtedElevationDatabase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimDtedElevationImageSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimDtedFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimDtedHandler.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimDtedHdr.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimDtedInfo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimDtedRecord.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimDtedTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimDtedUhl.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimDtedVol.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimDuration.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\plugin\ossimDynamicLibrary.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimEastingNorthingCutter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimEbcdicToAscii.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimEcefPoint.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimEcefRay.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimEcefVector.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimEckert4Projection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimEckert6Projection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimEdgeFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimElevationDatabase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimElevationDatabaseFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimElevationDatabaseFactoryBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimElevationDatabaseRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimElevationManagerEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimElevationManagerEventListener.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimElevCellHandler.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimElevCellHandlerFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimElevImageSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimElevLess.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimElevManager.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimElevSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimElevSourceFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimEllipsoid.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimEllipsoidFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimEndian.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimEnviHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimEnviHeaderFileWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimEnvironmentUtility.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimEquationCombiner.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimEquDistCylProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimEquTokenDefines.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimEquTokenizer.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimErrorCodes.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimErrorContext.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimErrorStatusInterface.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimERS.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimERSFileWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimERSTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimEventIds.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimException.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimFactoryBaseTemplate.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimFactoryListInterface.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimFcsiModel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimFeatherMosaic.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimFfL5.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimFfL7.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimFfRevb.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimFfRevc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimFftFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimFgdcFileWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimFilename.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimFilenameProperty.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimFilterResampler.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimFilterTable.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimFixedTileCache.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimFlexLexer.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\font\ossimFont.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\font\ossimFontFactoryBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\font\ossimFontFactoryRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimFontInformation.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimFontProperty.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimFpt.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimFpt3d.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\font\ossimFreeTypeFont.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\font\ossimFreeTypeFontFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimFusionCombiner.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGammaRemapper.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimGcsCodeProjectionFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\font\ossimGdBitmapFont.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGdFont.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGdFontExterns.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\font\ossimGdSansBold.inc"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimGeneralRasterElevationDatabase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimGeneralRasterElevFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimGeneralRasterElevHandler.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeneralRasterInfo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeneralRasterTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeneralRasterWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeoAnnotationBitmap.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeoAnnotationEllipseObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeoAnnotationFontObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeoAnnotationGdBitmapFont.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeoAnnotationLineObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeoAnnotationMultiEllipseObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeoAnnotationMultiPolyLineObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeoAnnotationMultiPolyObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeoAnnotationObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeoAnnotationPolyLineObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeoAnnotationPolyObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeoAnnotationSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimGeocent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeographicAnnotationGrid.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimGeoid.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimGeoidEgm96.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimGeoidManager.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimGeoidNgs.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimGeoidNgsHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeomFileWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGeoPolyCutter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimGeoPolygon.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimGeoref.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimGeoTiff.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimGeoTiffCoordTransformsLut.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimGeoTiffDatumLut.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimGnomonicProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimGpt.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimGrect.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGridRemapEngine.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGridRemapEngineFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimGridRemapSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimGzStream.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimHexString.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimHgtRef.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimHistogram.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimHistogramEqualization.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimHistogramMatchFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimHistogramRemapper.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimHistogramSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimHistogramThreshholdFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimHistogramWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimHistoMatchRemapper.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimHsiRemapper.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimHsiToRgbSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimHsiVector.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimHsvGridRemapEngine.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimHsvToRgbSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimHsvVector.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimId.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimIdManager.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\parallel\ossimIgen.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimIgenGenerator.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimIkonosMetaData.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimIkonosRpcModel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimImageAoiListener.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageChain.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageCombiner.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageData.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageDataFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageDataHelper.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageDisplayWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageFileWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageGaussianFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageGeometry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimImageGeometryEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimImageGeometryEventListener.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageGeometryFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageGeometryFactoryBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageGeometryRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageHandler.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageHandlerFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageHandlerFactoryBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageHandlerRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageHistogramSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageMetaData.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageMetaDataWriterFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageMetaDataWriterFactoryBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageMetaDataWriterRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageModel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageMosaic.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\parallel\ossimImageMpiMWriterSequenceConnection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\parallel\ossimImageMpiSWriterSequenceConnection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimImagePolygonEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimImageProjectionModel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageReconstructionFilterFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageReconstructionFilterRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimImageRectangleEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageRenderer.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageSharpenFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageSourceFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageSourceFactoryBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageSourceFactoryRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageSourceFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageSourceHistogramFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageSourceSequencer.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageStatisticsSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageToPlaneNormalFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimImageTypeLut.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimImageViewAffineTransform.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimImageViewProjectionTransform.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimImageViewTransform.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimImageViewTransformFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageWriterFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageWriterFactoryBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimImageWriterFactoryRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimIndexToRgbLutFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimInfoBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimInfoFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimInfoFactoryInterface.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimInfoFactoryRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\init\ossimInit.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimIntensityAdjustmentFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimInterleaveTypeLut.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimIoStream.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimIpt.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimIrect.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimIso8211.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimJ2kCodRecord.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimJ2kInfo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimJ2kSizRecord.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimJ2kSotRecord.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimJpegMemSrc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimJpegTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimJpegWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimJpegYCbCrToRgbSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimJpegYCbCrVector.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimKeyword.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimKeywordlist.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimKeywordNames.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimLambertConformalConicProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimLandSatModel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimLandsatTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimLandsatTopoCorrectionFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimLeastSquaresBilin.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimLensDistortion.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimLine.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimListener.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimListenerManager.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimLlxyProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimLocalCorrelationFusion.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimLookUpTable.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimLsrPoint.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimLsrRay.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimLsrSpace.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimLsrVector.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimMapCompositionSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimMapProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimMapProjectionFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimMapProjectionInfo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimMapViewController.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimMaskFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimMatrix3x3.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimMatrix4x4.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimMatrixProperty.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimMaxMosaic.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimMeanMedianFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimMeanRadialLensDistortion.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimMemoryImageSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimMercatorProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimMetadataFileWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimMgrs.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimMillerProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimMiscProjectionFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimMollweidProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimMonoGridRemapEngine.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimMouseEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimMouseListener.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\parallel\ossimMpi.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\parallel\ossimMpiMasterOverviewSequencer.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\parallel\ossimMpiSlaveOverviewSequencer.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimMultiBandHistogram.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimMultiBandHistogramTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimMultiResLevelHistogram.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimNadconGridDatum.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimNadconGridFile.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimNadconGridHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimNadconNarDatum.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimNadconNasDatum.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimNBandLutDataObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimNBandToIndexFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimNewZealandMapGridProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimNitf20Writer.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfAcftbTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfAimidbTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfBlockaTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfCommon.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfCompressionHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfCscrnaTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfCsdidaTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfCsexraTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfDataExtensionSegment.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfDataExtensionSegmentV2_0.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfEmbeddedRpfDes.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfEmbeddedRpfHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfEngrdaTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfFile.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfFileHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfFileHeaderV2_0.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfFileHeaderV2_1.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfFileHeaderV2_X.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfGeoPositioningTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfIchipbTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfImageBand.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfImageBandV2_0.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfImageBandV2_1.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfImageHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfImageHeaderV2_0.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfImageHeaderV2_1.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfImageHeaderV2_X.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfImageLut.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfImageLutV2_0.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfImageLutV2_1.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfInfo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfLabelHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfLabelHeaderV2_0.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfLocalCartographicTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfLocalGeographicTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimNitfMapModel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfMstgtaTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfNameConversionTables.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfPiaimcTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimNitfProjectionFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfProjectionParameterTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfRegisteredTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfRegisteredTagFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfRpcATag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfRpcBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfRpcBTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimNitfRpcModel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfRpfTagFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfSensraTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfStdidcTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfSymbolHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfSymbolHeaderV2_0.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfTagFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfTagFactoryRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfTagInformation.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfTextHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfTextHeaderV2_0.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimNitfTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfUnknownTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfUse00aTag.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimNitfVqCompressionHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimNitfWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimNitfWriterBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimNormalizedRemapTable.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimNormalizedS16RemapTable.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimNormalizedU11RemapTable.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimNormalizedU16RemapTable.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimNormalizedU8RemapTable.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimNormRgbVector.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimNotify.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimNotifyContext.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimNullPixelFlip.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimNumericProperty.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimObjectDestructingEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimObjectEvents.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimObjectFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimObjectFactoryRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimObliqueMercatorProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimOptimizableProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimOrthoGraphicProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\parallel\ossimOrthoIgen.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimOrthoImageMosaic.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimOutputSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimOverviewBuilderBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimOverviewBuilderFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimOverviewBuilderFactoryBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimOverviewBuilderFactoryRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimOverviewSequencer.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimPackedBits.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimPcsCodeProjectionFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimPixelFlipper.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\plugin\ossimPluginLibrary.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimPointHash.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimPolarst.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimPolarStereoProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimPolyArea2d.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimPolyconicProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimPolyCutter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimPolygon.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimPolyLine.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimPolynom.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimPolynomProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimPool.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimPoolObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimPositionQualityEvaluator.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimPreferences.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimProcessInterface.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimProcessListener.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimProcessProgressEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimProjectionFactoryBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimProjectionFactoryRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimProjectionViewControllerFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimProperty.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimPropertyEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimPropertyInterface.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimPropertyInterfaceFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimPropertyInterfaceRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimProtocolStream.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimQuadProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimQuadrilateralMap.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimQuadTreeWarp.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimQuaternion.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimQuickbirdNitfTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimQuickbirdRpcHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimQuickbirdRpcModel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimQuickbirdTiffTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimQuickbirdTile.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimRadialDecentLensDistortion.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimRationalNumber.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimReadmeFileWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimRectangleCutFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimRectanglePartitioner.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimRectilinearDataObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimReferenced.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimRefPtr.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimRefreshEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimRegExp.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimResampler.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimRgbGridRemapEngine.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimRgbImage.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimRgbLutDataObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimRgbToGreyFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimRgbToHsiSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimRgbToHsvSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimRgbToIndexFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimRgbToJpegYCbCrSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimRgbVector.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimRLevelFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimROIEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimROIEventListener.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimRpcModel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimRpcProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimRpcSolver.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfAttributeOffsetRecord.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfAttributes.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfAttributeSectionSubheader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfBoundaryRectRecord.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfBoundaryRectSectionSubheader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfBoundaryRectTable.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfColorConverterOffsetRecord.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfColorConverterSubsection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfColorConverterTable.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfColorGrayscaleOffsetRecord.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfColorGrayscaleSubheader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfColorGrayscaleTable.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfCompressionLookupOffsetRecord.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfCompressionSection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfCompressionSectionSubheader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfConstants.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfCoverageSection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfFrame.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfFrameEntry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfFrameFileIndexRecord.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfFrameFileIndexSectionSubheader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfFrameFileIndexSubsection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfFrameFileReader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfImageDescriptionSubheader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfImageDisplayParameterSubheader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfLocationSection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfMaskSubheader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfMaskSubsection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfPathnameRecord.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfToc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimRpfTocEntry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimRtti.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimS16ImageData.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimSarModel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimScalarRemapper.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimScalarTypeLut.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimScaleFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimSensorModel.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimSensorModelFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimSensorModelTuple.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimSevenParamDatum.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimSFIMFusion.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\plugin\ossimSharedObjectBridge.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\plugin\ossimSharedPluginRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimSingleImageChain.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimSinusoid.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimSinusoidalProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimSmacCallibrationSystem.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimSpaceImagingGeom.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimSpaceObliqueMercatorProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimSpot5Model.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimSpotDimapSupportData.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimSrsProjectionFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimSrtmElevationDatabase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimSrtmFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimSrtmFilename.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\elevation\ossimSrtmHandler.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimSrtmSupportData.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimSrtmTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimStateChangedEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimStatePlaneProjectionFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimStatePlaneProjectionInfo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimStdOutProgress.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimStereographicProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimStreamBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimStreamFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimStreamFactoryBase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimStreamFactoryRegistry.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimString.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimStringListProperty.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimStringProperty.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimSubImageTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimTableRemapper.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimTDpt.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimTempFilename.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimTextProperty.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimThreeParamDatum.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimTieGpt.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimTieGptSet.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimTiffInfo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimTiffOverviewBuilder.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimTiffProjectionFactory.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimTiffTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\support_data\ossimTiffWorld.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimTiffWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimTileCache.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimTiledImageHash.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimTileHash.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimTilePatch.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimTiling.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimTimer.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimTopographicCorrectionFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimTrace.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimTraceManager.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimTranmerc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimTransCylEquAreaProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimTransMercatorProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimTrimFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimTwoColorView.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimU11ImageData.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimU16ImageData.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimU8ImageData.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimUnitConversionTool.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimUnitTypeLut.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimUps.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimUpsProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimUpspt.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimUsgsDemTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimUsgsQuad.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimUtm.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimUtmProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimUtmpt.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimValueAssignImageSourceFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimVanDerGrintenProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimVectorRenderer.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\ossimVersion.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimVertexExtractor.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimViewController.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimViewEvent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimViewInterface.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimViewListener.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimVirtualImageHandler.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimVirtualImageWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimVirtualOverviewBuilder.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimVirtualOverviewSequencer.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimVpfAnnotationCoverageInfo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimVpfAnnotationFeatureInfo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimVpfAnnotationLibraryInfo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimVpfAnnotationSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vec\ossimVpfBoundingRecordTable.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vec\ossimVpfCoverage.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vec\ossimVpfDatabase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vec\ossimVpfDatabaseHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vec\ossimVpfDatabaseHeaderTableValidator.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vec\ossimVpfExtent.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vec\ossimVpfFeatureClass.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vec\ossimVpfFeatureClassSchema.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vec\ossimVpfLibrary.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vec\ossimVpfLibraryAttributeTableValidator.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vec\ossimVpfTable.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vec\ossimVpfTableValidator.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimVpfTileSource.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimVrect.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\projection\ossimWarpProjection.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimWatermarkFilter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimWgs72Datum.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimWgs84Datum.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimWms.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\imaging\ossimWorldFileWriter.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimXmlAttribute.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimXmlDocument.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimXmlNode.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\base\ossimXmlString.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\polygrf.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\matrix\precisio.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\projectn.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\protomas.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\kbool\record.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\kbool\scanbeam.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\set.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\matrix\solution.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\system.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\values.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\kbool\valuesvc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vec\vpf.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\vpfapi.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\vpfdisp.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\vpfdraw.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\vpfinit.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\vpfio.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\vpfmisc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\vpfprim.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\vpfrelat.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\vpfselec.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\vpftable.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\vpftidx.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\vpfview.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\include\ossim\vpfutil\xmemory.h"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Source Files"
-			>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\bandmat.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\bitarray.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\kbool\booleng.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\cholesky.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\distance.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\evalue.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\fft.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\kbool\graph.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\kbool\graphlst.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\hholder.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\jacobi.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\kbool\line.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\kbool\link.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\linklist.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\kbool\lpoint.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\myexcept.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\newfft.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\newmat1.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\newmat2.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\newmat3.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\newmat4.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\newmat5.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\newmat6.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\newmat7.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\newmat8.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\newmat9.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\newmatex.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\newmatnl.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\newmatrm.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\kbool\node.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossim2dBilinearTransform.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossim2dLinearRegression.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossim2dTo2dIdentityTransform.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossim2dTo2dShiftTransform.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossim2dTo2dTransform.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossim2dTo2dTransformFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossim2dTo2dTransformRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossim3x3ConvolutionFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimActiveEdgeTable.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimAdjMapModel.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimAdjustableParameterInfo.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimAdjustableParameterInterface.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimAdjustmentInfo.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAdrgHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAdrgTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimAffineProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimAffineTransform.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimAigBounds.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimAigDataFileHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimAigHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimAigIndexFileHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimAigStatistics.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimAlbersProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAnnotationEllipseObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAnnotationFontObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAnnotationGdBitmapFont.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAnnotationLineObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAnnotationMultiEllipseObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAnnotationMultiLineObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAnnotationMultiPolyLineObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAnnotationMultiPolyObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAnnotationObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAnnotationObjectFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAnnotationPolyObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAnnotationSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAOD.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAppFixedTileCache.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimApplanixEcefModel.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimApplanixEOFile.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimApplanixUtmModel.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimApplicationUsage.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAppTileCache.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimArcInfoGridWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimArgumentParser.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAtbController.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAtbMatchPoint.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAtbPointSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAtCorrGridRemapper.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimAtCorrRemapper.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimAuxFileHandler.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimAzimEquDistProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimBandAverageFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimBandClipFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimBandMergeSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimBandSelector.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimBaseObjectFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimBilinearProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimBilSplitter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimBlendMosaic.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimBngProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimBonneProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimBooleanProperty.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimBrightnessContrastSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimBrightnessMatch.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimBuckeyeSensor.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimBumpShadeTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimCacheTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimCadrgProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimCassiniProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimCastTileSourceFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimCcfHead.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimCcfInfo.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimCcfTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimCibCadrgTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimClosestToCenterCombiner.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimCmyVector.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimCoarseGridModel.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimColorNormalizedFusion.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimColorProperty.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimColumnVector3d.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimCommon.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimConnectableContainer.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimConnectableContainerInterface.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimConnectableDisplayListener.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimConnectableObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimConnectableObjectListener.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimConnectionEvent.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimContainerEvent.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimContainerProperty.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimConvolutionFilter1D.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimConvolutionSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimCplUtil.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimCsvFile.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimCustomEditorWindow.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimCustomEditorWindowFactoryBase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimCustomEditorWindowRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimCylEquAreaProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDataObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDate.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDateProperty.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDatum.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDatumFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDatumFactory.inc"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDatumFactoryRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDblGrid.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimDdffield.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimDdffielddefn.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimDdfmodule.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimDdfrecord.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimDdfsubfielddefn.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimDdfutils.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimDemGrid.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimDemHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimDemInfo.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimDemPoint.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimDemProfile.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimDemStats.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimDemUtil.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDirectory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDirectoryData.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDirectoryTree.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimDiscrete3x3HatFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimDiscreteConvolutionKernel.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDisplayEventListener.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDisplayInterface.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDisplayListEvent.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDisplayRefreshEvent.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\dll_main\ossimDllMain.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDms.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimDoqq.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimDoqqTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDoubleGridProperty.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDpt.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDpt3d.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDrect.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimDtedAcc.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimDtedDsi.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimDtedElevationDatabase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimDtedElevationImageSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimDtedFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimDtedHandler.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimDtedHdr.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimDtedInfo.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimDtedRecord.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimDtedTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimDtedUhl.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimDtedVol.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimDuration.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\plugin\ossimDynamicLibrary.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimEastingNorthingCutter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimEbcdicToAscii.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimEcefPoint.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimEcefRay.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimEcefVector.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimEckert4Projection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimEckert6Projection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimEdgeFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimElevationDatabase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimElevationDatabaseFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimElevationDatabaseRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimElevationManagerEvent.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimElevationManagerEventListener.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimElevCellHandler.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimElevCellHandlerFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimElevImageSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimElevManager.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimElevSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimElevSourceFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimEllipsoid.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimEllipsoidFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimEndian.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimEnviHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimEnviHeaderFileWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimEnvironmentUtility.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimEquationCombiner.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimEquDistCylProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimEquTokenizer.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimErrorCodes.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimErrorStatusInterface.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimERS.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimERSFileWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimERSTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimEvent.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimException.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimFactoryBaseTemplate.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimFcsiModel.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimFeatherMosaic.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimFfL5.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimFfL7.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimFfRevb.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimFfRevc.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimFftFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimFgdcFileWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimFilename.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimFilenameProperty.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimFilterResampler.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimFilterTable.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimFixedTileCache.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\font\ossimFont.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\font\ossimFontFactoryRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimFontInformation.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimFontProperty.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimFpt.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimFpt3d.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\font\ossimFreeTypeFont.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\font\ossimFreeTypeFontFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimFusionCombiner.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGammaRemapper.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimGcsCodeProjectionFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\font\ossimGdBitmapFont.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimGeneralRasterElevationDatabase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimGeneralRasterElevFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimGeneralRasterElevHandler.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeneralRasterInfo.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeneralRasterTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeneralRasterWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeoAnnotationBitmap.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeoAnnotationEllipseObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeoAnnotationFontObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeoAnnotationGdBitmapFont.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeoAnnotationLineObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeoAnnotationMultiEllipseObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeoAnnotationMultiPolyLineObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeoAnnotationMultiPolyObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeoAnnotationObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeoAnnotationPolyLineObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeoAnnotationPolyObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeoAnnotationSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimGeocent.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeographicAnnotationGrid.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimGeoid.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimGeoidEgm96.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimGeoidManager.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimGeoidNgs.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimGeoidNgsHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeomFileWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGeoPolyCutter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimGeoPolygon.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimGeoref.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimGeoTiff.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimGeoTiffCoordTransformsLut.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimGeoTiffDatumLut.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimGnomonicProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimGpt.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimGrect.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGridRemapEngine.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGridRemapEngineFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimGridRemapSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimGzStream.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimHexString.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimHgtRef.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimHistogram.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimHistogramEqualization.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimHistogramMatchFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimHistogramRemapper.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimHistogramSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimHistogramThreshholdFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimHistogramWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimHistoMatchRemapper.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimHsiRemapper.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimHsiToRgbSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimHsiVector.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimHsvGridRemapEngine.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimHsvToRgbSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimHsvVector.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimId.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimIdManager.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\parallel\ossimIgen.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimIgenGenerator.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimIkonosMetaData.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimIkonosRpcModel.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimImageAoiListener.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageChain.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageCombiner.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageData.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageDataFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageDataHelper.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageDisplayWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageFileWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageGaussianFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageGeometry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimImageGeometryEvent.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimImageGeometryEventListener.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageGeometryFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageGeometryRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageHandler.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageHandlerFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageHandlerFactoryBase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageHandlerRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageHistogramSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageMetaData.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageMetaDataWriterFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageMetaDataWriterFactoryBase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageMetaDataWriterRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageModel.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageMosaic.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\parallel\ossimImageMpiMWriterSequenceConnection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\parallel\ossimImageMpiSWriterSequenceConnection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimImageProjectionModel.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageReconstructionFilterFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageReconstructionFilterRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageRenderer.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageSharpenFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageSourceFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageSourceFactoryBase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageSourceFactoryRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageSourceFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageSourceHistogramFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageSourceSequencer.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageStatisticsSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageToPlaneNormalFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimImageTypeLut.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimImageViewAffineTransform.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimImageViewProjectionTransform.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimImageViewTransform.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimImageViewTransformFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageWriterFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageWriterFactoryBase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimImageWriterFactoryRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimIndexToRgbLutFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimInfoBase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimInfoFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimInfoFactoryRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\init\ossimInit.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimIntensityAdjustmentFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimInterleaveTypeLut.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimIoStream.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimIpt.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimIrect.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimJ2kCodRecord.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimJ2kInfo.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimJ2kSizRecord.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimJ2kSotRecord.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimJpegMemSrc.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimJpegTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimJpegWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimJpegYCbCrToRgbSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimJpegYCbCrVector.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimKeyword.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimKeywordlist.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimKeywordNames.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimLambertConformalConicProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimLandSatModel.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimLandsatTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimLandsatTopoCorrectionFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimLeastSquaresBilin.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimLensDistortion.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimLine.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimListener.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimListenerManager.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimLlxyProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimLocalCorrelationFusion.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimLookUpTable.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimLsrPoint.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimLsrRay.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimLsrSpace.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimLsrVector.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimMapCompositionSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimMapProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimMapProjectionFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimMapProjectionInfo.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimMapViewController.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimMaskFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimMatrix3x3.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimMatrix4x4.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimMatrixProperty.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimMaxMosaic.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimMeanMedianFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimMeanRadialLensDistortion.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimMemoryImageSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimMercatorProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimMetadataFileWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimMgrs.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimMillerProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimMiscProjectionFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimMollweidProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimMonoGridRemapEngine.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimMouseEvent.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimMouseListener.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\parallel\ossimMpi.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\parallel\ossimMpiMasterOverviewSequencer.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\parallel\ossimMpiSlaveOverviewSequencer.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimMultiBandHistogram.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimMultiBandHistogramTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimMultiResLevelHistogram.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimNadconGridDatum.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimNadconGridFile.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimNadconGridHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimNadconNarDatum.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimNadconNasDatum.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimNBandLutDataObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimNBandToIndexFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimNewZealandMapGridProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimNitf20Writer.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfAcftbTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfAimidbTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfBlockaTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfCommon.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfCompressionHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfCscrnaTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfCsdidaTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfCsexraTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfDataExtensionSegment.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfDataExtensionSegmentV2_0.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfEmbeddedRpfDes.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfEmbeddedRpfHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfEngrdaTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfFile.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfFileHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfFileHeaderV2_0.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfFileHeaderV2_1.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfFileHeaderV2_X.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfGeoPositioningTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfIchipbTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfImageBand.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfImageBandV2_0.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfImageBandV2_1.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfImageHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfImageHeaderV2_0.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfImageHeaderV2_1.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfImageHeaderV2_X.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfImageLut.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfImageLutV2_0.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfImageLutV2_1.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfInfo.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfLabelHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfLabelHeaderV2_0.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfLocalCartographicTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfLocalGeographicTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimNitfMapModel.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfMstgtaTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfNameConversionTables.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfPiaimcTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimNitfProjectionFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfProjectionParameterTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfRegisteredTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfRegisteredTagFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfRpcATag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfRpcBase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfRpcBTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimNitfRpcModel.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfRpfTagFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfSensraTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfStdidcTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfSymbolHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfSymbolHeaderV2_0.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfTagFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfTagFactoryRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfTagInformation.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfTextHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfTextHeaderV2_0.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimNitfTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfUnknownTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfUse00aTag.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimNitfVqCompressionHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimNitfWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimNitfWriterBase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimNormalizedRemapTable.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimNormalizedS16RemapTable.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimNormalizedU11RemapTable.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimNormalizedU16RemapTable.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimNormalizedU8RemapTable.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimNormRgbVector.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimNotify.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimNullPixelFlip.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimNumericProperty.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimObjectDestructingEvent.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimObjectFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimObjectFactoryRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimObliqueMercatorProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimOptimizableProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimOrthoGraphicProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\parallel\ossimOrthoIgen.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimOrthoImageMosaic.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimOutputSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimOverviewBuilderBase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimOverviewBuilderFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimOverviewBuilderFactoryBase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimOverviewBuilderFactoryRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimOverviewSequencer.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimPackedBits.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimPcsCodeProjectionFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimPixelFlipper.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\plugin\ossimPluginLibrary.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimPolarst.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimPolarStereoProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimPolyArea2d.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimPolyconicProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimPolyCutter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimPolygon.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimPolyLine.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimPolynomProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimPositionQualityEvaluator.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimPreferences.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimProcessInterface.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimProcessListener.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimProcessProgressEvent.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimProjectionFactoryBase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimProjectionFactoryRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimProjectionViewControllerFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimProperty.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimPropertyInterface.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimPropertyInterfaceFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimPropertyInterfaceRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimQuadProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimQuadrilateralMap.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimQuadTreeWarp.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimQuaternion.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimQuickbirdNitfTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimQuickbirdRpcHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimQuickbirdRpcModel.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimQuickbirdTiffTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimQuickbirdTile.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimRadialDecentLensDistortion.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimRationalNumber.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimReadmeFileWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimRectangleCutFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimRectanglePartitioner.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimRectilinearDataObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimReferenced.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimRefreshEvent.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimRegExp.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimResampler.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimRgbGridRemapEngine.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimRgbImage.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimRgbLutDataObject.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimRgbToGreyFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimRgbToHsiSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimRgbToHsvSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimRgbToIndexFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimRgbToJpegYCbCrSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimRgbVector.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimRLevelFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimROIEvent.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimROIEventListener.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimRpcModel.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimRpcProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimRpcSolver.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfAttributeOffsetRecord.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfAttributes.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfAttributeSectionSubheader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfBoundaryRectRecord.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfBoundaryRectSectionSubheader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfBoundaryRectTable.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfColorConverterOffsetRecord.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfColorConverterSubsection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfColorConverterTable.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfColorGrayscaleOffsetRecord.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfColorGrayscaleSubheader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfColorGrayscaleTable.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfCompressionLookupOffsetRecord.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfCompressionSection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfCompressionSectionSubheader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfCoverageSection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfFrame.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfFrameEntry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfFrameFileIndexRecord.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfFrameFileIndexSectionSubheader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfFrameFileIndexSubsection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfFrameFileReader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfImageDescriptionSubheader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfImageDisplayParameterSubheader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfLocationSection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfMaskSubheader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfMaskSubsection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfPathnameRecord.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfToc.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimRpfTocEntry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimRtti.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimS16ImageData.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimSarModel.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimScalarRemapper.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimScalarTypeLut.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimScaleFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimSensorModel.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimSensorModelFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimSensorModelTuple.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimSevenParamDatum.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimSFIMFusion.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\plugin\ossimSharedObjectBridge.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\plugin\ossimSharedPluginRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimSingleImageChain.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimSinusoid.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimSinusoidalProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimSmacCallibrationSystem.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimSpaceImagingGeom.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimSpaceObliqueMercatorProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimSpot5Model.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimSpotDimapSupportData.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimSrsProjectionFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimSrtmElevationDatabase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimSrtmFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimSrtmFilename.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\elevation\ossimSrtmHandler.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimSrtmSupportData.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimSrtmTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimStateChangedEvent.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimStatePlaneProjectionFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimStatePlaneProjectionInfo.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimStdOutProgress.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimStereographicProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimStreamBase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimStreamFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimStreamFactoryRegistry.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimString.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimStringListProperty.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimStringProperty.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimSubImageTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimTableRemapper.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimTDpt.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimTempFilename.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimTextProperty.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimThreeParamDatum.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimTieGpt.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimTieGptSet.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimTiffInfo.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimTiffOverviewBuilder.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimTiffProjectionFactory.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimTiffTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\support_data\ossimTiffWorld.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimTiffWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimTileCache.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimTiledImageHash.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimTileHash.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimTilePatch.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimTiling.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimTimer.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimTopographicCorrectionFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimTrace.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimTraceManager.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimTranmerc.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimTransCylEquAreaProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimTransMercatorProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimTrimFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimTwoColorView.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimU11ImageData.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimU16ImageData.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimU8ImageData.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimUnitConversionTool.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimUnitTypeLut.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimUps.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimUpsProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimUpspt.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimUsgsDemTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimUsgsQuad.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimUtm.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimUtmProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimUtmpt.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimValueAssignImageSourceFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimVanDerGrintenProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimVectorRenderer.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimVertexExtractor.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimViewController.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimViewEvent.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimViewInterface.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimViewListener.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimVirtualImageHandler.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimVirtualImageWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimVirtualOverviewBuilder.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimVirtualOverviewSequencer.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimVpfAnnotationCoverageInfo.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimVpfAnnotationFeatureInfo.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimVpfAnnotationLibraryInfo.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimVpfAnnotationSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vec\ossimVpfBoundingRecordTable.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vec\ossimVpfCoverage.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vec\ossimVpfDatabase.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vec\ossimVpfDatabaseHeader.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vec\ossimVpfDatabaseHeaderTableValidator.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vec\ossimVpfExtent.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vec\ossimVpfFeatureClass.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vec\ossimVpfFeatureClassSchema.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vec\ossimVpfLibrary.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vec\ossimVpfLibraryAttributeTableValidator.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vec\ossimVpfTable.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimVpfTileSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimVrect.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\projection\ossimWarpProjection.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimWatermarkFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimWgs72Datum.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimWgs84Datum.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimWms.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\imaging\ossimWorldFileWriter.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimXmlAttribute.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimXmlDocument.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimXmlNode.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\base\ossimXmlString.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\polygrf.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\kbool\record.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\kbool\scanbeam.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\set.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\solution.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\sort.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\submat.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\matrix\svd.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\version-config.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpfclip.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpfcntnt.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpfdict.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpfdisp.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpfdraw.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpfmisc.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpfnear.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpfprim.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpfptply.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpfquery.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpfread.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpfrelat.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpfselec.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpfspx.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpftable.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpftidx.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\src\ossim\vpfutil\vpfwrite.c"
-				>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/ossim_gdalplugin/ossim_gdalplugin.vcproj b/projects/vs/ossim_gdalplugin/ossim_gdalplugin.vcproj
deleted file mode 100644
index 38bbbfa..0000000
--- a/projects/vs/ossim_gdalplugin/ossim_gdalplugin.vcproj
+++ /dev/null
@@ -1,326 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossimgdal_plugin"
-	ProjectGUID="{7304FB0A-AD7F-4B23-BB48-7696598138F6}"
-	RootNamespace="ossim_gdalplugin"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""$(SolutionDir)..\..\..\ossim_plugins\gdal";"$(SolutionDir)..\..\..\ossim_plugins";"$(SolutionDir)..\..\..\ossim_dependencies\src\gdal-1.4.0\frmts\mem";"$(SolutionDir)..\..\..\ossim\include\";"$(SolutionDir)..\..\..\ossim_dependencies\src\gdal-1.4.0\gcore";"$(SolutionDir)..\..\..\ossim_dependencies\src\3rdParty\include""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;OSSIMUSINGDLL;GDAL_EXPORTS;HAVE_CONFIG_H"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="gdal_i.lib"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories="$(SolutionDir)..\..\..\ossim_dependencies\src\3rdParty\lib"
-				GenerateDebugInformation="true"
-				SubSystem="0"
-				OptimizeReferences="0"
-				EnableCOMDATFolding="0"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(InputDir)..\..\..\include";"$(InputDir)..\..\..\..\ossim_dependencies\include";"$(InputDir)..\..\..\..\ossim_dependencies\include\freetype";"$(InputDir)..\..\..\..\ossim_plugins\gdal";"$(InputDir)..\..\..\..\ossim_plugins\""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;OSSIMUSINGDLL;GDAL_EXPORTS;HAVE_CONFIG_H"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="gdal_i.lib"
-				OutputFile="$(OutDir)\bin\$(ProjectName).dll"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(SolutionDir)..\..\..\ossim_dependencies\lib""
-				GenerateDebugInformation="true"
-				SubSystem="0"
-				OptimizeReferences="0"
-				EnableCOMDATFolding="0"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				ImportLibrary="$(OutDir)\lib\$(ProjectName).lib"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimEsriShapeFileFilter.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimEsriShapeFileFilter.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalDataset.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalDataset.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalFactory.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalFactory.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalImageWriterFactory.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalImageWriterFactory.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalObjectFactory.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalObjectFactory.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalOgrVectorAnnotation.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalOgrVectorAnnotation.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalOverviewBuilder.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalOverviewBuilder.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalOverviewBuilderFactory.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalOverviewBuilderFactory.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalPluginInit.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalProjectionFactory.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalProjectionFactory.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalTiledDataset.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalTiledDataset.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalTileSource.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalTileSource.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalType.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalType.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalWriter.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimGdalWriter.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimOgcWktTranslator.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimOgcWktTranslator.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimOgrGdalTileSource.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimOgrGdalTileSource.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimShapeDatabase.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimShapeDatabase.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimShapeFile.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\ossimShapeFile.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\gdal\shapefil.h"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/ossim_pngplugin/ossim_pngplugin.vcproj b/projects/vs/ossim_pngplugin/ossim_pngplugin.vcproj
deleted file mode 100644
index 4f658ae..0000000
--- a/projects/vs/ossim_pngplugin/ossim_pngplugin.vcproj
+++ /dev/null
@@ -1,218 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ossimpng_plugin"
-	ProjectGUID="{88263ADA-AEAB-49E7-95DE-2066A61DB3F4}"
-	RootNamespace="ossim_pngplugin"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="C:\Users\Kent\Projects\OSSIM\ossim_plugins;C:\Users\Kent\Projects\OSSIM\ossim\include;C:\Users\Kent\Projects\OSSIM\ossim_dependencies\src\3rdParty\include;"$(InputDir)""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;OSSIMUSINGDLL;HAVE_CONFIG_H"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="libpng.lib zlib.lib"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories="$(SolutionDir)..\..\..\ossim_dependencies\src\3rdParty\lib"
-				GenerateDebugInformation="true"
-				SubSystem="0"
-				OptimizeReferences="0"
-				EnableCOMDATFolding="0"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""$(ProjectDir)..\..\..\..\ossim_plugins\gdal";"$(ProjectDir)..\..\..\..\ossim_plugins";"$(ProjectDir)..\..\..\..\ossim\include\";"$(ProjectDir)..\..\..\..\ossim_dependencies\include";"$(ProjectDir)""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;OSSIMUSINGDLL;HAVE_CONFIG_H"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="libpng13.lib zlib1.lib"
-				OutputFile="$(OutDir)\bin\$(ProjectName).dll"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""$(SolutionDir)..\..\..\ossim_dependencies\lib""
-				GenerateDebugInformation="false"
-				SubSystem="0"
-				OptimizeReferences="0"
-				EnableCOMDATFolding="0"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				ImportLibrary="$(OutDir)\lib\$(ProjectName).lib"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\png\ossimPngPluginInit.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\png\ossimPngReader.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\png\ossimPngReader.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\png\ossimPngReaderFactory.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\png\ossimPngReaderFactory.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\png\ossimPngWriter.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\png\ossimPngWriter.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\png\ossimPngWriterFactory.cpp"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\..\ossim_plugins\png\ossimPngWriterFactory.h"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/package_setup/package_setup.vcproj b/projects/vs/package_setup/package_setup.vcproj
deleted file mode 100755
index 53bc349..0000000
--- a/projects/vs/package_setup/package_setup.vcproj
+++ /dev/null
@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="package_setup"
-	ProjectGUID="{74A170D6-C5E7-47FC-832E-6DB8719D96B3}"
-	RootNamespace="package_setup"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine="copy "$(OSSIM_DEPENDENCIES)\bin\*" "$(OutDir)\bin"&#x0D;&#x0A;copy "$(OSSIM_DEPENDENCIES)\data\*.csv"  "$(OutDir)\bin"&#x0D;&#x0A;copy "$(OSSIM_DEPENDENCIES)\data\*.wkt"  "$(OutDir)\bin"&#x0D;&#x0A;copy "$(OSSIM_DEPENDENCIES)\bin\osgplugins\*.dll" "$(OutDir)\bin"&#x0D;&#x0A;copy "$(OSSIM_HOME\..\ossimPlanetQt\lib\*.dll" "$(OutDir)\bin"&#x0D;&#x0A;copy $(OSSIM_HOME\..\ossim [...]
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath=".\page_setup_dummy.cpp"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/package_setup/page_setup_dummy.cpp b/projects/vs/package_setup/page_setup_dummy.cpp
deleted file mode 100755
index 0519ecb..0000000
--- a/projects/vs/package_setup/page_setup_dummy.cpp
+++ /dev/null
@@ -1 +0,0 @@
- 
\ No newline at end of file
diff --git a/projects/vs/solution.sln b/projects/vs/solution.sln
deleted file mode 100644
index 860ddc7..0000000
Binary files a/projects/vs/solution.sln and /dev/null differ
diff --git a/projects/vs/updatesolution/README.txt b/projects/vs/updatesolution/README.txt
deleted file mode 100644
index c9ff1e2..0000000
--- a/projects/vs/updatesolution/README.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-------------------UpdateSolution---------------------------
-Written By: David A. Horner - (http://dave.thehorners.com)
-License: LGPL
------------------------------------------------------------
-This is a program I wrote to create solution and project
-files for the OSSIM tree.  I did this because I didn't want to
-have to copy files by hand...and there are a lot of apps in the
-OSSIM tree.
-
-This program allows the developer to maintain a set of template
-files which are populated with source code from the OSSIM tree.
-This means you can quickly change the include and code generation
-parameters specific to your build machine without having to
-manually change each and every project file.
-
-(It also means you can quickly re-generate the projects when files
-are added or removed from the OSSIM tree)
-
-At this time the software overwrites the contents of existing solution
-and project files.  Be careful, changes made to solution/project files
-will be lost.
-
-NOTE:
-It is important that updatesolution.exe be run from:
-makefiles\vs2005\updatesolution\updatesolution\bin\Release or
-makefiles\vs2005\updatesolution\updatesolution\bin\Debug
-As it relies on this location to find all the OSSIM source.
-
-
-What is a project template file?
---------------------------------
-A template file is simply a .vcproj file with all the <File>
-entries erased from the <Files> section.  Sample templates can
-be found in the templates folder of updatesolution.
-
-To make a new template, open the existing solution/project files
-get it to compile with your specific include/lib information. Save it,
-then strip out all the files in the <Files> section.
-
-Make sure to leave the <Files> entry so that updatesolution
-knows where to stuff the files it finds.
\ No newline at end of file
diff --git a/projects/vs/updatesolution/templates/appTemplate.vcproj b/projects/vs/updatesolution/templates/appTemplate.vcproj
deleted file mode 100644
index c18578f..0000000
--- a/projects/vs/updatesolution/templates/appTemplate.vcproj
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="template"
-	ProjectGUID="{}"
-	RootNamespace="template"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				RuntimeLibrary="2"
-				Optimization="0"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.3.0\include";"..\..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\..\jpeg-6b""
-				RuntimeLibrary="2"
-				Optimization="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="false"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/updatesolution/templates/dllTemplate.vcproj b/projects/vs/updatesolution/templates/dllTemplate.vcproj
deleted file mode 100644
index 6f19ae2..0000000
--- a/projects/vs/updatesolution/templates/dllTemplate.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="ossim_dll"
-	ProjectGUID="{0A1DFEA3-6E30-432C-AA02-313AF18E9188}"
-	RootNamespace="ossim_dll"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories=""..\..\..\include";"..\..\..\..\freetype-2.3.0\include";"..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;OSSIM_DLL_EXPORTS;OSSIMMAKINGDLL;_FILE_OFFSET_BITS=64;_LARGE_FILES;MPI_SETTING=0;OSSIM_HAS_OPEN_THREADS=0;GEOTIFF_ENABLED;FREETYPE_SETTING=1;HAVE_CONFIG_H;SHAPELIB_DLLEXPORT"
-				RuntimeLibrary="2"
-				Optimization="0"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="libjpeg.lib geotiff.lib libtiff.lib freetype230.lib"
-				AdditionalLibraryDirectories=""..\..\..\..\freetype-2.3.0\objs";"..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\jpeg-6b""
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="0"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""..\..\..\include";"..\..\..\..\freetype-2.3.0\include";"..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\libgeotiff-1.2.3\libxtiff";"..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;OSSIM_DLL_EXPORTS;OSSIMMAKINGDLL;_FILE_OFFSET_BITS=64;_LARGE_FILES;MPI_SETTING=0;OSSIM_HAS_OPEN_THREADS=0;GEOTIFF_ENABLED;FREETYPE_SETTING=1;HAVE_CONFIG_H;SHAPELIB_DLLEXPORT"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="libjpeg.lib geotiff.lib libtiff.lib freetype230.lib"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""..\..\..\..\freetype-2.3.0\objs";"..\..\..\..\tiff-3.8.2\libtiff";"..\..\..\..\libgeotiff-1.2.3";"..\..\..\..\jpeg-6b""
-				GenerateDebugInformation="false"
-				SubSystem="0"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/updatesolution/templates/pluginGdalTemplate.vcproj b/projects/vs/updatesolution/templates/pluginGdalTemplate.vcproj
deleted file mode 100644
index af68b4c..0000000
--- a/projects/vs/updatesolution/templates/pluginGdalTemplate.vcproj
+++ /dev/null
@@ -1,181 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="ossim_gdalplugin"
-	ProjectGUID="{8322dccd-a92b-4e3d-b3eb-038345b24342}"
-	RootNamespace="ossim_gdalplugin"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\";"..\..\..\include";"..\..\..\..\ossim_plugins";"..\..\..\..\ossim_plugins\gdal";"..\..\..\..\gdal-1.4.0\gcore";"..\..\..\..\gdal-1.4.0\frmts\mem";"..\..\..\..\gdal-1.4.0\port";"..\..\..\..\gdal-1.4.0\ogr";"..\..\..\..\gdal-1.4.0\ogr\ogrsf_frmts";"..\..\..\..\gdal-1.4.0\frmts\gtiff\libtiff""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;OSSIMUSINGDLL;GDAL_EXPORTS;HAVE_CONFIG_H"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				AdditionalDependencies="gdal.lib"
-				AdditionalLibraryDirectories=""..\..\..\..\gdal-1.4.0\""
-				GenerateDebugInformation="true"
-				SubSystem="0"
-				OptimizeReferences="0"
-				EnableCOMDATFolding="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""..\..\..\";"..\..\..\include";"..\..\..\..\ossim_plugins";"..\..\..\..\ossim_plugins\gdal";"..\..\..\..\gdal-1.4.0\gcore";"..\..\..\..\gdal-1.4.0\frmts\mem";"..\..\..\..\gdal-1.4.0\port";"..\..\..\..\gdal-1.4.0\ogr";"..\..\..\..\gdal-1.4.0\ogr\ogrsf_frmts";"..\..\..\..\gdal-1.4.0\frmts\gtiff\libtiff""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;OSSIMUSINGDLL;GDAL_EXPORTS;HAVE_CONFIG_H"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				AdditionalDependencies="gdal.lib"
-				AdditionalLibraryDirectories=""..\..\..\..\gdal-1.4.0\""
-				GenerateDebugInformation="false"
-				SubSystem="0"
-				OptimizeReferences="0"
-				EnableCOMDATFolding="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/updatesolution/templates/pluginPNGTemplate.vcproj b/projects/vs/updatesolution/templates/pluginPNGTemplate.vcproj
deleted file mode 100644
index d791ce9..0000000
--- a/projects/vs/updatesolution/templates/pluginPNGTemplate.vcproj
+++ /dev/null
@@ -1,181 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="ossim_pngplugin"
-	ProjectGUID="{8322dccd-a92b-4e3d-b3eb-038345b24342}"
-	RootNamespace="ossim_pngplugin"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="ReleaseWithSymbols|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\";"..\..\..\include";"..\..\..\..\ossim_plugins";"..\..\..\..\ossim_plugins\png";"..\..\..\..\libpng-1.2.15";"..\..\..\..\zlib";"..\..\..\..\tiff-3.8.2\libtiff""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;OSSIMUSINGDLL;HAVE_CONFIG_H"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				AdditionalDependencies="libpng.lib zlib.lib"
-				AdditionalLibraryDirectories=""..\..\..\..\libpng-1.2.15\projects\visualc71\Win32_LIB_Release";"..\..\..\..\zlib""
-				GenerateDebugInformation="true"
-				SubSystem="0"
-				OptimizeReferences="0"
-				EnableCOMDATFolding="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="3"
-				AdditionalIncludeDirectories=""..\..\..\";"..\..\..\include";"..\..\..\..\ossim_plugins";"..\..\..\..\ossim_plugins\png";"..\..\..\..\libpng-1.2.15";"..\..\..\..\zlib";"..\..\..\..\tiff-3.8.2\libtiff""
-				PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;OSSIMUSINGDLL;HAVE_CONFIG_H"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				AdditionalDependencies="libpng.lib zlib.lib"
-            AdditionalLibraryDirectories=""..\..\..\..\libpng-1.2.15\projects\visualc71\Win32_LIB_Release";"..\..\..\..\zlib""
-				GenerateDebugInformation="false"
-				SubSystem="0"
-				OptimizeReferences="0"
-				EnableCOMDATFolding="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/updatesolution/templates/staticTemplate.vcproj b/projects/vs/updatesolution/templates/staticTemplate.vcproj
deleted file mode 100644
index 8bc4315..0000000
--- a/projects/vs/updatesolution/templates/staticTemplate.vcproj
+++ /dev/null
@@ -1,165 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="base"
-	ProjectGUID="{08D7D543-100C-4389-9B5E-3FC432011B63}"
-	RootNamespace="base"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="4"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				Description=""
-				CommandLine=""
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=""..\..\..\..\include";"..\..\..\..\..\freetype-2.1.9\include";"..\..\..\..\..\tiff-3.7.2\libtiff";"..\..\..\..\..\libgeotiff-1.2.2";"..\..\..\..\..\libgeotiff-1.2.2\libxtiff";"..\..\..\..\..\jpeg-6b""
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OSSIM_DLL_EXPORTS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/projects/vs/updatesolution/updatesolution/Form1.Designer.cs b/projects/vs/updatesolution/updatesolution/Form1.Designer.cs
deleted file mode 100644
index 3d93fe6..0000000
--- a/projects/vs/updatesolution/updatesolution/Form1.Designer.cs
+++ /dev/null
@@ -1,155 +0,0 @@
-////////////////////////////////////////////////////////////
-// - UpdateSolution -
-// A tool for generating project and solution files from
-// the OSSIM source tree.
-//
-// Written By: David A. Horner (http://dave.thehorners.com)
-// License: LGPL
-// $Id: Form1.Designer.cs 10417 2007-02-02 15:02:32Z dburken $
-////////////////////////////////////////////////////////////
-
-namespace updatesolution
-{
-    partial class Form1
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
-            this.process = new System.Windows.Forms.Button();
-            this.label1 = new System.Windows.Forms.Label();
-            this.linkLabel1 = new System.Windows.Forms.LinkLabel();
-            this.label2 = new System.Windows.Forms.Label();
-            this.linkLabel2 = new System.Windows.Forms.LinkLabel();
-            this.status = new System.Windows.Forms.TextBox();
-            this.label3 = new System.Windows.Forms.Label();
-            this.SuspendLayout();
-            // 
-            // process
-            // 
-            this.process.Location = new System.Drawing.Point(207, 213);
-            this.process.Name = "process";
-            this.process.Size = new System.Drawing.Size(111, 36);
-            this.process.TabIndex = 0;
-            this.process.Text = "Build solution";
-            this.process.UseVisualStyleBackColor = true;
-            this.process.Click += new System.EventHandler(this.process_Click);
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(65, 9);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(395, 65);
-            this.label1.TabIndex = 1;
-            this.label1.Text = resources.GetString("label1.Text");
-            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
-            // linkLabel1
-            // 
-            this.linkLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.linkLabel1.AutoSize = true;
-            this.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.AlwaysUnderline;
-            this.linkLabel1.Location = new System.Drawing.Point(370, 239);
-            this.linkLabel1.Name = "linkLabel1";
-            this.linkLabel1.Size = new System.Drawing.Size(143, 13);
-            this.linkLabel1.TabIndex = 2;
-            this.linkLabel1.TabStop = true;
-            this.linkLabel1.Text = "http://dave.thehorners.com/";
-            this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
-            // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(12, 239);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(137, 13);
-            this.label2.TabIndex = 3;
-            this.label2.Text = "Written by: David A. Horner";
-            // 
-            // linkLabel2
-            // 
-            this.linkLabel2.AutoSize = true;
-            this.linkLabel2.LinkBehavior = System.Windows.Forms.LinkBehavior.AlwaysUnderline;
-            this.linkLabel2.Location = new System.Drawing.Point(205, 98);
-            this.linkLabel2.Name = "linkLabel2";
-            this.linkLabel2.Size = new System.Drawing.Size(114, 13);
-            this.linkLabel2.TabIndex = 4;
-            this.linkLabel2.TabStop = true;
-            this.linkLabel2.Text = "http://www.ossim.org/";
-            this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked);
-            // 
-            // status
-            // 
-            this.status.Location = new System.Drawing.Point(2, 113);
-            this.status.Multiline = true;
-            this.status.Name = "status";
-            this.status.ReadOnly = true;
-            this.status.ScrollBars = System.Windows.Forms.ScrollBars.Both;
-            this.status.Size = new System.Drawing.Size(520, 94);
-            this.status.TabIndex = 5;
-            // 
-            // label3
-            // 
-            this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(191, 85);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(143, 13);
-            this.label3.TabIndex = 6;
-            this.label3.Text = "Long live the OSSIM project!";
-            // 
-            // Form1
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(525, 261);
-            this.Controls.Add(this.label3);
-            this.Controls.Add(this.status);
-            this.Controls.Add(this.linkLabel2);
-            this.Controls.Add(this.label2);
-            this.Controls.Add(this.linkLabel1);
-            this.Controls.Add(this.label1);
-            this.Controls.Add(this.process);
-            this.Name = "Form1";
-            this.Text = "OSSIM Solution Maker";
-            this.Load += new System.EventHandler(this.Form1_Load);
-            this.ResumeLayout(false);
-            this.PerformLayout();
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.Button process;
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.LinkLabel linkLabel1;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.LinkLabel linkLabel2;
-        private System.Windows.Forms.TextBox status;
-        private System.Windows.Forms.Label label3;
-    }
-}
-
diff --git a/projects/vs/updatesolution/updatesolution/Form1.cs b/projects/vs/updatesolution/updatesolution/Form1.cs
deleted file mode 100644
index 6edb91b..0000000
--- a/projects/vs/updatesolution/updatesolution/Form1.cs
+++ /dev/null
@@ -1,671 +0,0 @@
-////////////////////////////////////////////////////////////
-// - UpdateSolution -
-// A tool for generating project and solution files from
-// the OSSIM source tree.
-//
-// Written By: David A. Horner (http://dave.thehorners.com)
-// License: LGPL
-// $Id: Form1.cs 10417 2007-02-02 15:02:32Z dburken $
-////////////////////////////////////////////////////////////
-
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.IO;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using System.Xml;
-using System.Collections;
-
-namespace updatesolution
-{
-    public partial class Form1 : Form
-    {
-        // maintains the list of extensions we are going to add to projects.
-        private ArrayList theExtList = new ArrayList();
-        // the applications we found in the tree.
-        private ArrayList theAppList = new ArrayList();
-        // break up ossim into its internal parts. (I don't like everything just jammed into the project file)
-        private Hashtable theOssimList = new Hashtable();
-        // the output directory to write all the solution and project files.
-        private string theDestDir = "..\\..\\..\\..\\";
-        // the top level of the ossim tree relative to our CWD
-        const string theTopLevel = "..\\..\\..\\..\\..\\..";
-        // the directory to recurse for applications.
-        private string theAppPath = theTopLevel+"\\src\\apps";
-        // the directory to recurse for OSSIM src.
-        private string theOssimSrcPath = theTopLevel+"\\src\\ossim";
-        // the directory to recurse for OSSIM inc.
-        private string theOssimIncPath = theTopLevel + "\\include\\ossim";
-        // the directory to recurse for OSSIM gdal plugin.
-        private string theOssimGdalPath = theTopLevel + "\\..\\ossim_plugins\\gdal";
-        // the directory to recurse for OSSIM PNG plugin.
-        private string theOssimPNGPath = theTopLevel + "\\..\\ossim_plugins\\png";
-        
-        // the application project template.
-        string theAppTemplate = "..\\..\\..\\templates\\appTemplate.vcproj";
-        // the plugin GDAL project template.
-        string thePluginGdalTemplate = "..\\..\\..\\templates\\pluginGdalTemplate.vcproj";
-        // the plugin PNG project template.
-        string thePluginPNGTemplate = "..\\..\\..\\templates\\pluginPNGTemplate.vcproj";
-        // the static project template.
-        string theStaticTemplate = "..\\..\\..\\templates\\staticTemplate.vcproj";
-        // the dll project template.
-        string theDllTemplate = "..\\..\\..\\templates\\dllTemplate.vcproj";
-        
-        // the OSSIM pref file.
-        string theOssimPref = "";
-        private ProjectInfo theOssimDLLPrj = null;
-        private ProjectInfo thePluginGdalPrj = null;
-        private ProjectInfo thePluginPNGPrj = null;
-
-
-        public Form1()
-        {
-            InitializeComponent();
-        }
-
-        // convert two absolute paths to a relative path with respect to mainDirPath
-        // code quickly copied from:
-        // http://www.snippetcenter.org/en/convert-absolute-to-relative-path-with-c-s1901.aspx
-        private static string EvaluateRelativePath(string mainDirPath, string absoluteFilePath)
-        {
-            string[] firstPathParts = mainDirPath.Trim(Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar);
-            string[] secondPathParts = absoluteFilePath.Trim(Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar);
-            int sameCounter = 0;
-            for (int i = 0; i < Math.Min(firstPathParts.Length, secondPathParts.Length); i++) { 
-                if (!firstPathParts[i].ToLower().Equals(secondPathParts[i].ToLower())) { break; }
-                sameCounter++;
-            } 
-            if (sameCounter == 0) { return absoluteFilePath; } 
-            string newPath = String.Empty; 
-            for (int i = sameCounter; i < firstPathParts.Length; i++) { 
-                if (i > sameCounter) { newPath += Path.DirectorySeparatorChar; } newPath += "..";
-            } 
-            if (newPath.Length == 0) { newPath = "."; }
-            for (int i = sameCounter; i < secondPathParts.Length; i++) {
-                newPath += Path.DirectorySeparatorChar; 
-                newPath += secondPathParts[i]; 
-            } 
-            return newPath; 
-        }
-
-        // write the hackish (I hate VS .sln format!) .sln format to disk.
-        // I'm not writing a full solution file out, just enough to get
-        // VS up and running.  VS will fill in the missing info automagically.
-        private void WriteSolutionFile(string path)
-        {
-            bool dep = true;
-            status.AppendText("Writing solution @ "+path + "\r\n");
-            FileStream Fs = new FileStream(path, FileMode.Create,
-                                              FileAccess.Write,
-                                              FileShare.ReadWrite);
-            // create a unicode writer (dos won't cut it)
-            TextWriter tw = new StreamWriter(Fs,Encoding.Unicode);
-
-            // write the header.
-            tw.WriteLine("");
-            tw.WriteLine("Microsoft Visual Studio Solution File, Format Version 9.00");
-            tw.WriteLine("# Visual Studio 2005");
-
-            // dependencies
-            tw.WriteLine("Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\")" +
-                         "= \""+theOssimDLLPrj.theName+"\", \""+theOssimDLLPrj.theProjPath+"\", " +
-                         "\"{"+theOssimDLLPrj.theGuid+"}\"");
-
-            /*tw.WriteLine("Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\")" +
-                         "= \"ossim_dll\", \".\\ossim_dll\\ossim_dll.vcproj\", " +
-                         "\"{0A1DFEA3-6E30-432C-AA02-313AF18E9188}\"");*/
-
-            // app folder for grouping the applications together.
-            tw.WriteLine("Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Apps\", \"Apps\", \"{04B4259A-9680-4155-910C-C63122938012}\"");
-
-            // ossim pref file
-            string prefRelPath = EvaluateRelativePath(theDestDir, theOssimPref);
-            tw.WriteLine("Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Solution Items\", \"Solution Items\", \"{2367DF4B-8C26-44FB-9BC9-994045D45C6F}\"");
-            tw.WriteLine("\tProjectSection(SolutionItems) = preProject");
-            tw.WriteLine("\t\t" + prefRelPath + " = " + prefRelPath);
-            tw.WriteLine("\tEndProjectSection");
-            tw.WriteLine("EndProject");
-
-            // Add each project to the solution and add the deps.
-            foreach (ProjectInfo app in theAppList)
-            {
-                tw.WriteLine("Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\")" +
-                             "= \"" + app.theName + "\", \"" + app.theProjPath + "\", " +
-                             "\"{" + app.theGuid + "}\"");
-                if (dep)
-                {
-                    tw.WriteLine("\tProjectSection(ProjectDependencies) = postProject");
-                    tw.WriteLine("\t\t{"+theOssimDLLPrj.theGuid+"} = {"+theOssimDLLPrj.theGuid+"}");
-//                    tw.WriteLine("\t\t{0A1DFEA3-6E30-432C-AA02-313AF18E9188} = {0A1DFEA3-6E30-432C-AA02-313AF18E9188}");
-                    tw.WriteLine("\tEndProjectSection");
-                }
-                tw.WriteLine("EndProject");
-            }
-            // the png plugin project file.
-            tw.WriteLine("Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\")" +
-                         "= \"" + thePluginPNGPrj.theName + "\", \"" + thePluginPNGPrj.theProjPath + "\", " +
-                         "\"{" + thePluginPNGPrj.theGuid + "}\"");
-            tw.WriteLine("\tProjectSection(ProjectDependencies) = postProject");
-            tw.WriteLine("\t\t{" + theOssimDLLPrj.theGuid + "} = {" + theOssimDLLPrj.theGuid + "}");
-            tw.WriteLine("\tEndProjectSection");
-            tw.WriteLine("EndProject");
-            // the gdal plugin project file.
-            tw.WriteLine("Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\")" +
-                         "= \"" + thePluginGdalPrj.theName + "\", \"" + thePluginGdalPrj.theProjPath + "\", " +
-                         "\"{" + thePluginGdalPrj.theGuid + "}\"");
-                tw.WriteLine("\tProjectSection(ProjectDependencies) = postProject");
-                tw.WriteLine("\t\t{"+theOssimDLLPrj.theGuid+"} = {"+theOssimDLLPrj.theGuid+"}");
-                tw.WriteLine("\tEndProjectSection");
-            tw.WriteLine("EndProject");
-            
-
-            tw.WriteLine("Global");
-            
-            // write the nesting GUIDs to that VS knows which ones to group under our apps folder.
-            tw.WriteLine("\tGlobalSection(NestedProjects) = preSolution");
-            foreach (ProjectInfo app in theAppList)
-            {
-                tw.WriteLine("\t\t{" + app.theGuid + "} = {04B4259A-9680-4155-910C-C63122938012}");
-            }
-            tw.WriteLine("\tEndGlobalSection");            
-            tw.WriteLine("EndGlobal");
-            // close the stream
-            tw.Close();
-            Fs.Close();
-            status.AppendText("Finished writing solution file." + "\r\n");
-        }
-
-        // Process an application by taking the project template and overriding the
-        // important GUIDs and names.  Then we add all the proper files in the file
-        // section of the project file.
-        private void GenerateApplicationProj(string appName,string pathDir)
-        {
-            // make sure we have absolute path.
-            pathDir = System.IO.Path.GetFullPath(pathDir);
-
-            string destDir = System.IO.Path.Combine(theDestDir,"apps\\" + appName);
-            string projPath = System.IO.Path.Combine(destDir,appName + ".vcproj");
-
-            Directory.CreateDirectory(destDir);
-            status.AppendText("Application: " + appName + " @ (" + pathDir + ")" + "\r\n");
-
-            ProjectInfo project = new ProjectInfo(appName,EvaluateRelativePath(theDestDir, projPath));
-            project.FindFiles(pathDir,theExtList);
-            theAppList.Add(project);
-            
-            // load the application project template for changes.
-            XmlDocument xDoc = new XmlDocument();
-            xDoc.Load(theAppTemplate);
-            XmlNodeList xmlProject = xDoc.GetElementsByTagName("VisualStudioProject");
-            if (xmlProject.Count>0)
-            {
-                // Name
-                XmlNode Name=xmlProject[0].Attributes.GetNamedItem("Name");
-                Name.Value = appName;
-                xmlProject[0].Attributes.SetNamedItem(Name);
-                // RootNamespace
-                XmlNode RootNamespace = xmlProject[0].Attributes.GetNamedItem("RootNamespace");
-                RootNamespace.Value = appName;
-                xmlProject[0].Attributes.SetNamedItem(RootNamespace);
-                // ProjectGUID
-                XmlNode ProjectGUID = xmlProject[0].Attributes.GetNamedItem("ProjectGUID");
-                ProjectGUID.Value = "{" + project.theGuid + "}";
-                xmlProject[0].Attributes.SetNamedItem(ProjectGUID);                
-            }
-            // Files
-            XmlNodeList xmlFiles = xDoc.GetElementsByTagName("Files");
-            if (xmlFiles.Count > 0)
-            {
-                foreach (FileSystemInfo entry in project.theFiles)
-                {
-                    string relPath = EvaluateRelativePath(destDir, entry.FullName);
-                    status.AppendText("+ " + entry.Name+"\r\n");
-                    XmlNode fileNode=xDoc.CreateElement("File");
-                    XmlAttribute relAttr=xDoc.CreateAttribute("RelativePath");
-                    relAttr.Value = relPath;
-                    fileNode.Attributes.Append(relAttr);
-                    xmlFiles[0].AppendChild(fileNode);
-                }
-            }
-
-            // save out the resulting XML, we're done! woot.
-            FileStream fsxml = new FileStream(projPath, FileMode.Create,
-                                              FileAccess.Write,
-                                              FileShare.ReadWrite);
-            xDoc.Save(fsxml);
-            fsxml.Close();
-        }
-
-        private void ProcessOssimStatic()
-        {
-            status.AppendText("**** Processing OSSIM Static ****" + "\r\n");
-            status.AppendText("**** OSSIM Static, code started but not finished. ****" + "\r\n");
-            return;
-            foreach (ProjectInfo prj in theOssimList.Values)
-            {
-                string destDir = System.IO.Path.Combine(theDestDir, "static"+Path.DirectorySeparatorChar+prj.theName);
-                string projPath = System.IO.Path.Combine(destDir, prj.theName + ".vcproj");
-                Directory.CreateDirectory(destDir);
-                //update the proj path with where we are putting it for solution file.
-                prj.theProjPath=EvaluateRelativePath(theDestDir, projPath);
-                // load the application project template for changes.
-                XmlDocument xDoc = new XmlDocument();
-                xDoc.Load(theStaticTemplate);
-                XmlNodeList xmlProject = xDoc.GetElementsByTagName("VisualStudioProject");
-                if (xmlProject.Count > 0)
-                {
-                    // Name
-                    XmlNode Name = xmlProject[0].Attributes.GetNamedItem("Name");
-                    Name.Value = prj.theName;
-                    xmlProject[0].Attributes.SetNamedItem(Name);
-                    // RootNamespace
-                    XmlNode RootNamespace = xmlProject[0].Attributes.GetNamedItem("RootNamespace");
-                    RootNamespace.Value = prj.theName;
-                    xmlProject[0].Attributes.SetNamedItem(RootNamespace);
-                    // ProjectGUID
-                    XmlNode ProjectGUID = xmlProject[0].Attributes.GetNamedItem("ProjectGUID");
-                    ProjectGUID.Value = "{" + prj.theGuid + "}";
-                    xmlProject[0].Attributes.SetNamedItem(ProjectGUID);
-                }
-                // Files
-                XmlNodeList xmlFiles = xDoc.GetElementsByTagName("Files");
-                if (xmlFiles.Count > 0)
-                {
-                    foreach (FileSystemInfo entry in prj.theFiles)
-                    {
-                        string relPath = EvaluateRelativePath(destDir, entry.FullName);
-                        status.AppendText("+ " + entry.Name + "\r\n");
-                        XmlNode fileNode = xDoc.CreateElement("File");
-                        XmlAttribute relAttr = xDoc.CreateAttribute("RelativePath");
-                        relAttr.Value = relPath;
-                        fileNode.Attributes.Append(relAttr);
-                        xmlFiles[0].AppendChild(fileNode);
-                    }
-                }
-                // save out the resulting XML, we're done! woot.
-                FileStream fsxml = new FileStream(projPath, FileMode.Create,
-                                                  FileAccess.Write,
-                                                  FileShare.ReadWrite);
-                xDoc.Save(fsxml);
-                fsxml.Close();
-            }
-            status.AppendText("**** Done Processing OSSIM Static ****" + "\r\n");
-        }
-
-        private void ProcessOssimPNGPlugin()
-        {
-            if (System.IO.Directory.Exists(theOssimPNGPath))
-            {
-                status.AppendText("- Processing OSSIM PNG Plugin" + "\r\n");
-                string name = "ossim_pngplugin";
-                string destDir = System.IO.Path.Combine(theDestDir, name);
-                string projPath = System.IO.Path.Combine(destDir, name + ".vcproj");
-                Directory.CreateDirectory(destDir);
-                thePluginPNGPrj = new ProjectInfo(name, EvaluateRelativePath(theDestDir, projPath));
-                thePluginPNGPrj.FindFiles(theOssimPNGPath, theExtList);
-
-                // load the application project template for changes.
-                XmlDocument xDoc = new XmlDocument();
-                xDoc.Load(thePluginPNGTemplate);
-                XmlNodeList xmlProject = xDoc.GetElementsByTagName("VisualStudioProject");
-                if (xmlProject.Count > 0)
-                {
-                    // Name
-                    XmlNode Name = xmlProject[0].Attributes.GetNamedItem("Name");
-                    Name.Value = thePluginPNGPrj.theName;
-                    xmlProject[0].Attributes.SetNamedItem(Name);
-                    // RootNamespace
-                    XmlNode RootNamespace = xmlProject[0].Attributes.GetNamedItem("RootNamespace");
-                    RootNamespace.Value = thePluginPNGPrj.theName;
-                    xmlProject[0].Attributes.SetNamedItem(RootNamespace);
-                    // ProjectGUID
-                    XmlNode ProjectGUID = xmlProject[0].Attributes.GetNamedItem("ProjectGUID");
-                    ProjectGUID.Value = "{" + thePluginPNGPrj.theGuid + "}";
-                    xmlProject[0].Attributes.SetNamedItem(ProjectGUID);
-                }
-                // Files
-                XmlNodeList xmlFiles = xDoc.GetElementsByTagName("Files");
-                if (xmlFiles.Count > 0)
-                {
-                    foreach (FileSystemInfo entry in thePluginPNGPrj.theFiles)
-                    {
-                        string relPath = EvaluateRelativePath(destDir, entry.FullName);
-                        status.AppendText("+ " + entry.Name + "\r\n");
-                        XmlNode fileNode = xDoc.CreateElement("File");
-                        XmlAttribute relAttr = xDoc.CreateAttribute("RelativePath");
-                        relAttr.Value = relPath;
-                        fileNode.Attributes.Append(relAttr);
-                        xmlFiles[0].AppendChild(fileNode);
-                    }
-                }
-
-                // save out the resulting XML, we're done! woot.
-                FileStream fsxml = new FileStream(projPath, FileMode.Create,
-                                                  FileAccess.Write,
-                                                  FileShare.ReadWrite);
-                xDoc.Save(fsxml);
-                fsxml.Close();
-            }
-            else
-            {
-                status.AppendText("- OSSIM PNG source not found, please check it out and try again." + "\r\n");
-            }
-            status.AppendText("- Done Processing OSSIM PNG Plugin" + "\r\n");
-        }
-
-        private void ProcessOssimGdalPlugin()
-        {
-            if (System.IO.Directory.Exists(theOssimGdalPath))
-            {
-                status.AppendText("- Processing OSSIM GDAL Plugin" + "\r\n");
-                string name = "ossim_gdalplugin";
-                string destDir = System.IO.Path.Combine(theDestDir, name);
-                string projPath = System.IO.Path.Combine(destDir, name+".vcproj");
-                Directory.CreateDirectory(destDir);
-                thePluginGdalPrj = new ProjectInfo(name, EvaluateRelativePath(theDestDir, projPath));
-                thePluginGdalPrj.FindFiles(theOssimGdalPath, theExtList);
-
-                // load the application project template for changes.
-                XmlDocument xDoc = new XmlDocument();
-                xDoc.Load(thePluginGdalTemplate);
-                XmlNodeList xmlProject = xDoc.GetElementsByTagName("VisualStudioProject");
-                if (xmlProject.Count > 0)
-                {
-                    // Name
-                    XmlNode Name = xmlProject[0].Attributes.GetNamedItem("Name");
-                    Name.Value = thePluginGdalPrj.theName;
-                    xmlProject[0].Attributes.SetNamedItem(Name);
-                    // RootNamespace
-                    XmlNode RootNamespace = xmlProject[0].Attributes.GetNamedItem("RootNamespace");
-                    RootNamespace.Value = thePluginGdalPrj.theName;
-                    xmlProject[0].Attributes.SetNamedItem(RootNamespace);
-                    // ProjectGUID
-                    XmlNode ProjectGUID = xmlProject[0].Attributes.GetNamedItem("ProjectGUID");
-                    ProjectGUID.Value = "{" + thePluginGdalPrj.theGuid + "}";
-                    xmlProject[0].Attributes.SetNamedItem(ProjectGUID);
-                }
-                // Files
-                XmlNodeList xmlFiles = xDoc.GetElementsByTagName("Files");
-                if (xmlFiles.Count > 0)
-                {
-                    foreach (FileSystemInfo entry in thePluginGdalPrj.theFiles)
-                    {
-                        string relPath = EvaluateRelativePath(destDir, entry.FullName);
-                        status.AppendText("+ " + entry.Name + "\r\n");
-                        XmlNode fileNode = xDoc.CreateElement("File");
-                        XmlAttribute relAttr = xDoc.CreateAttribute("RelativePath");
-                        relAttr.Value = relPath;
-                        fileNode.Attributes.Append(relAttr);
-                        xmlFiles[0].AppendChild(fileNode);
-                    }
-                }
-
-                // save out the resulting XML, we're done! woot.
-                FileStream fsxml = new FileStream(projPath, FileMode.Create,
-                                                  FileAccess.Write,
-                                                  FileShare.ReadWrite);
-                xDoc.Save(fsxml);
-                fsxml.Close();
-            }
-            else
-            {
-                status.AppendText("- OSSIM GDAL source not found, please check it out and try again." + "\r\n");
-            }
-            status.AppendText("- Done Processing OSSIM GDAL Plugin" + "\r\n");
-        }
-
-        private void ProcessOssimPlugins()
-        {
-            status.AppendText("**** Processing OSSIM Plugins ****" + "\r\n");
-            ProcessOssimGdalPlugin();
-            ProcessOssimPNGPlugin();
-            status.AppendText("**** Done Processing OSSIM Plugins ****" + "\r\n");
-        }
-        private void ProcessOssimDLL()
-        {
-            status.AppendText("**** Processing OSSIM DLL ****" + "\r\n");
-            string destDir = System.IO.Path.Combine(theDestDir, "ossim");
-            string projPath = System.IO.Path.Combine(destDir, "ossim.vcproj");
-            theOssimDLLPrj = new ProjectInfo("ossim", EvaluateRelativePath(theDestDir, projPath));
-
-            Directory.CreateDirectory(destDir);
-            status.AppendText("Writing ossim DLL project @ (" + projPath + ")" + "\r\n");
-
-
-            // load the application project template for changes.
-            XmlDocument xDoc = new XmlDocument();
-            xDoc.Load(theDllTemplate);
-            XmlNodeList xmlProject = xDoc.GetElementsByTagName("VisualStudioProject");
-            if (xmlProject.Count > 0)
-            {
-                // Name
-                XmlNode Name = xmlProject[0].Attributes.GetNamedItem("Name");
-                Name.Value = theOssimDLLPrj.theName;
-                xmlProject[0].Attributes.SetNamedItem(Name);
-                // RootNamespace
-                XmlNode RootNamespace = xmlProject[0].Attributes.GetNamedItem("RootNamespace");
-                RootNamespace.Value = theOssimDLLPrj.theName;
-                xmlProject[0].Attributes.SetNamedItem(RootNamespace);
-                // ProjectGUID
-                XmlNode ProjectGUID = xmlProject[0].Attributes.GetNamedItem("ProjectGUID");
-                ProjectGUID.Value = "{" + theOssimDLLPrj.theGuid + "}";
-                xmlProject[0].Attributes.SetNamedItem(ProjectGUID);
-            }
-            // Files
-            XmlNodeList xmlFiles = xDoc.GetElementsByTagName("Files");
-            if (xmlFiles.Count > 0)
-            {
-                foreach (ProjectInfo prj in theOssimList.Values) {
-
-                    XmlNode filterNode = xDoc.CreateElement("Filter");
-                    XmlAttribute nameAttr = xDoc.CreateAttribute("Name");
-                    nameAttr.Value = prj.theName;
-                    filterNode.Attributes.Append(nameAttr);
-                    foreach (FileSystemInfo entry in prj.theFiles)
-                    {   
-                        string relPath = EvaluateRelativePath(destDir, entry.FullName);
-                        status.AppendText("+ " + entry.Name + "\r\n");
-                        XmlNode fileNode = xDoc.CreateElement("File");
-                        XmlAttribute relAttr = xDoc.CreateAttribute("RelativePath");
-                        relAttr.Value = relPath;
-                        fileNode.Attributes.Append(relAttr);
-                        filterNode.AppendChild(fileNode);
-                    }
-                    xmlFiles[0].AppendChild(filterNode);
-                }
-            }
-
-            // save out the resulting XML, we're done! woot.
-            FileStream fsxml = new FileStream(projPath, FileMode.Create,
-                                              FileAccess.Write,
-                                              FileShare.ReadWrite);
-            xDoc.Save(fsxml);
-            fsxml.Close();
-            status.AppendText("**** Done Processing OSSIM DLL ****" + "\r\n");
-        }
-        
-        private void FindCoreOSSIMFiles()
-        {
-            theOssimList.Clear();
-            status.AppendText("**** Finding core OSSIM files ****" + "\r\n");
-            // Process the directory list for the core src of OSSIM
-            DirectoryInfo dir = new DirectoryInfo(theOssimSrcPath);
-            foreach (FileSystemInfo entry in dir.GetFileSystemInfos())
-            {
-                // make sure we are looking at a directory
-                if ((entry.Attributes & FileAttributes.Directory) > 0)
-                {
-                    // don't do anything to svn and CVS directories.
-                    if (entry.Name != ".svn" && entry.Name != "CVS")
-                    {
-                        // process the application folder.
-                        string tmpPath = System.IO.Path.Combine(theOssimSrcPath, entry.Name);
-                        ProjectInfo project = new ProjectInfo(entry.Name, "");
-                        // insert a new project representing this core element
-                        // if we already have it, just add the new files.
-                        if (!theOssimList.ContainsKey(project.theName))
-                        {
-                            project.FindFiles(tmpPath, theExtList);
-                            theOssimList.Add(project.theName,project);
-                        }
-                        else
-                        {
-                            ((ProjectInfo)theOssimList[project.theName]).FindFiles(tmpPath, theExtList);
-                            
-                        }
-                    }
-                }
-            }
-
-            // Process the directory list for the core inc of OSSIM
-            dir = new DirectoryInfo(theOssimIncPath);
-            foreach (FileSystemInfo entry in dir.GetFileSystemInfos())
-            {
-                // make sure we are looking at a directory
-                if ((entry.Attributes & FileAttributes.Directory) > 0)
-                {
-                    // don't do anything to svn and CVS directories.
-                    if (entry.Name != ".svn" && entry.Name != "CVS")
-                    {
-                        // process the application folder.
-                        string tmpPath = System.IO.Path.Combine(theOssimIncPath, entry.Name);
-                        ProjectInfo project = new ProjectInfo(entry.Name, "");
-
-                        // insert a new project representing this core element
-                        // if we already have it, just add the new files.
-                        if (!theOssimList.ContainsKey(project.theName))
-                        {
-                            project.FindFiles(tmpPath, theExtList);
-                            theOssimList.Add(project.theName, project);
-                        }
-                        else
-                        {
-                            ((ProjectInfo)theOssimList[project.theName]).FindFiles(tmpPath, theExtList);
-
-                        }
-
-                    }
-                }
-            }
-            // tell the user how many files we found
-            int total_files = 0;
-            foreach (ProjectInfo prj in theOssimList.Values)
-            {
-                total_files += prj.theFiles.Count;
-            }
-            status.AppendText("We found "+total_files+" files in the core." + "\r\n");
-            status.AppendText("**** Done finding core OSSIM files ****" + "\r\n");
-        }
-
-        private void ProcessApplications()
-        {
-            status.AppendText("**** Processing Applications ****" + "\r\n");
-            // Process the directory list for the applications
-            DirectoryInfo dir = new DirectoryInfo(theAppPath);
-            foreach (FileSystemInfo entry in dir.GetFileSystemInfos())
-            {
-                // make sure we are looking at a directory
-                if ((entry.Attributes & FileAttributes.Directory) > 0)
-                {
-                    // don't do anything to svn and CVS directories.
-                    if (entry.Name != ".svn" && entry.Name != "CVS")
-                    {
-                        // process the application folder.
-                        string tmpPath = System.IO.Path.Combine(theAppPath, entry.Name);
-                        GenerateApplicationProj(entry.Name, tmpPath);
-                    }
-                }
-            }
-            status.AppendText("**** Done Processing Applications ****" + "\r\n");
-        }
-
-        private void printenv()
-        {
-            status.AppendText("**** Information about env ****" + "\r\n");
-            status.AppendText("OSSIM_PREFS_FILE: " + theOssimPref + "\r\n");
-            status.AppendText("CWD: " + Directory.GetCurrentDirectory() + "\r\n");
-            status.AppendText("Destination Folder: " + theDestDir + "\r\n");
-            status.AppendText("Searching App Folder: " + theAppPath + "\r\n");
-            status.AppendText("**** Template Information ****" + "\r\n");
-            status.AppendText("* Edit the following templates (using a text editor) to change project variables *" + "\r\n");
-            status.AppendText("OSSIM App template: " + theAppTemplate + "\r\n");
-            status.AppendText("OSSIM DLL template: " + theDllTemplate + "\r\n");
-            status.AppendText("OSSIM Static template: " + theStaticTemplate + "\r\n");
-            if (System.IO.Directory.Exists(theOssimGdalPath))
-            {
-                status.AppendText("OSSIM GDAL Plugin template: " + thePluginGdalTemplate + "\r\n");
-            }
-            else
-            {
-                status.AppendText("OSSIM GDAL Plugin template: DOESN'T EXIST! - " + thePluginGdalTemplate + "\r\n");
-            }
-            
-        }
-
-        private void process_Click(object sender, EventArgs e)
-        {
-            // clear previous applications.
-            theAppList.Clear();
-            // clear previous status messages
-            status.Clear();
-
-            printenv();
-            FindCoreOSSIMFiles();
-            ProcessApplications();
-            ProcessOssimDLL();
-            ProcessOssimStatic();
-            ProcessOssimPlugins();
-            status.AppendText("**** Generating Solution File ****" + "\r\n");
-            WriteSolutionFile(System.IO.Path.Combine(theDestDir,"solution.sln"));
-            status.AppendText("**** Done! ****" + "\r\n");
-            status.AppendText("If you have any questions or concerns, contact me through my website's contact page. Thanks." + "\r\n");
-        }
-
-        private void Form1_Load(object sender, EventArgs e)
-        {
-            // make sure we have absolute paths for display
-            theOssimPref = System.IO.Path.GetFullPath(Environment.GetEnvironmentVariable("OSSIM_PREFS_FILE"));
-            // our search paths
-            theAppPath = System.IO.Path.GetFullPath(theAppPath);
-            theOssimSrcPath = System.IO.Path.GetFullPath(theOssimSrcPath);
-            // the directory to recurse for OSSIM inc.
-            theOssimIncPath = System.IO.Path.GetFullPath(theOssimIncPath);
-            // the directory to recurse for OSSIM gdal plugin.
-            theOssimGdalPath = System.IO.Path.GetFullPath(theOssimGdalPath);
-            // where are we writing our results?
-            theDestDir = System.IO.Path.GetFullPath(theDestDir);
-            // our templates to fill up with the good stuff.
-            theAppTemplate = System.IO.Path.GetFullPath(theAppTemplate);
-            thePluginGdalTemplate = System.IO.Path.GetFullPath(thePluginGdalTemplate);
-            theStaticTemplate = System.IO.Path.GetFullPath(theStaticTemplate);
-            theDllTemplate = System.IO.Path.GetFullPath(theDllTemplate);
-
-
-            // theExtList defines which files we add to the
-            // project files as we recurse through the tree.
-            theExtList.Add(".cpp");
-            theExtList.Add(".cc");
-            theExtList.Add(".cxx");
-            theExtList.Add(".c");
-            theExtList.Add(".h");
-            theExtList.Add(".hpp");
-            theExtList.Add(".hxx");
-
-            printenv();
-        }
-
-        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
-        {
-            System.Diagnostics.Process.Start(linkLabel1.Text);
-        }
-
-        private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
-        {
-            System.Diagnostics.Process.Start(linkLabel2.Text);
-        }
-    }
-}
\ No newline at end of file
diff --git a/projects/vs/updatesolution/updatesolution/Form1.resx b/projects/vs/updatesolution/updatesolution/Form1.resx
deleted file mode 100644
index 981db0d..0000000
--- a/projects/vs/updatesolution/updatesolution/Form1.resx
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <data name="label1.Text" xml:space="preserve">
-    <value>This program generates .vcproj files for each of the applications in the OSSIM tree.
-Files are generated from templates to allow for easy config. (inc paths,libs,etc)
-
-In the future this program may verify files within existing proj and sln files....
-But at this time, it overwrites any existing files. So be careful.
-</value>
-  </data>
-</root>
\ No newline at end of file
diff --git a/projects/vs/updatesolution/updatesolution/Program.cs b/projects/vs/updatesolution/updatesolution/Program.cs
deleted file mode 100644
index 5025038..0000000
--- a/projects/vs/updatesolution/updatesolution/Program.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-
-namespace updatesolution
-{
-    static class Program
-    {
-        /// <summary>
-        /// The main entry point for the application.
-        /// </summary>
-        [STAThread]
-        static void Main()
-        {
-            Application.EnableVisualStyles();
-            Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new Form1());
-        }
-    }
-}
\ No newline at end of file
diff --git a/projects/vs/updatesolution/updatesolution/ProjectInfo.cs b/projects/vs/updatesolution/updatesolution/ProjectInfo.cs
deleted file mode 100644
index 7eb95b2..0000000
--- a/projects/vs/updatesolution/updatesolution/ProjectInfo.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-////////////////////////////////////////////////////////////
-// - UpdateSolution -
-// A tool for generating project and solution files from
-// the OSSIM source tree.
-//
-// Written By: David A. Horner (http://dave.thehorners.com)
-// License: LGPL
-// $Id: ProjectInfo.cs 10417 2007-02-02 15:02:32Z dburken $
-////////////////////////////////////////////////////////////
-
-using System;
-using System.Collections;
-using System.Text;
-using System.Data;
-using System.IO;
-
-namespace updatesolution
-{
-    // this class is just a simple data holder for
-    // projects we find in the tree.
-    class ProjectInfo
-    {
-        public string theName = "";
-        public string theProjPath = "";
-        public string theGuid = "";
-        public ArrayList theFiles = new ArrayList();
-
-        public ProjectInfo(string appName, string path)
-        {
-            // set our members
-            this.theName = appName;
-            this.theGuid = System.Guid.NewGuid().ToString();
-            this.theProjPath = path;
-            this.theFiles.Clear();
-        }
-
-        public void FindFiles(string path, ArrayList extList)
-        {
-            // move through the directory and add all matching files
-            DirectoryInfo dir = new DirectoryInfo(path);
-            foreach (FileSystemInfo entry in dir.GetFileSystemInfos())
-            {
-                if (filterFile(entry.Extension, extList))
-                {
-                    theFiles.Add(entry);
-                }
-            }
-        }
-
-        // check the incoming extension matches one of the files we'd like to keep.
-        private bool filterFile(string strExtension, ArrayList extList)
-        {
-            for (int j = 0; j < extList.Count; j++)
-            {
-                if (extList[j].ToString() == strExtension)
-                {
-                    return true;
-                }
-            }
-            return false;
-        }
-
-    }
-}
diff --git a/projects/vs/updatesolution/updatesolution/Properties/AssemblyInfo.cs b/projects/vs/updatesolution/updatesolution/Properties/AssemblyInfo.cs
deleted file mode 100644
index 15a849f..0000000
--- a/projects/vs/updatesolution/updatesolution/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following 
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("updatesolution")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("updatesolution")]
-[assembly: AssemblyCopyright("Copyright ©  2007")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible 
-// to COM components.  If you need to access a type in this assembly from 
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("ac03b347-75f0-49de-bec1-3039a58561bf")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/projects/vs/updatesolution/updatesolution/Properties/Resources.Designer.cs b/projects/vs/updatesolution/updatesolution/Properties/Resources.Designer.cs
deleted file mode 100644
index a97b91e..0000000
--- a/projects/vs/updatesolution/updatesolution/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.42
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace updatesolution.Properties {
-    using System;
-    
-    
-    /// <summary>
-    ///   A strongly-typed resource class, for looking up localized strings, etc.
-    /// </summary>
-    // This class was auto-generated by the StronglyTypedResourceBuilder
-    // class via a tool like ResGen or Visual Studio.
-    // To add or remove a member, edit your .ResX file then rerun ResGen
-    // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources {
-        
-        private static global::System.Resources.ResourceManager resourceMan;
-        
-        private static global::System.Globalization.CultureInfo resourceCulture;
-        
-        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resources() {
-        }
-        
-        /// <summary>
-        ///   Returns the cached ResourceManager instance used by this class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager {
-            get {
-                if (object.ReferenceEquals(resourceMan, null)) {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("updatesolution.Properties.Resources", typeof(Resources).Assembly);
-                    resourceMan = temp;
-                }
-                return resourceMan;
-            }
-        }
-        
-        /// <summary>
-        ///   Overrides the current thread's CurrentUICulture property for all
-        ///   resource lookups using this strongly typed resource class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture {
-            get {
-                return resourceCulture;
-            }
-            set {
-                resourceCulture = value;
-            }
-        }
-    }
-}
diff --git a/projects/vs/updatesolution/updatesolution/Properties/Resources.resx b/projects/vs/updatesolution/updatesolution/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/projects/vs/updatesolution/updatesolution/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>
\ No newline at end of file
diff --git a/projects/vs/updatesolution/updatesolution/Properties/Settings.Designer.cs b/projects/vs/updatesolution/updatesolution/Properties/Settings.Designer.cs
deleted file mode 100644
index 3257166..0000000
--- a/projects/vs/updatesolution/updatesolution/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.42
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace updatesolution.Properties {
-    
-    
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
-    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-        
-        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-        
-        public static Settings Default {
-            get {
-                return defaultInstance;
-            }
-        }
-    }
-}
diff --git a/projects/vs/updatesolution/updatesolution/Properties/Settings.settings b/projects/vs/updatesolution/updatesolution/Properties/Settings.settings
deleted file mode 100644
index 3964565..0000000
--- a/projects/vs/updatesolution/updatesolution/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
-  <Profiles>
-    <Profile Name="(Default)" />
-  </Profiles>
-  <Settings />
-</SettingsFile>
diff --git a/projects/vs/updatesolution/updatesolution/updatesolution.csproj b/projects/vs/updatesolution/updatesolution/updatesolution.csproj
deleted file mode 100644
index 7ab1dc4..0000000
--- a/projects/vs/updatesolution/updatesolution/updatesolution.csproj
+++ /dev/null
@@ -1,98 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{FA63B3AF-21A0-4956-8A0A-CA1AEAC1B505}</ProjectGuid>
-    <OutputType>WinExe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>updatesolution</RootNamespace>
-    <AssemblyName>updatesolution</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Deployment" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Windows.Forms" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Form1.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="Form1.Designer.cs">
-      <DependentUpon>Form1.cs</DependentUpon>
-    </Compile>
-    <Compile Include="Program.cs" />
-    <Compile Include="ProjectInfo.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <EmbeddedResource Include="Form1.resx">
-      <SubType>Designer</SubType>
-      <DependentUpon>Form1.cs</DependentUpon>
-    </EmbeddedResource>
-    <EmbeddedResource Include="Properties\Resources.resx">
-      <Generator>ResXFileCodeGenerator</Generator>
-      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
-    <Compile Include="Properties\Resources.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DependentUpon>Resources.resx</DependentUpon>
-      <DesignTime>True</DesignTime>
-    </Compile>
-    <None Include="Properties\Settings.settings">
-      <Generator>SettingsSingleFileGenerator</Generator>
-      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
-    </None>
-    <Compile Include="Properties\Settings.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DependentUpon>Settings.settings</DependentUpon>
-      <DesignTimeSharedInput>True</DesignTimeSharedInput>
-    </Compile>
-  </ItemGroup>
-  <ItemGroup>
-    <COMReference Include="EnvDTE">
-      <Guid>{80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2}</Guid>
-      <VersionMajor>8</VersionMajor>
-      <VersionMinor>0</VersionMinor>
-      <Lcid>0</Lcid>
-      <WrapperTool>primary</WrapperTool>
-      <Isolated>False</Isolated>
-    </COMReference>
-    <COMReference Include="stdole">
-      <Guid>{00020430-0000-0000-C000-000000000046}</Guid>
-      <VersionMajor>2</VersionMajor>
-      <VersionMinor>0</VersionMinor>
-      <Lcid>0</Lcid>
-      <WrapperTool>primary</WrapperTool>
-      <Isolated>False</Isolated>
-    </COMReference>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>
\ No newline at end of file
diff --git a/projects/vs/updatesolution/updatesolution/updatesolution.sln b/projects/vs/updatesolution/updatesolution/updatesolution.sln
deleted file mode 100644
index 6953a2d..0000000
--- a/projects/vs/updatesolution/updatesolution/updatesolution.sln
+++ /dev/null
@@ -1,20 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "updatesolution", "updatesolution.csproj", "{FA63B3AF-21A0-4956-8A0A-CA1AEAC1B505}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Release|Any CPU = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{FA63B3AF-21A0-4956-8A0A-CA1AEAC1B505}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{FA63B3AF-21A0-4956-8A0A-CA1AEAC1B505}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{FA63B3AF-21A0-4956-8A0A-CA1AEAC1B505}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{FA63B3AF-21A0-4956-8A0A-CA1AEAC1B505}.Release|Any CPU.Build.0 = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/projects/vs/updatesolution/updatesolution/updatesolution.suo b/projects/vs/updatesolution/updatesolution/updatesolution.suo
deleted file mode 100644
index bf558fe..0000000
Binary files a/projects/vs/updatesolution/updatesolution/updatesolution.suo and /dev/null differ
diff --git a/share/ossim/ossim_state_plane_readme.txt b/share/ossim/ossim_state_plane_readme.txt
index 8168a9a..e173a0e 100644
--- a/share/ossim/ossim_state_plane_readme.txt
+++ b/share/ossim/ossim_state_plane_readme.txt
@@ -1,4 +1,4 @@
-// $Id$
+// $Id: ossim_state_plane_readme.txt 2644 2011-05-26 15:20:11Z oscar.kramer $
 
 This is a readme to document the state_plane.csv file keys.
 
diff --git a/share/ossim/ossim_state_plane_spcs.csv b/share/ossim/ossim_state_plane_spcs.csv
index 0f76a6e..0186269 100644
--- a/share/ossim/ossim_state_plane_spcs.csv
+++ b/share/ossim/ossim_state_plane_spcs.csv
@@ -1,253 +1,253 @@
-SPCS_EPSG_MAP
-spcs_name,pcs_code
-NAD27_SPAF_2102,26802
-NAD27_SPAF_2101,26801
-NAD27_SPAF_2103,26803
-NAD27_SPAF_0101,26729
-NAD27_SPAF_0102,26730
-NAD27_SPAF_5010,26740
-NAD27_SPAF_5002,26732
-NAD27_SPAF_5003,26733
-NAD27_SPAF_5004,26734
-NAD27_SPAF_5005,26735
-NAD27_SPAF_5006,26736
-NAD27_SPAF_5007,26737
-NAD27_SPAF_5008,26738
-NAD27_SPAF_5009,26739
-NAD27_SPAF_0202,26749
-NAD27_SPAF_0201,26748
-NAD27_SPAF_0203,26750
-NAD27_SPAF_0301,26751
-NAD27_SPAF_0302,26752
-NAD27_SPAF_0401,26741
-NAD27_SPAF_0402,26742
-NAD27_SPAF_0403,26743
-NAD27_SPAF_0404,26744
-NAD27_SPAF_0405,26745
-NAD27_SPAF_0406,26746
-NAD27_SPAF_0407,26747
-NAD27_SPAF_0502,26754
-NAD27_SPAF_0501,26753
-NAD27_SPAF_0503,26755
-NAD27_SPAF_0600,26756
-NAD27_SPAF_0700,26757
-NAD27_SPAF_0901,26758
-NAD27_SPAF_0902,26760
-NAD27_SPAF_0903,26759
-NAD27_SPAF_1001,26766
-NAD27_SPAF_1002,26767
-NAD27_SPAF_5101,26761
-NAD27_SPAF_5102,26762
-NAD27_SPAF_5103,26763
-NAD27_SPAF_5104,26764
-NAD27_SPAF_5105,26765
-NAD27_SPAF_1102,26769
-NAD27_SPAF_1101,26768
-NAD27_SPAF_1103,26770
-NAD27_SPAF_1201,26771
-NAD27_SPAF_1202,26772
-NAD27_SPAF_1301,26773
-NAD27_SPAF_1302,26774
-NAD27_SPAF_1401,26775
-NAD27_SPAF_1402,26776
-NAD27_SPAF_1501,26777
-NAD27_SPAF_1502,26778
-NAD27_SPAF_1601,26779
-NAD27_SPAF_1602,26780
-NAD27_SPAF_1701,26781
-NAD27_SPAF_1702,26782
-NAD27_SPAF_1801,26783
-NAD27_SPAF_1802,26784
-NAD27_SPAF_1900,26785
-NAD27_SPAF_2001,26786
-NAD27_SPAF_2002,26787
-NAD27_SPAF_2112,26789
-NAD27_SPAF_2111,26788
-NAD27_SPAF_2113,26790
-NAD27_SPAF_2202,26792
-NAD27_SPAF_2201,26791
-NAD27_SPAF_2203,26793
-NAD27_SPAF_2301,26794
-NAD27_SPAF_2302,26795
-NAD27_SPAF_2402,26797
-NAD27_SPAF_2401,26796
-NAD27_SPAF_2403,26798
-NAD27_SPAF_2502,32002
-NAD27_SPAF_2501,32001
-NAD27_SPAF_2503,32003
-NAD27_SPAF_2601,32005
-NAD27_SPAF_2602,32006
-NAD27_SPAF_2702,32008
-NAD27_SPAF_2701,32007
-NAD27_SPAF_2703,32009
-NAD27_SPAF_2800,32010
-NAD27_SPAF_2900,32011
-NAD27_SPAF_3002,32013
-NAD27_SPAF_3001,32012
-NAD27_SPAF_3003,32014
-NAD27_SPAF_3102,32016
-NAD27_SPAF_3101,32015
-NAD27_SPAF_3104,32018
-NAD27_SPAF_3103,32017
-NAD27_SPAF_3200,32019
-NAD27_SPAF_3301,32020
-NAD27_SPAF_3302,32021
-NAD27_SPAF_3401,32022
-NAD27_SPAF_3402,32023
-NAD27_SPAF_3501,32024
-NAD27_SPAF_3502,32025
-NAD27_SPAF_3601,32026
-NAD27_SPAF_3602,32027
-NAD27_SPAF_3701,32028
-NAD27_SPAF_3702,32029
-NAD27_SPAF_5201,32059
-NAD27_SPAF_3800,32030
-NAD27_SPAF_3901,32031
-NAD27_SPAF_3902,32033
-NAD27_SPAF_4001,32034
-NAD27_SPAF_4002,32035
-NAD27_SPAF_5202,32060
-NAD27_SPAF_4100,32036
-NAD27_SPAF_4203,32039
-NAD27_SPAF_4201,32037
-NAD27_SPAF_4202,32038
-NAD27_SPAF_4205,32041
-NAD27_SPAF_4204,32040
-NAD27_SPAF_4302,32043
-NAD27_SPAF_4301,32042
-NAD27_SPAF_4303,32044
-NAD27_SPAF_4400,32045
-NAD27_SPAF_4501,32046
-NAD27_SPAF_4502,32047
-NAD27_SPAF_4601,32048
-NAD27_SPAF_4602,32049
-NAD27_SPAF_4701,32050
-NAD27_SPAF_4702,32051
-NAD27_SPAF_4802,32053
-NAD27_SPAF_4801,32052
-NAD27_SPAF_4803,32054
-NAD27_SPAF_4902,32056
-NAD27_SPAF_4901,32055
-NAD27_SPAF_4903,32057
-NAD27_SPAF_4904,32058
-NAD83_SPCS_0101,26929
-NAD83_SPCS_0102,26930
-NAD83_SPCS_5010,26940
-NAD83_SPCS_5002,26932
-NAD83_SPCS_5003,26933
-NAD83_SPCS_5004,26934
-NAD83_SPCS_5005,26935
-NAD83_SPCS_5006,26936
-NAD83_SPCS_5007,26937
-NAD83_SPCS_5008,26938
-NAD83_SPCS_5009,26939
-NAD83_SPCS_0202,26949
-NAD83_SPCS_0201,26948
-NAD83_SPCS_0203,26950
-NAD83_SPCS_0301,26951
-NAD83_SPCS_0302,26952
-NAD83_SPCS_0401,26941
-NAD83_SPCS_0402,26942
-NAD83_SPCS_0403,26943
-NAD83_SPCS_0404,26944
-NAD83_SPCS_0405,26945
-NAD83_SPCS_0406,26946
-NAD83_SPCS_0407,26954
-NAD83_SPCS_0502,26953
-NAD83_SPCS_0501,26955
-NAD83_SPCS_0503,26956
-NAD83_SPCS_0600,26957
-NAD83_SPCS_0700,26958
-NAD83_SPCS_0901,26960
-NAD83_SPCS_0902,26959
-NAD83_SPCS_0903,26966
-NAD83_SPCS_1001,26967
-NAD83_SPCS_1002,26961
-NAD83_SPCS_5101,26962
-NAD83_SPCS_5102,26963
-NAD83_SPCS_5103,26964
-NAD83_SPCS_5104,26965
-NAD83_SPCS_5105,26969
-NAD83_SPCS_1102,26968
-NAD83_SPCS_1101,26970
-NAD83_SPCS_1103,26971
-NAD83_SPCS_1201,26972
-NAD83_SPCS_1202,26973
-NAD83_SPCS_1301,26974
-NAD83_SPCS_1302,26975
-NAD83_SPCS_1401,26976
-NAD83_SPCS_1402,26977
-NAD83_SPCS_1501,26978
-NAD83_SPCS_1502,26979
-NAD83_SPCS_1601,26980
-NAD83_SPCS_1602,26981
-NAD83_SPCS_1701,26982
-NAD83_SPCS_1702,26983
-NAD83_SPCS_1801,26984
-NAD83_SPCS_1802,26985
-NAD83_SPCS_1900,26986
-NAD83_SPCS_2001,26987
-NAD83_SPCS_2002,26989
-NAD83_SPCS_2112,26988
-NAD83_SPCS_2111,26990
-NAD83_SPCS_2113,26992
-NAD83_SPCS_2202,26991
-NAD83_SPCS_2201,26993
-NAD83_SPCS_2203,26994
-NAD83_SPCS_2301,26995
-NAD83_SPCS_2302,26997
-NAD83_SPCS_2402,26996
-NAD83_SPCS_2401,26998
-NAD83_SPCS_2403,32100
-NAD83_SPCS_2601,32104
-NAD83_SPCS_2702,32108
-NAD83_SPCS_2701,32107
-NAD83_SPCS_2703,32109
-NAD83_SPCS_2800,32110
-NAD83_SPCS_2900,32111
-NAD83_SPCS_3002,32113
-NAD83_SPCS_3001,32112
-NAD83_SPCS_3003,32114
-NAD83_SPCS_3102,32116
-NAD83_SPCS_3101,32115
-NAD83_SPCS_3104,32118
-NAD83_SPCS_3103,32117
-NAD83_SPCS_3200,32119
-NAD83_SPCS_3301,32120
-NAD83_SPCS_3302,32121
-NAD83_SPCS_3401,32122
-NAD83_SPCS_3402,32123
-NAD83_SPCS_3501,32124
-NAD83_SPCS_3502,32125
-NAD83_SPCS_3601,32126
-NAD83_SPCS_3602,32127
-NAD83_SPCS_3701,32128
-NAD83_SPCS_3702,32129
-NAD83_SPCS_5201,32161
-NAD83_SPCS_3800,32130
-NAD83_SPCS_3901,32133
-NAD83_SPCS_4001,32134
-NAD83_SPCS_4002,32135
-NAD83_SPCS_4100,32136
-NAD83_SPCS_4203,32139
-NAD83_SPCS_4201,32137
-NAD83_SPCS_4202,32138
-NAD83_SPCS_4205,32141
-NAD83_SPCS_4204,32140
-NAD83_SPCS_4302,32143
-NAD83_SPCS_4301,32142
-NAD83_SPCS_4303,32144
-NAD83_SPCS_4400,32145
-NAD83_SPCS_4501,32146
-NAD83_SPCS_4502,32147
-NAD83_SPCS_4601,32148
-NAD83_SPCS_4602,32149
-NAD83_SPCS_4701,32150
-NAD83_SPCS_4702,32151
-NAD83_SPCS_4802,32153
-NAD83_SPCS_4801,32152
-NAD83_SPCS_4803,32154
-NAD83_SPCS_4902,32156
-NAD83_SPCS_4901,32155
-NAD83_SPCS_4903,32157
-NAD83_SPCS_4904,32158
+SPCS_EPSG_MAP
+spcs_name,pcs_code
+NAD27_SPAF_2102,26802
+NAD27_SPAF_2101,26801
+NAD27_SPAF_2103,26803
+NAD27_SPAF_0101,26729
+NAD27_SPAF_0102,26730
+NAD27_SPAF_5010,26740
+NAD27_SPAF_5002,26732
+NAD27_SPAF_5003,26733
+NAD27_SPAF_5004,26734
+NAD27_SPAF_5005,26735
+NAD27_SPAF_5006,26736
+NAD27_SPAF_5007,26737
+NAD27_SPAF_5008,26738
+NAD27_SPAF_5009,26739
+NAD27_SPAF_0202,26749
+NAD27_SPAF_0201,26748
+NAD27_SPAF_0203,26750
+NAD27_SPAF_0301,26751
+NAD27_SPAF_0302,26752
+NAD27_SPAF_0401,26741
+NAD27_SPAF_0402,26742
+NAD27_SPAF_0403,26743
+NAD27_SPAF_0404,26744
+NAD27_SPAF_0405,26745
+NAD27_SPAF_0406,26746
+NAD27_SPAF_0407,26747
+NAD27_SPAF_0502,26754
+NAD27_SPAF_0501,26753
+NAD27_SPAF_0503,26755
+NAD27_SPAF_0600,26756
+NAD27_SPAF_0700,26757
+NAD27_SPAF_0901,26758
+NAD27_SPAF_0902,26760
+NAD27_SPAF_0903,26759
+NAD27_SPAF_1001,26766
+NAD27_SPAF_1002,26767
+NAD27_SPAF_5101,26761
+NAD27_SPAF_5102,26762
+NAD27_SPAF_5103,26763
+NAD27_SPAF_5104,26764
+NAD27_SPAF_5105,26765
+NAD27_SPAF_1102,26769
+NAD27_SPAF_1101,26768
+NAD27_SPAF_1103,26770
+NAD27_SPAF_1201,26771
+NAD27_SPAF_1202,26772
+NAD27_SPAF_1301,26773
+NAD27_SPAF_1302,26774
+NAD27_SPAF_1401,26775
+NAD27_SPAF_1402,26776
+NAD27_SPAF_1501,26777
+NAD27_SPAF_1502,26778
+NAD27_SPAF_1601,26779
+NAD27_SPAF_1602,26780
+NAD27_SPAF_1701,26781
+NAD27_SPAF_1702,26782
+NAD27_SPAF_1801,26783
+NAD27_SPAF_1802,26784
+NAD27_SPAF_1900,26785
+NAD27_SPAF_2001,26786
+NAD27_SPAF_2002,26787
+NAD27_SPAF_2112,26789
+NAD27_SPAF_2111,26788
+NAD27_SPAF_2113,26790
+NAD27_SPAF_2202,26792
+NAD27_SPAF_2201,26791
+NAD27_SPAF_2203,26793
+NAD27_SPAF_2301,26794
+NAD27_SPAF_2302,26795
+NAD27_SPAF_2402,26797
+NAD27_SPAF_2401,26796
+NAD27_SPAF_2403,26798
+NAD27_SPAF_2502,32002
+NAD27_SPAF_2501,32001
+NAD27_SPAF_2503,32003
+NAD27_SPAF_2601,32005
+NAD27_SPAF_2602,32006
+NAD27_SPAF_2702,32008
+NAD27_SPAF_2701,32007
+NAD27_SPAF_2703,32009
+NAD27_SPAF_2800,32010
+NAD27_SPAF_2900,32011
+NAD27_SPAF_3002,32013
+NAD27_SPAF_3001,32012
+NAD27_SPAF_3003,32014
+NAD27_SPAF_3102,32016
+NAD27_SPAF_3101,32015
+NAD27_SPAF_3104,32018
+NAD27_SPAF_3103,32017
+NAD27_SPAF_3200,32019
+NAD27_SPAF_3301,32020
+NAD27_SPAF_3302,32021
+NAD27_SPAF_3401,32022
+NAD27_SPAF_3402,32023
+NAD27_SPAF_3501,32024
+NAD27_SPAF_3502,32025
+NAD27_SPAF_3601,32026
+NAD27_SPAF_3602,32027
+NAD27_SPAF_3701,32028
+NAD27_SPAF_3702,32029
+NAD27_SPAF_5201,32059
+NAD27_SPAF_3800,32030
+NAD27_SPAF_3901,32031
+NAD27_SPAF_3902,32033
+NAD27_SPAF_4001,32034
+NAD27_SPAF_4002,32035
+NAD27_SPAF_5202,32060
+NAD27_SPAF_4100,32036
+NAD27_SPAF_4203,32039
+NAD27_SPAF_4201,32037
+NAD27_SPAF_4202,32038
+NAD27_SPAF_4205,32041
+NAD27_SPAF_4204,32040
+NAD27_SPAF_4302,32043
+NAD27_SPAF_4301,32042
+NAD27_SPAF_4303,32044
+NAD27_SPAF_4400,32045
+NAD27_SPAF_4501,32046
+NAD27_SPAF_4502,32047
+NAD27_SPAF_4601,32048
+NAD27_SPAF_4602,32049
+NAD27_SPAF_4701,32050
+NAD27_SPAF_4702,32051
+NAD27_SPAF_4802,32053
+NAD27_SPAF_4801,32052
+NAD27_SPAF_4803,32054
+NAD27_SPAF_4902,32056
+NAD27_SPAF_4901,32055
+NAD27_SPAF_4903,32057
+NAD27_SPAF_4904,32058
+NAD83_SPCS_0101,26929
+NAD83_SPCS_0102,26930
+NAD83_SPCS_5010,26940
+NAD83_SPCS_5002,26932
+NAD83_SPCS_5003,26933
+NAD83_SPCS_5004,26934
+NAD83_SPCS_5005,26935
+NAD83_SPCS_5006,26936
+NAD83_SPCS_5007,26937
+NAD83_SPCS_5008,26938
+NAD83_SPCS_5009,26939
+NAD83_SPCS_0202,26949
+NAD83_SPCS_0201,26948
+NAD83_SPCS_0203,26950
+NAD83_SPCS_0301,26951
+NAD83_SPCS_0302,26952
+NAD83_SPCS_0401,26941
+NAD83_SPCS_0402,26942
+NAD83_SPCS_0403,26943
+NAD83_SPCS_0404,26944
+NAD83_SPCS_0405,26945
+NAD83_SPCS_0406,26946
+NAD83_SPCS_0407,26954
+NAD83_SPCS_0502,26953
+NAD83_SPCS_0501,26955
+NAD83_SPCS_0503,26956
+NAD83_SPCS_0600,26957
+NAD83_SPCS_0700,26958
+NAD83_SPCS_0901,26960
+NAD83_SPCS_0902,26959
+NAD83_SPCS_0903,26966
+NAD83_SPCS_1001,26967
+NAD83_SPCS_1002,26961
+NAD83_SPCS_5101,26962
+NAD83_SPCS_5102,26963
+NAD83_SPCS_5103,26964
+NAD83_SPCS_5104,26965
+NAD83_SPCS_5105,26969
+NAD83_SPCS_1102,26968
+NAD83_SPCS_1101,26970
+NAD83_SPCS_1103,26971
+NAD83_SPCS_1201,26972
+NAD83_SPCS_1202,26973
+NAD83_SPCS_1301,26974
+NAD83_SPCS_1302,26975
+NAD83_SPCS_1401,26976
+NAD83_SPCS_1402,26977
+NAD83_SPCS_1501,26978
+NAD83_SPCS_1502,26979
+NAD83_SPCS_1601,26980
+NAD83_SPCS_1602,26981
+NAD83_SPCS_1701,26982
+NAD83_SPCS_1702,26983
+NAD83_SPCS_1801,26984
+NAD83_SPCS_1802,26985
+NAD83_SPCS_1900,26986
+NAD83_SPCS_2001,26987
+NAD83_SPCS_2002,26989
+NAD83_SPCS_2112,26988
+NAD83_SPCS_2111,26990
+NAD83_SPCS_2113,26992
+NAD83_SPCS_2202,26991
+NAD83_SPCS_2201,26993
+NAD83_SPCS_2203,26994
+NAD83_SPCS_2301,26995
+NAD83_SPCS_2302,26997
+NAD83_SPCS_2402,26996
+NAD83_SPCS_2401,26998
+NAD83_SPCS_2403,32100
+NAD83_SPCS_2601,32104
+NAD83_SPCS_2702,32108
+NAD83_SPCS_2701,32107
+NAD83_SPCS_2703,32109
+NAD83_SPCS_2800,32110
+NAD83_SPCS_2900,32111
+NAD83_SPCS_3002,32113
+NAD83_SPCS_3001,32112
+NAD83_SPCS_3003,32114
+NAD83_SPCS_3102,32116
+NAD83_SPCS_3101,32115
+NAD83_SPCS_3104,32118
+NAD83_SPCS_3103,32117
+NAD83_SPCS_3200,32119
+NAD83_SPCS_3301,32120
+NAD83_SPCS_3302,32121
+NAD83_SPCS_3401,32122
+NAD83_SPCS_3402,32123
+NAD83_SPCS_3501,32124
+NAD83_SPCS_3502,32125
+NAD83_SPCS_3601,32126
+NAD83_SPCS_3602,32127
+NAD83_SPCS_3701,32128
+NAD83_SPCS_3702,32129
+NAD83_SPCS_5201,32161
+NAD83_SPCS_3800,32130
+NAD83_SPCS_3901,32133
+NAD83_SPCS_4001,32134
+NAD83_SPCS_4002,32135
+NAD83_SPCS_4100,32136
+NAD83_SPCS_4203,32139
+NAD83_SPCS_4201,32137
+NAD83_SPCS_4202,32138
+NAD83_SPCS_4205,32141
+NAD83_SPCS_4204,32140
+NAD83_SPCS_4302,32143
+NAD83_SPCS_4301,32142
+NAD83_SPCS_4303,32144
+NAD83_SPCS_4400,32145
+NAD83_SPCS_4501,32146
+NAD83_SPCS_4502,32147
+NAD83_SPCS_4601,32148
+NAD83_SPCS_4602,32149
+NAD83_SPCS_4701,32150
+NAD83_SPCS_4702,32151
+NAD83_SPCS_4802,32153
+NAD83_SPCS_4801,32152
+NAD83_SPCS_4803,32154
+NAD83_SPCS_4902,32156
+NAD83_SPCS_4901,32155
+NAD83_SPCS_4903,32157
+NAD83_SPCS_4904,32158
diff --git a/share/ossim/ossim_wkt_pcs.csv b/share/ossim/ossim_wkt_pcs.csv
index 7a56ea2..c2e6679 100644
--- a/share/ossim/ossim_wkt_pcs.csv
+++ b/share/ossim/ossim_wkt_pcs.csv
@@ -1,3175 +1,3175 @@
-WKT_PCS
-COORD_REF_SYS_CODE,COORD_REF_SYS_NAME,FALSE_EASTING,FALSE_NORTHING,PARAMETER_VALUE_1,PARAMETER_VALUE_2,PARAMETER_VALUE_3,PARAMETER_VALUE_4,UNIT
-2000,Anguilla_1957_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
-2001,Antigua_1943_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
-2002,Dominica_1945_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
-2003,Grenada_1953_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
-2004,Montserrat_1958_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
-2005,St_Kitts_1955_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
-2006,St_Lucia_1955_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
-2007,St_Vincent_1945_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
-2008,NAD_1927_CGQ77_MTM_2_SCoPQ,304800,0,-55.5,0.9999, ,0,Meter
-2009,NAD_1927_CGQ77_MTM_3_SCoPQ,304800,0,-58.5,0.9999, ,0,Meter
-2010,NAD_1927_CGQ77_MTM_4_SCoPQ,304800,0,-61.5,0.9999, ,0,Meter
-2011,NAD_1927_CGQ77_MTM_5_SCoPQ,304800,0,-64.5,0.9999, ,0,Meter
-2012,NAD_1927_CGQ77_MTM_6_SCoPQ,304800,0,-67.5,0.9999, ,0,Meter
-2013,NAD_1927_CGQ77_MTM_7_SCoPQ,304800,0,-70.5,0.9999, ,0,Meter
-2014,NAD_1927_CGQ77_MTM_8_SCoPQ,304800,0,-73.5,0.9999, ,0,Meter
-2015,NAD_1927_CGQ77_MTM_9_SCoPQ,304800,0,-76.5,0.9999, ,0,Meter
-2016,NAD_1927_CGQ77_MTM_10_SCoPQ,304800,0,-79.5,0.9999, ,0,Meter
-2017,NAD_1927_DEF_1976_MTM_8,304800,0,-73.5,0.9999, ,0,Meter
-2018,NAD_1927_DEF_1976_MTM_9,304800,0,-76.5,0.9999, ,0,Meter
-2019,NAD_1927_DEF_1976_MTM_10,304800,0,-79.5,0.9999, ,0,Meter
-2020,NAD_1927_DEF_1976_MTM_11,304800,0,-82.5,0.9999, ,0,Meter
-2021,NAD_1927_DEF_1976_MTM_12,304800,0,-81,0.9999, ,0,Meter
-2022,NAD_1927_DEF_1976_MTM_13,304800,0,-84,0.9999, ,0,Meter
-2023,NAD_1927_DEF_1976_MTM_14,304800,0,-87,0.9999, ,0,Meter
-2024,NAD_1927_DEF_1976_MTM_15,304800,0,-90,0.9999, ,0,Meter
-2025,NAD_1927_DEF_1976_MTM_16,304800,0,-93,0.9999, ,0,Meter
-2026,NAD_1927_DEF_1976_MTM_17,304800,0,-96,0.9999, ,0,Meter
-2027,NAD_1927_DEF_1976_UTM_Zone_15N,500000,0,-93,0.9996, ,0,Meter
-2028,NAD_1927_DEF_1976_UTM_Zone_16N,500000,0,-87,0.9996, ,0,Meter
-2029,NAD_1927_DEF_1976_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
-2030,NAD_1927_DEF_1976_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-2031,NAD_1927_CGQ77_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
-2032,NAD_1927_CGQ77_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-2033,NAD_1927_CGQ77_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
-2034,NAD_1927_CGQ77_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-2035,NAD_1927_CGQ77_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-2036,NAD_1983_CSRS98_New_Brunswick_Stereographic,2500000,7500000,-66.5,0.999912, ,46.5,Meter
-2037,NAD_1983_CSRS98_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
-2038,NAD_1983_CSRS98_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-2039,Israel_TM_Grid,219529.584,626907.39,35.20451694,1.0000067, ,31.73439361,Meter
-2040,Locodjo_1965_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
-2041,Abidjan_1987_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
-2042,Locodjo_1965_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
-2043,Abidjan_1987_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
-2044,Hanoi_1972_GK_Zone_18,18500000,0,105,1, ,0,Meter
-2045,Hanoi_1972_GK_Zone_19,19500000,0,111,1, ,0,Meter
-2056,CH1903+_LV95,2600000,1200000,1,90,7.439583333,46.95240556,Meter
-2057,Rassadiran_Nakhl_e_Taqi,658377.437,3044969.194,0.999895934,0.571661194,52.60353917,27.56882881,Meter
-2058,ED_1950_ED77_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
-2059,ED_1950_ED77_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
-2060,ED_1950_ED77_UTM_Zone_40N,500000,0,57,0.9996, ,0,Meter
-2061,ED_1950_ED77_UTM_Zone_41N,500000,0,63,0.9996, ,0,Meter
-2062,Madrid_1870_Madrid_Spain,600000,600000,0,40,0.998808529,40,Meter
-2063,Dabola_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-2064,Dabola_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
-2066,Mount_Dillon_Tobago_Grid,187500,180000,-60.68600889,1, ,11.25217861,Link_Clarke
-2067,Naparima_1955_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-2068,ELD_1979_Libya_5,200000,0,9,0.9999, ,0,Meter
-2069,ELD_1979_Libya_6,200000,0,11,0.9999, ,0,Meter
-2070,ELD_1979_Libya_7,200000,0,13,0.9999, ,0,Meter
-2071,ELD_1979_Libya_8,200000,0,15,0.9999, ,0,Meter
-2072,ELD_1979_Libya_9,200000,0,17,0.9999, ,0,Meter
-2073,ELD_1979_Libya_10,200000,0,19,0.9999, ,0,Meter
-2074,ELD_1979_Libya_11,200000,0,21,0.9999, ,0,Meter
-2075,ELD_1979_Libya_12,200000,0,23,0.9999, ,0,Meter
-2076,ELD_1979_Libya_13,200000,0,25,0.9999, ,0,Meter
-2077,ELD_1979_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
-2078,ELD_1979_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
-2079,ELD_1979_UTM_Zone_34N,500000,0,21,0.9996, ,0,Meter
-2080,ELD_1979_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
-2081,Chos_Malal_1914_Argentina_2,2500000,0,-69,1, ,-90,Meter
-2082,Pampa_del_Castillo_Argentina_2,2500000,0,-69,1, ,-90,Meter
-2083,Hito_XVIII_1963_Argentina_2,2500000,0,-69,1, ,-90,Meter
-2084,Hito_XVIII_1963_UTM_19S,500000,10000000,-69,0.9996, ,0,Meter
-2085,NAD_1927_Cuba_Norte,500000,280296.016,-81,22.35,0.99993602,22.35,Meter
-2086,NAD_1927_Cuba_Sur,500000,229126.939,-76.83333333,20.71666667,0.99994848,20.71666667,Meter
-2087,ELD_1979_TM_12_NE,500000,0,12,0.9996, ,0,Meter
-2088,Carthage_TM_11_NE,500000,0,11,0.9996, ,0,Meter
-2089,Yemen_NGN_1996_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
-2090,Yemen_NGN_1996_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
-2091,South_Yemen_GK_Zone_8,8500000,0,45,1, ,0,Meter
-2092,South_Yemen_GK_Zone_9,9500000,0,51,1, ,0,Meter
-2093,Hanoi_1972_GK_106_NE,500000,0,106,1, ,0,Meter
-2094,WGS_1972_BE_TM_106_NE,500000,0,106,0.9996, ,0,Meter
-2095,Bissau_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-2096,Korean_1985_Korea_East_Belt,200000,500000,129,1, ,38,Meter
-2097,Korean_1985_Korea_Central_Belt,200000,500000,127,1, ,38,Meter
-2098,Korean_1985_Korea_West_Belt,200000,500000,125,1, ,38,Meter
-2099,Qatar_1948_Qatar_Grid,100000,100000,50.76138889,1, ,25.38236111,Meter
-2100,Greek_Grid,500000,0,24,0.9996, ,0,Meter
-2101,Lake_Maracaibo_Grid_M1,0,-52684.972,-71.60561778,10.16666667,1,10.16666667,Meter
-2102,Lake_Maracaibo_Grid,200000,147315.028,-71.60561778,10.16666667,1,10.16666667,Meter
-2103,Lake_Maracaibo_Grid_M3,500000,447315.028,-71.60561778,10.16666667,1,10.16666667,Meter
-2104,Lake_Maracaibo_La_Rosa_Grid,-17044,-23139.97,-71.60561778,10.16666667,1,10.16666667,Meter
-2105,NZGD_2000_Mount_Eden_Circuit,400000,800000,174.7641667,0.9999, ,-36.87972222,Meter
-2106,NZGD_2000_Bay_of_Plenty_Circuit,400000,800000,176.4661111,1, ,-37.76111111,Meter
-2107,NZGD_2000_Poverty_Bay_Circuit,400000,800000,177.8855556,1, ,-38.62444444,Meter
-2108,NZGD_2000_Hawkes_Bay_Circuit,400000,800000,176.6736111,1, ,-39.65083333,Meter
-2109,NZGD_2000_Taranaki_Circuit,400000,800000,174.2277778,1, ,-39.13555556,Meter
-2110,NZGD_2000_Tuhirangi_Circuit,400000,800000,175.64,1, ,-39.51222222,Meter
-2111,NZGD_2000_Wanganui_Circuit,400000,800000,175.4880556,1, ,-40.24194444,Meter
-2112,NZGD_2000_Wairarapa_Circuit,400000,800000,175.6472222,1, ,-40.92527778,Meter
-2113,NZGD_2000_Wellington_Circuit,400000,800000,174.7763889,1, ,-41.30111111,Meter
-2114,NZGD_2000_Collingwood_Circuit,400000,800000,172.6719444,1, ,-40.71472222,Meter
-2115,NZGD_2000_Nelson_Circuit,400000,800000,173.2991667,1, ,-41.27444444,Meter
-2116,NZGD_2000_Karamea_Circuit,400000,800000,172.1088889,1, ,-41.28972222,Meter
-2117,NZGD_2000_Buller_Circuit,400000,800000,171.5811111,1, ,-41.81055556,Meter
-2118,NZGD_2000_Grey_Circuit,400000,800000,171.5497222,1, ,-42.33361111,Meter
-2119,NZGD_2000_Amuri_Circuit,400000,800000,173.01,1, ,-42.68888889,Meter
-2120,NZGD_2000_Marlborough_Circuit,400000,800000,173.8019444,1, ,-41.54444444,Meter
-2121,NZGD_2000_Hokitika_Circuit,400000,800000,170.9797222,1, ,-42.88611111,Meter
-2122,NZGD_2000_Okarito_Circuit,400000,800000,170.2608333,1, ,-43.11,Meter
-2123,NZGD_2000_Jacksons_Bay_Circuit,400000,800000,168.6061111,1, ,-43.97777778,Meter
-2124,NZGD_2000_Mount_Pleasant_Circuit,400000,800000,172.7269444,1, ,-43.59055556,Meter
-2125,NZGD_2000_Gawler_Circuit,400000,800000,171.3605556,1, ,-43.74861111,Meter
-2126,NZGD_2000_Timaru_Circuit,400000,800000,171.0572222,1, ,-44.40194444,Meter
-2127,NZGD_2000_Lindis_Peak_Circuit,400000,800000,169.4675,1, ,-44.735,Meter
-2128,NZGD_2000_Mount_Nicholas_Circuit,400000,800000,168.3986111,1, ,-45.13277778,Meter
-2129,NZGD_2000_Mount_York_Circuit,400000,800000,167.7386111,1, ,-45.56361111,Meter
-2130,NZGD_2000_Observation_Point_Circuit,400000,800000,170.6283333,1, ,-45.81611111,Meter
-2131,NZGD_2000_North_Taieri_Circuit,400000,800000,170.2825,0.99996, ,-45.86138889,Meter
-2132,NZGD_2000_Bluff_Circuit,400000,800000,168.3427778,1, ,-46.6,Meter
-2133,NZGD_2000_UTM_Zone_58S,500000,10000000,165,0.9996, ,0,Meter
-2134,NZGD_2000_UTM_Zone_59S,500000,10000000,171,0.9996, ,0,Meter
-2135,NZGD_2000_UTM_Zone_60S,500000,10000000,177,0.9996, ,0,Meter
-2136,Accra_Ghana_Grid,900000,0,-1,0.99975, ,4.666666667,Foot_Gold_Coast
-2137,Accra_TM_1_NW,500000,0,-1,0.9996, ,0,Meter
-2138,NAD_1927_CGQ77_Quebec_Lambert,0,0,-68.5,46,60,44,Meter
-2139,NAD_1983_CSRS98_MTM_2_SCoPQ,304800,0,-55.5,0.9999, ,0,Meter
-2140,NAD_1983_CRS98_MTM_3,304800,0,-58.5,0.9999, ,0,Meter
-2141,NAD_1983_CRS98_MTM_4,304800,0,-61.5,0.9999, ,0,Meter
-2142,NAD_1983_CRS98_MTM_5,304800,0,-64.5,0.9999, ,0,Meter
-2143,NAD_1983_CRS98_MTM_6,304800,0,-67.5,0.9999, ,0,Meter
-2144,NAD_1983_CRS98_MTM_7,304800,0,-70.5,0.9999, ,0,Meter
-2145,NAD_1983_CRS98_MTM_8,304800,0,-73.5,0.9999, ,0,Meter
-2146,NAD_1983_CRS98_MTM_9,304800,0,-76.5,0.9999, ,0,Meter
-2147,NAD_1983_CRS98_MTM_10,304800,0,-79.5,0.9999, ,0,Meter
-2148,NAD_1983_CSRS98_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-2149,NAD_1983_CSRS98_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-2150,NAD_1983_CSRS98_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
-2151,NAD_1983_CSRS98_UTM_Zone_13N,500000,0,-105,0.9996, ,0,Meter
-2152,NAD_1983_CSRS98_UTM_Zone_12N,500000,0,-111,0.9996, ,0,Meter
-2153,NAD_1983_CSRS98_UTM_Zone_11N,500000,0,-117,0.9996, ,0,Meter
-2154,RGF_1993_Lambert_93,700000,6600000,3,44,49,46.5,Meter
-2155,Samoa_1962_Samoa_Lambert,500000,312234.65,-170,-14.26666667,1,-14.26666667,Foot_US
-2157,IRENET95_Irish_Transverse_Mercator,600000,750000,-8,0.99982, ,53.5,Meter
-2158,IRENET95_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
-2159,Sierra_Leone_1924_New_Colony_Grid,500000,0,-12,1, ,6.666666667,Foot_Gold_Coast
-2160,Sierra_Leone_1924_New_War_Office_Grid,800000,600000,-12,1, ,6.666666667,Foot_Gold_Coast
-2161,Sierra_Leone_1968_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-2162,Sierra_Leone_1968_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
-2163,US_National_Atlas_Equal_Area,0,0,-100,,,45,Meter
-2164,Locodjo_1965_TM_5_NW,500000,0,-5,0.9996, ,0,Meter
-2165,Abidjan_1987_TM_5_NW,500000,0,-5,0.9996, ,0,Meter
-2166,Pulkovo_1942_Adj_1983_3_Degree_GK_Zone_3,3500000,0,9,1, ,0,Meter
-2167,Pulkovo_1942_Adj_1983_3_Degree_GK_Zone_4,4500000,0,12,1, ,0,Meter
-2168,Pulkovo_1942_Adj_1983_3_Degree_GK_Zone_5,5500000,0,15,1, ,0,Meter
-2169,Luxembourg_1930_Gauss,80000,100000,6.166666667,1, ,49.83333333,Meter
-2170,MGI_Slovenia_Grid,500000,0,15,0.9999, ,0,Meter
-2176,ETRS_1989_Poland_CS2000_Zone_5,5500000,0,15,0.999923, ,0,Meter
-2177,ETRS_1989_Poland_CS2000_Zone_6,6500000,0,18,0.999923, ,0,Meter
-2178,ETRS_1989_Poland_CS2000_Zone_7,7500000,0,21,0.999923, ,0,Meter
-2179,ETRS_1989_Poland_CS2000_Zone_8,8500000,0,24,0.999923, ,0,Meter
-2180,ETRS_1989_Poland_CS92,500000,-5300000,19,0.9993, ,0,Meter
-2181,ED_1950_Turkey_9,9500000,0,27,0.9996, ,0,Meter
-2182,ED_1950_Turkey_10,10500000,0,30,0.9996, ,0,Meter
-2183,ED_1950_Turkey_11,11500000,0,33,0.9996, ,0,Meter
-2184,ED_1950_Turkey_12,12500000,0,36,0.9996, ,0,Meter
-2185,ED_1950_Turkey_13,13500000,0,39,0.9996, ,0,Meter
-2186,ED_1950_Turkey_14,14500000,0,42,0.9996, ,0,Meter
-2187,ED_1950_Turkey_15,15500000,0,45,0.9996, ,0,Meter
-2192,ED_1950_France_EuroLambert,600000,2200000,2.337229167,46.8,0.99987742,46.8,Meter
-2193,NZGD_2000_New_Zealand_Transverse_Mercator,1600000,10000000,173,0.9996, ,0,Meter
-2195,NAD_1983_HARN_UTM_Zone_2S,500000,10000000,-171,0.9996, ,0,Meter
-2196,ETRS_1989_Kp2000_Jutland,200000,0,9.5,0.99995, ,0,Meter
-2197,ETRS_1989_Kp2000_Zealand,500000,0,12,0.99995, ,0,Meter
-2198,ETRS_1989_Kp2000_Bornholm,900000,0,15,1, ,0,Meter
-2200,ATS_1977_New_Brunswick_Stereographic,300000,800000,-66.5,0.999912, ,46.5,Meter
-2201,REGVEN_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-2202,REGVEN_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
-2203,REGVEN_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-2206,ED_1950_3_Degree_GK_Zone_9,9500000,0,27,1, ,0,Meter
-2207,ED_1950_3_Degree_GK_Zone_10,10500000,0,30,1, ,0,Meter
-2208,ED_1950_3_Degree_GK_Zone_11,11500000,0,33,1, ,0,Meter
-2209,ED_1950_3_Degree_GK_Zone_12,12500000,0,36,1, ,0,Meter
-2210,ED_1950_3_Degree_GK_Zone_13,13500000,0,39,1, ,0,Meter
-2211,ED_1950_3_Degree_GK_Zone_14,14500000,0,42,1, ,0,Meter
-2212,ED_1950_3_Degree_GK_Zone_15,15500000,0,45,1, ,0,Meter
-2213,ETRS_1989_TM_30_NE,500000,0,30,0.9996, ,0,Meter
-2214,Douala_1948_AEF_West,1000000,1000000,10.5,0.999, ,0,Meter
-2215,Manoca_1962_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
-2216,Qornoq_1927_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
-2217,Qornoq_1927_UTM_Zone_23N,500000,0,-45,0.9996, ,0,Meter
-2219,ATS_1977_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
-2220,ATS_1977_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-2222,NAD_1983_StatePlane_Arizona_East_FIPS_0201_Feet_Intl,700000,0,-110.1666667,0.9999, ,31,Foot
-2223,NAD_1983_StatePlane_Arizona_Central_FIPS_0202_Feet_Intl,700000,0,-111.9166667,0.9999, ,31,Foot
-2224,NAD_1983_StatePlane_Arizona_West_FIPS_0203_Feet_Intl,700000,0,-113.75,0.999933333, ,31,Foot
-2225,NAD_1983_StatePlane_California_I_FIPS_0401_Feet,6561666.667,1640416.667,-122,40,41.66666667,39.33333333,Foot_US
-2226,NAD_1983_StatePlane_California_II_FIPS_0402_Feet,6561666.667,1640416.667,-122,38.33333333,39.83333333,37.66666667,Foot_US
-2227,NAD_1983_StatePlane_California_III_FIPS_0403_Feet,6561666.667,1640416.667,-120.5,37.06666667,38.43333333,36.5,Foot_US
-2228,NAD_1983_StatePlane_California_IV_FIPS_0404_Feet,6561666.667,1640416.667,-119,36,37.25,35.33333333,Foot_US
-2229,NAD_1983_StatePlane_California_V_FIPS_0405_Feet,6561666.667,1640416.667,-118,34.03333333,35.46666667,33.5,Foot_US
-2230,NAD_1983_StatePlane_California_VI_FIPS_0406_Feet,6561666.667,1640416.667,-116.25,32.78333333,33.88333333,32.16666667,Foot_US
-2231,NAD_1983_StatePlane_Colorado_North_FIPS_0501_Feet,3000000,1000000,-105.5,39.71666667,40.78333333,39.33333333,Foot_US
-2232,NAD_1983_StatePlane_Colorado_Central_FIPS_0502_Feet,3000000,1000000,-105.5,38.45,39.75,37.83333333,Foot_US
-2233,NAD_1983_StatePlane_Colorado_South_FIPS_0503_Feet,3000000,1000000,-105.5,37.23333333,38.43333333,36.66666667,Foot_US
-2234,NAD_1983_StatePlane_Connecticut_FIPS_0600_Feet,1000000,500000,-72.75,41.2,41.86666667,40.83333333,Foot_US
-2235,NAD_1983_StatePlane_Delaware_FIPS_0700_Feet,656166.6667,0,-75.41666667,0.999995, ,38,Foot_US
-2236,NAD_1983_StatePlane_Florida_East_FIPS_0901_Feet,656166.6667,0,-81,0.999941176, ,24.33333333,Foot_US
-2237,NAD_1983_StatePlane_Florida_West_FIPS_0902_Feet,656166.6667,0,-82,0.999941176, ,24.33333333,Foot_US
-2238,NAD_1983_StatePlane_Florida_North_FIPS_0903_Feet,1968500,0,-84.5,29.58333333,30.75,29,Foot_US
-2239,NAD_1983_StatePlane_Georgia_East_FIPS_1001_Feet,656166.6667,0,-82.16666667,0.9999, ,30,Foot_US
-2240,NAD_1983_StatePlane_Georgia_West_FIPS_1002_Feet,2296583.333,0,-84.16666667,0.9999, ,30,Foot_US
-2241,NAD_1983_StatePlane_Idaho_East_FIPS_1101_Feet,656166.6667,0,-112.1666667,0.999947368, ,41.66666667,Foot_US
-2242,NAD_1983_StatePlane_Idaho_Central_FIPS_1102_Feet,1640416.667,0,-114,0.999947368, ,41.66666667,Foot_US
-2243,NAD_1983_StatePlane_Idaho_West_FIPS_1103_Feet,2624666.667,0,-115.75,0.999933333, ,41.66666667,Foot_US
-2246,NAD_1983_StatePlane_Kentucky_North_FIPS_1601_Feet,1640416.667,0,-84.25,37.96666667,38.96666667,37.5,Foot_US
-2247,NAD_1983_StatePlane_Kentucky_South_FIPS_1602_Feet,1640416.667,1640416.667,-85.75,36.73333333,37.93333333,36.33333333,Foot_US
-2248,NAD_1983_StatePlane_Maryland_FIPS_1900_Feet,1312333.333,0,-77,38.3,39.45,37.66666667,Foot_US
-2249,NAD_1983_StatePlane_Massachusetts_Mainland_FIPS_2001_Feet,656166.6667,2460625,-71.5,41.71666667,42.68333333,41,Foot_US
-2250,NAD_1983_StatePlane_Massachusetts_Island_FIPS_2002_Feet,1640416.667,0,-70.5,41.28333333,41.48333333,41,Foot_US
-2251,NAD_1983_StatePlane_Michigan_North_FIPS_2111_Feet_Intl,26246719.16,0,-87,45.48333333,47.08333333,44.78333333,Foot
-2252,NAD_1983_StatePlane_Michigan_Central_FIPS_2112_Feet_Intl,19685039.37,0,-84.36666667,44.18333333,45.7,43.31666667,Foot
-2253,NAD_1983_StatePlane_Michigan_South_FIPS_2113_Feet_Intl,13123359.58,0,-84.36666667,42.1,43.66666667,41.5,Foot
-2254,NAD_1983_StatePlane_Mississippi_East_FIPS_2301_Feet,984250,0,-88.83333333,0.99995, ,29.5,Foot_US
-2255,NAD_1983_StatePlane_Mississippi_West_FIPS_2302_Feet,2296583.333,0,-90.33333333,0.99995, ,29.5,Foot_US
-2256,NAD_1983_StatePlane_Montana_FIPS_2500_Feet_Intl,1968503.937,0,-109.5,45,49,44.25,Foot
-2257,NAD_1983_StatePlane_New_Mexico_East_FIPS_3001_Feet,541337.5,0,-104.3333333,0.999909091, ,31,Foot_US
-2258,NAD_1983_StatePlane_New_Mexico_Central_FIPS_3002_Feet,1640416.667,0,-106.25,0.9999, ,31,Foot_US
-2259,NAD_1983_StatePlane_New_Mexico_West_FIPS_3003_Feet,2723091.667,0,-107.8333333,0.999916667, ,31,Foot_US
-2260,NAD_1983_StatePlane_New_York_East_FIPS_3101_Feet,492125,0,-74.5,0.9999, ,38.83333333,Foot_US
-2261,NAD_1983_StatePlane_New_York_Central_FIPS_3102_Feet,820208.3333,0,-76.58333333,0.9999375, ,40,Foot_US
-2262,NAD_1983_StatePlane_New_York_West_FIPS_3103_Feet,1148291.667,0,-78.58333333,0.9999375, ,40,Foot_US
-2263,NAD_1983_StatePlane_New_York_Long_Island_FIPS_3104_Feet,984250,0,-74,40.66666667,41.03333333,40.16666667,Foot_US
-2264,NAD_1983_StatePlane_North_Carolina_FIPS_3200_Feet,2000000.003,0,-79,34.33333333,36.16666667,33.75,Foot_US
-2265,NAD_1983_StatePlane_North_Dakota_North_FIPS_3301_Feet_Intl,1968503.937,0,-100.5,47.43333333,48.73333333,47,Foot
-2266,NAD_1983_StatePlane_North_Dakota_South_FIPS_3302_Feet_Intl,1968503.937,0,-100.5,46.18333333,47.48333333,45.66666667,Foot
-2267,NAD_1983_StatePlane_Oklahoma_North_FIPS_3501_Feet,1968500,0,-98,35.56666667,36.76666667,35,Foot_US
-2268,NAD_1983_StatePlane_Oklahoma_South_FIPS_3502_Feet,1968500,0,-98,33.93333333,35.23333333,33.33333333,Foot_US
-2269,NAD_1983_StatePlane_Oregon_North_FIPS_3601_Feet_Intl,8202099.738,0,-120.5,44.33333333,46,43.66666667,Foot
-2270,NAD_1983_StatePlane_Oregon_South_FIPS_3602_Feet_Intl,4921259.843,0,-120.5,42.33333333,44,41.66666667,Foot
-2271,NAD_1983_StatePlane_Pennsylvania_North_FIPS_3701_Feet,1968500,0,-77.75,40.88333333,41.95,40.16666667,Foot_US
-2272,NAD_1983_StatePlane_Pennsylvania_South_FIPS_3702_Feet,1968500,0,-77.75,39.93333333,40.96666667,39.33333333,Foot_US
-2273,NAD_1983_StatePlane_South_Carolina_FIPS_3900_Feet_Intl,2000000,0,-81,32.5,34.83333333,31.83333333,Foot
-2274,NAD_1983_StatePlane_Tennessee_FIPS_4100_Feet,1968500,0,-86,35.25,36.41666667,34.33333333,Foot_US
-2275,NAD_1983_StatePlane_Texas_North_FIPS_4201_Feet,656166.6667,3280833.333,-101.5,34.65,36.18333333,34,Foot_US
-2276,NAD_1983_StatePlane_Texas_North_Central_FIPS_4202_Feet,1968500,6561666.667,-98.5,32.13333333,33.96666667,31.66666667,Foot_US
-2277,NAD_1983_StatePlane_Texas_Central_FIPS_4203_Feet,2296583.333,9842500,-100.3333333,30.11666667,31.88333333,29.66666667,Foot_US
-2278,NAD_1983_StatePlane_Texas_South_Central_FIPS_4204_Feet,1968500,13123333.33,-99,28.38333333,30.28333333,27.83333333,Foot_US
-2279,NAD_1983_StatePlane_Texas_South_FIPS_4205_Feet,984250,16404166.67,-98.5,26.16666667,27.83333333,25.66666667,Foot_US
-2280,NAD_1983_StatePlane_Utah_North_FIPS_4301_Feet_Intl,1640419.948,3280839.895,-111.5,40.71666667,41.78333333,40.33333333,Foot
-2281,NAD_1983_StatePlane_Utah_Central_FIPS_4302_Feet_Intl,1640419.948,6561679.79,-111.5,39.01666667,40.65,38.33333333,Foot
-2282,NAD_1983_StatePlane_Utah_South_FIPS_4303_Feet_Intl,1640419.948,9842519.685,-111.5,37.21666667,38.35,36.66666667,Foot
-2283,NAD_1983_StatePlane_Virginia_North_FIPS_4501_Feet,11482916.67,6561666.667,-78.5,38.03333333,39.2,37.66666667,Foot_US
-2284,NAD_1983_StatePlane_Virginia_South_FIPS_4502_Feet,11482916.67,3280833.333,-78.5,36.76666667,37.96666667,36.33333333,Foot_US
-2285,NAD_1983_StatePlane_Washington_North_FIPS_4601_Feet,1640416.667,0,-120.8333333,47.5,48.73333333,47,Foot_US
-2286,NAD_1983_StatePlane_Washington_South_FIPS_4602_Feet,1640416.667,0,-120.5,45.83333333,47.33333333,45.33333333,Foot_US
-2287,NAD_1983_StatePlane_Wisconsin_North_FIPS_4801_Feet,1968500,0,-90,45.56666667,46.76666667,45.16666667,Foot_US
-2288,NAD_1983_StatePlane_Wisconsin_Central_FIPS_4802_Feet,1968500,0,-90,44.25,45.5,43.83333333,Foot_US
-2289,NAD_1983_StatePlane_Wisconsin_South_FIPS_4803_Feet,1968500,0,-90,42.73333333,44.06666667,42,Foot_US
-2290,Prince_Edward_Island_Stereographic,700000,400000,-63,0.999912, ,47.25,Meter
-2291,NAD_1983_CSRS98_Prince_Edward_Island,400000,800000,-63,0.999912, ,47.25,Meter
-2294,ATS_1977_MTM_4_Nova_Scotia,4500000,0,-61.5,0.9999, ,0,Meter
-2295,ATS_1977_MTM_5_Nova_Scotia,5500000,0,-64.5,0.9999, ,0,Meter
-2308,Batavia_TM_109_SE,500000,10000000,109,0.9996, ,0,Meter
-2309,WGS_1984_TM_116_SE,500000,10000000,116,0.9996, ,0,Meter
-2310,WGS_1984_TM_132_SE,500000,10000000,132,0.9996, ,0,Meter
-2311,WGS_1984_TM_6_NE,500000,10000000,6,0.9996, ,0,Meter
-2312,Garoua_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
-2313,Kousseri_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
-2314,Trinidad_1903_Trinidad_Grid_Feet_Clarke,283800,214500,-61.33333333,1, ,10.44166667,Foot_Clarke
-2315,Campo_Inchauspe_UTM_19S,500000,10000000,-69,0.9996, ,0,Meter
-2316,Campo_Inchauspe_UTM_20S,500000,10000000,-63,0.9996, ,0,Meter
-2317,PSAD_1956_ICN_Regional,1000000,1000000,-66,3,9,6,Meter
-2318,Ain_el_Abd_Aramco_Lambert,0,0,48,17,33,25.08951,Meter
-2319,ED_1950_TM27,500000,0,27,1, ,0,Meter
-2320,ED_1950_TM30,500000,0,30,1, ,0,Meter
-2321,ED_1950_TM33,500000,0,33,1, ,0,Meter
-2322,ED_1950_TM36,500000,0,36,1, ,0,Meter
-2323,ED_1950_TM39,500000,0,39,1, ,0,Meter
-2324,ED_1950_TM42,500000,0,42,1, ,0,Meter
-2325,ED_1950_TM45,500000,0,45,1, ,0,Meter
-2326,Hong_Kong_1980_Grid,836694.05,819069.8,114.1785556,1, ,22.31213333,Meter
-2327,Xian_1980_GK_Zone_13,13500000,0,75,1, ,0,Meter
-2328,Xian_1980_GK_Zone_14,14500000,0,81,1, ,0,Meter
-2329,Xian_1980_GK_Zone_15,15500000,0,87,1, ,0,Meter
-2330,Xian_1980_GK_Zone_16,16500000,0,93,1, ,0,Meter
-2331,Xian_1980_GK_Zone_17,17500000,0,99,1, ,0,Meter
-2332,Xian_1980_GK_Zone_18,18500000,0,105,1, ,0,Meter
-2333,Xian_1980_GK_Zone_19,19500000,0,111,1, ,0,Meter
-2334,Xian_1980_GK_Zone_20,20500000,0,117,1, ,0,Meter
-2335,Xian_1980_GK_Zone_21,21500000,0,123,1, ,0,Meter
-2336,Xian_1980_GK_Zone_22,22500000,0,129,1, ,0,Meter
-2337,Xian_1980_GK_Zone_23,23500000,0,135,1, ,0,Meter
-2338,Xian_1980_GK_CM_75E,500000,0,75,1, ,0,Meter
-2339,Xian_1980_GK_CM_81E,500000,0,81,1, ,0,Meter
-2340,Xian_1980_GK_CM_87E,500000,0,87,1, ,0,Meter
-2341,Xian_1980_GK_CM_93E,500000,0,93,1, ,0,Meter
-2342,Xian_1980_GK_CM_99E,500000,0,99,1, ,0,Meter
-2343,Xian_1980_GK_CM_105E,500000,0,105,1, ,0,Meter
-2344,Xian_1980_GK_CM_111E,500000,0,111,1, ,0,Meter
-2345,Xian_1980_GK_CM_117E,500000,0,117,1, ,0,Meter
-2346,Xian_1980_GK_CM_123E,500000,0,123,1, ,0,Meter
-2347,Xian_1980_GK_CM_129E,500000,0,129,1, ,0,Meter
-2348,Xian_1980_GK_CM_135E,500000,0,135,1, ,0,Meter
-2349,Xian_1980_3_Degree_GK_Zone_25,25500000,0,75,1, ,0,Meter
-2350,Xian_1980_3_Degree_GK_Zone_26,26500000,0,78,1, ,0,Meter
-2351,Xian_1980_3_Degree_GK_Zone_27,27500000,0,81,1, ,0,Meter
-2352,Xian_1980_3_Degree_GK_Zone_28,28500000,0,84,1, ,0,Meter
-2353,Xian_1980_3_Degree_GK_Zone_29,29500000,0,87,1, ,0,Meter
-2354,Xian_1980_3_Degree_GK_Zone_30,30500000,0,90,1, ,0,Meter
-2355,Xian_1980_3_Degree_GK_Zone_31,31500000,0,93,1, ,0,Meter
-2356,Xian_1980_3_Degree_GK_Zone_32,32500000,0,96,1, ,0,Meter
-2357,Xian_1980_3_Degree_GK_Zone_33,33500000,0,99,1, ,0,Meter
-2358,Xian_1980_3_Degree_GK_Zone_34,34500000,0,102,1, ,0,Meter
-2359,Xian_1980_3_Degree_GK_Zone_35,35500000,0,105,1, ,0,Meter
-2360,Xian_1980_3_Degree_GK_Zone_36,36500000,0,108,1, ,0,Meter
-2361,Xian_1980_3_Degree_GK_Zone_37,37500000,0,111,1, ,0,Meter
-2362,Xian_1980_3_Degree_GK_Zone_38,38500000,0,114,1, ,0,Meter
-2363,Xian_1980_3_Degree_GK_Zone_39,39500000,0,117,1, ,0,Meter
-2364,Xian_1980_3_Degree_GK_Zone_40,40500000,0,120,1, ,0,Meter
-2365,Xian_1980_3_Degree_GK_Zone_41,41500000,0,123,1, ,0,Meter
-2366,Xian_1980_3_Degree_GK_Zone_42,42500000,0,126,1, ,0,Meter
-2367,Xian_1980_3_Degree_GK_Zone_43,43500000,0,129,1, ,0,Meter
-2368,Xian_1980_3_Degree_GK_Zone_44,44500000,0,132,1, ,0,Meter
-2369,Xian_1980_3_Degree_GK_Zone_45,45500000,0,135,1, ,0,Meter
-2370,Xian_1980_3_Degree_GK_CM_75E,500000,0,75,1, ,0,Meter
-2371,Xian_1980_3_Degree_GK_CM_78E,500000,0,78,1, ,0,Meter
-2372,Xian_1980_3_Degree_GK_CM_81E,500000,0,81,1, ,0,Meter
-2373,Xian_1980_3_Degree_GK_CM_84E,500000,0,84,1, ,0,Meter
-2374,Xian_1980_3_Degree_GK_CM_87E,500000,0,87,1, ,0,Meter
-2375,Xian_1980_3_Degree_GK_CM_90E,500000,0,90,1, ,0,Meter
-2376,Xian_1980_3_Degree_GK_CM_93E,500000,0,93,1, ,0,Meter
-2377,Xian_1980_3_Degree_GK_CM_96E,500000,0,96,1, ,0,Meter
-2378,Xian_1980_3_Degree_GK_CM_99E,500000,0,99,1, ,0,Meter
-2379,Xian_1980_3_Degree_GK_CM_102E,500000,0,102,1, ,0,Meter
-2380,Xian_1980_3_Degree_GK_CM_105E,500000,0,105,1, ,0,Meter
-2381,Xian_1980_3_Degree_GK_CM_108E,500000,0,108,1, ,0,Meter
-2382,Xian_1980_3_Degree_GK_CM_111E,500000,0,111,1, ,0,Meter
-2383,Xian_1980_3_Degree_GK_CM_114E,500000,0,114,1, ,0,Meter
-2384,Xian_1980_3_Degree_GK_CM_117E,500000,0,117,1, ,0,Meter
-2385,Xian_1980_3_Degree_GK_CM_120E,500000,0,120,1, ,0,Meter
-2386,Xian_1980_3_Degree_GK_CM_123E,500000,0,123,1, ,0,Meter
-2387,Xian_1980_3_Degree_GK_CM_126E,500000,0,126,1, ,0,Meter
-2388,Xian_1980_3_Degree_GK_CM_129E,500000,0,129,1, ,0,Meter
-2389,Xian_1980_3_Degree_GK_CM_132E,500000,0,132,1, ,0,Meter
-2390,Xian_1980_3_Degree_GK_CM_135E,500000,0,135,1, ,0,Meter
-2391,Finland_Zone_1,1500000,0,21,1, ,0,Meter
-2392,Finland_Zone_2,2500000,0,24,1, ,0,Meter
-2393,Finland_Zone_3,3500000,0,27,1, ,0,Meter
-2394,Finland_Zone_4,4500000,0,30,1, ,0,Meter
-2395,South_Yemen_GK_Zone_8,8500000,0,45,1, ,0,Meter
-2396,South_Yemen_GK_Zone_9,9500000,0,51,1, ,0,Meter
-2397,Pulkovo_1942_Adj_1983_3_Degree_GK_Zone_3,3500000,0,9,1, ,0,Meter
-2398,Pulkovo_1942_Adj_1983_3_Degree_GK_Zone_4,4500000,0,12,1, ,0,Meter
-2399,Pulkovo_1942_Adj_1983_3_Degree_GK_Zone_5,5500000,0,15,1, ,0,Meter
-2400,RT90_25_gon_W,1500000,0,15.80827778,1, ,0,Meter
-2401,Beijing_1954_3_Degree_GK_Zone_25,25500000,0,75,1, ,0,Meter
-2402,Beijing_1954_3_Degree_GK_Zone_26,26500000,0,78,1, ,0,Meter
-2403,Beijing_1954_3_Degree_GK_Zone_27,27500000,0,81,1, ,0,Meter
-2404,Beijing_1954_3_Degree_GK_Zone_28,28500000,0,84,1, ,0,Meter
-2405,Beijing_1954_3_Degree_GK_Zone_29,29500000,0,87,1, ,0,Meter
-2406,Beijing_1954_3_Degree_GK_Zone_30,30500000,0,90,1, ,0,Meter
-2407,Beijing_1954_3_Degree_GK_Zone_31,31500000,0,93,1, ,0,Meter
-2408,Beijing_1954_3_Degree_GK_Zone_32,32500000,0,96,1, ,0,Meter
-2409,Beijing_1954_3_Degree_GK_Zone_33,33500000,0,99,1, ,0,Meter
-2410,Beijing_1954_3_Degree_GK_Zone_34,34500000,0,102,1, ,0,Meter
-2411,Beijing_1954_3_Degree_GK_Zone_35,35500000,0,105,1, ,0,Meter
-2412,Beijing_1954_3_Degree_GK_Zone_36,36500000,0,108,1, ,0,Meter
-2413,Beijing_1954_3_Degree_GK_Zone_37,37500000,0,111,1, ,0,Meter
-2414,Beijing_1954_3_Degree_GK_Zone_38,38500000,0,114,1, ,0,Meter
-2415,Beijing_1954_3_Degree_GK_Zone_39,39500000,0,117,1, ,0,Meter
-2416,Beijing_1954_3_Degree_GK_Zone_40,40500000,0,120,1, ,0,Meter
-2417,Beijing_1954_3_Degree_GK_Zone_41,41500000,0,123,1, ,0,Meter
-2418,Beijing_1954_3_Degree_GK_Zone_42,42500000,0,126,1, ,0,Meter
-2419,Beijing_1954_3_Degree_GK_Zone_43,43500000,0,129,1, ,0,Meter
-2420,Beijing_1954_3_Degree_GK_Zone_44,44500000,0,132,1, ,0,Meter
-2421,Beijing_1954_3_Degree_GK_Zone_45,45500000,0,135,1, ,0,Meter
-2422,Beijing_1954_3_Degree_GK_CM_75E,500000,0,75,1, ,0,Meter
-2423,Beijing_1954_3_Degree_GK_CM_78E,500000,0,78,1, ,0,Meter
-2424,Beijing_1954_3_Degree_GK_CM_81E,500000,0,81,1, ,0,Meter
-2425,Beijing_1954_3_Degree_GK_CM_84E,500000,0,84,1, ,0,Meter
-2426,Beijing_1954_3_Degree_GK_CM_87E,500000,0,87,1, ,0,Meter
-2427,Beijing_1954_3_Degree_GK_CM_90E,500000,0,90,1, ,0,Meter
-2428,Beijing_1954_3_Degree_GK_CM_93E,500000,0,93,1, ,0,Meter
-2429,Beijing_1954_3_Degree_GK_CM_96E,500000,0,96,1, ,0,Meter
-2430,Beijing_1954_3_Degree_GK_CM_99E,500000,0,99,1, ,0,Meter
-2431,Beijing_1954_3_Degree_GK_CM_102E,500000,0,102,1, ,0,Meter
-2432,Beijing_1954_3_Degree_GK_CM_105E,500000,0,105,1, ,0,Meter
-2433,Beijing_1954_3_Degree_GK_CM_108E,500000,0,108,1, ,0,Meter
-2434,Beijing_1954_3_Degree_GK_CM_111E,500000,0,111,1, ,0,Meter
-2435,Beijing_1954_3_Degree_GK_CM_114E,500000,0,114,1, ,0,Meter
-2436,Beijing_1954_3_Degree_GK_CM_117E,500000,0,117,1, ,0,Meter
-2437,Beijing_1954_3_Degree_GK_CM_120E,500000,0,120,1, ,0,Meter
-2438,Beijing_1954_3_Degree_GK_CM_123E,500000,0,123,1, ,0,Meter
-2439,Beijing_1954_3_Degree_GK_CM_126E,500000,0,126,1, ,0,Meter
-2440,Beijing_1954_3_Degree_GK_CM_129E,500000,0,129,1, ,0,Meter
-2441,Beijing_1954_3_Degree_GK_CM_132E,500000,0,132,1, ,0,Meter
-2442,Beijing_1954_3_Degree_GK_CM_135E,500000,0,135,1, ,0,Meter
-2443,JGD_2000_Japan_Zone_1,0,0,129.5,0.9999, ,33,Meter
-2444,JGD_2000_Japan_Zone_2,0,0,131,0.9999, ,33,Meter
-2445,JGD_2000_Japan_Zone_3,0,0,132.1666667,0.9999, ,36,Meter
-2446,JGD_2000_Japan_Zone_4,0,0,133.5,0.9999, ,33,Meter
-2447,JGD_2000_Japan_Zone_5,0,0,134.3333333,0.9999, ,36,Meter
-2448,JGD_2000_Japan_Zone_6,0,0,136,0.9999, ,36,Meter
-2449,JGD_2000_Japan_Zone_7,0,0,137.1666667,0.9999, ,36,Meter
-2450,JGD_2000_Japan_Zone_8,0,0,138.5,0.9999, ,36,Meter
-2451,JGD_2000_Japan_Zone_9,0,0,139.8333333,0.9999, ,36,Meter
-2452,JGD_2000_Japan_Zone_10,0,0,140.8333333,0.9999, ,40,Meter
-2453,JGD_2000_Japan_Zone_11,0,0,140.25,0.9999, ,44,Meter
-2454,JGD_2000_Japan_Zone_12,0,0,142.25,0.9999, ,44,Meter
-2455,JGD_2000_Japan_Zone_13,0,0,144.25,0.9999, ,44,Meter
-2456,JGD_2000_Japan_Zone_14,0,0,142,0.9999, ,26,Meter
-2457,JGD_2000_Japan_Zone_15,0,0,127.5,0.9999, ,26,Meter
-2458,JGD_2000_Japan_Zone_16,0,0,124,0.9999, ,26,Meter
-2459,JGD_2000_Japan_Zone_17,0,0,131,0.9999, ,26,Meter
-2460,JGD_2000_Japan_Zone_18,0,0,136,0.9999, ,20,Meter
-2461,JGD_2000_Japan_Zone_19,0,0,154,0.9999, ,26,Meter
-2462,Albanian_1987_GK_Zone_4,4500000,0,21,1, ,0,Meter
-2523,Pulkovo_1942_3_Degree_GK_Zone_7,7500000,0,21,1, ,0,Meter
-2524,Pulkovo_1942_3_Degree_GK_Zone_8,8500000,0,24,1, ,0,Meter
-2525,Pulkovo_1942_3_Degree_GK_Zone_9,9500000,0,27,1, ,0,Meter
-2526,Pulkovo_1942_3_Degree_GK_Zone_10,10500000,0,30,1, ,0,Meter
-2527,Pulkovo_1942_3_Degree_GK_Zone_11,11500000,0,33,1, ,0,Meter
-2528,Pulkovo_1942_3_Degree_GK_Zone_12,12500000,0,36,1, ,0,Meter
-2529,Pulkovo_1942_3_Degree_GK_Zone_13,13500000,0,39,1, ,0,Meter
-2530,Pulkovo_1942_3_Degree_GK_Zone_14,14500000,0,42,1, ,0,Meter
-2531,Pulkovo_1942_3_Degree_GK_Zone_15,15500000,0,45,1, ,0,Meter
-2532,Pulkovo_1942_3_Degree_GK_Zone_16,16500000,0,48,1, ,0,Meter
-2533,Pulkovo_1942_3_Degree_GK_Zone_17,17500000,0,51,1, ,0,Meter
-2534,Pulkovo_1942_3_Degree_GK_Zone_18,18500000,0,54,1, ,0,Meter
-2535,Pulkovo_1942_3_Degree_GK_Zone_19,19500000,0,57,1, ,0,Meter
-2536,Pulkovo_1942_3_Degree_GK_Zone_20,20500000,0,60,1, ,0,Meter
-2537,Pulkovo_1942_3_Degree_GK_Zone_21,21500000,0,63,1, ,0,Meter
-2538,Pulkovo_1942_3_Degree_GK_Zone_22,22500000,0,66,1, ,0,Meter
-2539,Pulkovo_1942_3_Degree_GK_Zone_23,23500000,0,69,1, ,0,Meter
-2540,Pulkovo_1942_3_Degree_GK_Zone_24,24500000,0,72,1, ,0,Meter
-2541,Pulkovo_1942_3_Degree_GK_Zone_25,25500000,0,75,1, ,0,Meter
-2542,Pulkovo_1942_3_Degree_GK_Zone_26,26500000,0,78,1, ,0,Meter
-2543,Pulkovo_1942_3_Degree_GK_Zone_27,27500000,0,81,1, ,0,Meter
-2544,Pulkovo_1942_3_Degree_GK_Zone_28,28500000,0,84,1, ,0,Meter
-2545,Pulkovo_1942_3_Degree_GK_Zone_29,29500000,0,87,1, ,0,Meter
-2546,Pulkovo_1942_3_Degree_GK_Zone_30,30500000,0,90,1, ,0,Meter
-2547,Pulkovo_1942_3_Degree_GK_Zone_31,31500000,0,93,1, ,0,Meter
-2548,Pulkovo_1942_3_Degree_GK_Zone_32,32500000,0,96,1, ,0,Meter
-2549,Pulkovo_1942_3_Degree_GK_Zone_33,33500000,0,99,1, ,0,Meter
-2550,Samboja_UTM_Zone_50S,500000,10000000,117,0.9996, ,0,Meter
-2551,Pulkovo_1942_3_Degree_GK_Zone_34,34500000,0,102,1, ,0,Meter
-2552,Pulkovo_1942_3_Degree_GK_Zone_35,35500000,0,105,1, ,0,Meter
-2553,Pulkovo_1942_3_Degree_GK_Zone_36,36500000,0,108,1, ,0,Meter
-2554,Pulkovo_1942_3_Degree_GK_Zone_37,37500000,0,111,1, ,0,Meter
-2555,Pulkovo_1942_3_Degree_GK_Zone_38,38500000,0,114,1, ,0,Meter
-2556,Pulkovo_1942_3_Degree_GK_Zone_39,39500000,0,117,1, ,0,Meter
-2557,Pulkovo_1942_3_Degree_GK_Zone_40,40500000,0,120,1, ,0,Meter
-2558,Pulkovo_1942_3_Degree_GK_Zone_41,41500000,0,123,1, ,0,Meter
-2559,Pulkovo_1942_3_Degree_GK_Zone_42,42500000,0,126,1, ,0,Meter
-2560,Pulkovo_1942_3_Degree_GK_Zone_43,43500000,0,129,1, ,0,Meter
-2561,Pulkovo_1942_3_Degree_GK_Zone_44,44500000,0,132,1, ,0,Meter
-2562,Pulkovo_1942_3_Degree_GK_Zone_45,45500000,0,135,1, ,0,Meter
-2563,Pulkovo_1942_3_Degree_GK_Zone_46,46500000,0,138,1, ,0,Meter
-2564,Pulkovo_1942_3_Degree_GK_Zone_47,47500000,0,141,1, ,0,Meter
-2565,Pulkovo_1942_3_Degree_GK_Zone_48,48500000,0,144,1, ,0,Meter
-2566,Pulkovo_1942_3_Degree_GK_Zone_49,49500000,0,147,1, ,0,Meter
-2567,Pulkovo_1942_3_Degree_GK_Zone_50,50500000,0,150,1, ,0,Meter
-2568,Pulkovo_1942_3_Degree_GK_Zone_51,51500000,0,153,1, ,0,Meter
-2569,Pulkovo_1942_3_Degree_GK_Zone_52,52500000,0,156,1, ,0,Meter
-2570,Pulkovo_1942_3_Degree_GK_Zone_53,53500000,0,159,1, ,0,Meter
-2571,Pulkovo_1942_3_Degree_GK_Zone_54,54500000,0,162,1, ,0,Meter
-2572,Pulkovo_1942_3_Degree_GK_Zone_55,55500000,0,165,1, ,0,Meter
-2573,Pulkovo_1942_3_Degree_GK_Zone_56,56500000,0,168,1, ,0,Meter
-2574,Pulkovo_1942_3_Degree_GK_Zone_57,57500000,0,171,1, ,0,Meter
-2575,Pulkovo_1942_3_Degree_GK_Zone_58,58500000,0,174,1, ,0,Meter
-2576,Pulkovo_1942_3_Degree_GK_Zone_59,59500000,0,177,1, ,0,Meter
-2577,Pulkovo_1942_3_Degree_GK_Zone_60,60500000,0,180,1, ,0,Meter
-2578,Pulkovo_1942_3_Degree_GK_Zone_61,61500000,0,-177,1, ,0,Meter
-2579,Pulkovo_1942_3_Degree_GK_Zone_62,62500000,0,-174,1, ,0,Meter
-2580,Pulkovo_1942_3_Degree_GK_Zone_63,63500000,0,-171,1, ,0,Meter
-2581,Pulkovo_1942_3_Degree_GK_Zone_64,64500000,0,-168,1, ,0,Meter
-2582,Pulkovo_1942_3_Degree_GK_CM_21E,500000,0,21,1, ,0,Meter
-2583,Pulkovo_1942_3_Degree_GK_CM_24E,500000,0,24,1, ,0,Meter
-2584,Pulkovo_1942_3_Degree_GK_CM_27E,500000,0,27,1, ,0,Meter
-2585,Pulkovo_1942_3_Degree_GK_CM_30E,500000,0,30,1, ,0,Meter
-2586,Pulkovo_1942_3_Degree_GK_CM_33E,500000,0,33,1, ,0,Meter
-2587,Pulkovo_1942_3_Degree_GK_CM_36E,500000,0,36,1, ,0,Meter
-2588,Pulkovo_1942_3_Degree_GK_CM_39E,500000,0,39,1, ,0,Meter
-2589,Pulkovo_1942_3_Degree_GK_CM_42E,500000,0,42,1, ,0,Meter
-2590,Pulkovo_1942_3_Degree_GK_CM_45E,500000,0,45,1, ,0,Meter
-2591,Pulkovo_1942_3_Degree_GK_CM_48E,500000,0,48,1, ,0,Meter
-2592,Pulkovo_1942_3_Degree_GK_CM_51E,500000,0,51,1, ,0,Meter
-2593,Pulkovo_1942_3_Degree_GK_CM_54E,500000,0,54,1, ,0,Meter
-2594,Pulkovo_1942_3_Degree_GK_CM_57E,500000,0,57,1, ,0,Meter
-2595,Pulkovo_1942_3_Degree_GK_CM_60E,500000,0,60,1, ,0,Meter
-2596,Pulkovo_1942_3_Degree_GK_CM_63E,500000,0,63,1, ,0,Meter
-2597,Pulkovo_1942_3_Degree_GK_CM_66E,500000,0,66,1, ,0,Meter
-2598,Pulkovo_1942_3_Degree_GK_CM_69E,500000,0,69,1, ,0,Meter
-2599,Pulkovo_1942_3_Degree_GK_CM_72E,500000,0,72,1, ,0,Meter
-2600,Lietuvos_Koordinaciu_Sistema,500000,0,24,0.9998, ,0,Meter
-2601,Pulkovo_1942_3_Degree_GK_CM_75E,500000,0,75,1, ,0,Meter
-2602,Pulkovo_1942_3_Degree_GK_CM_78E,500000,0,78,1, ,0,Meter
-2603,Pulkovo_1942_3_Degree_GK_CM_81E,500000,0,81,1, ,0,Meter
-2604,Pulkovo_1942_3_Degree_GK_CM_84E,500000,0,84,1, ,0,Meter
-2605,Pulkovo_1942_3_Degree_GK_CM_87E,500000,0,87,1, ,0,Meter
-2606,Pulkovo_1942_3_Degree_GK_CM_90E,500000,0,90,1, ,0,Meter
-2607,Pulkovo_1942_3_Degree_GK_CM_93E,500000,0,93,1, ,0,Meter
-2608,Pulkovo_1942_3_Degree_GK_CM_96E,500000,0,96,1, ,0,Meter
-2609,Pulkovo_1942_3_Degree_GK_CM_99E,500000,0,99,1, ,0,Meter
-2610,Pulkovo_1942_3_Degree_GK_CM_102E,500000,0,102,1, ,0,Meter
-2611,Pulkovo_1942_3_Degree_GK_CM_105E,500000,0,105,1, ,0,Meter
-2612,Pulkovo_1942_3_Degree_GK_CM_108E,500000,0,108,1, ,0,Meter
-2613,Pulkovo_1942_3_Degree_GK_CM_111E,500000,0,111,1, ,0,Meter
-2614,Pulkovo_1942_3_Degree_GK_CM_114E,500000,0,114,1, ,0,Meter
-2615,Pulkovo_1942_3_Degree_GK_CM_117E,500000,0,117,1, ,0,Meter
-2616,Pulkovo_1942_3_Degree_GK_CM_120E,500000,0,120,1, ,0,Meter
-2617,Pulkovo_1942_3_Degree_GK_CM_123E,500000,0,123,1, ,0,Meter
-2618,Pulkovo_1942_3_Degree_GK_CM_126E,500000,0,126,1, ,0,Meter
-2619,Pulkovo_1942_3_Degree_GK_CM_129E,500000,0,129,1, ,0,Meter
-2620,Pulkovo_1942_3_Degree_GK_CM_132E,500000,0,132,1, ,0,Meter
-2621,Pulkovo_1942_3_Degree_GK_CM_135E,500000,0,135,1, ,0,Meter
-2622,Pulkovo_1942_3_Degree_GK_CM_138E,500000,0,138,1, ,0,Meter
-2623,Pulkovo_1942_3_Degree_GK_CM_141E,500000,0,141,1, ,0,Meter
-2624,Pulkovo_1942_3_Degree_GK_CM_144E,500000,0,144,1, ,0,Meter
-2625,Pulkovo_1942_3_Degree_GK_CM_147E,500000,0,147,1, ,0,Meter
-2626,Pulkovo_1942_3_Degree_GK_CM_150E,500000,0,150,1, ,0,Meter
-2627,Pulkovo_1942_3_Degree_GK_CM_153E,500000,0,153,1, ,0,Meter
-2628,Pulkovo_1942_3_Degree_GK_CM_156E,500000,0,156,1, ,0,Meter
-2629,Pulkovo_1942_3_Degree_GK_CM_159E,500000,0,159,1, ,0,Meter
-2630,Pulkovo_1942_3_Degree_GK_CM_162E,500000,0,162,1, ,0,Meter
-2631,Pulkovo_1942_3_Degree_GK_CM_165E,500000,0,165,1, ,0,Meter
-2632,Pulkovo_1942_3_Degree_GK_CM_168E,500000,0,168,1, ,0,Meter
-2633,Pulkovo_1942_3_Degree_GK_CM_171E,500000,0,171,1, ,0,Meter
-2634,Pulkovo_1942_3_Degree_GK_CM_174E,500000,0,174,1, ,0,Meter
-2635,Pulkovo_1942_3_Degree_GK_CM_177E,500000,0,177,1, ,0,Meter
-2636,Pulkovo_1942_3_Degree_GK_CM_180E,500000,0,180,1, ,0,Meter
-2637,Pulkovo_1942_3_Degree_GK_CM_177W,500000,0,-177,1, ,0,Meter
-2638,Pulkovo_1942_3_Degree_GK_CM_174W,500000,0,-174,1, ,0,Meter
-2639,Pulkovo_1942_3_Degree_GK_CM_171W,500000,0,-171,1, ,0,Meter
-2640,Pulkovo_1942_3_Degree_GK_CM_168W,500000,0,-168,1, ,0,Meter
-2641,Pulkovo_1995_3_Degree_GK_Zone_7,7500000,0,21,1, ,0,Meter
-2642,Pulkovo_1995_3_Degree_GK_Zone_8,8500000,0,24,1, ,0,Meter
-2643,Pulkovo_1995_3_Degree_GK_Zone_9,9500000,0,27,1, ,0,Meter
-2644,Pulkovo_1995_3_Degree_GK_Zone_10,10500000,0,30,1, ,0,Meter
-2645,Pulkovo_1995_3_Degree_GK_Zone_11,11500000,0,33,1, ,0,Meter
-2646,Pulkovo_1995_3_Degree_GK_Zone_12,12500000,0,36,1, ,0,Meter
-2647,Pulkovo_1995_3_Degree_GK_Zone_13,13500000,0,39,1, ,0,Meter
-2648,Pulkovo_1995_3_Degree_GK_Zone_14,14500000,0,42,1, ,0,Meter
-2649,Pulkovo_1995_3_Degree_GK_Zone_15,15500000,0,45,1, ,0,Meter
-2650,Pulkovo_1995_3_Degree_GK_Zone_16,16500000,0,48,1, ,0,Meter
-2651,Pulkovo_1995_3_Degree_GK_Zone_17,17500000,0,51,1, ,0,Meter
-2652,Pulkovo_1995_3_Degree_GK_Zone_18,18500000,0,54,1, ,0,Meter
-2653,Pulkovo_1995_3_Degree_GK_Zone_19,19500000,0,57,1, ,0,Meter
-2654,Pulkovo_1995_3_Degree_GK_Zone_20,20500000,0,60,1, ,0,Meter
-2655,Pulkovo_1995_3_Degree_GK_Zone_21,21500000,0,63,1, ,0,Meter
-2656,Pulkovo_1995_3_Degree_GK_Zone_22,22500000,0,66,1, ,0,Meter
-2657,Pulkovo_1995_3_Degree_GK_Zone_23,23500000,0,69,1, ,0,Meter
-2658,Pulkovo_1995_3_Degree_GK_Zone_24,24500000,0,72,1, ,0,Meter
-2659,Pulkovo_1995_3_Degree_GK_Zone_25,25500000,0,75,1, ,0,Meter
-2660,Pulkovo_1995_3_Degree_GK_Zone_26,26500000,0,78,1, ,0,Meter
-2661,Pulkovo_1995_3_Degree_GK_Zone_27,27500000,0,81,1, ,0,Meter
-2662,Pulkovo_1995_3_Degree_GK_Zone_28,28500000,0,84,1, ,0,Meter
-2663,Pulkovo_1995_3_Degree_GK_Zone_29,29500000,0,87,1, ,0,Meter
-2664,Pulkovo_1995_3_Degree_GK_Zone_30,30500000,0,90,1, ,0,Meter
-2665,Pulkovo_1995_3_Degree_GK_Zone_31,31500000,0,93,1, ,0,Meter
-2666,Pulkovo_1995_3_Degree_GK_Zone_32,32500000,0,96,1, ,0,Meter
-2667,Pulkovo_1995_3_Degree_GK_Zone_33,33500000,0,99,1, ,0,Meter
-2668,Pulkovo_1995_3_Degree_GK_Zone_34,34500000,0,102,1, ,0,Meter
-2669,Pulkovo_1995_3_Degree_GK_Zone_35,35500000,0,105,1, ,0,Meter
-2670,Pulkovo_1995_3_Degree_GK_Zone_36,36500000,0,108,1, ,0,Meter
-2671,Pulkovo_1995_3_Degree_GK_Zone_37,37500000,0,111,1, ,0,Meter
-2672,Pulkovo_1995_3_Degree_GK_Zone_38,38500000,0,114,1, ,0,Meter
-2673,Pulkovo_1995_3_Degree_GK_Zone_39,39500000,0,117,1, ,0,Meter
-2674,Pulkovo_1995_3_Degree_GK_Zone_40,40500000,0,120,1, ,0,Meter
-2675,Pulkovo_1995_3_Degree_GK_Zone_41,41500000,0,123,1, ,0,Meter
-2676,Pulkovo_1995_3_Degree_GK_Zone_42,42500000,0,126,1, ,0,Meter
-2677,Pulkovo_1995_3_Degree_GK_Zone_43,43500000,0,129,1, ,0,Meter
-2678,Pulkovo_1995_3_Degree_GK_Zone_44,44500000,0,132,1, ,0,Meter
-2679,Pulkovo_1995_3_Degree_GK_Zone_45,45500000,0,135,1, ,0,Meter
-2680,Pulkovo_1995_3_Degree_GK_Zone_46,46500000,0,138,1, ,0,Meter
-2681,Pulkovo_1995_3_Degree_GK_Zone_47,47500000,0,141,1, ,0,Meter
-2682,Pulkovo_1995_3_Degree_GK_Zone_48,48500000,0,144,1, ,0,Meter
-2683,Pulkovo_1995_3_Degree_GK_Zone_49,49500000,0,147,1, ,0,Meter
-2684,Pulkovo_1995_3_Degree_GK_Zone_50,50500000,0,150,1, ,0,Meter
-2685,Pulkovo_1995_3_Degree_GK_Zone_51,51500000,0,153,1, ,0,Meter
-2686,Pulkovo_1995_3_Degree_GK_Zone_52,52500000,0,156,1, ,0,Meter
-2687,Pulkovo_1995_3_Degree_GK_Zone_53,53500000,0,159,1, ,0,Meter
-2688,Pulkovo_1995_3_Degree_GK_Zone_54,54500000,0,162,1, ,0,Meter
-2689,Pulkovo_1995_3_Degree_GK_Zone_55,55500000,0,165,1, ,0,Meter
-2690,Pulkovo_1995_3_Degree_GK_Zone_56,56500000,0,168,1, ,0,Meter
-2691,Pulkovo_1995_3_Degree_GK_Zone_57,57500000,0,171,1, ,0,Meter
-2692,Pulkovo_1995_3_Degree_GK_Zone_58,58500000,0,174,1, ,0,Meter
-2693,Pulkovo_1995_3_Degree_GK_Zone_59,59500000,0,177,1, ,0,Meter
-2694,Pulkovo_1995_3_Degree_GK_Zone_60,60500000,0,180,1, ,0,Meter
-2695,Pulkovo_1995_3_Degree_GK_Zone_61,61500000,0,-177,1, ,0,Meter
-2696,Pulkovo_1995_3_Degree_GK_Zone_62,62500000,0,-174,1, ,0,Meter
-2697,Pulkovo_1995_3_Degree_GK_Zone_63,63500000,0,-171,1, ,0,Meter
-2698,Pulkovo_1995_3_Degree_GK_Zone_64,64500000,0,-168,1, ,0,Meter
-2699,Pulkovo_1995_3_Degree_GK_CM_21E,500000,0,21,1, ,0,Meter
-2700,Pulkovo_1995_3_Degree_GK_CM_24E,500000,0,24,1, ,0,Meter
-2701,Pulkovo_1995_3_Degree_GK_CM_27E,500000,0,27,1, ,0,Meter
-2702,Pulkovo_1995_3_Degree_GK_CM_30E,500000,0,30,1, ,0,Meter
-2703,Pulkovo_1995_3_Degree_GK_CM_33E,500000,0,33,1, ,0,Meter
-2704,Pulkovo_1995_3_Degree_GK_CM_36E,500000,0,36,1, ,0,Meter
-2705,Pulkovo_1995_3_Degree_GK_CM_39E,500000,0,39,1, ,0,Meter
-2706,Pulkovo_1995_3_Degree_GK_CM_42E,500000,0,42,1, ,0,Meter
-2707,Pulkovo_1995_3_Degree_GK_CM_45E,500000,0,45,1, ,0,Meter
-2708,Pulkovo_1995_3_Degree_GK_CM_48E,500000,0,48,1, ,0,Meter
-2709,Pulkovo_1995_3_Degree_GK_CM_51E,500000,0,51,1, ,0,Meter
-2710,Pulkovo_1995_3_Degree_GK_CM_54E,500000,0,54,1, ,0,Meter
-2711,Pulkovo_1995_3_Degree_GK_CM_57E,500000,0,57,1, ,0,Meter
-2712,Pulkovo_1995_3_Degree_GK_CM_60E,500000,0,60,1, ,0,Meter
-2713,Pulkovo_1995_3_Degree_GK_CM_63E,500000,0,63,1, ,0,Meter
-2714,Pulkovo_1995_3_Degree_GK_CM_66E,500000,0,66,1, ,0,Meter
-2715,Pulkovo_1995_3_Degree_GK_CM_69E,500000,0,69,1, ,0,Meter
-2716,Pulkovo_1995_3_Degree_GK_CM_72E,500000,0,72,1, ,0,Meter
-2717,Pulkovo_1995_3_Degree_GK_CM_75E,500000,0,75,1, ,0,Meter
-2718,Pulkovo_1995_3_Degree_GK_CM_78E,500000,0,78,1, ,0,Meter
-2719,Pulkovo_1995_3_Degree_GK_CM_81E,500000,0,81,1, ,0,Meter
-2720,Pulkovo_1995_3_Degree_GK_CM_84E,500000,0,84,1, ,0,Meter
-2721,Pulkovo_1995_3_Degree_GK_CM_87E,500000,0,87,1, ,0,Meter
-2722,Pulkovo_1995_3_Degree_GK_CM_90E,500000,0,90,1, ,0,Meter
-2723,Pulkovo_1995_3_Degree_GK_CM_93E,500000,0,93,1, ,0,Meter
-2724,Pulkovo_1995_3_Degree_GK_CM_96E,500000,0,96,1, ,0,Meter
-2725,Pulkovo_1995_3_Degree_GK_CM_99E,500000,0,99,1, ,0,Meter
-2726,Pulkovo_1995_3_Degree_GK_CM_102E,500000,0,102,1, ,0,Meter
-2727,Pulkovo_1995_3_Degree_GK_CM_105E,500000,0,105,1, ,0,Meter
-2728,Pulkovo_1995_3_Degree_GK_CM_108E,500000,0,108,1, ,0,Meter
-2729,Pulkovo_1995_3_Degree_GK_CM_111E,500000,0,111,1, ,0,Meter
-2730,Pulkovo_1995_3_Degree_GK_CM_114E,500000,0,114,1, ,0,Meter
-2731,Pulkovo_1995_3_Degree_GK_CM_117E,500000,0,117,1, ,0,Meter
-2732,Pulkovo_1995_3_Degree_GK_CM_120E,500000,0,120,1, ,0,Meter
-2733,Pulkovo_1995_3_Degree_GK_CM_123E,500000,0,123,1, ,0,Meter
-2734,Pulkovo_1995_3_Degree_GK_CM_126E,500000,0,126,1, ,0,Meter
-2735,Pulkovo_1995_3_Degree_GK_CM_129E,500000,0,129,1, ,0,Meter
-2736,Tete_UTM_Zone_36S,500000,10000000,33,0.9996, ,0,Meter
-2737,Tete_UTM_Zone_37S,500000,10000000,39,0.9996, ,0,Meter
-2738,Pulkovo_1995_3_Degree_GK_CM_132E,500000,0,132,1, ,0,Meter
-2739,Pulkovo_1995_3_Degree_GK_CM_135E,500000,0,135,1, ,0,Meter
-2740,Pulkovo_1995_3_Degree_GK_CM_138E,500000,0,138,1, ,0,Meter
-2741,Pulkovo_1995_3_Degree_GK_CM_141E,500000,0,141,1, ,0,Meter
-2742,Pulkovo_1995_3_Degree_GK_CM_144E,500000,0,144,1, ,0,Meter
-2743,Pulkovo_1995_3_Degree_GK_CM_147E,500000,0,147,1, ,0,Meter
-2744,Pulkovo_1995_3_Degree_GK_CM_150E,500000,0,150,1, ,0,Meter
-2745,Pulkovo_1995_3_Degree_GK_CM_153E,500000,0,153,1, ,0,Meter
-2746,Pulkovo_1995_3_Degree_GK_CM_156E,500000,0,156,1, ,0,Meter
-2747,Pulkovo_1995_3_Degree_GK_CM_159E,500000,0,159,1, ,0,Meter
-2748,Pulkovo_1995_3_Degree_GK_CM_162E,500000,0,162,1, ,0,Meter
-2749,Pulkovo_1995_3_Degree_GK_CM_165E,500000,0,165,1, ,0,Meter
-2750,Pulkovo_1995_3_Degree_GK_CM_168E,500000,0,168,1, ,0,Meter
-2751,Pulkovo_1995_3_Degree_GK_CM_171E,500000,0,171,1, ,0,Meter
-2752,Pulkovo_1995_3_Degree_GK_CM_174E,500000,0,174,1, ,0,Meter
-2753,Pulkovo_1995_3_Degree_GK_CM_177E,500000,0,177,1, ,0,Meter
-2754,Pulkovo_1995_3_Degree_GK_CM_180E,500000,0,180,1, ,0,Meter
-2755,Pulkovo_1995_3_Degree_GK_CM_177W,500000,0,-177,1, ,0,Meter
-2756,Pulkovo_1995_3_Degree_GK_CM_174W,500000,0,-174,1, ,0,Meter
-2757,Pulkovo_1995_3_Degree_GK_CM_171W,500000,0,-171,1, ,0,Meter
-2758,Pulkovo_1995_3_Degree_GK_CM_168W,500000,0,-168,1, ,0,Meter
-2759,NAD_1983_HARN_StatePlane_Alabama_East_FIPS_0101,200000,0,-85.83333333,0.99996, ,30.5,Meter
-2760,NAD_1983_HARN_StatePlane_Alabama_West_FIPS_0102,600000,0,-87.5,0.999933333, ,30,Meter
-2761,NAD_1983_HARN_StatePlane_Arizona_East_FIPS_0201,213360,0,-110.1666667,0.9999, ,31,Meter
-2762,NAD_1983_HARN_StatePlane_Arizona_Central_FIPS_0202,213360,0,-111.9166667,0.9999, ,31,Meter
-2763,NAD_1983_HARN_StatePlane_Arizona_West_FIPS_0203,213360,0,-113.75,0.999933333, ,31,Meter
-2764,NAD_1983_HARN_StatePlane_Arkansas_North_FIPS_0301,400000,0,-92,34.93333333,36.23333333,34.33333333,Meter
-2765,NAD_1983_HARN_StatePlane_Arkansas_South_FIPS_0302,400000,400000,-92,33.3,34.76666667,32.66666667,Meter
-2766,NAD_1983_HARN_StatePlane_California_I_FIPS_0401,2000000,500000,-122,40,41.66666667,39.33333333,Meter
-2767,NAD_1983_HARN_StatePlane_California_II_FIPS_0402,2000000,500000,-122,38.33333333,39.83333333,37.66666667,Meter
-2768,NAD_1983_HARN_StatePlane_California_III_FIPS_0403,2000000,500000,-120.5,37.06666667,38.43333333,36.5,Meter
-2769,NAD_1983_HARN_StatePlane_California_IV_FIPS_0404,2000000,500000,-119,36,37.25,35.33333333,Meter
-2770,NAD_1983_HARN_StatePlane_California_V_FIPS_0405,2000000,500000,-118,34.03333333,35.46666667,33.5,Meter
-2771,NAD_1983_HARN_StatePlane_California_VI_FIPS_0406,2000000,500000,-116.25,32.78333333,33.88333333,32.16666667,Meter
-2772,NAD_1983_HARN_StatePlane_Colorado_North_FIPS_0501,914401.8289,304800.6096,-105.5,39.71666667,40.78333333,39.33333333,Meter
-2773,NAD_1983_HARN_StatePlane_Colorado_Central_FIPS_0502,914401.8289,304800.6096,-105.5,38.45,39.75,37.83333333,Meter
-2774,NAD_1983_HARN_StatePlane_Colorado_South_FIPS_0503,914401.8289,304800.6096,-105.5,37.23333333,38.43333333,36.66666667,Meter
-2775,NAD_1983_HARN_StatePlane_Connecticut_FIPS_0600,304800.6096,152400.3048,-72.75,41.2,41.86666667,40.83333333,Meter
-2776,NAD_1983_HARN_StatePlane_Delaware_FIPS_0700,200000,0,-75.41666667,0.999995, ,38,Meter
-2777,NAD_1983_HARN_StatePlane_Florida_East_FIPS_0901,200000,0,-81,0.999941176, ,24.33333333,Meter
-2778,NAD_1983_HARN_StatePlane_Florida_West_FIPS_0902,200000,0,-82,0.999941176, ,24.33333333,Meter
-2779,NAD_1983_HARN_StatePlane_Florida_North_FIPS_0903,600000,0,-84.5,29.58333333,30.75,29,Meter
-2780,NAD_1983_HARN_StatePlane_Georgia_East_FIPS_1001,200000,0,-82.16666667,0.9999, ,30,Meter
-2781,NAD_1983_HARN_StatePlane_Georgia_West_FIPS_1002,700000,0,-84.16666667,0.9999, ,30,Meter
-2782,NAD_1983_HARN_StatePlane_Hawaii_1_FIPS_5101,500000,0,-155.5,0.999966667, ,18.83333333,Meter
-2783,NAD_1983_HARN_StatePlane_Hawaii_2_FIPS_5102,500000,0,-156.6666667,0.999966667, ,20.33333333,Meter
-2784,NAD_1983_HARN_StatePlane_Hawaii_3_FIPS_5103,500000,0,-158,0.99999, ,21.16666667,Meter
-2785,NAD_1983_HARN_StatePlane_Hawaii_4_FIPS_5104,500000,0,-159.5,0.99999, ,21.83333333,Meter
-2786,NAD_1983_HARN_StatePlane_Hawaii_5_FIPS_5105,500000,0,-160.1666667,1, ,21.66666667,Meter
-2787,NAD_1983_HARN_StatePlane_Idaho_East_FIPS_1101,200000,0,-112.1666667,0.999947368, ,41.66666667,Meter
-2788,NAD_1983_HARN_StatePlane_Idaho_Central_FIPS_1102,500000,0,-114,0.999947368, ,41.66666667,Meter
-2789,NAD_1983_HARN_StatePlane_Idaho_West_FIPS_1103,800000,0,-115.75,0.999933333, ,41.66666667,Meter
-2790,NAD_1983_HARN_StatePlane_Illinois_East_FIPS_1201,300000,0,-88.33333333,0.999975, ,36.66666667,Meter
-2791,NAD_1983_HARN_StatePlane_Illinois_West_FIPS_1202,700000,0,-90.16666667,0.999941176, ,36.66666667,Meter
-2792,NAD_1983_HARN_StatePlane_Indiana_East_FIPS_1301,100000,250000,-85.66666667,0.999966667, ,37.5,Meter
-2793,NAD_1983_HARN_StatePlane_Indiana_West_FIPS_1302,900000,250000,-87.08333333,0.999966667, ,37.5,Meter
-2794,NAD_1983_HARN_StatePlane_Iowa_North_FIPS_1401,1500000,1000000,-93.5,42.06666667,43.26666667,41.5,Meter
-2795,NAD_1983_HARN_StatePlane_Iowa_South_FIPS_1402,500000,0,-93.5,40.61666667,41.78333333,40,Meter
-2796,NAD_1983_HARN_StatePlane_Kansas_North_FIPS_1501,400000,0,-98,38.71666667,39.78333333,38.33333333,Meter
-2797,NAD_1983_HARN_StatePlane_Kansas_South_FIPS_1502,400000,400000,-98.5,37.26666667,38.56666667,36.66666667,Meter
-2798,NAD_1983_HARN_StatePlane_Kentucky_North_FIPS_1601,500000,0,-84.25,37.96666667,38.96666667,37.5,Meter
-2799,NAD_1983_HARN_StatePlane_Kentucky_South_FIPS_1602,500000,500000,-85.75,36.73333333,37.93333333,36.33333333,Meter
-2800,NAD_1983_HARN_StatePlane_Louisiana_North_FIPS_1701,1000000,0,-92.5,31.16666667,32.66666667,30.5,Meter
-2801,NAD_1983_HARN_StatePlane_Louisiana_South_FIPS_1702,1000000,0,-91.33333333,29.3,30.7,28.5,Meter
-2802,NAD_1983_HARN_StatePlane_Maine_East_FIPS_1801,300000,0,-68.5,0.9999, ,43.66666667,Meter
-2803,NAD_1983_HARN_StatePlane_Maine_West_FIPS_1802,900000,0,-70.16666667,0.999966667, ,42.83333333,Meter
-2804,NAD_1983_HARN_StatePlane_Maryland_FIPS_1900,400000,0,-77,38.3,39.45,37.66666667,Meter
-2805,NAD_1983_HARN_StatePlane_Massachusetts_Mainland_FIPS_2001,200000,750000,-71.5,41.71666667,42.68333333,41,Meter
-2806,NAD_1983_HARN_StatePlane_Massachusetts_Island_FIPS_2002,500000,0,-70.5,41.28333333,41.48333333,41,Meter
-2807,NAD_1983_HARN_StatePlane_Michigan_North_FIPS_2111,8000000,0,-87,45.48333333,47.08333333,44.78333333,Meter
-2808,NAD_1983_HARN_StatePlane_Michigan_Central_FIPS_2112,6000000,0,-84.36666667,44.18333333,45.7,43.31666667,Meter
-2809,NAD_1983_HARN_StatePlane_Michigan_South_FIPS_2113,4000000,0,-84.36666667,42.1,43.66666667,41.5,Meter
-2810,NAD_1983_HARN_StatePlane_Minnesota_North_FIPS_2201,800000,100000,-93.1,47.03333333,48.63333333,46.5,Meter
-2811,NAD_1983_HARN_StatePlane_Minnesota_Central_FIPS_2202,800000,100000,-94.25,45.61666667,47.05,45,Meter
-2812,NAD_1983_HARN_StatePlane_Minnesota_South_FIPS_2203,800000,100000,-94,43.78333333,45.21666667,43,Meter
-2813,NAD_1983_HARN_StatePlane_Mississippi_East_FIPS_2301,300000,0,-88.83333333,0.99995, ,29.5,Meter
-2814,NAD_1983_HARN_StatePlane_Mississippi_West_FIPS_2302,700000,0,-90.33333333,0.99995, ,29.5,Meter
-2815,NAD_1983_HARN_StatePlane_Missouri_East_FIPS_2401,250000,0,-90.5,0.999933333, ,35.83333333,Meter
-2816,NAD_1983_HARN_StatePlane_Missouri_Central_FIPS_2402,500000,0,-92.5,0.999933333, ,35.83333333,Meter
-2817,NAD_1983_HARN_StatePlane_Missouri_West_FIPS_2403,850000,0,-94.5,0.999941176, ,36.16666667,Meter
-2818,NAD_1983_HARN_StatePlane_Montana_FIPS_2500,600000,0,-109.5,45,49,44.25,Meter
-2819,NAD_1983_HARN_StatePlane_Nebraska_FIPS_2600,500000,0,-100,40,43,39.83333333,Meter
-2820,NAD_1983_HARN_StatePlane_Nevada_East_FIPS_2701,200000,8000000,-115.5833333,0.9999, ,34.75,Meter
-2821,NAD_1983_HARN_StatePlane_Nevada_Central_FIPS_2702,500000,6000000,-116.6666667,0.9999, ,34.75,Meter
-2822,NAD_1983_HARN_StatePlane_Nevada_West_FIPS_2703,800000,4000000,-118.5833333,0.9999, ,34.75,Meter
-2823,NAD_1983_HARN_StatePlane_New_Hampshire_FIPS_2800,300000,0,-71.66666667,0.999966667, ,42.5,Meter
-2824,NAD_1983_HARN_StatePlane_New_Jersey_FIPS_2900,150000,0,-74.5,0.9999, ,38.83333333,Meter
-2825,NAD_1983_HARN_StatePlane_New_Mexico_East_FIPS_3001,165000,0,-104.3333333,0.999909091, ,31,Meter
-2826,NAD_1983_HARN_StatePlane_New_Mexico_Central_FIPS_3002,500000,0,-106.25,0.9999, ,31,Meter
-2827,NAD_1983_HARN_StatePlane_New_Mexico_West_FIPS_3003,830000,0,-107.8333333,0.999916667, ,31,Meter
-2828,NAD_1983_HARN_StatePlane_New_York_East_FIPS_3101,150000,0,-74.5,0.9999, ,38.83333333,Meter
-2829,NAD_1983_HARN_StatePlane_New_York_Central_FIPS_3102,250000,0,-76.58333333,0.9999375, ,40,Meter
-2830,NAD_1983_HARN_StatePlane_New_York_West_FIPS_3103,350000,0,-78.58333333,0.9999375, ,40,Meter
-2831,NAD_1983_HARN_StatePlane_New_York_Long_Island_FIPS_3104,300000,0,-74,40.66666667,41.03333333,40.16666667,Meter
-2832,NAD_1983_HARN_StatePlane_North_Dakota_North_FIPS_3301,600000,0,-100.5,47.43333333,48.73333333,47,Meter
-2833,NAD_1983_HARN_StatePlane_North_Dakota_South_FIPS_3302,600000,0,-100.5,46.18333333,47.48333333,45.66666667,Meter
-2834,NAD_1983_HARN_StatePlane_Ohio_North_FIPS_3401,600000,0,-82.5,40.43333333,41.7,39.66666667,Meter
-2835,NAD_1983_HARN_StatePlane_Ohio_South_FIPS_3402,600000,0,-82.5,38.73333333,40.03333333,38,Meter
-2836,NAD_1983_HARN_StatePlane_Oklahoma_North_FIPS_3501,600000,0,-98,35.56666667,36.76666667,35,Meter
-2837,NAD_1983_HARN_StatePlane_Oklahoma_South_FIPS_3502,600000,0,-98,33.93333333,35.23333333,33.33333333,Meter
-2838,NAD_1983_HARN_StatePlane_Oregon_North_FIPS_3601,2500000,0,-120.5,44.33333333,46,43.66666667,Meter
-2839,NAD_1983_HARN_StatePlane_Oregon_South_FIPS_3602,1500000,0,-120.5,42.33333333,44,41.66666667,Meter
-2840,NAD_1983_HARN_StatePlane_Rhode_Island_FIPS_3800,100000,0,-71.5,0.99999375, ,41.08333333,Meter
-2841,NAD_1983_HARN_StatePlane_South_Dakota_North_FIPS_4001,600000,0,-100,44.41666667,45.68333333,43.83333333,Meter
-2842,NAD_1983_HARN_StatePlane_South_Dakota_South_FIPS_4002,600000,0,-100.3333333,42.83333333,44.4,42.33333333,Meter
-2843,NAD_1983_HARN_StatePlane_Tennessee_FIPS_4100,600000,0,-86,35.25,36.41666667,34.33333333,Meter
-2844,NAD_1983_HARN_StatePlane_Texas_North_FIPS_4201,200000,1000000,-101.5,34.65,36.18333333,34,Meter
-2845,NAD_1983_HARN_StatePlane_Texas_North_Central_FIPS_4202,600000,2000000,-98.5,32.13333333,33.96666667,31.66666667,Meter
-2846,NAD_1983_HARN_StatePlane_Texas_Central_FIPS_4203,700000,3000000,-100.3333333,30.11666667,31.88333333,29.66666667,Meter
-2847,NAD_1983_HARN_StatePlane_Texas_South_Central_FIPS_4204,600000,4000000,-99,28.38333333,30.28333333,27.83333333,Meter
-2848,NAD_1983_HARN_StatePlane_Texas_South_FIPS_4205,300000,5000000,-98.5,26.16666667,27.83333333,25.66666667,Meter
-2849,NAD_1983_HARN_StatePlane_Utah_North_FIPS_4301,500000,1000000,-111.5,40.71666667,41.78333333,40.33333333,Meter
-2850,NAD_1983_HARN_StatePlane_Utah_Central_FIPS_4302,500000,2000000,-111.5,39.01666667,40.65,38.33333333,Meter
-2851,NAD_1983_HARN_StatePlane_Utah_South_FIPS_4303,500000,3000000,-111.5,37.21666667,38.35,36.66666667,Meter
-2852,NAD_1983_HARN_StatePlane_Vermont_FIPS_4400,500000,0,-72.5,0.999964286, ,42.5,Meter
-2853,NAD_1983_HARN_StatePlane_Virginia_North_FIPS_4501,3500000,2000000,-78.5,38.03333333,39.2,37.66666667,Meter
-2854,NAD_1983_HARN_StatePlane_Virginia_South_FIPS_4502,3500000,1000000,-78.5,36.76666667,37.96666667,36.33333333,Meter
-2855,NAD_1983_HARN_StatePlane_Washington_North_FIPS_4601,500000,0,-120.8333333,47.5,48.73333333,47,Meter
-2856,NAD_1983_HARN_StatePlane_Washington_South_FIPS_4602,500000,0,-120.5,45.83333333,47.33333333,45.33333333,Meter
-2857,NAD_1983_HARN_StatePlane_West_Virginia_North_FIPS_4701,600000,0,-79.5,39,40.25,38.5,Meter
-2858,NAD_1983_HARN_StatePlane_West_Virginia_South_FIPS_4702,600000,0,-81,37.48333333,38.88333333,37,Meter
-2859,NAD_1983_HARN_StatePlane_Wisconsin_North_FIPS_4801,600000,0,-90,45.56666667,46.76666667,45.16666667,Meter
-2860,NAD_1983_HARN_StatePlane_Wisconsin_Central_FIPS_4802,600000,0,-90,44.25,45.5,43.83333333,Meter
-2861,NAD_1983_HARN_StatePlane_Wisconsin_South_FIPS_4803,600000,0,-90,42.73333333,44.06666667,42,Meter
-2862,NAD_1983_HARN_StatePlane_Wyoming_East_FIPS_4901,200000,0,-105.1666667,0.9999375, ,40.5,Meter
-2863,NAD_1983_HARN_StatePlane_Wyoming_East_Central_FIPS_4902,400000,100000,-107.3333333,0.9999375, ,40.5,Meter
-2864,NAD_1983_HARN_StatePlane_Wyoming_West_Central_FIPS_4903,600000,0,-108.75,0.9999375, ,40.5,Meter
-2865,NAD_1983_HARN_StatePlane_Wyoming_West_FIPS_4904,800000,100000,-110.0833333,0.9999375, ,40.5,Meter
-2866,NAD_1983_HARN_StatePlane_Puerto_Rico_Virgin_Islands_FIPS_5200,200000,200000,-66.43333333,18.03333333,18.43333333,17.83333333,Meter
-2867,NAD_1983_HARN_StatePlane_Arizona_East_FIPS_0201_Feet_Intl,700000,0,-110.1666667,0.9999, ,31,Foot
-2868,NAD_1983_HARN_StatePlane_Arizona_Central_FIPS_0202_Feet_Intl,700000,0,-111.9166667,0.9999, ,31,Foot
-2869,NAD_1983_HARN_StatePlane_Arizona_West_FIPS_0203_Feet_Intl,700000,0,-113.75,0.999933333, ,31,Foot
-2870,NAD_1983_HARN_StatePlane_California_I_FIPS_0401_Feet,6561666.667,1640416.667,-122,40,41.66666667,39.33333333,Foot_US
-2871,NAD_1983_HARN_StatePlane_California_II_FIPS_0402_Feet,6561666.667,1640416.667,-122,38.33333333,39.83333333,37.66666667,Foot_US
-2872,NAD_1983_HARN_StatePlane_California_III_FIPS_0403_Feet,6561666.667,1640416.667,-120.5,37.06666667,38.43333333,36.5,Foot_US
-2873,NAD_1983_HARN_StatePlane_California_IV_FIPS_0404_Feet,6561666.667,1640416.667,-119,36,37.25,35.33333333,Foot_US
-2874,NAD_1983_HARN_StatePlane_California_V_FIPS_0405_Feet,6561666.667,1640416.667,-118,34.03333333,35.46666667,33.5,Foot_US
-2875,NAD_1983_HARN_StatePlane_California_VI_FIPS_0406_Feet,6561666.667,1640416.667,-116.25,32.78333333,33.88333333,32.16666667,Foot_US
-2876,NAD_1983_HARN_StatePlane_Colorado_North_FIPS_0501_Feet,3000000,1000000,-105.5,39.71666667,40.78333333,39.33333333,Foot_US
-2877,NAD_1983_HARN_StatePlane_Colorado_Central_FIPS_0502_Feet,3000000,1000000,-105.5,38.45,39.75,37.83333333,Foot_US
-2878,NAD_1983_HARN_StatePlane_Colorado_South_FIPS_0503_Feet,3000000,1000000,-105.5,37.23333333,38.43333333,36.66666667,Foot_US
-2879,NAD_1983_HARN_StatePlane_Connecticut_FIPS_0600_Feet,1000000,500000,-72.75,41.2,41.86666667,40.83333333,Foot_US
-2880,NAD_1983_HARN_StatePlane_Delaware_FIPS_0700_Feet,656166.6667,0,-75.41666667,0.999995, ,38,Foot_US
-2881,NAD_1983_HARN_StatePlane_Florida_East_FIPS_0901_Feet,656166.6667,0,-81,0.999941176, ,24.33333333,Foot_US
-2882,NAD_1983_HARN_StatePlane_Florida_West_FIPS_0902_Feet,656166.6667,0,-82,0.999941176, ,24.33333333,Foot_US
-2883,NAD_1983_HARN_StatePlane_Florida_North_FIPS_0903_Feet,1968500,0,-84.5,29.58333333,30.75,29,Foot_US
-2884,NAD_1983_HARN_StatePlane_Georgia_East_FIPS_1001_Feet,656166.6667,0,-82.16666667,0.9999, ,30,Foot_US
-2885,NAD_1983_HARN_StatePlane_Georgia_West_FIPS_1002_Feet,2296583.333,0,-84.16666667,0.9999, ,30,Foot_US
-2886,NAD_1983_HARN_StatePlane_Idaho_East_FIPS_1101_Feet,656166.6667,0,-112.1666667,0.999947368, ,41.66666667,Foot_US
-2887,NAD_1983_HARN_StatePlane_Idaho_Central_FIPS_1102_Feet,1640416.667,0,-114,0.999947368, ,41.66666667,Foot_US
-2888,NAD_1983_HARN_StatePlane_Idaho_West_FIPS_1103_Feet,2624666.667,0,-115.75,0.999933333, ,41.66666667,Foot_US
-2891,NAD_1983_HARN_StatePlane_Kentucky_North_FIPS_1601_Feet,1640416.667,0,-84.25,37.96666667,38.96666667,37.5,Foot_US
-2892,NAD_1983_HARN_StatePlane_Kentucky_South_FIPS_1602_Feet,1640416.667,1640416.667,-85.75,36.73333333,37.93333333,36.33333333,Foot_US
-2893,NAD_1983_HARN_StatePlane_Maryland_FIPS_1900_Feet,1312333.333,0,-77,38.3,39.45,37.66666667,Foot_US
-2894,NAD_1983_HARN_StatePlane_Massachusetts_Mainland_FIPS_2001_Feet,656166.6667,2460625,-71.5,41.71666667,42.68333333,41,Foot_US
-2895,NAD_1983_HARN_StatePlane_Massachusetts_Island_FIPS_2002_Feet,1640416.667,0,-70.5,41.28333333,41.48333333,41,Foot_US
-2896,NAD_1983_HARN_StatePlane_Michigan_North_FIPS_2111_Feet_Intl,26246719.16,0,-87,45.48333333,47.08333333,44.78333333,Foot
-2897,NAD_1983_HARN_StatePlane_Michigan_Central_FIPS_2112_Feet_Intl,19685039.37,0,-84.36666667,44.18333333,45.7,43.31666667,Foot
-2898,NAD_1983_HARN_StatePlane_Michigan_South_FIPS_2113_Feet_Intl,13123359.58,0,-84.36666667,42.1,43.66666667,41.5,Foot
-2899,NAD_1983_HARN_StatePlane_Mississippi_East_FIPS_2301_Feet,984250,0,-88.83333333,0.99995, ,29.5,Foot_US
-2900,NAD_1983_HARN_StatePlane_Mississippi_West_FIPS_2302_Feet,2296583.333,0,-90.33333333,0.99995, ,29.5,Foot_US
-2901,NAD_1983_HARN_StatePlane_Montana_FIPS_2500_Feet_Intl,1968503.937,0,-109.5,45,49,44.25,Foot
-2902,NAD_1983_HARN_StatePlane_New_Mexico_East_FIPS_3001_Feet,541337.5,0,-104.3333333,0.999909091, ,31,Foot_US
-2903,NAD_1983_HARN_StatePlane_New_Mexico_Central_FIPS_3002_Feet,1640416.667,0,-106.25,0.9999, ,31,Foot_US
-2904,NAD_1983_HARN_StatePlane_New_Mexico_West_FIPS_3003_Feet,2723091.667,0,-107.8333333,0.999916667, ,31,Foot_US
-2905,NAD_1983_HARN_StatePlane_New_York_East_FIPS_3101_Feet,492125,0,-74.5,0.9999, ,38.83333333,Foot_US
-2906,NAD_1983_HARN_StatePlane_New_York_Central_FIPS_3102_Feet,820208.3333,0,-76.58333333,0.9999375, ,40,Foot_US
-2907,NAD_1983_HARN_StatePlane_New_York_West_FIPS_3103_Feet,1148291.667,0,-78.58333333,0.9999375, ,40,Foot_US
-2908,NAD_1983_HARN_StatePlane_New_York_Long_Island_FIPS_3104_Feet,984250,0,-74,40.66666667,41.03333333,40.16666667,Foot_US
-2909,NAD_1983_HARN_StatePlane_North_Dakota_North_FIPS_3301_Feet_Intl,1968503.937,0,-100.5,47.43333333,48.73333333,47,Foot
-2910,NAD_1983_HARN_StatePlane_North_Dakota_South_FIPS_3302_Feet_Intl,1968503.937,0,-100.5,46.18333333,47.48333333,45.66666667,Foot
-2911,NAD_1983_HARN_StatePlane_Oklahoma_North_FIPS_3501_Feet,1968500,0,-98,35.56666667,36.76666667,35,Foot_US
-2912,NAD_1983_HARN_StatePlane_Oklahoma_South_FIPS_3502_Feet,1968500,0,-98,33.93333333,35.23333333,33.33333333,Foot_US
-2913,NAD_1983_HARN_StatePlane_Oregon_North_FIPS_3601_Feet_Intl,8202099.738,0,-120.5,44.33333333,46,43.66666667,Foot
-2914,NAD_1983_HARN_StatePlane_Oregon_South_FIPS_3602_Feet_Intl,4921259.843,0,-120.5,42.33333333,44,41.66666667,Foot
-2915,NAD_1983_HARN_StatePlane_Tennessee_FIPS_4100_Feet,1968500,0,-86,35.25,36.41666667,34.33333333,Foot_US
-2916,NAD_1983_HARN_StatePlane_Texas_North_FIPS_4201_Feet,656166.6667,3280833.333,-101.5,34.65,36.18333333,34,Foot_US
-2917,NAD_1983_HARN_StatePlane_Texas_North_Central_FIPS_4202_Feet,1968500,6561666.667,-98.5,32.13333333,33.96666667,31.66666667,Foot_US
-2918,NAD_1983_HARN_StatePlane_Texas_Central_FIPS_4203_Feet,2296583.333,9842500,-100.3333333,30.11666667,31.88333333,29.66666667,Foot_US
-2919,NAD_1983_HARN_StatePlane_Texas_South_Central_FIPS_4204_Feet,1968500,13123333.33,-99,28.38333333,30.28333333,27.83333333,Foot_US
-2920,NAD_1983_HARN_StatePlane_Texas_South_FIPS_4205_Feet,984250,16404166.67,-98.5,26.16666667,27.83333333,25.66666667,Foot_US
-2921,NAD_1983_HARN_StatePlane_Utah_North_FIPS_4301_Feet_Intl,1640419.948,3280839.895,-111.5,40.71666667,41.78333333,40.33333333,Foot
-2922,NAD_1983_HARN_StatePlane_Utah_Central_FIPS_4302_Feet_Intl,1640419.948,6561679.79,-111.5,39.01666667,40.65,38.33333333,Foot
-2923,NAD_1983_HARN_StatePlane_Utah_South_FIPS_4303_Feet_Intl,1640419.948,9842519.685,-111.5,37.21666667,38.35,36.66666667,Foot
-2924,NAD_1983_HARN_StatePlane_Virginia_North_FIPS_4501_Feet,11482916.67,6561666.667,-78.5,38.03333333,39.2,37.66666667,Foot_US
-2925,NAD_1983_HARN_StatePlane_Virginia_South_FIPS_4502_Feet,11482916.67,3280833.333,-78.5,36.76666667,37.96666667,36.33333333,Foot_US
-2926,NAD_1983_HARN_StatePlane_Washington_North_FIPS_4601_Feet,1640416.667,0,-120.8333333,47.5,48.73333333,47,Foot_US
-2927,NAD_1983_HARN_StatePlane_Washington_South_FIPS_4602_Feet,1640416.667,0,-120.5,45.83333333,47.33333333,45.33333333,Foot_US
-2928,NAD_1983_HARN_StatePlane_Wisconsin_North_FIPS_4801_Feet,1968500,0,-90,45.56666667,46.76666667,45.16666667,Foot_US
-2929,NAD_1983_HARN_StatePlane_Wisconsin_Central_FIPS_4802_Feet,1968500,0,-90,44.25,45.5,43.83333333,Foot_US
-2930,NAD_1983_HARN_StatePlane_Wisconsin_South_FIPS_4803_Feet,1968500,0,-90,42.73333333,44.06666667,42,Foot_US
-2931,Beduaram_TM_13_NE,500000,0,13,0.9996, ,0,Meter
-2932,QND_1995_Qatar_National_Grid,200000,300000,51.21666667,0.99999, ,24.45,Meter
-2933,Gunung_Segara_UTM_Zone_50S,500000,10000000,117,0.9996, ,0,Meter
-2935,Pulkovo_1942_CS63_Zone_A1,1300000,0,41.53333333,1, ,0.116666667,Meter
-2936,Pulkovo_1942_CS63_Zone_A2,2300000,0,44.53333333,1, ,0.116666667,Meter
-2937,Pulkovo_1942_CS63_Zone_A3,3300000,0,47.53333333,1, ,0.116666667,Meter
-2938,Pulkovo_1942_CS63_Zone_A4,4300000,0,50.53333333,1, ,0.116666667,Meter
-2939,Pulkovo_1942_CS63_Zone_K2,2300000,0,50.76666667,1, ,0.133333333,Meter
-2940,Pulkovo_1942_CS63_Zone_K3,3300000,0,53.76666667,1, ,0.133333333,Meter
-2941,Pulkovo_1942_CS63_Zone_K4,4300000,0,56.76666667,1, ,0.133333333,Meter
-2942,Porto_Santo_1936_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-2943,Selvagem_Grande_1938_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-2964,NAD_1927_Alaska_Albers_Feet,0,0,-154,55,65,50,Foot_US
-2965,NAD_1983_StatePlane_Indiana_East_FIPS_1301_Feet,328083.3333,820208.3333,-85.66666667,0.999966667, ,37.5,Foot_US
-2966,NAD_1983_StatePlane_Indiana_West_FIPS_1302_Feet,2952750,820208.3333,-87.08333333,0.999966667, ,37.5,Foot_US
-2967,NAD_1983_HARN_StatePlane_Indiana_East_FIPS_1301_Feet,328083.3333,820208.3333,-85.66666667,0.999966667, ,37.5,Foot_US
-2968,NAD_1983_HARN_StatePlane_Indiana_West_FIPS_1302_Feet,2952750,820208.3333,-87.08333333,0.999966667, ,37.5,Foot_US
-2969,Fort_Marigot_UTM_20N,500000,0,-63,0.9996, ,0,Meter
-2970,Sainte_Anne_UTM_20N,500000,0,-63,0.9996, ,0,Meter
-2971,CSG_1967_UTM_22N,500000,0,-51,0.9996, ,0,Meter
-2972,RGFG_1995_UTM_22N,500000,0,-51,0.9996, ,0,Meter
-2973,Fort_Desaix_UTM_20N,500000,0,-63,0.9996, ,0,Meter
-2975,RGR_1992_UTM_40S,500000,10000000,57,0.9996, ,0,Meter
-2976,Tahiti_1952_UTM_6S,500000,10000000,-147,0.9996, ,0,Meter
-2977,Tahaa_1954_UTM_5S,500000,10000000,-153,0.9996, ,0,Meter
-2978,IGN72_Nuku_Hiva_UTM_7S,500000,10000000,-141,0.9996, ,0,Meter
-2979,K0_1949_UTM_42S,500000,10000000,69,0.9996, ,0,Meter
-2980,Combani_1950_UTM_38S,500000,10000000,45,0.9996, ,0,Meter
-2981,IGN56_Lifou_UTM_58S,500000,10000000,165,0.9996, ,0,Meter
-2982,IGN72_Grande_Terre_UTM_58S,500000,10000000,165,0.9996, ,0,Meter
-2983,ST87_Ouvea_UTM_58S,500000,10000000,165,0.9996, ,0,Meter
-2984,RGNC_1991_Lambert_New_Caledonia,400000,300000,166,-20.66666667,-22.33333333,-21.5,Meter
-2985,Petrels_1972_Terre_Adelie_Polar_Stereographic,300000,-2299363.488,140,-67,,,Meter
-2986,Perroud_1950_Terre_Adelie_Polar_Stereographic,300000,-2299363.488,140,-67,,,Meter
-2987,Saint_Pierre_et_Miquelon_1950_UTM_21N,500000,0,-57,0.9996, ,0,Meter
-2988,MOP78_UTM_1S,500000,10000000,-177,0.9996, ,0,Meter
-2989,RRAF_1991_UTM_20N,500000,0,-63,0.9996, ,0,Meter
-2990,Reunion_1947_TM_Reunion,50000,160000,55.53333333,1, ,-21.11666667,Meter
-2991,NAD_1983_Oregon_Statewide_Lambert,400000,0,-120.5,43,45.5,41.75,Meter
-2992,NAD_1983_Oregon_Statewide_Lambert_Feet_Intl,1312335.958,0,-120.5,43,45.5,41.75,Foot
-2993,NAD_1983_HARN_Oregon_Statewide_Lambert,400000,0,-120.5,43,45.5,41.75,Meter
-2994,NAD_1983_HARN_Oregon_Statewide_Lambert_Feet_Intl,1312335.958,0,-120.5,43,45.5,41.75,Foot
-2995,IGN53_Mare_UTM_58S,500000,10000000,165,0.9996, ,0,Meter
-2996,ST84_Ile_des_Pins_UTM_58S,500000,10000000,165,0.9996, ,0,Meter
-2997,ST71_Belep_UTM_58S,500000,10000000,165,0.9996, ,0,Meter
-2998,NEA74_Noumea_UTM_58S,500000,10000000,165,0.9996, ,0,Meter
-2999,Grand_Comoros_UTM_38S,500000,10000000,45,0.9996, ,0,Meter
-3000,Gunung_Segara_NEIEZ,3900000,900000,110,4.454051546,,,Meter
-3001,Batavia_NEIEZ,3900000,900000,110,4.454051546,,,Meter
-3002,Makassar_NEIEZ,3900000,900000,110,4.454051546,,,Meter
-3003,Monte_Mario_Italy_1,1500000,0,9,0.9996, ,0,Meter
-3004,Monte_Mario_Italy_2,2520000,0,15,0.9996, ,0,Meter
-3005,NAD_1983_BC_Environment_Albers,1000000,0,-126,50,58.5,45,Meter
-3006,SWEREF99_TM,500000,0,15,0.9996, ,0,Meter
-3007,SWEREF99_12_00,150000,0,12,1, ,0,Meter
-3008,SWEREF99_13_30,150000,0,13.5,1, ,0,Meter
-3009,SWEREF99_15_00,150000,0,15,1, ,0,Meter
-3010,SWEREF99_16_30,150000,0,16.5,1, ,0,Meter
-3011,SWEREF99_18_00,150000,0,18,1, ,0,Meter
-3012,SWEREF99_14_15,150000,0,14.25,1, ,0,Meter
-3013,SWEREF99_15_45,150000,0,15.75,1, ,0,Meter
-3014,SWEREF99_17_15,150000,0,17.25,1, ,0,Meter
-3015,SWEREF99_18_45,150000,0,18.75,1, ,0,Meter
-3016,SWEREF99_20_15,150000,0,20.25,1, ,0,Meter
-3017,SWEREF99_21_45,150000,0,21.75,1, ,0,Meter
-3018,SWEREF99_23_15,150000,0,23.25,1, ,0,Meter
-3019,RT90_75_gon_V,1500000,0,11.30827778,1, ,0,Meter
-3020,RT90_5_gon_V,1500000,0,13.55827778,1, ,0,Meter
-3021,RT90_25_gon_V,1500000,0,15.80827778,1, ,0,Meter
-3022,RT90_0_gon,1500000,0,18.05827778,1, ,0,Meter
-3023,RT90_25_gon_O,1500000,0,20.30827778,1, ,0,Meter
-3024,RT90_5_gon_O,1500000,0,22.55827778,1, ,0,Meter
-3025,RT38_75_gon_V,1500000,0,11.30827778,1, ,0,Meter
-3026,RT38_5_gon_V,1500000,0,13.55827778,1, ,0,Meter
-3027,RT38_25_gon_V,1500000,0,15.80827778,1, ,0,Meter
-3028,RT38_0_gon,1500000,0,18.05827778,1, ,0,Meter
-3029,RT38_25_gon_O,1500000,0,20.30827778,1, ,0,Meter
-3030,RT38_5_gon_O,1500000,0,22.55827778,1, ,0,Meter
-3031,WGS_1984_Antarctic_Polar_Stereographic,0,0,0,-71,,,Meter
-3032,WGS_1984_Australian_Antarctic_Polar_Stereographic,6000000,6000000,70,-71,,,Meter
-3033,WGS_1984_Australian_Antarctic_Lambert,6000000,6000000,70,-68.5,-74.5,-50,Meter
-3034,ETRS_1989_LCC,4000000,2800000,10,35,65,52,Meter
-3035,ETRS_1989_LAEA,4321000,3210000,10,,,52,Meter
-3036,Moznet_UTM_Zone_36S,500000,10000000,33,0.9996, ,0,Meter
-3037,Moznet_UTM_Zone_37S,500000,10000000,39,0.9996, ,0,Meter
-3054,Hjorsey_1955_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
-3055,Hjorsey_1955_UTM_Zone_27N,500000,0,-21,0.9996, ,0,Meter
-3056,Hjorsey_1955_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-3057,ISN_1993_Lambert_1993,500000,500000,-19,64.25,65.75,65,Meter
-3058,Helle_1954_Jan_Mayen_Grid,50000,-7800000,-8.5,1, ,0,Meter
-3059,LKS_1992_Latvia_TM,500000,-6000000,24,0.9996, ,0,Meter
-3061,Porto_Santo_1995_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-3062,Azores_Oriental_1995_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
-3063,Azores_Central_1995_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
-3064,IGM_1995_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
-3065,IGM_1995_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
-3066,ED_1950_Jordan_TM,500000,-3000000,37,0.9998, ,0,Meter
-3067,EUREF_FIN_TM35FIN,500000,0,27,0.9996, ,0,Meter
-3068,DHDN_Soldner_Berlin,40000,10000,13.62720367,1, ,52.41864828,Meter
-3069,NAD_1927_Wisconsin_TM,500000,-4500000,-90,0.9996, ,0,Meter
-3070,NAD_1983_Wisconsin_TM,520000,-4480000,-90,0.9996, ,0,Meter
-3071,NAD_1983_HARN_Wisconsin_TM,520000,-4480000,-90,0.9996, ,0,Meter
-3072,NAD_1983_Maine_2000_East_Zone,700000,0,-67.875,0.99998, ,43.83333333,Meter
-3073,NAD_1983_Maine_2000_Central_Zone,500000,0,-69.125,0.99998, ,43.5,Meter
-3074,NAD_1983_Maine_2000_West_Zone,300000,0,-70.375,0.99998, ,42.83333333,Meter
-3075,NAD_1983_HARN_Maine_2000_East_Zone,700000,0,-67.875,0.99998, ,43.83333333,Meter
-3076,NAD_1983_HARN_Maine_2000_Central_Zone,500000,0,-69.125,0.99998, ,43.5,Meter
-3077,NAD_1983_HARN_Maine_2000_West_Zone,300000,0,-70.375,0.99998, ,42.83333333,Meter
-3078,NAD_1983_Michigan_GeoRef_Meters,2546731.496,-4354009.816,0.9996,337.25556,-86,45.30916667,Meter
-3079,NAD_1983_HARN_Michigan_GeoRef_Meters,2546731.496,-4354009.816,0.9996,337.25556,-86,45.30916667,Meter
-3080,NAD_1927_Texas_Statewide_Mapping_System,3000000,3000000,-100,27.41666667,34.91666667,31.16666667,Foot
-3081,NAD_1983_Texas_Statewide_Mapping_System,1000000,1000000,-100,27.41666667,34.91666667,31.16666667,Meter
-3082,NAD_1983_Texas_Centric_Mapping_System_Lambert,1500000,5000000,-100,27.5,35,18,Meter
-3083,NAD_1983_Texas_Centric_Mapping_System_Albers,1500000,6000000,-100,27.5,35,18,Meter
-3084,NAD_1983_HARN_Texas_Centric_Mapping_System_Lambert,1500000,5000000,-100,27.5,35,18,Meter
-3085,NAD_1983_HARN_Texas_Centric_Mapping_System_Albers,1500000,6000000,-100,27.5,35,18,Meter
-3086,NAD_1983_Florida_GDL_Albers,400000,0,-84,24,31.5,24,Meter
-3087,NAD_1983_HARN_Florida_GDL_Albers,400000,0,-84,24,31.5,24,Meter
-3088,NAD_1983_StatePlane_Kentucky_FIPS_1600,1500000,1000000,-85.75,37.08333333,38.66666667,36.33333333,Meter
-3089,NAD_1983_StatePlane_Kentucky_FIPS_1600_Feet,4921250,3280833.333,-85.75,37.08333333,38.66666667,36.33333333,Foot_US
-3090,NAD_1983_HARN_StatePlane_Kentucky_FIPS_1600,1500000,1000000,-85.75,37.08333333,38.66666667,36.33333333,Meter
-3091,NAD_1983_HARN_StatePlane_Kentucky_FIPS_1600_Feet,4921250,3280833.333,-85.75,37.08333333,38.66666667,36.33333333,Foot_US
-3092,Tokyo_UTM_Zone_51N,500000,0,123,0.9996, ,0,Meter
-3093,Tokyo_UTM_Zone_52N,500000,0,129,0.9996, ,0,Meter
-3094,Tokyo_UTM_Zone_53N,500000,0,135,0.9996, ,0,Meter
-3095,Tokyo_UTM_Zone_54N,500000,0,141,0.9996, ,0,Meter
-3096,Tokyo_UTM_Zone_55N,500000,0,147,0.9996, ,0,Meter
-3097,JGD_2000_UTM_Zone_51N,500000,0,123,0.9996, ,0,Meter
-3098,JGD_2000_UTM_Zone_52N,500000,0,129,0.9996, ,0,Meter
-3099,JGD_2000_UTM_Zone_53N,500000,0,135,0.9996, ,0,Meter
-3100,JGD_2000_UTM_Zone_54N,500000,0,141,0.9996, ,0,Meter
-3101,JGD_2000_UTM_Zone_55N,500000,0,147,0.9996, ,0,Meter
-3102,Samoa_1962_Samoa_Lambert,500000,312234.65,-170,-14.26666667,1,-14.26666667,Foot_US
-3106,Gulshan_303_Bangladesh_TM,500000,0,90,0.9996, ,0,Meter
-3107,GDA_1994_South_Australia_Lambert,1000000,2000000,135,-28,-36,-32,Meter
-3108,ETRS_1989_Guernsey_Grid,47000,50000,-2.416666667,0.999997, ,49.5,Meter
-3109,ETRS_1989_Jersey_Transverse_Mercator,40000,70000,-2.135,0.9999999, ,49.225,Meter
-3110,AGD_1966_VICGRID,2500000,4500000,145,-36,-38,-37,Meter
-3111,GDA_1994_VICGRID94,2500000,2500000,145,-36,-38,-37,Meter
-3112,GDA_1994_Geoscience_Australia_Lambert,0,0,134,-18,-36,0,Meter
-3113,GDA_1994_BCSG02,50000,100000,153,0.99999, ,-28,Meter
-3114,MAGNA_Colombia_Oeste_Oeste,1000000,1000000,-80.07750792,1, ,4.596200417,Meter
-3115,MAGNA_Colombia_Oeste,1000000,1000000,-77.07750792,1, ,4.596200417,Meter
-3116,MAGNA_Colombia_Bogota,1000000,1000000,-74.07750792,1, ,4.596200417,Meter
-3117,MAGNA_Colombia_Este,1000000,1000000,-71.07750792,1, ,4.596200417,Meter
-3118,MAGNA_Colombia_Este_Este,1000000,1000000,-68.07750792,1, ,4.596200417,Meter
-3119,Douala_1948_AEF_West,1000000,1000000,10.5,0.999, ,0,Meter
-3121,Philippines_Zone_I,500000,0,117,0.99995, ,0,Meter
-3122,Philippines_Zone_II,500000,0,119,0.99995, ,0,Meter
-3123,Philippines_Zone_III,500000,0,121,0.99995, ,0,Meter
-3124,Philippines_Zone_IV,500000,0,123,0.99995, ,0,Meter
-3125,Philippines_Zone_V,500000,0,125,0.99995, ,0,Meter
-3126,ETRS_1989_ETRS-GK19FIN,500000,0,19,1, ,0,Meter
-3127,ETRS_1989_ETRS-GK20FIN,500000,0,20,1, ,0,Meter
-3128,ETRS_1989_ETRS-GK21FIN,500000,0,21,1, ,0,Meter
-3129,ETRS_1989_ETRS-GK22FIN,500000,0,22,1, ,0,Meter
-3130,ETRS_1989_ETRS-GK23FIN,500000,0,23,1, ,0,Meter
-3131,ETRS_1989_ETRS-GK24FIN,500000,0,24,1, ,0,Meter
-3132,ETRS_1989_ETRS-GK25FIN,500000,0,25,1, ,0,Meter
-3133,ETRS_1989_ETRS-GK26FIN,500000,0,26,1, ,0,Meter
-3134,ETRS_1989_ETRS-GK27FIN,500000,0,27,1, ,0,Meter
-3135,ETRS_1989_ETRS-GK28FIN,500000,0,28,1, ,0,Meter
-3136,ETRS_1989_ETRS-GK29FIN,500000,0,29,1, ,0,Meter
-3137,ETRS_1989_ETRS-GK30FIN,500000,0,30,1, ,0,Meter
-3138,ETRS_1989_ETRS-GK31FIN,500000,0,31,1, ,0,Meter
-3148,Indian_1960_UTM_Zone_48N,500000,0,105,0.9996, ,0,Meter
-3149,Indian_1960_UTM_Zone_49N,500000,0,111,0.9996, ,0,Meter
-3176,Indian_1960_TM_106NE,500000,0,106,0.9996, ,0,Meter
-3200,FD_1958_Iraq,1500000,1166200,45,32.5,0.998786408,32.5,Meter
-3294,WGS_1984_USGS_Transantarctic_Mountains,0,0,162,-76.66666667,-79.33333333,-78,Meter
-3296,RGPF_UTM_Zone_5S,500000,10000000,-153,0.9996, ,0,Meter
-3297,RGPF_UTM_Zone_6S,500000,10000000,-147,0.9996, ,0,Meter
-3298,RGPF_UTM_Zone_7S,500000,10000000,-141,0.9996, ,0,Meter
-3299,RGPF_UTM_Zone_8S,500000,10000000,-135,0.9996, ,0,Meter
-3300,Estonian_Coordinate_System_of_1992,500000,6375000,24,58,59.33333333,57.51755393,Meter
-3301,Estonia_1997_Estonia_National_Grid,500000,6375000,24,58,59.33333333,57.51755393,Meter
-3302,IGN63_Hiva_Oa_UTM_Zone_7S,500000,10000000,-141,0.9996, ,0,Meter
-3303,Fatu_Iva_1972_UTM_Zone_7S,500000,10000000,-141,0.9996, ,0,Meter
-3304,Tahiti_1979_UTM_Zone_6S,500000,10000000,-147,0.9996, ,0,Meter
-3305,Moorea_1987_UTM_Zone_6S,500000,10000000,-147,0.9996, ,0,Meter
-3306,Maupiti_1983_UTM_Zone_5S,500000,10000000,-153,0.9996, ,0,Meter
-3307,Nakhl-e_Ghanem_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
-3308,GDA_1994_NSW_lambert,9300000,4500000,147,-30.75,-35.75,-33.25,Meter
-3309,NAD_1927_California_Teale_Albers,0,-4000000,-120,34,40.5,0,Meter
-3310,NAD_1983_California_Teale_Albers,0,-4000000,-120,34,40.5,0,Meter
-3311,NAD_1983_HARN_California_Teale_Albers,0,-4000000,-120,34,40.5,0,Meter
-3312,CSG_1967_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-3313,RGFG_1995_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-3314,Katanga_1955_Katanga_Lambert,0,0,26,-6.5,-11.5,0,Meter
-3315,Katanga_1955_Katanga_TM,0,0,26,0.9998, ,-9,Meter
-3316,Kasai_1953_Congo_TM_Zone_22,500000,10000000,22,0.9999, ,0,Meter
-3317,Kasai_1953_Congo_TM_Zone_24,500000,10000000,24,0.9999, ,0,Meter
-3318,IGC_1962_Congo_TM_Zone_12,500000,10000000,12,0.9999, ,0,Meter
-3319,IGC_1962_Congo_TM_Zone_14,500000,10000000,14,0.9999, ,0,Meter
-3320,IGC_1962_Congo_TM_Zone_16,500000,10000000,16,0.9999, ,0,Meter
-3321,IGC_1962_Congo_TM_Zone_18,500000,10000000,18,0.9999, ,0,Meter
-3322,IGC_1962_Congo_TM_Zone_20,500000,10000000,20,0.9999, ,0,Meter
-3323,IGC_1962_Congo_TM_Zone_22,500000,10000000,22,0.9999, ,0,Meter
-3324,IGC_1962_Congo_TM_Zone_24,500000,10000000,24,0.9999, ,0,Meter
-3325,IGC_1962_Congo_TM_Zone_26,500000,10000000,26,0.9999, ,0,Meter
-3326,IGC_1962_Congo_TM_Zone_28,500000,10000000,28,0.9999, ,0,Meter
-3327,IGC_1962_Congo_TM_Zone_30,500000,10000000,30,0.9999, ,0,Meter
-3328,Pulkovo_1942_Adj_1958_GUGiK-80,500000,500000,19.16666667,0.99714, ,52.16666667,Meter
-3329,Pulkovo_1942_Adj_1958_3_Degree_GK_Zone_5,5500000,0,15,1, ,0,Meter
-3330,Pulkovo_1942_Adj_1958_3_Degree_GK_Zone_6,6500000,0,18,1, ,0,Meter
-3331,Pulkovo_1942_Adj_1958_3_Degree_GK_Zone_7,7500000,0,21,1, ,0,Meter
-3332,Pulkovo_1942_Adj_1958_3_Degree_GK_Zone_8,8500000,0,24,1, ,0,Meter
-3333,Pulkovo_1942_Adj_1958_GK_Zone_3,3500000,0,15,1, ,0,Meter
-3334,Pulkovo_1942_Adj_1958_GK_Zone_4,4500000,0,21,1, ,0,Meter
-3335,Pulkovo_1942_Adj_1958_GK_Zone_5,5500000,0,27,1, ,0,Meter
-3336,Kerguelen_Island_1949_UTM_42S,500000,10000000,69,0.9996, ,0,Meter
-3339,IGCB_1955_Congo_TM_Zone_12,500000,10000000,12,0.9999, ,0,Meter
-3340,IGCB_1955_Congo_TM_Zone_14,500000,10000000,14,0.9999, ,0,Meter
-3341,IGCB_1955_Congo_TM_Zone_16,500000,10000000,16,0.9999, ,0,Meter
-3342,IGCB_1955_UTM_Zone_33S,500000,10000000,15,0.9996, ,0,Meter
-3343,Mauritania_1999_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-3344,Mauritania_1999_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
-3345,Mauritania_1999_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
-3347,NAD_1983_Statistics_Canada_Lambert,6200000,3000000,-91.86666667,49,77,63.390675,Meter
-3349,WGS_1984_PDC_Mercator,0,0,-150,0,,,Meter
-3350,Pulkovo_1942_CS63_Zone_K0,250000,0,21.95,1, ,0.1,Meter
-3351,Pulkovo_1942_CS63_Zone_K1,1250000,0,24.95,1, ,0.1,Meter
-3352,Pulkovo_1942_CS63_Zone_K2,2250000,0,27.95,1, ,0.1,Meter
-3353,Mhast_Onshore_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
-3354,Mhast_Offshore_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
-3355,Egypt_Gulf_of_Suez_S-650_TL_Red_Belt,615000,810000,31,1, ,30,Meter
-3356,Grand_Cayman_1959_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
-3357,Little_Cayman_1961_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
-3358,NAD_1983_HARN_StatePlane_North_Carolina_FIPS_3200,609601.2192,0,-79,34.33333333,36.16666667,33.75,Meter
-3359,NAD_1983_HARN_StatePlane_North_Carolina_FIPS_3200_Feet,2000000,0,-79,34.33333333,36.16666667,33.75,Foot_US
-3360,NAD_1983_HARN_StatePlane_South_Carolina_FIPS_3900,609600,0,-81,32.5,34.83333333,31.83333333,Meter
-3361,NAD_1983_HARN_StatePlane_South_Carolina_FIPS_3900_Feet_Intl,2000000,0,-81,32.5,34.83333333,31.83333333,Foot
-3362,NAD_1983_HARN_StatePlane_Pennsylvania_North_FIPS_3701,600000,0,-77.75,40.88333333,41.95,40.16666667,Meter
-3363,NAD_1983_HARN_StatePlane_Pennsylvania_North_FIPS_3701_Feet,1968500,0,-77.75,40.88333333,41.95,40.16666667,Foot_US
-3364,NAD_1983_HARN_StatePlane_Pennsylvania_South_FIPS_3702,600000,0,-77.75,39.93333333,40.96666667,39.33333333,Meter
-3365,NAD_1983_HARN_StatePlane_Pennsylvania_South_FIPS_3702_Feet,1968500,0,-77.75,39.93333333,40.96666667,39.33333333,Foot_US
-3366,Hong_Kong_1963_Grid,132033.92,62565.96,114.1785556,1, ,22.31213333,Foot_Clarke
-3370,NAD_1927_UTM_Zone_59N,500000,0,171,0.9996, ,0,Meter
-3371,NAD_1927_UTM_Zone_60N,500000,0,177,0.9996, ,0,Meter
-3372,NAD_1983_UTM_Zone_59N,500000,0,171,0.9996, ,0,Meter
-3373,NAD_1983_UTM_Zone_60N,500000,0,177,0.9996, ,0,Meter
-3377,GDM_2000_State_Cassini_Johor,-14810.562,8758.32,103.4279362,1, ,2.121679744,Meter
-3378,GDM_2000_State_Cassini_Negeri_Sembilan_&_Melaka,3673.785,-4240.573,101.974905,1, ,2.682347636,Meter
-3379,GDM_2000_State_Cassini_Pahang,-7368.228,6485.858,102.368299,1, ,3.769388089,Meter
-3380,GDM_2000_State_Cassini_Selangor,-34836.161,56464.049,101.3891079,1, ,3.68464905,Meter
-3381,GDM_2000_State_Cassini_Terengganu,19594.245,3371.895,103.0702756,1, ,4.9762852,Meter
-3382,GDM_2000_State_Cassini_Pulau_Pinang_&_Seberang_Perai,-23.414,62.283,100.344377,1, ,5.421517542,Meter
-3383,GDM_2000_State_Cassini_Perlis,0,0,100.6363711,1, ,5.964672714,Meter
-3384,GDM_2000_State_Cassini_Perak,-1.769,133454.779,100.8154106,1, ,4.859063022,Meter
-3385,GDM_2000_State_Cassini_Kelantan,13227.851,8739.894,102.2952417,1, ,5.972543658,Meter
-3439,PDO_1993_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
-3440,PDO_1993_UTM_Zone_40N,500000,0,57,0.9996, ,0,Meter
-3561,Old_Hawaiian_StatePlane_Hawaii_1_FIPS_5101,500000,0,-155.5,0.999966667, ,18.83333333,Foot_US
-3562,Old_Hawaiian_StatePlane_Hawaii_2_FIPS_5102,500000,0,-156.6666667,0.999966667, ,20.33333333,Foot_US
-3563,Old_Hawaiian_StatePlane_Hawaii_3_FIPS_5103,500000,0,-158,0.99999, ,21.16666667,Foot_US
-3564,Old_Hawaiian_StatePlane_Hawaii_4_FIPS_5104,500000,0,-159.5,0.99999, ,21.83333333,Foot_US
-3565,Old_Hawaiian_StatePlane_Hawaii_5_FIPS_5105,500000,0,-160.1666667,1, ,21.66666667,Foot_US
-3920,Puerto_Rico_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-3991,Puerto_Rico_StatePlane_Puerto_Rico_FIPS_5201,500000,0,-66.43333333,18.03333333,18.43333333,17.83333333,Foot_US
-3992,Puerto_Rico_StatePlane_Virgin_Islands_St_Croix_FIPS_5202,500000,100000,-66.43333333,18.03333333,18.43333333,17.83333333,Foot_US
-20002,Pulkovo_1995_GK_Zone_2,2500000,0,9,1, ,0,Meter
-20003,Pulkovo_1995_GK_Zone_3,3500000,0,15,1, ,0,Meter
-20004,Pulkovo_1995_GK_Zone_4,4500000,0,21,1, ,0,Meter
-20005,Pulkovo_1995_GK_Zone_5,5500000,0,27,1, ,0,Meter
-20006,Pulkovo_1995_GK_Zone_6,6500000,0,33,1, ,0,Meter
-20007,Pulkovo_1995_GK_Zone_7,7500000,0,39,1, ,0,Meter
-20008,Pulkovo_1995_GK_Zone_8,8500000,0,45,1, ,0,Meter
-20009,Pulkovo_1995_GK_Zone_9,9500000,0,51,1, ,0,Meter
-20010,Pulkovo_1995_GK_Zone_10,10500000,0,57,1, ,0,Meter
-20011,Pulkovo_1995_GK_Zone_11,11500000,0,63,1, ,0,Meter
-20012,Pulkovo_1995_GK_Zone_12,12500000,0,69,1, ,0,Meter
-20013,Pulkovo_1995_GK_Zone_13,13500000,0,75,1, ,0,Meter
-20014,Pulkovo_1995_GK_Zone_14,14500000,0,81,1, ,0,Meter
-20015,Pulkovo_1995_GK_Zone_15,15500000,0,87,1, ,0,Meter
-20016,Pulkovo_1995_GK_Zone_16,16500000,0,93,1, ,0,Meter
-20017,Pulkovo_1995_GK_Zone_17,17500000,0,99,1, ,0,Meter
-20018,Pulkovo_1995_GK_Zone_18,18500000,0,105,1, ,0,Meter
-20019,Pulkovo_1995_GK_Zone_19,19500000,0,111,1, ,0,Meter
-20020,Pulkovo_1995_GK_Zone_20,20500000,0,117,1, ,0,Meter
-20021,Pulkovo_1995_GK_Zone_21,21500000,0,123,1, ,0,Meter
-20022,Pulkovo_1995_GK_Zone_22,22500000,0,129,1, ,0,Meter
-20023,Pulkovo_1995_GK_Zone_23,23500000,0,135,1, ,0,Meter
-20024,Pulkovo_1995_GK_Zone_24,24500000,0,141,1, ,0,Meter
-20025,Pulkovo_1995_GK_Zone_25,25500000,0,147,1, ,0,Meter
-20026,Pulkovo_1995_GK_Zone_26,26500000,0,153,1, ,0,Meter
-20027,Pulkovo_1995_GK_Zone_27,27500000,0,159,1, ,0,Meter
-20028,Pulkovo_1995_GK_Zone_28,28500000,0,165,1, ,0,Meter
-20029,Pulkovo_1995_GK_Zone_29,29500000,0,171,1, ,0,Meter
-20030,Pulkovo_1995_GK_Zone_30,30500000,0,177,1, ,0,Meter
-20031,Pulkovo_1995_GK_Zone_31,31500000,0,-177,1, ,0,Meter
-20032,Pulkovo_1995_GK_Zone_32,32500000,0,-171,1, ,0,Meter
-20062,Pulkovo_1995_GK_Zone_2N,500000,0,9,1, ,0,Meter
-20063,Pulkovo_1995_GK_Zone_3N,500000,0,15,1, ,0,Meter
-20064,Pulkovo_1995_GK_Zone_4N,500000,0,21,1, ,0,Meter
-20065,Pulkovo_1995_GK_Zone_5N,500000,0,27,1, ,0,Meter
-20066,Pulkovo_1995_GK_Zone_6N,500000,0,33,1, ,0,Meter
-20067,Pulkovo_1995_GK_Zone_7N,500000,0,39,1, ,0,Meter
-20068,Pulkovo_1995_GK_Zone_8N,500000,0,45,1, ,0,Meter
-20069,Pulkovo_1995_GK_Zone_9N,500000,0,51,1, ,0,Meter
-20070,Pulkovo_1995_GK_Zone_10N,500000,0,57,1, ,0,Meter
-20071,Pulkovo_1995_GK_Zone_11N,500000,0,63,1, ,0,Meter
-20072,Pulkovo_1995_GK_Zone_12N,500000,0,69,1, ,0,Meter
-20073,Pulkovo_1995_GK_Zone_13N,500000,0,75,1, ,0,Meter
-20074,Pulkovo_1995_GK_Zone_14N,500000,0,81,1, ,0,Meter
-20075,Pulkovo_1995_GK_Zone_15N,500000,0,87,1, ,0,Meter
-20076,Pulkovo_1995_GK_Zone_16N,500000,0,93,1, ,0,Meter
-20077,Pulkovo_1995_GK_Zone_17N,500000,0,99,1, ,0,Meter
-20078,Pulkovo_1995_GK_Zone_18N,500000,0,105,1, ,0,Meter
-20079,Pulkovo_1995_GK_Zone_19N,500000,0,111,1, ,0,Meter
-20080,Pulkovo_1995_GK_Zone_20N,500000,0,117,1, ,0,Meter
-20081,Pulkovo_1995_GK_Zone_21N,500000,0,123,1, ,0,Meter
-20082,Pulkovo_1995_GK_Zone_22N,500000,0,129,1, ,0,Meter
-20083,Pulkovo_1995_GK_Zone_23N,500000,0,135,1, ,0,Meter
-20084,Pulkovo_1995_GK_Zone_24N,500000,0,141,1, ,0,Meter
-20085,Pulkovo_1995_GK_Zone_25N,500000,0,147,1, ,0,Meter
-20086,Pulkovo_1995_GK_Zone_26N,500000,0,153,1, ,0,Meter
-20087,Pulkovo_1995_GK_Zone_27N,500000,0,159,1, ,0,Meter
-20088,Pulkovo_1995_GK_Zone_28N,500000,0,165,1, ,0,Meter
-20089,Pulkovo_1995_GK_Zone_29N,500000,0,171,1, ,0,Meter
-20090,Pulkovo_1995_GK_Zone_30N,500000,0,177,1, ,0,Meter
-20091,Pulkovo_1995_GK_Zone_31N,500000,0,-177,1, ,0,Meter
-20092,Pulkovo_1995_GK_Zone_32N,500000,0,-171,1, ,0,Meter
-20135,Adindan_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
-20136,Adindan_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
-20137,Adindan_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
-20138,Adindan_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
-20248,AGD_1966_AMG_Zone_48,500000,10000000,105,0.9996, ,0,Meter
-20249,AGD_1966_AMG_Zone_49,500000,10000000,111,0.9996, ,0,Meter
-20250,AGD_1966_AMG_Zone_50,500000,10000000,117,0.9996, ,0,Meter
-20251,AGD_1966_AMG_Zone_51,500000,10000000,123,0.9996, ,0,Meter
-20252,AGD_1966_AMG_Zone_52,500000,10000000,129,0.9996, ,0,Meter
-20253,AGD_1966_AMG_Zone_53,500000,10000000,135,0.9996, ,0,Meter
-20254,AGD_1966_AMG_Zone_54,500000,10000000,141,0.9996, ,0,Meter
-20255,AGD_1966_AMG_Zone_55,500000,10000000,147,0.9996, ,0,Meter
-20256,AGD_1966_AMG_Zone_56,500000,10000000,153,0.9996, ,0,Meter
-20257,AGD_1966_AMG_Zone_57,500000,10000000,159,0.9996, ,0,Meter
-20258,AGD_1966_AMG_Zone_58,500000,10000000,165,0.9996, ,0,Meter
-20348,AGD_1984_AMG_Zone_48,500000,10000000,105,0.9996, ,0,Meter
-20349,AGD_1984_AMG_Zone_49,500000,10000000,111,0.9996, ,0,Meter
-20350,AGD_1984_AMG_Zone_50,500000,10000000,117,0.9996, ,0,Meter
-20351,AGD_1984_AMG_Zone_51,500000,10000000,123,0.9996, ,0,Meter
-20352,AGD_1984_AMG_Zone_52,500000,10000000,129,0.9996, ,0,Meter
-20353,AGD_1984_AMG_Zone_53,500000,10000000,135,0.9996, ,0,Meter
-20354,AGD_1984_AMG_Zone_54,500000,10000000,141,0.9996, ,0,Meter
-20355,AGD_1984_AMG_Zone_55,500000,10000000,147,0.9996, ,0,Meter
-20356,AGD_1984_AMG_Zone_56,500000,10000000,153,0.9996, ,0,Meter
-20357,AGD_1984_AMG_Zone_57,500000,10000000,159,0.9996, ,0,Meter
-20358,AGD_1984_AMG_Zone_58,500000,10000000,165,0.9996, ,0,Meter
-20436,Ain_el_Abd_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
-20437,Ain_el_Abd_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
-20438,Ain_el_Abd_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
-20439,Ain_el_Abd_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
-20440,Ain_el_Abd_UTM_Zone_40N,500000,0,57,0.9996, ,0,Meter
-20499,Bahrain_State_Grid,500000,0,51,0.9996, ,0,Meter
-20538,Afgooye_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
-20539,Afgooye_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
-20790,Portuguese_National_Grid,200000,300000,1,1, ,39.66666667,Meter
-20822,Aratu_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
-20823,Aratu_UTM_Zone_23S,500000,10000000,-45,0.9996, ,0,Meter
-20824,Aratu_UTM_Zone_24S,500000,10000000,-39,0.9996, ,0,Meter
-20934,Arc_1950_UTM_Zone_34S,500000,10000000,21,0.9996, ,0,Meter
-20935,Arc_1950_UTM_Zone_35S,500000,10000000,27,0.9996, ,0,Meter
-20936,Arc_1950_UTM_Zone_36S,500000,10000000,33,0.9996, ,0,Meter
-21035,Arc_1960_UTM_Zone_35S,500000,10000000,27,0.9996, ,0,Meter
-21036,Arc_1960_UTM_Zone_36S,500000,10000000,33,0.9996, ,0,Meter
-21037,Arc_1960_UTM_Zone_37S,500000,10000000,39,0.9996, ,0,Meter
-21095,Arc_1960_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
-21096,Arc_1960_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
-21097,Arc_1960_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
-21148,Batavia_UTM_Zone_48S,500000,10000000,105,0.9996, ,0,Meter
-21149,Batavia_UTM_Zone_49S,500000,10000000,111,0.9996, ,0,Meter
-21150,Batavia_UTM_Zone_50S,500000,10000000,117,0.9996, ,0,Meter
-21291,Barbados_1938_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
-21292,Barbados_1938_Barbados_Grid,30000,75000,-59.55972222,0.9999986, ,13.17638889,Meter
-21413,Beijing_1954_GK_Zone_13,13500000,0,75,1, ,0,Meter
-21414,Beijing_1954_GK_Zone_14,14500000,0,81,1, ,0,Meter
-21415,Beijing_1954_GK_Zone_15,15500000,0,87,1, ,0,Meter
-21416,Beijing_1954_GK_Zone_16,16500000,0,93,1, ,0,Meter
-21417,Beijing_1954_GK_Zone_17,17500000,0,99,1, ,0,Meter
-21418,Beijing_1954_GK_Zone_18,18500000,0,105,1, ,0,Meter
-21419,Beijing_1954_GK_Zone_19,19500000,0,111,1, ,0,Meter
-21420,Beijing_1954_GK_Zone_20,20500000,0,117,1, ,0,Meter
-21421,Beijing_1954_GK_Zone_21,21500000,0,123,1, ,0,Meter
-21422,Beijing_1954_GK_Zone_22,22500000,0,129,1, ,0,Meter
-21423,Beijing_1954_GK_Zone_23,23500000,0,135,1, ,0,Meter
-21473,Beijing_1954_GK_Zone_13N,500000,0,75,1, ,0,Meter
-21474,Beijing_1954_GK_Zone_14N,500000,0,81,1, ,0,Meter
-21475,Beijing_1954_GK_Zone_15N,500000,0,87,1, ,0,Meter
-21476,Beijing_1954_GK_Zone_16N,500000,0,93,1, ,0,Meter
-21477,Beijing_1954_GK_Zone_17N,500000,0,99,1, ,0,Meter
-21478,Beijing_1954_GK_Zone_18N,500000,0,105,1, ,0,Meter
-21479,Beijing_1954_GK_Zone_19N,500000,0,111,1, ,0,Meter
-21480,Beijing_1954_GK_Zone_20N,500000,0,117,1, ,0,Meter
-21481,Beijing_1954_GK_Zone_21N,500000,0,123,1, ,0,Meter
-21482,Beijing_1954_GK_Zone_22N,500000,0,129,1, ,0,Meter
-21483,Beijing_1954_GK_Zone_23N,500000,0,135,1, ,0,Meter
-21500,Belge_Lambert_1950,150000,5400000,0,49.83333333,51.16666667,90,Meter
-21780,Bern_1898_Bern_LV03C,0,0,1,90,0,46.95240556,Meter
-21781,CH1903_LV03,600000,200000,1,90,7.439583333,46.95240556,Meter
-21817,Bogota_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
-21818,Bogota_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-21891,Colombia_West_Zone,1000000,1000000,-77.08091667,1, ,4.599047222,Meter
-21892,Colombia_Bogota_Zone,1000000,1000000,-74.08091667,1, ,4.599047222,Meter
-21893,Colombia_East_Central_Zone,1000000,1000000,-71.08091667,1, ,4.599047222,Meter
-21894,Colombia_East_Zone,1000000,1000000,-68.08091667,1, ,4.599047222,Meter
-21896,Colombia_West_Zone,1000000,1000000,-77.08091667,1, ,4.599047222,Meter
-21897,Colombia_Bogota_Zone,1000000,1000000,-74.08091667,1, ,4.599047222,Meter
-21898,Colombia_East_Central_Zone,1000000,1000000,-71.08091667,1, ,4.599047222,Meter
-21899,Colombia_East_Zone,1000000,1000000,-68.08091667,1, ,4.599047222,Meter
-22032,Camacupa_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
-22033,Camacupa_UTM_Zone_33S,500000,10000000,15,0.9996, ,0,Meter
-22091,Camacupa_TM_11_30_SE,500000,10000000,11.5,0.9996, ,0,Meter
-22092,Camacupa_TM_12_SE,500000,10000000,12,0.9996, ,0,Meter
-22171,POSGAR_1998_Argentina_Zone_1,1500000,0,-72,1, ,-90,Meter
-22172,POSGAR_1998_Argentina_Zone_2,2500000,0,-69,1, ,-90,Meter
-22173,POSGAR_1998_Argentina_Zone_3,3500000,0,-66,1, ,-90,Meter
-22174,POSGAR_1998_Argentina_Zone_4,4500000,0,-63,1, ,-90,Meter
-22175,POSGAR_1998_Argentina_Zone_5,5500000,0,-60,1, ,-90,Meter
-22176,POSGAR_1998_Argentina_Zone_6,6500000,0,-57,1, ,-90,Meter
-22177,POSGAR_1998_Argentina_Zone_7,7500000,0,-54,1, ,-90,Meter
-22181,POSGAR_1994_Argentina_Zone_1,1500000,0,-72,1, ,-90,Meter
-22182,POSGAR_1994_Argentina_Zone_2,2500000,0,-69,1, ,-90,Meter
-22183,POSGAR_1994_Argentina_Zone_3,3500000,0,-66,1, ,-90,Meter
-22184,POSGAR_1994_Argentina_Zone_4,4500000,0,-63,1, ,-90,Meter
-22185,POSGAR_1994_Argentina_Zone_5,5500000,0,-60,1, ,-90,Meter
-22186,POSGAR_1994_Argentina_Zone_6,6500000,0,-57,1, ,-90,Meter
-22187,POSGAR_1994_Argentina_Zone_7,7500000,0,-54,1, ,-90,Meter
-22191,Argentina_Zone_1,1500000,0,-72,1, ,-90,Meter
-22192,Argentina_Zone_2,2500000,0,-69,1, ,-90,Meter
-22193,Argentina_Zone_3,3500000,0,-66,1, ,-90,Meter
-22194,Argentina_Zone_4,4500000,0,-63,1, ,-90,Meter
-22195,Argentina_Zone_5,5500000,0,-60,1, ,-90,Meter
-22196,Argentina_Zone_6,6500000,0,-57,1, ,-90,Meter
-22197,Argentina_Zone_7,7500000,0,-54,1, ,-90,Meter
-22234,Cape_UTM_Zone_34S,500000,10000000,21,0.9996, ,0,Meter
-22235,Cape_UTM_Zone_35S,500000,10000000,27,0.9996, ,0,Meter
-22236,Cape_UTM_Zone_36S,500000,10000000,33,0.9996, ,0,Meter
-22332,Carthage_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
-22391,Nord_Tunisie,500000,300000,11,40,0.999625544,40,Meter
-22392,Sud_Tunisie,500000,300000,11,37,0.999625769,37,Meter
-22521,Corrego_Alegre_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
-22522,Corrego_Alegre_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
-22523,Corrego_Alegre_UTM_Zone_23S,500000,10000000,-45,0.9996, ,0,Meter
-22524,Corrego_Alegre_UTM_Zone_24S,500000,10000000,-39,0.9996, ,0,Meter
-22525,Corrego_Alegre_UTM_Zone_25S,500000,10000000,-33,0.9996, ,0,Meter
-22700,Deir_ez_Zor_Levant_Zone,0,0,39.15,0.9995341, ,34.2,Meter
-22770,Deir_ez_Zor_Syria_Lambert,300000,300000,37.35,34.65,0.9996256,34.65,Meter
-22780,Deir_ez_Zor_Levant_Stereographic,0,0,39.15,0.9995341, ,34.2,Meter
-22832,Douala_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
-22991,Egypt_Blue_Belt,300000,1100000,35,1, ,30,Meter
-22992,Egypt_Red_Belt,615000,810000,31,1, ,30,Meter
-22993,Egypt_Purple_Belt,700000,200000,27,1, ,30,Meter
-22994,Egypt_Extended_Purple_Belt,700000,1200000,27,1, ,30,Meter
-23028,ED_1950_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-23029,ED_1950_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
-23030,ED_1950_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
-23031,ED_1950_UTM_Zone_31N,500000,0,3,0.9996, ,0,Meter
-23032,ED_1950_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
-23033,ED_1950_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
-23034,ED_1950_UTM_Zone_34N,500000,0,21,0.9996, ,0,Meter
-23035,ED_1950_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
-23036,ED_1950_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
-23037,ED_1950_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
-23038,ED_1950_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
-23090,ED_1950_TM_0_N,500000,0,0,0.9996, ,0,Meter
-23095,ED_1950_TM_5_NE,500000,0,5,0.9996, ,0,Meter
-23239,Fahud_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
-23240,Fahud_UTM_Zone_40N,500000,0,57,0.9996, ,0,Meter
-23433,Garoua_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
-23700,Hungarian_1972_Egyseges_Orszagos_Vetuleti,650000,200000,0.99993,90,19.04857178,47.14439372,Meter
-23846,Indonesian_1974_UTM_Zone_46N,500000,0,93,0.9996, ,0,Meter
-23847,Indonesian_1974_UTM_Zone_47N,500000,0,99,0.9996, ,0,Meter
-23848,Indonesian_1974_UTM_Zone_48N,500000,0,105,0.9996, ,0,Meter
-23849,Indonesian_1974_UTM_Zone_49N,500000,0,111,0.9996, ,0,Meter
-23850,Indonesian_1974_UTM_Zone_50N,500000,0,117,0.9996, ,0,Meter
-23851,Indonesian_1974_UTM_Zone_51N,500000,0,123,0.9996, ,0,Meter
-23852,Indonesian_1974_UTM_Zone_52N,500000,0,129,0.9996, ,0,Meter
-23853,Indonesian_1974_UTM_Zone_53N,500000,0,135,0.9996, ,0,Meter
-23886,Indonesian_1974_UTM_Zone_46S,500000,10000000,93,0.9996, ,0,Meter
-23887,Indonesian_1974_UTM_Zone_47S,500000,10000000,99,0.9996, ,0,Meter
-23888,Indonesian_1974_UTM_Zone_48S,500000,10000000,105,0.9996, ,0,Meter
-23889,Indonesian_1974_UTM_Zone_49S,500000,10000000,111,0.9996, ,0,Meter
-23890,Indonesian_1974_UTM_Zone_50S,500000,10000000,117,0.9996, ,0,Meter
-23891,Indonesian_1974_UTM_Zone_51S,500000,10000000,123,0.9996, ,0,Meter
-23892,Indonesian_1974_UTM_Zone_52S,500000,10000000,129,0.9996, ,0,Meter
-23893,Indonesian_1974_UTM_Zone_53S,500000,10000000,135,0.9996, ,0,Meter
-23894,Indonesian_1974_UTM_Zone_54S,500000,10000000,141,0.9996, ,0,Meter
-23946,Indian_1954_UTM_Zone_46N,500000,0,93,0.9996, ,0,Meter
-23947,Indian_1954_UTM_Zone_47N,500000,0,99,0.9996, ,0,Meter
-23948,Indian_1954_UTM_Zone_48N,500000,0,105,0.9996, ,0,Meter
-24047,Indian_1975_UTM_Zone_47N,500000,0,99,0.9996, ,0,Meter
-24048,Indian_1975_UTM_Zone_48N,500000,0,105,0.9996, ,0,Meter
-24100,Jamaica_1875_Old_Grid,550000,400000,-77,18,1,18,Meter
-24200,Jamaica_Grid,250000,150000,-77,18,1,18,Meter
-24305,Kalianpur_1937_UTM_Zone_45N,500000,0,87,0.9996, ,0,Meter
-24306,Kalianpur_1937_UTM_Zone_46N,500000,0,93,0.9996, ,0,Meter
-24311,Kalianpur_1962_UTM_Zone_41N,500000,0,63,0.9996, ,0,Meter
-24312,Kalianpur_1962_UTM_Zone_42N,500000,0,69,0.9996, ,0,Meter
-24313,Kalianpur_1962_UTM_Zone_43N,500000,0,75,0.9996, ,0,Meter
-24342,Kalianpur_1975_UTM_Zone_42N,500000,0,69,0.9996, ,0,Meter
-24343,Kalianpur_1975_UTM_Zone_43N,500000,0,75,0.9996, ,0,Meter
-24344,Kalianpur_1975_UTM_Zone_44N,500000,0,81,0.9996, ,0,Meter
-24345,Kalianpur_1975_UTM_Zone_45N,500000,0,87,0.9996, ,0,Meter
-24346,Kalianpur_1975_UTM_Zone_46N,500000,0,93,0.9996, ,0,Meter
-24347,Kalianpur_1975_UTM_Zone_47N,500000,0,99,0.9996, ,0,Meter
-24370,Kalianpur_1880_India_Zone_0,2355500,2590000,68,39.5,0.99846154,39.5,Yard_Indian
-24371,Kalianpur_1880_India_Zone_I,3000000,1000000,68,32.5,0.99878641,32.5,Yard_Indian
-24372,Kalianpur_1880_India_Zone_IIa,3000000,1000000,74,26,0.99878641,26,Yard_Indian
-24373,Kalianpur_1880_India_Zone_III,3000000,1000000,80,19,0.99878641,19,Yard_Indian
-24374,Kalianpur_1880_India_Zone_IV,3000000,1000000,80,12,0.99878641,12,Yard_Indian
-24375,Kalianpur_1937_India_Zone_IIb,2743195.5,914398.5,90,26,0.99878641,26,Meter
-24376,Kalianpur_1962_India_Zone_I,2743196.4,914398.8,68,32.5,0.99878641,32.5,Meter
-24377,Kalianpur_1962_India_Zone_IIa,2743196.4,914398.8,74,26,0.99878641,26,Meter
-24378,Kalianpur_1975_India_Zone_I,2743185.69,914395.23,68,32.5,0.99878641,32.5,Meter
-24379,Kalianpur_1975_India_Zone_IIa,2743185.69,914395.23,74,26,0.99878641,26,Meter
-24380,Kalianpur_1975_India_Zone_IIb,2743185.69,914395.23,90,26,0.99878641,26,Meter
-24381,Kalianpur_1975_India_Zone_III,2743185.69,914395.23,80,19,0.99878641,19,Meter
-24382,Kalianpur_1880_India_Zone_IIb,3000000,1000000,90,26,0.99878641,26,Yard_Indian
-24383,Kalianpur_1975_India_Zone_IV,2743185.69,914395.23,80,12,0.99878641,12,Meter
-24500,Kertau_Singapore_Grid,30000,30000,103.8530022,1, ,1.287646667,Meter
-24547,Kertau_UTM_Zone_47N,500000,0,99,0.9996, ,0,Meter
-24548,Kertau_UTM_Zone_48N,500000,0,105,0.9996, ,0,Meter
-24600,KOC_Lambert,1500000,1166200,45,32.5,0.998786408,32.5,Meter
-24718,La_Canoa_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-24719,La_Canoa_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
-24720,La_Canoa_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-24721,La_Canoa_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-24817,PSAD_1956_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
-24818,PSAD_1956_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-24819,PSAD_1956_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
-24820,PSAD_1956_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-24821,PSAD_1956_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-24877,PSAD_1956_UTM_Zone_17S,500000,10000000,-81,0.9996, ,0,Meter
-24878,PSAD_1956_UTM_Zone_18S,500000,10000000,-75,0.9996, ,0,Meter
-24879,PSAD_1956_UTM_Zone_19S,500000,10000000,-69,0.9996, ,0,Meter
-24880,PSAD_1956_UTM_Zone_20S,500000,10000000,-63,0.9996, ,0,Meter
-24881,PSAD_1956_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
-24882,PSAD_1956_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
-24891,Peru_West_Zone,222000,1426834.743,-80.5,0.99983008, ,-6,Meter
-24892,Peru_Central_Zone,720000,1039979.159,-76,0.99932994, ,-9.5,Meter
-24893,Peru_East_Zone,1324000,1040084.558,-70.5,0.99952992, ,-9.5,Meter
-25000,Ghana_Metre_Grid,274319.51,0,-1,0.99975, ,4.666666667,Meter
-25231,Lome_UTM_Zone_31N,500000,0,3,0.9996, ,0,Meter
-25391,Philippines_Zone_I,500000,0,117,0.99995, ,0,Meter
-25392,Philippines_Zone_II,500000,0,119,0.99995, ,0,Meter
-25393,Philippines_Zone_III,500000,0,121,0.99995, ,0,Meter
-25394,Philippines_Zone_IV,500000,0,123,0.99995, ,0,Meter
-25395,Philippines_Zone_V,500000,0,125,0.99995, ,0,Meter
-25828,ETRS_1989_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-25829,ETRS_1989_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
-25830,ETRS_1989_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
-25831,ETRS_1989_UTM_Zone_31N,500000,0,3,0.9996, ,0,Meter
-25832,ETRS_1989_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
-25833,ETRS_1989_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
-25834,ETRS_1989_UTM_Zone_34N,500000,0,21,0.9996, ,0,Meter
-25835,ETRS_1989_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
-25836,ETRS_1989_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
-25837,ETRS_1989_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
-25838,ETRS_1989_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
-25884,ETRS_1989_TM_Baltic_1993,500000,0,24,0.9996, ,0,Meter
-25932,Malongo_1987_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
-26191,Nord_Maroc,500000,300000,-6,37,0.999625769,37,Meter
-26192,Sud_Maroc,500000,300000,-6,33,0.999615596,33,Meter
-26193,Sahara,1200000,400000,-6,29,0.9996,29,Meter
-26194,Merchich_Sahara_Nord,1200000,400000,-6,29,0.999616304,29,Meter
-26195,Merchich_Sahara_Sud,1500000,400000,-6,25,0.999616437,25,Meter
-26237,Massawa_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
-26331,Minna_UTM_Zone_31N,500000,0,3,0.9996, ,0,Meter
-26332,Minna_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
-26391,Nigeria_West_Belt,230738.26,0,4.5,0.99975, ,4,Meter
-26392,Nigeria_Mid_Belt,670553.98,0,8.5,0.99975, ,4,Meter
-26393,Nigeria_East_Belt,1110369.7,0,12.5,0.99975, ,4,Meter
-26432,Mhast_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
-26591,Monte_Mario_Rome_Italy_1,1500000,0,-3.45233333,0.9996, ,0,Meter
-26592,Monte_Mario_Rome_Italy_2,2520000,0,2.54766667,0.9996, ,0,Meter
-26632,Mporaloko_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
-26692,Mporaloko_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
-26701,NAD_1927_UTM_Zone_1N,500000,0,-177,0.9996, ,0,Meter
-26702,NAD_1927_UTM_Zone_2N,500000,0,-171,0.9996, ,0,Meter
-26703,NAD_1927_UTM_Zone_3N,500000,0,-165,0.9996, ,0,Meter
-26704,NAD_1927_UTM_Zone_4N,500000,0,-159,0.9996, ,0,Meter
-26705,NAD_1927_UTM_Zone_5N,500000,0,-153,0.9996, ,0,Meter
-26706,NAD_1927_UTM_Zone_6N,500000,0,-147,0.9996, ,0,Meter
-26707,NAD_1927_UTM_Zone_7N,500000,0,-141,0.9996, ,0,Meter
-26708,NAD_1927_UTM_Zone_8N,500000,0,-135,0.9996, ,0,Meter
-26709,NAD_1927_UTM_Zone_9N,500000,0,-129,0.9996, ,0,Meter
-26710,NAD_1927_UTM_Zone_10N,500000,0,-123,0.9996, ,0,Meter
-26711,NAD_1927_UTM_Zone_11N,500000,0,-117,0.9996, ,0,Meter
-26712,NAD_1927_UTM_Zone_12N,500000,0,-111,0.9996, ,0,Meter
-26713,NAD_1927_UTM_Zone_13N,500000,0,-105,0.9996, ,0,Meter
-26714,NAD_1927_UTM_Zone_14N,500000,0,-99,0.9996, ,0,Meter
-26715,NAD_1927_UTM_Zone_15N,500000,0,-93,0.9996, ,0,Meter
-26716,NAD_1927_UTM_Zone_16N,500000,0,-87,0.9996, ,0,Meter
-26717,NAD_1927_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
-26718,NAD_1927_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-26719,NAD_1927_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
-26720,NAD_1927_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-26721,NAD_1927_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-26722,NAD_1927_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
-26729,NAD_1927_StatePlane_Alabama_East_FIPS_0101,500000,0,-85.83333333,0.99996, ,30.5,Foot_US
-26730,NAD_1927_StatePlane_Alabama_West_FIPS_0102,500000,0,-87.5,0.999933333, ,30,Foot_US
-26731,NAD_1927_StatePlane_Alaska_1_FIPS_5001,16404166.67,-16404166.67,0.9999,-36.86989765,-133.6666667,57,Foot_US
-26732,NAD_1927_StatePlane_Alaska_2_FIPS_5002,500000,0,-142,0.9999, ,54,Foot_US
-26733,NAD_1927_StatePlane_Alaska_3_FIPS_5003,500000,0,-146,0.9999, ,54,Foot_US
-26734,NAD_1927_StatePlane_Alaska_4_FIPS_5004,500000,0,-150,0.9999, ,54,Foot_US
-26735,NAD_1927_StatePlane_Alaska_5_FIPS_5005,500000,0,-154,0.9999, ,54,Foot_US
-26736,NAD_1927_StatePlane_Alaska_6_FIPS_5006,500000,0,-158,0.9999, ,54,Foot_US
-26737,NAD_1927_StatePlane_Alaska_7_FIPS_5007,700000,0,-162,0.9999, ,54,Foot_US
-26738,NAD_1927_StatePlane_Alaska_8_FIPS_5008,500000,0,-166,0.9999, ,54,Foot_US
-26739,NAD_1927_StatePlane_Alaska_9_FIPS_5009,600000,0,-170,0.9999, ,54,Foot_US
-26740,NAD_1927_StatePlane_Alaska_10_FIPS_5010,3000000,0,-176,51.83333333,53.83333333,51,Foot_US
-26741,NAD_1927_StatePlane_California_I_FIPS_0401,2000000,0,-122,40,41.66666667,39.33333333,Foot_US
-26742,NAD_1927_StatePlane_California_II_FIPS_0402,2000000,0,-122,38.33333333,39.83333333,37.66666667,Foot_US
-26743,NAD_1927_StatePlane_California_III_FIPS_0403,2000000,0,-120.5,37.06666667,38.43333333,36.5,Foot_US
-26744,NAD_1927_StatePlane_California_IV_FIPS_0404,2000000,0,-119,36,37.25,35.33333333,Foot_US
-26745,NAD_1927_StatePlane_California_V_FIPS_0405,2000000,0,-118,34.03333333,35.46666667,33.5,Foot_US
-26746,NAD_1927_StatePlane_California_VI_FIPS_0406,2000000,0,-116.25,32.78333333,33.88333333,32.16666667,Foot_US
-26748,NAD_1927_StatePlane_Arizona_East_FIPS_0201,500000,0,-110.1666667,0.9999, ,31,Foot_US
-26749,NAD_1927_StatePlane_Arizona_Central_FIPS_0202,500000,0,-111.9166667,0.9999, ,31,Foot_US
-26750,NAD_1927_StatePlane_Arizona_West_FIPS_0203,500000,0,-113.75,0.999933333, ,31,Foot_US
-26751,NAD_1927_StatePlane_Arkansas_North_FIPS_0301,2000000,0,-92,34.93333333,36.23333333,34.33333333,Foot_US
-26752,NAD_1927_StatePlane_Arkansas_South_FIPS_0302,2000000,0,-92,33.3,34.76666667,32.66666667,Foot_US
-26753,NAD_1927_StatePlane_Colorado_North_FIPS_0501,2000000,0,-105.5,39.71666667,40.78333333,39.33333333,Foot_US
-26754,NAD_1927_StatePlane_Colorado_Central_FIPS_0502,2000000,0,-105.5,38.45,39.75,37.83333333,Foot_US
-26755,NAD_1927_StatePlane_Colorado_South_FIPS_0503,2000000,0,-105.5,37.23333333,38.43333333,36.66666667,Foot_US
-26756,NAD_1927_StatePlane_Connecticut_FIPS_0600,600000,0,-72.75,41.2,41.86666667,40.83333333,Foot_US
-26757,NAD_1927_StatePlane_Delaware_FIPS_0700,500000,0,-75.41666667,0.999995, ,38,Foot_US
-26758,NAD_1927_StatePlane_Florida_East_FIPS_0901,500000,0,-81,0.999941176, ,24.33333333,Foot_US
-26759,NAD_1927_StatePlane_Florida_West_FIPS_0902,500000,0,-82,0.999941176, ,24.33333333,Foot_US
-26760,NAD_1927_StatePlane_Florida_North_FIPS_0903,2000000,0,-84.5,29.58333333,30.75,29,Foot_US
-26761,NAD_1927_StatePlane_Hawaii_1_FIPS_5101,500000,0,-155.5,0.999966667, ,18.83333333,Foot_US
-26762,NAD_1927_StatePlane_Hawaii_2_FIPS_5102,500000,0,-156.6666667,0.999966667, ,20.33333333,Foot_US
-26763,NAD_1927_StatePlane_Hawaii_3_FIPS_5103,500000,0,-158,0.99999, ,21.16666667,Foot_US
-26764,NAD_1927_StatePlane_Hawaii_4_FIPS_5104,500000,0,-159.5,0.99999, ,21.83333333,Foot_US
-26765,NAD_1927_StatePlane_Hawaii_5_FIPS_5105,500000,0,-160.1666667,1, ,21.66666667,Foot_US
-26766,NAD_1927_StatePlane_Georgia_East_FIPS_1001,500000,0,-82.16666667,0.9999, ,30,Foot_US
-26767,NAD_1927_StatePlane_Georgia_West_FIPS_1002,500000,0,-84.16666667,0.9999, ,30,Foot_US
-26768,NAD_1927_StatePlane_Idaho_East_FIPS_1101,500000,0,-112.1666667,0.999947368, ,41.66666667,Foot_US
-26769,NAD_1927_StatePlane_Idaho_Central_FIPS_1102,500000,0,-114,0.999947368, ,41.66666667,Foot_US
-26770,NAD_1927_StatePlane_Idaho_West_FIPS_1103,500000,0,-115.75,0.999933333, ,41.66666667,Foot_US
-26771,NAD_1927_StatePlane_Illinois_East_FIPS_1201,500000,0,-88.33333333,0.999975, ,36.66666667,Foot_US
-26772,NAD_1927_StatePlane_Illinois_West_FIPS_1202,500000,0,-90.16666667,0.999941176, ,36.66666667,Foot_US
-26773,NAD_1927_StatePlane_Indiana_East_FIPS_1301,500000,0,-85.66666667,0.999966667, ,37.5,Foot_US
-26774,NAD_1927_StatePlane_Indiana_West_FIPS_1302,500000,0,-87.08333333,0.999966667, ,37.5,Foot_US
-26775,NAD_1927_StatePlane_Iowa_North_FIPS_1401,2000000,0,-93.5,42.06666667,43.26666667,41.5,Foot_US
-26776,NAD_1927_StatePlane_Iowa_South_FIPS_1402,2000000,0,-93.5,40.61666667,41.78333333,40,Foot_US
-26777,NAD_1927_StatePlane_Kansas_North_FIPS_1501,2000000,0,-98,38.71666667,39.78333333,38.33333333,Foot_US
-26778,NAD_1927_StatePlane_Kansas_South_FIPS_1502,2000000,0,-98.5,37.26666667,38.56666667,36.66666667,Foot_US
-26779,NAD_1927_StatePlane_Kentucky_North_FIPS_1601,2000000,0,-84.25,37.96666667,38.96666667,37.5,Foot_US
-26780,NAD_1927_StatePlane_Kentucky_South_FIPS_1602,2000000,0,-85.75,36.73333333,37.93333333,36.33333333,Foot_US
-26781,NAD_1927_StatePlane_Louisiana_North_FIPS_1701,2000000,0,-92.5,31.16666667,32.66666667,30.66666667,Foot_US
-26782,NAD_1927_StatePlane_Louisiana_South_FIPS_1702,2000000,0,-91.33333333,29.3,30.7,28.66666667,Foot_US
-26783,NAD_1927_StatePlane_Maine_East_FIPS_1801,500000,0,-68.5,0.9999, ,43.83333333,Foot_US
-26784,NAD_1927_StatePlane_Maine_West_FIPS_1802,500000,0,-70.16666667,0.999966667, ,42.83333333,Foot_US
-26785,NAD_1927_StatePlane_Maryland_FIPS_1900,800000,0,-77,38.3,39.45,37.83333333,Foot_US
-26786,NAD_1927_StatePlane_Massachusetts_Mainland_FIPS_2001,600000,0,-71.5,41.71666667,42.68333333,41,Foot_US
-26787,NAD_1927_StatePlane_Massachusetts_Island_FIPS_2002,200000,0,-70.5,41.28333333,41.48333333,41,Foot_US
-26788,NAD_1927_StatePlane_Michigan_North_FIPS_2111,2000000,0,-87,45.48333333,47.08333333,44.78333333,Foot_US
-26789,NAD_1927_StatePlane_Michigan_Central_FIPS_2112,2000000,0,-84.33333333,44.18333333,45.7,43.31666667,Foot_US
-26790,NAD_1927_StatePlane_Michigan_South_FIPS_2113,2000000,0,-84.33333333,42.1,43.66666667,41.5,Foot_US
-26791,NAD_1927_StatePlane_Minnesota_North_FIPS_2201,2000000,0,-93.1,47.03333333,48.63333333,46.5,Foot_US
-26792,NAD_1927_StatePlane_Minnesota_Central_FIPS_2202,2000000,0,-94.25,45.61666667,47.05,45,Foot_US
-26793,NAD_1927_StatePlane_Minnesota_South_FIPS_2203,2000000,0,-94,43.78333333,45.21666667,43,Foot_US
-26794,NAD_1927_StatePlane_Mississippi_East_FIPS_2301,500000,0,-88.83333333,0.99996, ,29.66666667,Foot_US
-26795,NAD_1927_StatePlane_Mississippi_West_FIPS_2302,500000,0,-90.33333333,0.999941176, ,30.5,Foot_US
-26796,NAD_1927_StatePlane_Missouri_East_FIPS_2401,500000,0,-90.5,0.999933333, ,35.83333333,Foot_US
-26797,NAD_1927_StatePlane_Missouri_Central_FIPS_2402,500000,0,-92.5,0.999933333, ,35.83333333,Foot_US
-26798,NAD_1927_StatePlane_Missouri_West_FIPS_2403,500000,0,-94.5,0.999941176, ,36.16666667,Foot_US
-26801,NAD_Michigan_StatePlane_Michigan_East_Old_FIPS_2101,500000,0,-83.66666667,0.999942857, ,41.5,Foot_US
-26802,NAD_Michigan_StatePlane_Michigan_Central_Old_FIPS_2102,500000,0,-85.75,0.999909091, ,41.5,Foot_US
-26803,NAD_Michigan_StatePlane_Michigan_West_Old_FIPS_2103,500000,0,-88.75,0.999909091, ,41.5,Foot_US
-26811,NAD_Michigan_StatePlane_Michigan_North_FIPS_2111,2000000,0,-87,45.48333333,47.08333333,44.78333333,Foot_US
-26812,NAD_Michigan_StatePlane_Michigan_Central_FIPS_2112,2000000,0,-84.33333333,44.18333333,45.7,43.31666667,Foot_US
-26813,NAD_Michigan_StatePlane_Michigan_South_FIPS_2113,2000000,0,-84.33333333,42.1,43.66666667,41.5,Foot_US
-26901,NAD_1983_UTM_Zone_1N,500000,0,-177,0.9996, ,0,Meter
-26902,NAD_1983_UTM_Zone_2N,500000,0,-171,0.9996, ,0,Meter
-26903,NAD_1983_UTM_Zone_3N,500000,0,-165,0.9996, ,0,Meter
-26904,NAD_1983_UTM_Zone_4N,500000,0,-159,0.9996, ,0,Meter
-26905,NAD_1983_UTM_Zone_5N,500000,0,-153,0.9996, ,0,Meter
-26906,NAD_1983_UTM_Zone_6N,500000,0,-147,0.9996, ,0,Meter
-26907,NAD_1983_UTM_Zone_7N,500000,0,-141,0.9996, ,0,Meter
-26908,NAD_1983_UTM_Zone_8N,500000,0,-135,0.9996, ,0,Meter
-26909,NAD_1983_UTM_Zone_9N,500000,0,-129,0.9996, ,0,Meter
-26910,NAD_1983_UTM_Zone_10N,500000,0,-123,0.9996, ,0,Meter
-26911,NAD_1983_UTM_Zone_11N,500000,0,-117,0.9996, ,0,Meter
-26912,NAD_1983_UTM_Zone_12N,500000,0,-111,0.9996, ,0,Meter
-26913,NAD_1983_UTM_Zone_13N,500000,0,-105,0.9996, ,0,Meter
-26914,NAD_1983_UTM_Zone_14N,500000,0,-99,0.9996, ,0,Meter
-26915,NAD_1983_UTM_Zone_15N,500000,0,-93,0.9996, ,0,Meter
-26916,NAD_1983_UTM_Zone_16N,500000,0,-87,0.9996, ,0,Meter
-26917,NAD_1983_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
-26918,NAD_1983_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-26919,NAD_1983_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
-26920,NAD_1983_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-26921,NAD_1983_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-26922,NAD_1983_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
-26923,NAD_1983_UTM_Zone_23N,500000,0,-45,0.9996, ,0,Meter
-26929,NAD_1983_StatePlane_Alabama_East_FIPS_0101,200000,0,-85.83333333,0.99996, ,30.5,Meter
-26930,NAD_1983_StatePlane_Alabama_West_FIPS_0102,600000,0,-87.5,0.999933333, ,30,Meter
-26931,NAD_1983_StatePlane_Alaska_1_FIPS_5001,5000000,-5000000,0.9999,-36.86989765,-133.6666667,57,Meter
-26932,NAD_1983_StatePlane_Alaska_2_FIPS_5002,500000,0,-142,0.9999, ,54,Meter
-26933,NAD_1983_StatePlane_Alaska_3_FIPS_5003,500000,0,-146,0.9999, ,54,Meter
-26934,NAD_1983_StatePlane_Alaska_4_FIPS_5004,500000,0,-150,0.9999, ,54,Meter
-26935,NAD_1983_StatePlane_Alaska_5_FIPS_5005,500000,0,-154,0.9999, ,54,Meter
-26936,NAD_1983_StatePlane_Alaska_6_FIPS_5006,500000,0,-158,0.9999, ,54,Meter
-26937,NAD_1983_StatePlane_Alaska_7_FIPS_5007,500000,0,-162,0.9999, ,54,Meter
-26938,NAD_1983_StatePlane_Alaska_8_FIPS_5008,500000,0,-166,0.9999, ,54,Meter
-26939,NAD_1983_StatePlane_Alaska_9_FIPS_5009,500000,0,-170,0.9999, ,54,Meter
-26940,NAD_1983_StatePlane_Alaska_10_FIPS_5010,1000000,0,-176,51.83333333,53.83333333,51,Meter
-26941,NAD_1983_StatePlane_California_I_FIPS_0401,2000000,500000,-122,40,41.66666667,39.33333333,Meter
-26942,NAD_1983_StatePlane_California_II_FIPS_0402,2000000,500000,-122,38.33333333,39.83333333,37.66666667,Meter
-26943,NAD_1983_StatePlane_California_III_FIPS_0403,2000000,500000,-120.5,37.06666667,38.43333333,36.5,Meter
-26944,NAD_1983_StatePlane_California_IV_FIPS_0404,2000000,500000,-119,36,37.25,35.33333333,Meter
-26945,NAD_1983_StatePlane_California_V_FIPS_0405,2000000,500000,-118,34.03333333,35.46666667,33.5,Meter
-26946,NAD_1983_StatePlane_California_VI_FIPS_0406,2000000,500000,-116.25,32.78333333,33.88333333,32.16666667,Meter
-26948,NAD_1983_StatePlane_Arizona_East_FIPS_0201,213360,0,-110.1666667,0.9999, ,31,Meter
-26949,NAD_1983_StatePlane_Arizona_Central_FIPS_0202,213360,0,-111.9166667,0.9999, ,31,Meter
-26950,NAD_1983_StatePlane_Arizona_West_FIPS_0203,213360,0,-113.75,0.999933333, ,31,Meter
-26951,NAD_1983_StatePlane_Arkansas_North_FIPS_0301,400000,0,-92,34.93333333,36.23333333,34.33333333,Meter
-26952,NAD_1983_StatePlane_Arkansas_South_FIPS_0302,400000,400000,-92,33.3,34.76666667,32.66666667,Meter
-26953,NAD_1983_StatePlane_Colorado_North_FIPS_0501,914401.8289,304800.6096,-105.5,39.71666667,40.78333333,39.33333333,Meter
-26954,NAD_1983_StatePlane_Colorado_Central_FIPS_0502,914401.8289,304800.6096,-105.5,38.45,39.75,37.83333333,Meter
-26955,NAD_1983_StatePlane_Colorado_South_FIPS_0503,914401.8289,304800.6096,-105.5,37.23333333,38.43333333,36.66666667,Meter
-26956,NAD_1983_StatePlane_Connecticut_FIPS_0600,304800.6096,152400.3048,-72.75,41.2,41.86666667,40.83333333,Meter
-26957,NAD_1983_StatePlane_Delaware_FIPS_0700,200000,0,-75.41666667,0.999995, ,38,Meter
-26958,NAD_1983_StatePlane_Florida_East_FIPS_0901,200000,0,-81,0.999941176, ,24.33333333,Meter
-26959,NAD_1983_StatePlane_Florida_West_FIPS_0902,200000,0,-82,0.999941176, ,24.33333333,Meter
-26960,NAD_1983_StatePlane_Florida_North_FIPS_0903,600000,0,-84.5,29.58333333,30.75,29,Meter
-26961,NAD_1983_StatePlane_Hawaii_1_FIPS_5101,500000,0,-155.5,0.999966667, ,18.83333333,Meter
-26962,NAD_1983_StatePlane_Hawaii_2_FIPS_5102,500000,0,-156.6666667,0.999966667, ,20.33333333,Meter
-26963,NAD_1983_StatePlane_Hawaii_3_FIPS_5103,500000,0,-158,0.99999, ,21.16666667,Meter
-26964,NAD_1983_StatePlane_Hawaii_4_FIPS_5104,500000,0,-159.5,0.99999, ,21.83333333,Meter
-26965,NAD_1983_StatePlane_Hawaii_5_FIPS_5105,500000,0,-160.1666667,1, ,21.66666667,Meter
-26966,NAD_1983_StatePlane_Georgia_East_FIPS_1001,200000,0,-82.16666667,0.9999, ,30,Meter
-26967,NAD_1983_StatePlane_Georgia_West_FIPS_1002,700000,0,-84.16666667,0.9999, ,30,Meter
-26968,NAD_1983_StatePlane_Idaho_East_FIPS_1101,200000,0,-112.1666667,0.999947368, ,41.66666667,Meter
-26969,NAD_1983_StatePlane_Idaho_Central_FIPS_1102,500000,0,-114,0.999947368, ,41.66666667,Meter
-26970,NAD_1983_StatePlane_Idaho_West_FIPS_1103,800000,0,-115.75,0.999933333, ,41.66666667,Meter
-26971,NAD_1983_StatePlane_Illinois_East_FIPS_1201,300000,0,-88.33333333,0.999975, ,36.66666667,Meter
-26972,NAD_1983_StatePlane_Illinois_West_FIPS_1202,700000,0,-90.16666667,0.999941176, ,36.66666667,Meter
-26973,NAD_1983_StatePlane_Indiana_East_FIPS_1301,100000,250000,-85.66666667,0.999966667, ,37.5,Meter
-26974,NAD_1983_StatePlane_Indiana_West_FIPS_1302,900000,250000,-87.08333333,0.999966667, ,37.5,Meter
-26975,NAD_1983_StatePlane_Iowa_North_FIPS_1401,1500000,1000000,-93.5,42.06666667,43.26666667,41.5,Meter
-26976,NAD_1983_StatePlane_Iowa_South_FIPS_1402,500000,0,-93.5,40.61666667,41.78333333,40,Meter
-26977,NAD_1983_StatePlane_Kansas_North_FIPS_1501,400000,0,-98,38.71666667,39.78333333,38.33333333,Meter
-26978,NAD_1983_StatePlane_Kansas_South_FIPS_1502,400000,400000,-98.5,37.26666667,38.56666667,36.66666667,Meter
-26979,NAD_1983_StatePlane_Kentucky_North_FIPS_1601,500000,0,-84.25,37.96666667,38.96666667,37.5,Meter
-26980,NAD_1983_StatePlane_Kentucky_South_FIPS_1602,500000,500000,-85.75,36.73333333,37.93333333,36.33333333,Meter
-26981,NAD_1983_StatePlane_Louisiana_North_FIPS_1701,1000000,0,-92.5,31.16666667,32.66666667,30.5,Meter
-26982,NAD_1983_StatePlane_Louisiana_South_FIPS_1702,1000000,0,-91.33333333,29.3,30.7,28.5,Meter
-26983,NAD_1983_StatePlane_Maine_East_FIPS_1801,300000,0,-68.5,0.9999, ,43.66666667,Meter
-26984,NAD_1983_StatePlane_Maine_West_FIPS_1802,900000,0,-70.16666667,0.999966667, ,42.83333333,Meter
-26985,NAD_1983_StatePlane_Maryland_FIPS_1900,400000,0,-77,38.3,39.45,37.66666667,Meter
-26986,NAD_1983_StatePlane_Massachusetts_Mainland_FIPS_2001,200000,750000,-71.5,41.71666667,42.68333333,41,Meter
-26987,NAD_1983_StatePlane_Massachusetts_Island_FIPS_2002,500000,0,-70.5,41.28333333,41.48333333,41,Meter
-26988,NAD_1983_StatePlane_Michigan_North_FIPS_2111,8000000,0,-87,45.48333333,47.08333333,44.78333333,Meter
-26989,NAD_1983_StatePlane_Michigan_Central_FIPS_2112,6000000,0,-84.36666667,44.18333333,45.7,43.31666667,Meter
-26990,NAD_1983_StatePlane_Michigan_South_FIPS_2113,4000000,0,-84.36666667,42.1,43.66666667,41.5,Meter
-26991,NAD_1983_StatePlane_Minnesota_North_FIPS_2201,800000,100000,-93.1,47.03333333,48.63333333,46.5,Meter
-26992,NAD_1983_StatePlane_Minnesota_Central_FIPS_2202,800000,100000,-94.25,45.61666667,47.05,45,Meter
-26993,NAD_1983_StatePlane_Minnesota_South_FIPS_2203,800000,100000,-94,43.78333333,45.21666667,43,Meter
-26994,NAD_1983_StatePlane_Mississippi_East_FIPS_2301,300000,0,-88.83333333,0.99995, ,29.5,Meter
-26995,NAD_1983_StatePlane_Mississippi_West_FIPS_2302,700000,0,-90.33333333,0.99995, ,29.5,Meter
-26996,NAD_1983_StatePlane_Missouri_East_FIPS_2401,250000,0,-90.5,0.999933333, ,35.83333333,Meter
-26997,NAD_1983_StatePlane_Missouri_Central_FIPS_2402,500000,0,-92.5,0.999933333, ,35.83333333,Meter
-26998,NAD_1983_StatePlane_Missouri_West_FIPS_2403,850000,0,-94.5,0.999941176, ,36.16666667,Meter
-27038,Nahrwan_1967_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
-27039,Nahrwan_1967_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
-27040,Nahrwan_1967_UTM_Zone_40N,500000,0,57,0.9996, ,0,Meter
-27120,Naparima_1972_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-27200,GD_1949_New_Zealand_Map_Grid,2510000,6023150,173,,,-41,Meter
-27205,NZGD_1949_Mount_Eden_Circuit,300000,700000,174.7643394,0.9999, ,-36.87986528,Meter
-27206,NZGD_1949_Bay_of_Plenty_Circuit,300000,700000,176.4661973,1, ,-37.76124981,Meter
-27207,NZGD_1949_Poverty_Bay_Circuit,300000,700000,177.8856363,1, ,-38.62470278,Meter
-27208,NZGD_1949_Hawkes_Bay_Circuit,300000,700000,176.6736805,1, ,-39.65092931,Meter
-27209,NZGD_1949_Taranaki_Circuit,300000,700000,174.2280118,1, ,-39.13575831,Meter
-27210,NZGD_1949_Tuhirangi_Circuit,300000,700000,175.6400368,1, ,-39.51247039,Meter
-27211,NZGD_1949_Wanganui_Circuit,300000,700000,175.4880996,1, ,-40.24194714,Meter
-27212,NZGD_1949_Wairarapa_Circuit,300000,700000,175.6473497,1, ,-40.92553264,Meter
-27213,NZGD_1949_Wellington_Circuit,300000,700000,174.7766231,1, ,-41.30131964,Meter
-27214,NZGD_1949_Collingwood_Circuit,300000,700000,172.6720465,1, ,-40.71475906,Meter
-27215,NZGD_1949_Nelson_Circuit,300000,700000,173.2993168,1, ,-41.27454472,Meter
-27216,NZGD_1949_Karamea_Circuit,300000,700000,172.1090282,1, ,-41.28991153,Meter
-27217,NZGD_1949_Buller_Circuit,300000,700000,171.5812601,1, ,-41.81080286,Meter
-27218,NZGD_1949_Grey_Circuit,300000,700000,171.5497713,1, ,-42.33369428,Meter
-27219,NZGD_1949_Amuri_Circuit,300000,700000,173.0101334,1, ,-42.68911658,Meter
-27220,NZGD_1949_Marlborough_Circuit,300000,700000,173.8020741,1, ,-41.54448667,Meter
-27221,NZGD_1949_Hokitika_Circuit,300000,700000,170.9799935,1, ,-42.88632236,Meter
-27222,NZGD_1949_Okarito_Circuit,300000,700000,170.2609258,1, ,-43.11012814,Meter
-27223,NZGD_1949_Jacksons_Bay_Circuit,300000,700000,168.606267,1, ,-43.97780289,Meter
-27224,NZGD_1949_Mount_Pleasant_Circuit,300000,700000,172.7271936,1, ,-43.59063758,Meter
-27225,NZGD_1949_Gawler_Circuit,300000,700000,171.3607485,1, ,-43.74871156,Meter
-27226,NZGD_1949_Timaru_Circuit,300000,700000,171.0572508,1, ,-44.40222036,Meter
-27227,NZGD_1949_Lindis_Peak_Circuit,300000,700000,169.4677551,1, ,-44.73526797,Meter
-27228,NZGD_1949_Mount_Nicholas_Circuit,300000,700000,168.3986412,1, ,-45.13290258,Meter
-27229,NZGD_1949_Mount_York_Circuit,300000,700000,167.7388618,1, ,-45.56372617,Meter
-27230,NZGD_1949_Observation_Point_Circuit,300000,700000,170.6285952,1, ,-45.81619661,Meter
-27231,NZGD_1949_North_Taieri_Circuit,300000,700000,170.2825891,0.99996, ,-45.86151336,Meter
-27232,NZGD_1949_Bluff_Circuit,300002.66,699999.58,168.342872,1, ,-46.60000961,Meter
-27258,NZGD_1949_UTM_Zone_58S,500000,10000000,165,0.9996, ,0,Meter
-27259,NZGD_1949_UTM_Zone_59S,500000,10000000,171,0.9996, ,0,Meter
-27260,NZGD_1949_UTM_Zone_60S,500000,10000000,177,0.9996, ,0,Meter
-27291,New_Zealand_North_Island,300000,400000,175.5,1, ,-39,Yard_Sears
-27292,New_Zealand_South_Island,500000,500000,171.5,1, ,-44,Yard_Sears
-27391,NGO_1948_Oslo_Norway_Zone_1,0,0,-4.666666667,1, ,58,Meter
-27392,NGO_1948_Oslo_Norway_Zone_2,0,0,-2.333333333,1, ,58,Meter
-27393,NGO_1948_Oslo_Norway_Zone_3,0,0,0,1, ,58,Meter
-27394,NGO_1948_Oslo_Norway_Zone_4,0,0,2.5,1, ,58,Meter
-27395,NGO_1948_Oslo_Norway_Zone_5,0,0,6.166666667,1, ,58,Meter
-27396,NGO_1948_Oslo_Norway_Zone_6,0,0,10.16666667,1, ,58,Meter
-27397,NGO_1948_Oslo_Norway_Zone_7,0,0,14.16666667,1, ,58,Meter
-27398,NGO_1948_Oslo_Norway_Zone_8,0,0,18.33333333,1, ,58,Meter
-27429,Datum_73_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
-27492,Datum_73_Modified_Portuguese_Grid,180.598,-86.99,-8.131906111,1, ,39.66666667,Meter
-27500,Nord_de_Guerre,500000,300000,6,55,0.99950908,55,Meter
-27581,NTF_Paris_France_I,600000,1200000,0,55,0.999877341,55,Meter
-27582,NTF_Paris_France_II,600000,2200000,0,52,0.99987742,52,Meter
-27583,NTF_Paris_France_III,600000,3200000,0,49,0.999877499,49,Meter
-27584,NTF_Paris_France_IV,234.358,185861.369,0,46.85,0.99994471,46.85,Meter
-27591,NTF_Paris_Nord_France,600000,200000,0,55,0.999877341,55,Meter
-27592,NTF_Paris_Centre_France,600000,200000,0,52,0.99987742,52,Meter
-27593,NTF_Paris_Sud_France,600000,200000,0,49,0.999877499,49,Meter
-27594,NTF_Paris_Corse,234.358,185861.369,0,46.85,0.99994471,46.85,Meter
-27700,British_National_Grid,400000,-100000,-2,0.999601272, ,49,Meter
-28191,Palestine_1923_Palestine_Grid,170251.555,126867.909,35.21208056,1, ,31.73409694,Meter
-28192,Palestine_1923_Palestine_Belt,170251.555,1126867.909,35.21208056,1, ,31.73409694,Meter
-28193,Palestine_1923_Israel_CS_Grid,170251.555,1126867.909,35.21208056,1, ,31.73409694,Meter
-28232,Pointe_Noire_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
-28348,GDA_1994_MGA_Zone_48,500000,10000000,105,0.9996, ,0,Meter
-28349,GDA_1994_MGA_Zone_49,500000,10000000,111,0.9996, ,0,Meter
-28350,GDA_1994_MGA_Zone_50,500000,10000000,117,0.9996, ,0,Meter
-28351,GDA_1994_MGA_Zone_51,500000,10000000,123,0.9996, ,0,Meter
-28352,GDA_1994_MGA_Zone_52,500000,10000000,129,0.9996, ,0,Meter
-28353,GDA_1994_MGA_Zone_53,500000,10000000,135,0.9996, ,0,Meter
-28354,GDA_1994_MGA_Zone_54,500000,10000000,141,0.9996, ,0,Meter
-28355,GDA_1994_MGA_Zone_55,500000,10000000,147,0.9996, ,0,Meter
-28356,GDA_1994_MGA_Zone_56,500000,10000000,153,0.9996, ,0,Meter
-28357,GDA_1994_MGA_Zone_57,500000,10000000,159,0.9996, ,0,Meter
-28358,GDA_1994_MGA_Zone_58,500000,10000000,165,0.9996, ,0,Meter
-28402,Pulkovo_1942_GK_Zone_2,2500000,0,9,1, ,0,Meter
-28403,Pulkovo_1942_GK_Zone_3,3500000,0,15,1, ,0,Meter
-28404,Pulkovo_1942_GK_Zone_4,4500000,0,21,1, ,0,Meter
-28405,Pulkovo_1942_GK_Zone_5,5500000,0,27,1, ,0,Meter
-28406,Pulkovo_1942_GK_Zone_6,6500000,0,33,1, ,0,Meter
-28407,Pulkovo_1942_GK_Zone_7,7500000,0,39,1, ,0,Meter
-28408,Pulkovo_1942_GK_Zone_8,8500000,0,45,1, ,0,Meter
-28409,Pulkovo_1942_GK_Zone_9,9500000,0,51,1, ,0,Meter
-28410,Pulkovo_1942_GK_Zone_10,10500000,0,57,1, ,0,Meter
-28411,Pulkovo_1942_GK_Zone_11,11500000,0,63,1, ,0,Meter
-28412,Pulkovo_1942_GK_Zone_12,12500000,0,69,1, ,0,Meter
-28413,Pulkovo_1942_GK_Zone_13,13500000,0,75,1, ,0,Meter
-28414,Pulkovo_1942_GK_Zone_14,14500000,0,81,1, ,0,Meter
-28415,Pulkovo_1942_GK_Zone_15,15500000,0,87,1, ,0,Meter
-28416,Pulkovo_1942_GK_Zone_16,16500000,0,93,1, ,0,Meter
-28417,Pulkovo_1942_GK_Zone_17,17500000,0,99,1, ,0,Meter
-28418,Pulkovo_1942_GK_Zone_18,18500000,0,105,1, ,0,Meter
-28419,Pulkovo_1942_GK_Zone_19,19500000,0,111,1, ,0,Meter
-28420,Pulkovo_1942_GK_Zone_20,20500000,0,117,1, ,0,Meter
-28421,Pulkovo_1942_GK_Zone_21,21500000,0,123,1, ,0,Meter
-28422,Pulkovo_1942_GK_Zone_22,22500000,0,129,1, ,0,Meter
-28423,Pulkovo_1942_GK_Zone_23,23500000,0,135,1, ,0,Meter
-28424,Pulkovo_1942_GK_Zone_24,24500000,0,141,1, ,0,Meter
-28425,Pulkovo_1942_GK_Zone_25,25500000,0,147,1, ,0,Meter
-28426,Pulkovo_1942_GK_Zone_26,26500000,0,153,1, ,0,Meter
-28427,Pulkovo_1942_GK_Zone_27,27500000,0,159,1, ,0,Meter
-28428,Pulkovo_1942_GK_Zone_28,28500000,0,165,1, ,0,Meter
-28429,Pulkovo_1942_GK_Zone_29,29500000,0,171,1, ,0,Meter
-28430,Pulkovo_1942_GK_Zone_30,30500000,0,177,1, ,0,Meter
-28431,Pulkovo_1942_GK_Zone_31,31500000,0,-177,1, ,0,Meter
-28432,Pulkovo_1942_GK_Zone_32,32500000,0,-171,1, ,0,Meter
-28462,Pulkovo_1942_GK_Zone_2N,500000,0,9,1, ,0,Meter
-28463,Pulkovo_1942_GK_Zone_3N,500000,0,15,1, ,0,Meter
-28464,Pulkovo_1942_GK_Zone_4N,500000,0,21,1, ,0,Meter
-28465,Pulkovo_1942_GK_Zone_5N,500000,0,27,1, ,0,Meter
-28466,Pulkovo_1942_GK_Zone_6N,500000,0,33,1, ,0,Meter
-28467,Pulkovo_1942_GK_Zone_7N,500000,0,39,1, ,0,Meter
-28468,Pulkovo_1942_GK_Zone_8N,500000,0,45,1, ,0,Meter
-28469,Pulkovo_1942_GK_Zone_9N,500000,0,51,1, ,0,Meter
-28470,Pulkovo_1942_GK_Zone_10N,500000,0,57,1, ,0,Meter
-28471,Pulkovo_1942_GK_Zone_11N,500000,0,63,1, ,0,Meter
-28472,Pulkovo_1942_GK_Zone_12N,500000,0,69,1, ,0,Meter
-28473,Pulkovo_1942_GK_Zone_13N,500000,0,75,1, ,0,Meter
-28474,Pulkovo_1942_GK_Zone_14N,500000,0,81,1, ,0,Meter
-28475,Pulkovo_1942_GK_Zone_15N,500000,0,87,1, ,0,Meter
-28476,Pulkovo_1942_GK_Zone_16N,500000,0,93,1, ,0,Meter
-28477,Pulkovo_1942_GK_Zone_17N,500000,0,99,1, ,0,Meter
-28478,Pulkovo_1942_GK_Zone_18N,500000,0,105,1, ,0,Meter
-28479,Pulkovo_1942_GK_Zone_19N,500000,0,111,1, ,0,Meter
-28480,Pulkovo_1942_GK_Zone_20N,500000,0,117,1, ,0,Meter
-28481,Pulkovo_1942_GK_Zone_21N,500000,0,123,1, ,0,Meter
-28482,Pulkovo_1942_GK_Zone_22N,500000,0,129,1, ,0,Meter
-28483,Pulkovo_1942_GK_Zone_23N,500000,0,135,1, ,0,Meter
-28484,Pulkovo_1942_GK_Zone_24N,500000,0,141,1, ,0,Meter
-28485,Pulkovo_1942_GK_Zone_25N,500000,0,147,1, ,0,Meter
-28486,Pulkovo_1942_GK_Zone_26N,500000,0,153,1, ,0,Meter
-28487,Pulkovo_1942_GK_Zone_27N,500000,0,159,1, ,0,Meter
-28488,Pulkovo_1942_GK_Zone_28N,500000,0,165,1, ,0,Meter
-28489,Pulkovo_1942_GK_Zone_29N,500000,0,171,1, ,0,Meter
-28490,Pulkovo_1942_GK_Zone_30N,500000,0,177,1, ,0,Meter
-28491,Pulkovo_1942_GK_Zone_31N,500000,0,-177,1, ,0,Meter
-28492,Pulkovo_1942_GK_Zone_32N,500000,0,-171,1, ,0,Meter
-28600,Qatar_National_Grid,200000,300000,51.21666667,0.99999, ,24.45,Meter
-28991,RD_Old,0,0,5.387638889,0.9999079, ,52.15616056,Meter
-28992,RD_New,155000,463000,5.387638889,0.9999079, ,52.15616056,Meter
-29100,SAD_1969_Brazil_Polyconic,5000000,10000000,-54,,,0,Meter
-29101,SAD_1969_Brazil_Polyconic,5000000,10000000,-54,,,0,Meter
-29118,SAD_1969_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-29119,SAD_1969_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
-29120,SAD_1969_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-29121,SAD_1969_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-29122,SAD_1969_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
-29168,SAD_1969_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-29169,SAD_1969_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
-29170,SAD_1969_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-29171,SAD_1969_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-29172,SAD_1969_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
-29177,SAD_1969_UTM_Zone_17S,500000,10000000,-81,0.9996, ,0,Meter
-29178,SAD_1969_UTM_Zone_18S,500000,10000000,-75,0.9996, ,0,Meter
-29179,SAD_1969_UTM_Zone_19S,500000,10000000,-69,0.9996, ,0,Meter
-29180,SAD_1969_UTM_Zone_20S,500000,10000000,-63,0.9996, ,0,Meter
-29181,SAD_1969_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
-29182,SAD_1969_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
-29183,SAD_1969_UTM_Zone_23S,500000,10000000,-45,0.9996, ,0,Meter
-29184,SAD_1969_UTM_Zone_24S,500000,10000000,-39,0.9996, ,0,Meter
-29185,SAD_1969_UTM_Zone_25S,500000,10000000,-33,0.9996, ,0,Meter
-29187,SAD_1969_UTM_Zone_17S,500000,10000000,-81,0.9996, ,0,Meter
-29188,SAD_1969_UTM_Zone_18S,500000,10000000,-75,0.9996, ,0,Meter
-29189,SAD_1969_UTM_Zone_19S,500000,10000000,-69,0.9996, ,0,Meter
-29190,SAD_1969_UTM_Zone_20S,500000,10000000,-63,0.9996, ,0,Meter
-29191,SAD_1969_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
-29192,SAD_1969_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
-29193,SAD_1969_UTM_Zone_23S,500000,10000000,-45,0.9996, ,0,Meter
-29194,SAD_1969_UTM_Zone_24S,500000,10000000,-39,0.9996, ,0,Meter
-29195,SAD_1969_UTM_Zone_25S,500000,10000000,-33,0.9996, ,0,Meter
-29220,Sapper_Hill_1943_UTM_Zone_20S,500000,10000000,-63,0.9996, ,0,Meter
-29221,Sapper_Hill_1943_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
-29333,Schwarzeck_UTM_Zone_33S,500000,10000000,15,0.9996, ,0,Meter
-29635,Sudan_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
-29636,Sudan_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
-29738,Tananarive_1925_UTM_Zone_38S,500000,10000000,45,0.9996, ,0,Meter
-29739,Tananarive_1925_UTM_Zone_39S,500000,10000000,51,0.9996, ,0,Meter
-29849,Timbalai_1948_UTM_Zone_49N,500000,0,111,0.9996, ,0,Meter
-29850,Timbalai_1948_UTM_Zone_50N,500000,0,117,0.9996, ,0,Meter
-29900,TM65_Irish_Grid,200000,250000,-8,1.000035, ,53.5,Meter
-29901,OSNI_1952_Irish_National_Grid,200000,250000,-8,1.000035, ,53.5,Meter
-29902,TM65_Irish_Grid,200000,250000,-8,1.000035, ,53.5,Meter
-29903,TM75_Irish_Grid,200000,250000,-8,1.000035, ,53.5,Meter
-30161,Japan_Zone_1,0,0,129.5,0.9999, ,33,Meter
-30162,Japan_Zone_2,0,0,131,0.9999, ,33,Meter
-30163,Japan_Zone_3,0,0,132.1666667,0.9999, ,36,Meter
-30164,Japan_Zone_4,0,0,133.5,0.9999, ,33,Meter
-30165,Japan_Zone_5,0,0,134.3333333,0.9999, ,36,Meter
-30166,Japan_Zone_6,0,0,136,0.9999, ,36,Meter
-30167,Japan_Zone_7,0,0,137.1666667,0.9999, ,36,Meter
-30168,Japan_Zone_8,0,0,138.5,0.9999, ,36,Meter
-30169,Japan_Zone_9,0,0,139.8333333,0.9999, ,36,Meter
-30170,Japan_Zone_10,0,0,140.8333333,0.9999, ,40,Meter
-30171,Japan_Zone_11,0,0,140.25,0.9999, ,44,Meter
-30172,Japan_Zone_12,0,0,142.25,0.9999, ,44,Meter
-30173,Japan_Zone_13,0,0,144.25,0.9999, ,44,Meter
-30174,Japan_Zone_14,0,0,142,0.9999, ,26,Meter
-30175,Japan_Zone_15,0,0,127.5,0.9999, ,26,Meter
-30176,Japan_Zone_16,0,0,124,0.9999, ,26,Meter
-30177,Japan_Zone_17,0,0,131,0.9999, ,26,Meter
-30178,Japan_Zone_18,0,0,136,0.9999, ,20,Meter
-30179,Japan_Zone_19,0,0,154,0.9999, ,26,Meter
-30200,Trinidad_1903_Trinidad_Grid,430000,325000,-61.33333333,1, ,10.44166667,Link_Clarke
-30339,TC_1948_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
-30340,TC_1948_UTM_Zone_40N,500000,0,57,0.9996, ,0,Meter
-30491,Nord_Algerie_Ancienne,500000,300000,3,40,0.999625544,40,Meter
-30492,Sud_Algerie_Ancienne,500000,300000,3,37,0.999625769,37,Meter
-30493,Voirol_1879_Nord_Algerie_Ancienne,500000,300000,3,40,0.999625544,40,Meter
-30494,Voirol_1879_Sud_Algerie_Ancienne,500000,300000,3,37,0.999625769,37,Meter
-30591,Nord_Algerie,500135,300090,3,40,0.999625544,40,Meter
-30592,Sud_Algerie,500135,300090,3,37,0.999625769,37,Meter
-30729,Nord_Sahara_1959_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
-30730,Nord_Sahara_1959_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
-30731,Nord_Sahara_1959_UTM_Zone_31N,500000,0,3,0.9996, ,0,Meter
-30732,Nord_Sahara_1959_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
-30800,Swedish_National_Grid,1500000,0,-2.25,1, ,0,Meter
-31028,Yoff_1972_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-31121,Zanderij_1972_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-31154,Zanderij_TM_54_NW,500000,0,-54,0.9996, ,0,Meter
-31170,Zanderij_Suriname_Old_TM,500000,0,-55.68333333,0.9996, ,0,Meter
-31171,Zanderij_Suriname_TM,500000,0,-55.68333333,0.9999, ,0,Meter
-31265,MGI_3_Degree_Gauss_Zone_5,5500000,0,15,1, ,0,Meter
-31266,MGI_3_Degree_Gauss_Zone_6,6500000,0,18,1, ,0,Meter
-31267,MGI_3_Degree_Gauss_Zone_7,7500000,0,21,1, ,0,Meter
-31268,MGI_3_Degree_Gauss_Zone_8,8500000,0,24,1, ,0,Meter
-31275,MGI_Balkans_5,5500000,0,15,0.9999, ,0,Meter
-31276,MGI_Balkans_6,6500000,0,18,0.9999, ,0,Meter
-31277,MGI_Balkans_7,7500000,0,21,0.9999, ,0,Meter
-31278,MGI_Balkans_8,8500000,0,24,0.9999, ,0,Meter
-31279,MGI_Balkans_8,8500000,0,24,0.9999, ,0,Meter
-31281,Austria_West_Zone,0,0,28,1, ,0,Meter
-31282,Austria_Central_Zone,0,0,31,1, ,0,Meter
-31283,Austria_East_Zone,0,0,34,1, ,0,Meter
-31284,MGI_M28,150000,0,10.33333333,1, ,0,Meter
-31285,MGI_M31,450000,0,13.33333333,1, ,0,Meter
-31286,MGI_M34,750000,0,16.33333333,1, ,0,Meter
-31287,MGI_Austria_Lambert,400000,400000,13.33333333,46,49,47.5,Meter
-31291,Austria_West_Zone,0,0,28,1, ,0,Meter
-31292,Austria_Central_Zone,0,0,31,1, ,0,Meter
-31293,Austria_East_Zone,0,0,34,1, ,0,Meter
-31294,MGI_M28,150000,0,10.33333333,1, ,0,Meter
-31295,MGI_M31,450000,0,13.33333333,1, ,0,Meter
-31296,MGI_M34,750000,0,16.33333333,1, ,0,Meter
-31297,MGI_Austria_Lambert,400000,400000,13.33333333,46,49,47.5,Meter
-31370,Belge_Lambert_1972,150000.0126,5400088.438,4.367486667,49.8333339,51.16666723,90,Meter
-31461,DHDN_3_Degree_Gauss_Zone_1,1500000,0,3,1, ,0,Meter
-31462,DHDN_3_Degree_Gauss_Zone_2,2500000,0,6,1, ,0,Meter
-31463,DHDN_3_Degree_Gauss_Zone_3,3500000,0,9,1, ,0,Meter
-31464,DHDN_3_Degree_Gauss_Zone_4,4500000,0,12,1, ,0,Meter
-31465,DHDN_3_Degree_Gauss_Zone_5,5500000,0,15,1, ,0,Meter
-31466,DHDN_3_Degree_Gauss_Zone_2,2500000,0,6,1, ,0,Meter
-31467,DHDN_3_Degree_Gauss_Zone_3,3500000,0,9,1, ,0,Meter
-31468,DHDN_3_Degree_Gauss_Zone_4,4500000,0,12,1, ,0,Meter
-31469,DHDN_3_Degree_Gauss_Zone_5,5500000,0,15,1, ,0,Meter
-31491,Germany_Zone_1,1500000,0,3,1, ,0,Meter
-31492,Germany_Zone_2,2500000,0,6,1, ,0,Meter
-31493,Germany_Zone_3,3500000,0,9,1, ,0,Meter
-31494,Germany_Zone_4,4500000,0,12,1, ,0,Meter
-31495,Germany_Zone_5,5500000,0,15,1, ,0,Meter
-31528,Conakry_1905_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-31529,Conakry_1905_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
-31600,Stereo_33,500000,500000,25.39246589,0.9996667, ,45.9,Meter
-31700,Stereo_70,500000,500000,25,0.99975, ,46,Meter
-31838,NGN_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
-31839,NGN_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
-31900,KUDAMS_KTM,500000,0,48,0.9996, ,0,Meter
-31901,KUDAMS_KTM,500000,0,48,1, ,0,Meter
-31917,SIRGAS_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
-31918,SIRGAS_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-31919,SIRGAS_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
-31920,SIRGAS_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-31921,SIRGAS_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-31922,SIRGAS_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
-31971,SIRGAS_2000_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
-31972,SIRGAS_2000_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-31973,SIRGAS_2000_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
-31974,SIRGAS_2000_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-31975,SIRGAS_2000_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-31976,SIRGAS_2000_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
-31977,SIRGAS_2000_UTM_Zone_17S,500000,10000000,-81,0.9996, ,0,Meter
-31978,SIRGAS_2000_UTM_Zone_18S,500000,10000000,-75,0.9996, ,0,Meter
-31979,SIRGAS_2000_UTM_Zone_19S,500000,10000000,-69,0.9996, ,0,Meter
-31980,SIRGAS_2000_UTM_Zone_20S,500000,10000000,-63,0.9996, ,0,Meter
-31981,SIRGAS_2000_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
-31982,SIRGAS_2000_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
-31983,SIRGAS_2000_UTM_Zone_23S,500000,10000000,-45,0.9996, ,0,Meter
-31984,SIRGAS_2000_UTM_Zone_24S,500000,10000000,-39,0.9996, ,0,Meter
-31985,SIRGAS_2000_UTM_Zone_25S,500000,10000000,-33,0.9996, ,0,Meter
-31986,SIRGAS_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
-31987,SIRGAS_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-31988,SIRGAS_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
-31989,SIRGAS_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-31990,SIRGAS_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-31991,SIRGAS_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
-31992,SIRGAS_UTM_Zone_17S,500000,10000000,-81,0.9996, ,0,Meter
-31993,SIRGAS_UTM_Zone_18S,500000,10000000,-75,0.9996, ,0,Meter
-31994,SIRGAS_UTM_Zone_19S,500000,10000000,-69,0.9996, ,0,Meter
-31995,SIRGAS_UTM_Zone_20S,500000,10000000,-63,0.9996, ,0,Meter
-31996,SIRGAS_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
-31997,SIRGAS_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
-31998,SIRGAS_UTM_Zone_23S,500000,10000000,-45,0.9996, ,0,Meter
-31999,SIRGAS_UTM_Zone_24S,500000,10000000,-39,0.9996, ,0,Meter
-32000,SIRGAS_UTM_Zone_25S,500000,10000000,-33,0.9996, ,0,Meter
-32001,NAD_1927_StatePlane_Montana_North_FIPS_2501,2000000,0,-109.5,47.85,48.71666667,47,Foot_US
-32002,NAD_1927_StatePlane_Montana_Central_FIPS_2502,2000000,0,-109.5,46.45,47.88333333,45.83333333,Foot_US
-32003,NAD_1927_StatePlane_Montana_South_FIPS_2503,2000000,0,-109.5,44.86666667,46.4,44,Foot_US
-32005,NAD_1927_StatePlane_Nebraska_North_FIPS_2601,2000000,0,-100,41.85,42.81666667,41.33333333,Foot_US
-32006,NAD_1927_StatePlane_Nebraska_South_FIPS_2602,2000000,0,-99.5,40.28333333,41.71666667,39.66666667,Foot_US
-32007,NAD_1927_StatePlane_Nevada_East_FIPS_2701,500000,0,-115.5833333,0.9999, ,34.75,Foot_US
-32008,NAD_1927_StatePlane_Nevada_Central_FIPS_2702,500000,0,-116.6666667,0.9999, ,34.75,Foot_US
-32009,NAD_1927_StatePlane_Nevada_West_FIPS_2703,500000,0,-118.5833333,0.9999, ,34.75,Foot_US
-32010,NAD_1927_StatePlane_New_Hampshire_FIPS_2800,500000,0,-71.66666667,0.999966667, ,42.5,Foot_US
-32011,NAD_1927_StatePlane_New_Jersey_FIPS_2900,2000000,0,-74.66666667,0.999975, ,38.83333333,Foot_US
-32012,NAD_1927_StatePlane_New_Mexico_East_FIPS_3001,500000,0,-104.3333333,0.999909091, ,31,Foot_US
-32013,NAD_1927_StatePlane_New_Mexico_Central_FIPS_3002,500000,0,-106.25,0.9999, ,31,Foot_US
-32014,NAD_1927_StatePlane_New_Mexico_West_FIPS_3003,500000,0,-107.8333333,0.999916667, ,31,Foot_US
-32015,NAD_1927_StatePlane_New_York_East_FIPS_3101,500000,0,-74.33333333,0.999966667, ,40,Foot_US
-32016,NAD_1927_StatePlane_New_York_Central_FIPS_3102,500000,0,-76.58333333,0.9999375, ,40,Foot_US
-32017,NAD_1927_StatePlane_New_York_West_FIPS_3103,500000,0,-78.58333333,0.9999375, ,40,Foot_US
-32018,NAD_1927_StatePlane_New_York_Long_Island_FIPS_3104,2000000,100000,-74,40.66666667,41.03333333,40.5,Foot_US
-32019,NAD_1927_StatePlane_North_Carolina_FIPS_3200,2000000,0,-79,34.33333333,36.16666667,33.75,Foot_US
-32020,NAD_1927_StatePlane_North_Dakota_North_FIPS_3301,2000000,0,-100.5,47.43333333,48.73333333,47,Foot_US
-32021,NAD_1927_StatePlane_North_Dakota_South_FIPS_3302,2000000,0,-100.5,46.18333333,47.48333333,45.66666667,Foot_US
-32022,NAD_1927_StatePlane_Ohio_North_FIPS_3401,2000000,0,-82.5,40.43333333,41.7,39.66666667,Foot_US
-32023,NAD_1927_StatePlane_Ohio_South_FIPS_3402,2000000,0,-82.5,38.73333333,40.03333333,38,Foot_US
-32024,NAD_1927_StatePlane_Oklahoma_North_FIPS_3501,2000000,0,-98,35.56666667,36.76666667,35,Foot_US
-32025,NAD_1927_StatePlane_Oklahoma_South_FIPS_3502,2000000,0,-98,33.93333333,35.23333333,33.33333333,Foot_US
-32026,NAD_1927_StatePlane_Oregon_North_FIPS_3601,2000000,0,-120.5,44.33333333,46,43.66666667,Foot_US
-32027,NAD_1927_StatePlane_Oregon_South_FIPS_3602,2000000,0,-120.5,42.33333333,44,41.66666667,Foot_US
-32028,NAD_1927_StatePlane_Pennsylvania_North_FIPS_3701,2000000,0,-77.75,40.88333333,41.95,40.16666667,Foot_US
-32029,NAD_1927_StatePlane_Pennsylvania_South_FIPS_3702,2000000,0,-77.75,39.93333333,40.96666667,39.33333333,Foot_US
-32030,NAD_1927_StatePlane_Rhode_Island_FIPS_3800,500000,0,-71.5,0.99999375, ,41.08333333,Foot_US
-32031,NAD_1927_StatePlane_South_Carolina_North_FIPS_3901,2000000,0,-81,33.76666667,34.96666667,33,Foot_US
-32033,NAD_1927_StatePlane_South_Carolina_South_FIPS_3902,2000000,0,-81,32.33333333,33.66666667,31.83333333,Foot_US
-32034,NAD_1927_StatePlane_South_Dakota_North_FIPS_4001,2000000,0,-100,44.41666667,45.68333333,43.83333333,Foot_US
-32035,NAD_1927_StatePlane_South_Dakota_South_FIPS_4002,2000000,0,-100.3333333,42.83333333,44.4,42.33333333,Foot_US
-32036,NAD_1927_StatePlane_Tennessee_FIPS_4100,2000000,100000,-86,35.25,36.41666667,34.66666667,Foot_US
-32037,NAD_1927_StatePlane_Texas_North_FIPS_4201,2000000,0,-101.5,34.65,36.18333333,34,Foot_US
-32038,NAD_1927_StatePlane_Texas_North_Central_FIPS_4202,2000000,0,-97.5,32.13333333,33.96666667,31.66666667,Foot_US
-32039,NAD_1927_StatePlane_Texas_Central_FIPS_4203,2000000,0,-100.3333333,30.11666667,31.88333333,29.66666667,Foot_US
-32040,NAD_1927_StatePlane_Texas_South_Central_FIPS_4204,2000000,0,-99,28.38333333,30.28333333,27.83333333,Foot_US
-32041,NAD_1927_StatePlane_Texas_South_FIPS_4205,2000000,0,-98.5,26.16666667,27.83333333,25.66666667,Foot_US
-32042,NAD_1927_StatePlane_Utah_North_FIPS_4301,2000000,0,-111.5,40.71666667,41.78333333,40.33333333,Foot_US
-32043,NAD_1927_StatePlane_Utah_Central_FIPS_4302,2000000,0,-111.5,39.01666667,40.65,38.33333333,Foot_US
-32044,NAD_1927_StatePlane_Utah_South_FIPS_4303,2000000,0,-111.5,37.21666667,38.35,36.66666667,Foot_US
-32045,NAD_1927_StatePlane_Vermont_FIPS_3400,500000,0,-72.5,0.999964286, ,42.5,Foot_US
-32046,NAD_1927_StatePlane_Virginia_North_FIPS_4501,2000000,0,-78.5,38.03333333,39.2,37.66666667,Foot_US
-32047,NAD_1927_StatePlane_Virginia_South_FIPS_4502,2000000,0,-78.5,36.76666667,37.96666667,36.33333333,Foot_US
-32048,NAD_1927_StatePlane_Washington_North_FIPS_4601,2000000,0,-120.8333333,47.5,48.73333333,47,Foot_US
-32049,NAD_1927_StatePlane_Washington_South_FIPS_4602,2000000,0,-120.5,45.83333333,47.33333333,45.33333333,Foot_US
-32050,NAD_1927_StatePlane_West_Virginia_North_FIPS_4701,2000000,0,-79.5,39,40.25,38.5,Foot_US
-32051,NAD_1927_StatePlane_West_Virginia_South_FIPS_4702,2000000,0,-81,37.48333333,38.88333333,37,Foot_US
-32052,NAD_1927_StatePlane_Wisconsin_North_FIPS_4801,2000000,0,-90,45.56666667,46.76666667,45.16666667,Foot_US
-32053,NAD_1927_StatePlane_Wisconsin_Central_FIPS_4802,2000000,0,-90,44.25,45.5,43.83333333,Foot_US
-32054,NAD_1927_StatePlane_Wisconsin_South_FIPS_4803,2000000,0,-90,42.73333333,44.06666667,42,Foot_US
-32055,NAD_1927_StatePlane_Wyoming_East_FIPS_4901,500000,0,-105.1666667,0.999941176, ,40.66666667,Foot_US
-32056,NAD_1927_StatePlane_Wyoming_East_Central_FIPS_4902,500000,0,-107.3333333,0.999941176, ,40.66666667,Foot_US
-32057,NAD_1927_StatePlane_Wyoming_West_Central_FIPS_4903,500000,0,-108.75,0.999941176, ,40.66666667,Foot_US
-32058,NAD_1927_StatePlane_Wyoming_West_FIPS_4904,500000,0,-110.0833333,0.999941176, ,40.66666667,Foot_US
-32059,NAD_1927_StatePlane_Puerto_Rico_FIPS_5201,500000,0,-66.43333333,18.03333333,18.43333333,17.83333333,Foot_US
-32060,NAD_1927_StatePlane_Virgin_Islands_St_Croix_FIPS_5202,500000,100000,-66.43333333,18.03333333,18.43333333,17.83333333,Foot_US
-32061,NAD_1927_Guatemala_Norte,500000,292209.579,-90.33333333,16.81666667,0.99992226,16.81666667,Meter
-32062,NAD_1927_Guatemala_Sur,500000,325992.681,-90.33333333,14.9,0.99989906,14.9,Meter
-32074,NAD_1927_BLM_Zone_14N,1640416.667,0,-99,0.9996, ,0,Foot_US
-32075,NAD_1927_BLM_Zone_15N,1640416.667,0,-93,0.9996, ,0,Foot_US
-32076,NAD_1927_BLM_Zone_16N,1640416.667,0,-87,0.9996, ,0,Foot_US
-32077,NAD_1927_BLM_Zone_17N,1640416.667,0,-81,0.9996, ,0,Foot_US
-32081,NAD_1927_MTM_1,304800,0,-53,0.9999, ,0,Meter
-32082,NAD_1927_MTM_2,304800,0,-56,0.9999, ,0,Meter
-32083,NAD_1927_MTM_3,304800,0,-58.5,0.9999, ,0,Meter
-32084,NAD_1927_MTM_4,304800,0,-61.5,0.9999, ,0,Meter
-32085,NAD_1927_MTM_5,304800,0,-64.5,0.9999, ,0,Meter
-32086,NAD_1927_MTM_6,304800,0,-67.5,0.9999, ,0,Meter
-32098,NAD_1927_Quebec_Lambert,0,0,-68.5,46,60,44,Meter
-32100,NAD_1983_StatePlane_Montana_FIPS_2500,600000,0,-109.5,45,49,44.25,Meter
-32104,NAD_1983_StatePlane_Nebraska_FIPS_2600,500000,0,-100,40,43,39.83333333,Meter
-32107,NAD_1983_StatePlane_Nevada_East_FIPS_2701,200000,8000000,-115.5833333,0.9999, ,34.75,Meter
-32108,NAD_1983_StatePlane_Nevada_Central_FIPS_2702,500000,6000000,-116.6666667,0.9999, ,34.75,Meter
-32109,NAD_1983_StatePlane_Nevada_West_FIPS_2703,800000,4000000,-118.5833333,0.9999, ,34.75,Meter
-32110,NAD_1983_StatePlane_New_Hampshire_FIPS_2800,300000,0,-71.66666667,0.999966667, ,42.5,Meter
-32111,NAD_1983_StatePlane_New_Jersey_FIPS_2900,150000,0,-74.5,0.9999, ,38.83333333,Meter
-32112,NAD_1983_StatePlane_New_Mexico_East_FIPS_3001,165000,0,-104.3333333,0.999909091, ,31,Meter
-32113,NAD_1983_StatePlane_New_Mexico_Central_FIPS_3002,500000,0,-106.25,0.9999, ,31,Meter
-32114,NAD_1983_StatePlane_New_Mexico_West_FIPS_3003,830000,0,-107.8333333,0.999916667, ,31,Meter
-32115,NAD_1983_StatePlane_New_York_East_FIPS_3101,150000,0,-74.5,0.9999, ,38.83333333,Meter
-32116,NAD_1983_StatePlane_New_York_Central_FIPS_3102,250000,0,-76.58333333,0.9999375, ,40,Meter
-32117,NAD_1983_StatePlane_New_York_West_FIPS_3103,350000,0,-78.58333333,0.9999375, ,40,Meter
-32118,NAD_1983_StatePlane_New_York_Long_Island_FIPS_3104,300000,0,-74,40.66666667,41.03333333,40.16666667,Meter
-32119,NAD_1983_StatePlane_North_Carolina_FIPS_3200,609601.22,0,-79,34.33333333,36.16666667,33.75,Meter
-32120,NAD_1983_StatePlane_North_Dakota_North_FIPS_3301,600000,0,-100.5,47.43333333,48.73333333,47,Meter
-32121,NAD_1983_StatePlane_North_Dakota_South_FIPS_3302,600000,0,-100.5,46.18333333,47.48333333,45.66666667,Meter
-32122,NAD_1983_StatePlane_Ohio_North_FIPS_3401,600000,0,-82.5,40.43333333,41.7,39.66666667,Meter
-32123,NAD_1983_StatePlane_Ohio_South_FIPS_3402,600000,0,-82.5,38.73333333,40.03333333,38,Meter
-32124,NAD_1983_StatePlane_Oklahoma_North_FIPS_3501,600000,0,-98,35.56666667,36.76666667,35,Meter
-32125,NAD_1983_StatePlane_Oklahoma_South_FIPS_3502,600000,0,-98,33.93333333,35.23333333,33.33333333,Meter
-32126,NAD_1983_StatePlane_Oregon_North_FIPS_3601,2500000,0,-120.5,44.33333333,46,43.66666667,Meter
-32127,NAD_1983_StatePlane_Oregon_South_FIPS_3602,1500000,0,-120.5,42.33333333,44,41.66666667,Meter
-32128,NAD_1983_StatePlane_Pennsylvania_North_FIPS_3701,600000,0,-77.75,40.88333333,41.95,40.16666667,Meter
-32129,NAD_1983_StatePlane_Pennsylvania_South_FIPS_3702,600000,0,-77.75,39.93333333,40.96666667,39.33333333,Meter
-32130,NAD_1983_StatePlane_Rhode_Island_FIPS_3800,100000,0,-71.5,0.99999375, ,41.08333333,Meter
-32133,NAD_1983_StatePlane_South_Carolina_FIPS_3900,609600,0,-81,32.5,34.83333333,31.83333333,Meter
-32134,NAD_1983_StatePlane_South_Dakota_North_FIPS_4001,600000,0,-100,44.41666667,45.68333333,43.83333333,Meter
-32135,NAD_1983_StatePlane_South_Dakota_South_FIPS_4002,600000,0,-100.3333333,42.83333333,44.4,42.33333333,Meter
-32136,NAD_1983_StatePlane_Tennessee_FIPS_4100,600000,0,-86,35.25,36.41666667,34.33333333,Meter
-32137,NAD_1983_StatePlane_Texas_North_FIPS_4201,200000,1000000,-101.5,34.65,36.18333333,34,Meter
-32138,NAD_1983_StatePlane_Texas_North_Central_FIPS_4202,600000,2000000,-98.5,32.13333333,33.96666667,31.66666667,Meter
-32139,NAD_1983_StatePlane_Texas_Central_FIPS_4203,700000,3000000,-100.3333333,30.11666667,31.88333333,29.66666667,Meter
-32140,NAD_1983_StatePlane_Texas_South_Central_FIPS_4204,600000,4000000,-99,28.38333333,30.28333333,27.83333333,Meter
-32141,NAD_1983_StatePlane_Texas_South_FIPS_4205,300000,5000000,-98.5,26.16666667,27.83333333,25.66666667,Meter
-32142,NAD_1983_StatePlane_Utah_North_FIPS_4301,500000,1000000,-111.5,40.71666667,41.78333333,40.33333333,Meter
-32143,NAD_1983_StatePlane_Utah_Central_FIPS_4302,500000,2000000,-111.5,39.01666667,40.65,38.33333333,Meter
-32144,NAD_1983_StatePlane_Utah_South_FIPS_4303,500000,3000000,-111.5,37.21666667,38.35,36.66666667,Meter
-32145,NAD_1983_StatePlane_Vermont_FIPS_4400,500000,0,-72.5,0.999964286, ,42.5,Meter
-32146,NAD_1983_StatePlane_Virginia_North_FIPS_4501,3500000,2000000,-78.5,38.03333333,39.2,37.66666667,Meter
-32147,NAD_1983_StatePlane_Virginia_South_FIPS_4502,3500000,1000000,-78.5,36.76666667,37.96666667,36.33333333,Meter
-32148,NAD_1983_StatePlane_Washington_North_FIPS_4601,500000,0,-120.8333333,47.5,48.73333333,47,Meter
-32149,NAD_1983_StatePlane_Washington_South_FIPS_4602,500000,0,-120.5,45.83333333,47.33333333,45.33333333,Meter
-32150,NAD_1983_StatePlane_West_Virginia_North_FIPS_4701,600000,0,-79.5,39,40.25,38.5,Meter
-32151,NAD_1983_StatePlane_West_Virginia_South_FIPS_4702,600000,0,-81,37.48333333,38.88333333,37,Meter
-32152,NAD_1983_StatePlane_Wisconsin_North_FIPS_4801,600000,0,-90,45.56666667,46.76666667,45.16666667,Meter
-32153,NAD_1983_StatePlane_Wisconsin_Central_FIPS_4802,600000,0,-90,44.25,45.5,43.83333333,Meter
-32154,NAD_1983_StatePlane_Wisconsin_South_FIPS_4803,600000,0,-90,42.73333333,44.06666667,42,Meter
-32155,NAD_1983_StatePlane_Wyoming_East_FIPS_4901,200000,0,-105.1666667,0.9999375, ,40.5,Meter
-32156,NAD_1983_StatePlane_Wyoming_East_Central_FIPS_4902,400000,100000,-107.3333333,0.9999375, ,40.5,Meter
-32157,NAD_1983_StatePlane_Wyoming_West_Central_FIPS_4903,600000,0,-108.75,0.9999375, ,40.5,Meter
-32158,NAD_1983_StatePlane_Wyoming_West_FIPS_4904,800000,100000,-110.0833333,0.9999375, ,40.5,Meter
-32161,NAD_1983_StatePlane_Puerto_Rico_Virgin_Islands_FIPS_5200,200000,200000,-66.43333333,18.03333333,18.43333333,17.83333333,Meter
-32180,NAD_1983_MTM_2_SCoPQ,304800,0,-55.5,0.9999, ,0,Meter
-32181,NAD_1983_MTM_1,304800,0,-53,0.9999, ,0,Meter
-32182,NAD_1983_MTM_2,304800,0,-56,0.9999, ,0,Meter
-32183,NAD_1983_MTM_3,304800,0,-58.5,0.9999, ,0,Meter
-32184,NAD_1983_MTM_4,304800,0,-61.5,0.9999, ,0,Meter
-32185,NAD_1983_MTM_5,304800,0,-64.5,0.9999, ,0,Meter
-32186,NAD_1983_MTM_6,304800,0,-67.5,0.9999, ,0,Meter
-32187,NAD_1983_MTM_7,304800,0,-70.5,0.9999, ,0,Meter
-32188,NAD_1983_MTM_8,304800,0,-73.5,0.9999, ,0,Meter
-32189,NAD_1983_MTM_9,304800,0,-76.5,0.9999, ,0,Meter
-32190,NAD_1983_MTM_10,304800,0,-79.5,0.9999, ,0,Meter
-32191,NAD_1983_MTM_11,304800,0,-82.5,0.9999, ,0,Meter
-32192,NAD_1983_MTM_12,304800,0,-81,0.9999, ,0,Meter
-32193,NAD_1983_MTM_13,304800,0,-84,0.9999, ,0,Meter
-32194,NAD_1983_MTM_14,304800,0,-87,0.9999, ,0,Meter
-32195,NAD_1983_MTM_15,304800,0,-90,0.9999, ,0,Meter
-32196,NAD_1983_MTM_16,304800,0,-93,0.9999, ,0,Meter
-32197,NAD_1983_MTM_17,304800,0,-96,0.9999, ,0,Meter
-32198,NAD_1983_Quebec_Lambert,0,0,-68.5,46,60,44,Meter
-32201,WGS_1972_UTM_Zone_1N,500000,0,-177,0.9996, ,0,Meter
-32202,WGS_1972_UTM_Zone_2N,500000,0,-171,0.9996, ,0,Meter
-32203,WGS_1972_UTM_Zone_3N,500000,0,-165,0.9996, ,0,Meter
-32204,WGS_1972_UTM_Zone_4N,500000,0,-159,0.9996, ,0,Meter
-32205,WGS_1972_UTM_Zone_5N,500000,0,-153,0.9996, ,0,Meter
-32206,WGS_1972_UTM_Zone_6N,500000,0,-147,0.9996, ,0,Meter
-32207,WGS_1972_UTM_Zone_7N,500000,0,-141,0.9996, ,0,Meter
-32208,WGS_1972_UTM_Zone_8N,500000,0,-135,0.9996, ,0,Meter
-32209,WGS_1972_UTM_Zone_9N,500000,0,-129,0.9996, ,0,Meter
-32210,WGS_1972_UTM_Zone_10N,500000,0,-123,0.9996, ,0,Meter
-32211,WGS_1972_UTM_Zone_11N,500000,0,-117,0.9996, ,0,Meter
-32212,WGS_1972_UTM_Zone_12N,500000,0,-111,0.9996, ,0,Meter
-32213,WGS_1972_UTM_Zone_13N,500000,0,-105,0.9996, ,0,Meter
-32214,WGS_1972_UTM_Zone_14N,500000,0,-99,0.9996, ,0,Meter
-32215,WGS_1972_UTM_Zone_15N,500000,0,-93,0.9996, ,0,Meter
-32216,WGS_1972_UTM_Zone_16N,500000,0,-87,0.9996, ,0,Meter
-32217,WGS_1972_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
-32218,WGS_1972_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-32219,WGS_1972_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
-32220,WGS_1972_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-32221,WGS_1972_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-32222,WGS_1972_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
-32223,WGS_1972_UTM_Zone_23N,500000,0,-45,0.9996, ,0,Meter
-32224,WGS_1972_UTM_Zone_24N,500000,0,-39,0.9996, ,0,Meter
-32225,WGS_1972_UTM_Zone_25N,500000,0,-33,0.9996, ,0,Meter
-32226,WGS_1972_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
-32227,WGS_1972_UTM_Zone_27N,500000,0,-21,0.9996, ,0,Meter
-32228,WGS_1972_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-32229,WGS_1972_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
-32230,WGS_1972_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
-32231,WGS_1972_UTM_Zone_31N,500000,0,3,0.9996, ,0,Meter
-32232,WGS_1972_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
-32233,WGS_1972_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
-32234,WGS_1972_UTM_Zone_34N,500000,0,21,0.9996, ,0,Meter
-32235,WGS_1972_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
-32236,WGS_1972_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
-32237,WGS_1972_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
-32238,WGS_1972_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
-32239,WGS_1972_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
-32240,WGS_1972_UTM_Zone_40N,500000,0,57,0.9996, ,0,Meter
-32241,WGS_1972_UTM_Zone_41N,500000,0,63,0.9996, ,0,Meter
-32242,WGS_1972_UTM_Zone_42N,500000,0,69,0.9996, ,0,Meter
-32243,WGS_1972_UTM_Zone_43N,500000,0,75,0.9996, ,0,Meter
-32244,WGS_1972_UTM_Zone_44N,500000,0,81,0.9996, ,0,Meter
-32245,WGS_1972_UTM_Zone_45N,500000,0,87,0.9996, ,0,Meter
-32246,WGS_1972_UTM_Zone_46N,500000,0,93,0.9996, ,0,Meter
-32247,WGS_1972_UTM_Zone_47N,500000,0,99,0.9996, ,0,Meter
-32248,WGS_1972_UTM_Zone_48N,500000,0,105,0.9996, ,0,Meter
-32249,WGS_1972_UTM_Zone_49N,500000,0,111,0.9996, ,0,Meter
-32250,WGS_1972_UTM_Zone_50N,500000,0,117,0.9996, ,0,Meter
-32251,WGS_1972_UTM_Zone_51N,500000,0,123,0.9996, ,0,Meter
-32252,WGS_1972_UTM_Zone_52N,500000,0,129,0.9996, ,0,Meter
-32253,WGS_1972_UTM_Zone_53N,500000,0,135,0.9996, ,0,Meter
-32254,WGS_1972_UTM_Zone_54N,500000,0,141,0.9996, ,0,Meter
-32255,WGS_1972_UTM_Zone_55N,500000,0,147,0.9996, ,0,Meter
-32256,WGS_1972_UTM_Zone_56N,500000,0,153,0.9996, ,0,Meter
-32257,WGS_1972_UTM_Zone_57N,500000,0,159,0.9996, ,0,Meter
-32258,WGS_1972_UTM_Zone_58N,500000,0,165,0.9996, ,0,Meter
-32259,WGS_1972_UTM_Zone_59N,500000,0,171,0.9996, ,0,Meter
-32260,WGS_1972_UTM_Zone_60N,500000,0,177,0.9996, ,0,Meter
-32301,WGS_1972_UTM_Zone_1S,500000,10000000,-177,0.9996, ,0,Meter
-32302,WGS_1972_UTM_Zone_2S,500000,10000000,-171,0.9996, ,0,Meter
-32303,WGS_1972_UTM_Zone_3S,500000,10000000,-165,0.9996, ,0,Meter
-32304,WGS_1972_UTM_Zone_4S,500000,10000000,-159,0.9996, ,0,Meter
-32305,WGS_1972_UTM_Zone_5S,500000,10000000,-153,0.9996, ,0,Meter
-32306,WGS_1972_UTM_Zone_6S,500000,10000000,-147,0.9996, ,0,Meter
-32307,WGS_1972_UTM_Zone_7S,500000,10000000,-141,0.9996, ,0,Meter
-32308,WGS_1972_UTM_Zone_8S,500000,10000000,-135,0.9996, ,0,Meter
-32309,WGS_1972_UTM_Zone_9S,500000,10000000,-129,0.9996, ,0,Meter
-32310,WGS_1972_UTM_Zone_10S,500000,10000000,-123,0.9996, ,0,Meter
-32311,WGS_1972_UTM_Zone_11S,500000,10000000,-117,0.9996, ,0,Meter
-32312,WGS_1972_UTM_Zone_12S,500000,10000000,-111,0.9996, ,0,Meter
-32313,WGS_1972_UTM_Zone_13S,500000,10000000,-105,0.9996, ,0,Meter
-32314,WGS_1972_UTM_Zone_14S,500000,10000000,-99,0.9996, ,0,Meter
-32315,WGS_1972_UTM_Zone_15S,500000,10000000,-93,0.9996, ,0,Meter
-32316,WGS_1972_UTM_Zone_16S,500000,10000000,-87,0.9996, ,0,Meter
-32317,WGS_1972_UTM_Zone_17S,500000,10000000,-81,0.9996, ,0,Meter
-32318,WGS_1972_UTM_Zone_18S,500000,10000000,-75,0.9996, ,0,Meter
-32319,WGS_1972_UTM_Zone_19S,500000,10000000,-69,0.9996, ,0,Meter
-32320,WGS_1972_UTM_Zone_20S,500000,10000000,-63,0.9996, ,0,Meter
-32321,WGS_1972_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
-32322,WGS_1972_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
-32323,WGS_1972_UTM_Zone_23S,500000,10000000,-45,0.9996, ,0,Meter
-32324,WGS_1972_UTM_Zone_24S,500000,10000000,-39,0.9996, ,0,Meter
-32325,WGS_1972_UTM_Zone_25S,500000,10000000,-33,0.9996, ,0,Meter
-32326,WGS_1972_UTM_Zone_26S,500000,10000000,-27,0.9996, ,0,Meter
-32327,WGS_1972_UTM_Zone_27S,500000,10000000,-21,0.9996, ,0,Meter
-32328,WGS_1972_UTM_Zone_28S,500000,10000000,-15,0.9996, ,0,Meter
-32329,WGS_1972_UTM_Zone_29S,500000,10000000,-9,0.9996, ,0,Meter
-32330,WGS_1972_UTM_Zone_30S,500000,10000000,-3,0.9996, ,0,Meter
-32331,WGS_1972_UTM_Zone_31S,500000,10000000,3,0.9996, ,0,Meter
-32332,WGS_1972_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
-32333,WGS_1972_UTM_Zone_33S,500000,10000000,15,0.9996, ,0,Meter
-32334,WGS_1972_UTM_Zone_34S,500000,10000000,21,0.9996, ,0,Meter
-32335,WGS_1972_UTM_Zone_35S,500000,10000000,27,0.9996, ,0,Meter
-32336,WGS_1972_UTM_Zone_36S,500000,10000000,33,0.9996, ,0,Meter
-32337,WGS_1972_UTM_Zone_37S,500000,10000000,39,0.9996, ,0,Meter
-32338,WGS_1972_UTM_Zone_38S,500000,10000000,45,0.9996, ,0,Meter
-32339,WGS_1972_UTM_Zone_39S,500000,10000000,51,0.9996, ,0,Meter
-32340,WGS_1972_UTM_Zone_40S,500000,10000000,57,0.9996, ,0,Meter
-32341,WGS_1972_UTM_Zone_41S,500000,10000000,63,0.9996, ,0,Meter
-32342,WGS_1972_UTM_Zone_42S,500000,10000000,69,0.9996, ,0,Meter
-32343,WGS_1972_UTM_Zone_43S,500000,10000000,75,0.9996, ,0,Meter
-32344,WGS_1972_UTM_Zone_44S,500000,10000000,81,0.9996, ,0,Meter
-32345,WGS_1972_UTM_Zone_45S,500000,10000000,87,0.9996, ,0,Meter
-32346,WGS_1972_UTM_Zone_46S,500000,10000000,93,0.9996, ,0,Meter
-32347,WGS_1972_UTM_Zone_47S,500000,10000000,99,0.9996, ,0,Meter
-32348,WGS_1972_UTM_Zone_48S,500000,10000000,105,0.9996, ,0,Meter
-32349,WGS_1972_UTM_Zone_49S,500000,10000000,111,0.9996, ,0,Meter
-32350,WGS_1972_UTM_Zone_50S,500000,10000000,117,0.9996, ,0,Meter
-32351,WGS_1972_UTM_Zone_51S,500000,10000000,123,0.9996, ,0,Meter
-32352,WGS_1972_UTM_Zone_52S,500000,10000000,129,0.9996, ,0,Meter
-32353,WGS_1972_UTM_Zone_53S,500000,10000000,135,0.9996, ,0,Meter
-32354,WGS_1972_UTM_Zone_54S,500000,10000000,141,0.9996, ,0,Meter
-32355,WGS_1972_UTM_Zone_55S,500000,10000000,147,0.9996, ,0,Meter
-32356,WGS_1972_UTM_Zone_56S,500000,10000000,153,0.9996, ,0,Meter
-32357,WGS_1972_UTM_Zone_57S,500000,10000000,159,0.9996, ,0,Meter
-32358,WGS_1972_UTM_Zone_58S,500000,10000000,165,0.9996, ,0,Meter
-32359,WGS_1972_UTM_Zone_59S,500000,10000000,171,0.9996, ,0,Meter
-32360,WGS_1972_UTM_Zone_60S,500000,10000000,177,0.9996, ,0,Meter
-32601,WGS_1984_UTM_Zone_1N,500000,0,-177,0.9996, ,0,Meter
-32602,WGS_1984_UTM_Zone_2N,500000,0,-171,0.9996, ,0,Meter
-32603,WGS_1984_UTM_Zone_3N,500000,0,-165,0.9996, ,0,Meter
-32604,WGS_1984_UTM_Zone_4N,500000,0,-159,0.9996, ,0,Meter
-32605,WGS_1984_UTM_Zone_5N,500000,0,-153,0.9996, ,0,Meter
-32606,WGS_1984_UTM_Zone_6N,500000,0,-147,0.9996, ,0,Meter
-32607,WGS_1984_UTM_Zone_7N,500000,0,-141,0.9996, ,0,Meter
-32608,WGS_1984_UTM_Zone_8N,500000,0,-135,0.9996, ,0,Meter
-32609,WGS_1984_UTM_Zone_9N,500000,0,-129,0.9996, ,0,Meter
-32610,WGS_1984_UTM_Zone_10N,500000,0,-123,0.9996, ,0,Meter
-32611,WGS_1984_UTM_Zone_11N,500000,0,-117,0.9996, ,0,Meter
-32612,WGS_1984_UTM_Zone_12N,500000,0,-111,0.9996, ,0,Meter
-32613,WGS_1984_UTM_Zone_13N,500000,0,-105,0.9996, ,0,Meter
-32614,WGS_1984_UTM_Zone_14N,500000,0,-99,0.9996, ,0,Meter
-32615,WGS_1984_UTM_Zone_15N,500000,0,-93,0.9996, ,0,Meter
-32616,WGS_1984_UTM_Zone_16N,500000,0,-87,0.9996, ,0,Meter
-32617,WGS_1984_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
-32618,WGS_1984_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-32619,WGS_1984_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
-32620,WGS_1984_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-32621,WGS_1984_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-32622,WGS_1984_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
-32623,WGS_1984_UTM_Zone_23N,500000,0,-45,0.9996, ,0,Meter
-32624,WGS_1984_UTM_Zone_24N,500000,0,-39,0.9996, ,0,Meter
-32625,WGS_1984_UTM_Zone_25N,500000,0,-33,0.9996, ,0,Meter
-32626,WGS_1984_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
-32627,WGS_1984_UTM_Zone_27N,500000,0,-21,0.9996, ,0,Meter
-32628,WGS_1984_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-32629,WGS_1984_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
-32630,WGS_1984_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
-32631,WGS_1984_UTM_Zone_31N,500000,0,3,0.9996, ,0,Meter
-32632,WGS_1984_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
-32633,WGS_1984_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
-32634,WGS_1984_UTM_Zone_34N,500000,0,21,0.9996, ,0,Meter
-32635,WGS_1984_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
-32636,WGS_1984_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
-32637,WGS_1984_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
-32638,WGS_1984_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
-32639,WGS_1984_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
-32640,WGS_1984_UTM_Zone_40N,500000,0,57,0.9996, ,0,Meter
-32641,WGS_1984_UTM_Zone_41N,500000,0,63,0.9996, ,0,Meter
-32642,WGS_1984_UTM_Zone_42N,500000,0,69,0.9996, ,0,Meter
-32643,WGS_1984_UTM_Zone_43N,500000,0,75,0.9996, ,0,Meter
-32644,WGS_1984_UTM_Zone_44N,500000,0,81,0.9996, ,0,Meter
-32645,WGS_1984_UTM_Zone_45N,500000,0,87,0.9996, ,0,Meter
-32646,WGS_1984_UTM_Zone_46N,500000,0,93,0.9996, ,0,Meter
-32647,WGS_1984_UTM_Zone_47N,500000,0,99,0.9996, ,0,Meter
-32648,WGS_1984_UTM_Zone_48N,500000,0,105,0.9996, ,0,Meter
-32649,WGS_1984_UTM_Zone_49N,500000,0,111,0.9996, ,0,Meter
-32650,WGS_1984_UTM_Zone_50N,500000,0,117,0.9996, ,0,Meter
-32651,WGS_1984_UTM_Zone_51N,500000,0,123,0.9996, ,0,Meter
-32652,WGS_1984_UTM_Zone_52N,500000,0,129,0.9996, ,0,Meter
-32653,WGS_1984_UTM_Zone_53N,500000,0,135,0.9996, ,0,Meter
-32654,WGS_1984_UTM_Zone_54N,500000,0,141,0.9996, ,0,Meter
-32655,WGS_1984_UTM_Zone_55N,500000,0,147,0.9996, ,0,Meter
-32656,WGS_1984_UTM_Zone_56N,500000,0,153,0.9996, ,0,Meter
-32657,WGS_1984_UTM_Zone_57N,500000,0,159,0.9996, ,0,Meter
-32658,WGS_1984_UTM_Zone_58N,500000,0,165,0.9996, ,0,Meter
-32659,WGS_1984_UTM_Zone_59N,500000,0,171,0.9996, ,0,Meter
-32660,WGS_1984_UTM_Zone_60N,500000,0,177,0.9996, ,0,Meter
-32661,UPS_North,2000000,2000000,0,0.994, ,90,Meter
-32701,WGS_1984_UTM_Zone_1S,500000,10000000,-177,0.9996, ,0,Meter
-32702,WGS_1984_UTM_Zone_2S,500000,10000000,-171,0.9996, ,0,Meter
-32703,WGS_1984_UTM_Zone_3S,500000,10000000,-165,0.9996, ,0,Meter
-32704,WGS_1984_UTM_Zone_4S,500000,10000000,-159,0.9996, ,0,Meter
-32705,WGS_1984_UTM_Zone_5S,500000,10000000,-153,0.9996, ,0,Meter
-32706,WGS_1984_UTM_Zone_6S,500000,10000000,-147,0.9996, ,0,Meter
-32707,WGS_1984_UTM_Zone_7S,500000,10000000,-141,0.9996, ,0,Meter
-32708,WGS_1984_UTM_Zone_8S,500000,10000000,-135,0.9996, ,0,Meter
-32709,WGS_1984_UTM_Zone_9S,500000,10000000,-129,0.9996, ,0,Meter
-32710,WGS_1984_UTM_Zone_10S,500000,10000000,-123,0.9996, ,0,Meter
-32711,WGS_1984_UTM_Zone_11S,500000,10000000,-117,0.9996, ,0,Meter
-32712,WGS_1984_UTM_Zone_12S,500000,10000000,-111,0.9996, ,0,Meter
-32713,WGS_1984_UTM_Zone_13S,500000,10000000,-105,0.9996, ,0,Meter
-32714,WGS_1984_UTM_Zone_14S,500000,10000000,-99,0.9996, ,0,Meter
-32715,WGS_1984_UTM_Zone_15S,500000,10000000,-93,0.9996, ,0,Meter
-32716,WGS_1984_UTM_Zone_16S,500000,10000000,-87,0.9996, ,0,Meter
-32717,WGS_1984_UTM_Zone_17S,500000,10000000,-81,0.9996, ,0,Meter
-32718,WGS_1984_UTM_Zone_18S,500000,10000000,-75,0.9996, ,0,Meter
-32719,WGS_1984_UTM_Zone_19S,500000,10000000,-69,0.9996, ,0,Meter
-32720,WGS_1984_UTM_Zone_20S,500000,10000000,-63,0.9996, ,0,Meter
-32721,WGS_1984_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
-32722,WGS_1984_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
-32723,WGS_1984_UTM_Zone_23S,500000,10000000,-45,0.9996, ,0,Meter
-32724,WGS_1984_UTM_Zone_24S,500000,10000000,-39,0.9996, ,0,Meter
-32725,WGS_1984_UTM_Zone_25S,500000,10000000,-33,0.9996, ,0,Meter
-32726,WGS_1984_UTM_Zone_26S,500000,10000000,-27,0.9996, ,0,Meter
-32727,WGS_1984_UTM_Zone_27S,500000,10000000,-21,0.9996, ,0,Meter
-32728,WGS_1984_UTM_Zone_28S,500000,10000000,-15,0.9996, ,0,Meter
-32729,WGS_1984_UTM_Zone_29S,500000,10000000,-9,0.9996, ,0,Meter
-32730,WGS_1984_UTM_Zone_30S,500000,10000000,-3,0.9996, ,0,Meter
-32731,WGS_1984_UTM_Zone_31S,500000,10000000,3,0.9996, ,0,Meter
-32732,WGS_1984_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
-32733,WGS_1984_UTM_Zone_33S,500000,10000000,15,0.9996, ,0,Meter
-32734,WGS_1984_UTM_Zone_34S,500000,10000000,21,0.9996, ,0,Meter
-32735,WGS_1984_UTM_Zone_35S,500000,10000000,27,0.9996, ,0,Meter
-32736,WGS_1984_UTM_Zone_36S,500000,10000000,33,0.9996, ,0,Meter
-32737,WGS_1984_UTM_Zone_37S,500000,10000000,39,0.9996, ,0,Meter
-32738,WGS_1984_UTM_Zone_38S,500000,10000000,45,0.9996, ,0,Meter
-32739,WGS_1984_UTM_Zone_39S,500000,10000000,51,0.9996, ,0,Meter
-32740,WGS_1984_UTM_Zone_40S,500000,10000000,57,0.9996, ,0,Meter
-32741,WGS_1984_UTM_Zone_41S,500000,10000000,63,0.9996, ,0,Meter
-32742,WGS_1984_UTM_Zone_42S,500000,10000000,69,0.9996, ,0,Meter
-32743,WGS_1984_UTM_Zone_43S,500000,10000000,75,0.9996, ,0,Meter
-32744,WGS_1984_UTM_Zone_44S,500000,10000000,81,0.9996, ,0,Meter
-32745,WGS_1984_UTM_Zone_45S,500000,10000000,87,0.9996, ,0,Meter
-32746,WGS_1984_UTM_Zone_46S,500000,10000000,93,0.9996, ,0,Meter
-32747,WGS_1984_UTM_Zone_47S,500000,10000000,99,0.9996, ,0,Meter
-32748,WGS_1984_UTM_Zone_48S,500000,10000000,105,0.9996, ,0,Meter
-32749,WGS_1984_UTM_Zone_49S,500000,10000000,111,0.9996, ,0,Meter
-32750,WGS_1984_UTM_Zone_50S,500000,10000000,117,0.9996, ,0,Meter
-32751,WGS_1984_UTM_Zone_51S,500000,10000000,123,0.9996, ,0,Meter
-32752,WGS_1984_UTM_Zone_52S,500000,10000000,129,0.9996, ,0,Meter
-32753,WGS_1984_UTM_Zone_53S,500000,10000000,135,0.9996, ,0,Meter
-32754,WGS_1984_UTM_Zone_54S,500000,10000000,141,0.9996, ,0,Meter
-32755,WGS_1984_UTM_Zone_55S,500000,10000000,147,0.9996, ,0,Meter
-32756,WGS_1984_UTM_Zone_56S,500000,10000000,153,0.9996, ,0,Meter
-32757,WGS_1984_UTM_Zone_57S,500000,10000000,159,0.9996, ,0,Meter
-32758,WGS_1984_UTM_Zone_58S,500000,10000000,165,0.9996, ,0,Meter
-32759,WGS_1984_UTM_Zone_59S,500000,10000000,171,0.9996, ,0,Meter
-32760,WGS_1984_UTM_Zone_60S,500000,10000000,177,0.9996, ,0,Meter
-32761,UPS_South,2000000,2000000,0,0.994, ,-90,Meter
-32766,WGS_1984_TM_36_SE,500000,10000000,36,0.9996, ,0,Meter
-53001,Sphere_Plate_Carree,0,0,0,,,,Meter
-53002,Sphere_Equidistant_Cylindrical,0,0,0,60,,,Meter
-53003,Sphere_Miller_Cylindrical,0,0,0,,,,Meter
-53004,Sphere_Mercator,0,0,0,0,,,Meter
-53008,Sphere_Sinusoidal,0,0,0,,,,Meter
-53009,Sphere_Mollweide,0,0,0,,,,Meter
-53010,Sphere_Eckert_VI,0,0,0,,,,Meter
-53011,Sphere_Eckert_V,0,0,0,,,,Meter
-53012,Sphere_Eckert_IV,0,0,0,,,,Meter
-53013,Sphere_Eckert_III,0,0,0,,,,Meter
-53014,Sphere_Eckert_II,0,0,0,,,,Meter
-53015,Sphere_Eckert_I,0,0,0,,,,Meter
-53016,Sphere_Gall_Stereographic,0,0,0,,,,Meter
-53017,Sphere_Behrmann,0,0,0,,,,Meter
-53018,Sphere_Winkel_I,0,0,0,50.45977625,,,Meter
-53019,Sphere_Winkel_II,0,0,0,50.45977625,,,Meter
-53021,Sphere_Polyconic,0,0,0,0,,,Meter
-53022,Sphere_Quartic_Authalic,0,0,0,,,,Meter
-53023,Sphere_Loximuthal,0,0,0,40,,,Meter
-53024,Sphere_Bonne,0,0,0,60,,,Meter
-53026,Sphere_Stereographic,0,0,0,1, ,0,Meter
-53027,Sphere_Equidistant_Conic,0,0,0,60,60,0,Meter
-53028,Sphere_Cassini,0,0,0,1, ,0,Meter
-53029,Sphere_Van_der_Grinten_I,0,0,0,,,,Meter
-53030,Sphere_Robinson,0,0,0,,,,Meter
-53031,Sphere_Two_Point_Equidistant,0,0,0,60,0,60,Meter
-53032,Sphere_Azimuthal_Equidistant,0,0,0,,,0,Meter
-53034,Sphere_Cylindrical_Equal_Area,0,0,0,0,,,Meter
-53042,Sphere_Winkel_Tripel_NGS,0,0,0,50.467,,,Meter
-53043,Sphere_Aitoff,0,0,0,,,,Meter
-53044,Sphere_Hammer_Aitoff,0,0,0,,,,Meter
-53045,Sphere_Flat_Polar_Quartic,0,0,0,,,,Meter
-53046,Sphere_Craster_Parabolic,0,0,0,,,,Meter
-53048,Sphere_Times,0,0,0,,,,Meter
-54001,World_Plate_Carree,0,0,0,Meter,,,
-54002,World_Equidistant_Cylindrical,0,0,0,60,,,Meter
-54003,World_Miller_Cylindrical,0,0,0,,,,Meter
-54004,World_Mercator,0,0,0,0,,,Meter
-54008,World_Sinusoidal,0,0,0,,,,Meter
-54009,World_Mollweide,0,0,0,,,,Meter
-54010,World_Eckert_VI,0,0,0,,,,Meter
-54011,World_Eckert_V,0,0,0,,,,Meter
-54012,World_Eckert_IV,0,0,0,,,,Meter
-54013,World_Eckert_III,0,0,0,,,,Meter
-54014,World_Eckert_II,0,0,0,,,,Meter
-54015,World_Eckert_I,0,0,0,,,,Meter
-54016,World_Gall_Stereographic,0,0,0,,,,Meter
-54017,World_Behrmann,0,0,0,,,,Meter
-54018,World_Winkel_I,0,0,0,50.45977625,,,Meter
-54019,World_Winkel_II,0,0,0,50.45977625,,,Meter
-54021,World_Polyconic,0,0,0,,,0,Meter
-54022,World_Quartic_Authalic,0,0,0,,,,Meter
-54024,World_Bonne,0,0,0,60,,,Meter
-54026,World_Stereographic,0,0,0,1, ,0,Meter
-54027,World_Equidistant_Conic,0,0,0,60,60,0,Meter
-54028,World_Cassini,0,0,0,1, ,0,Meter
-54029,World_Van_der_Grinten_I,0,0,0,,,,Meter
-54030,World_Robinson,0,0,0,,,,Meter
-54031,World_Two_Point_Equidistant,0,0,0,60,0,60,Meter
-54032,World_Azimuthal_Equidistant,0,0,0,,,0,Meter
-54034,World_Cylindrical_Equal_Area,0,0,0,0,,,Meter
-54042,World_Winkel_Tripel_NGS,0,0,0,50.467,,,Meter
-54043,World_Aitoff,0,0,0,,,,Meter
-54044,World_Hammer_Aitoff,0,0,0,,,,Meter
-54045,World_Flat_Polar_Quartic,0,0,0,,,,Meter
-54046,World_Craster_Parabolic,0,0,0,,,,Meter
-54048,World_Times,0,0,0,,,,Meter
-54049,World_Vertical_Perspective,0,0,0,0,35800000,,Meter
-54050,World_Fuller,0,0,0,Meter,,,Meter
-54051,World_Cube,0,0,0,1,,,Meter
-54052,World_Goode_Homolosine_Land,0,0,0,1,,,Meter
-54053,World_Goode_Homolosine_Ocean,0,0,-160,2,,,Meter
-65061,NAD_1927_StatePlane_Guam_FIPS_5400,164041.6667,164041.6667,144.7487507,13.47246635,Foot_US,,
-65062,American_Samoa_1962_StatePlane_American_Samoa_FIPS_5300,500000,312234.65,-170,-14.26666667,1,-14.26666667,Foot_US
-65161,NAD_1983_StatePlane_Guam_FIPS_5400,50000,50000,144.7487507,,,13.47246635,Meter
-65163,NAD_1983_StatePlane_Kentucky_FIPS_1600,1500000,1000000,-85.75,37.08333333,38.66666667,36.33333333,Meter
-102001,Canada_Albers_Equal_Area_Conic,0,0,-96,50,70,40,Meter
-102002,Canada_Lambert_Conformal_Conic,0,0,-96,50,70,40,Meter
-102003,USA_Contiguous_Albers_Equal_Area_Conic,0,0,-96,29.5,45.5,37.5,Meter
-102004,USA_Contiguous_Lambert_Conformal_Conic,0,0,-96,33,45,39,Meter
-102005,USA_Contiguous_Equidistant_Conic,0,0,-96,33,45,39,Meter
-102006,Alaska_Albers_Equal_Area_Conic,0,0,-154,55,65,50,Meter
-102007,Hawaii_Albers_Equal_Area_Conic,0,0,-157,8,18,13,Meter
-102008,North_America_Albers_Equal_Area_Conic,0,0,-96,20,60,40,Meter
-102009,North_America_Lambert_Conformal_Conic,0,0,-96,20,60,40,Meter
-102010,North_America_Equidistant_Conic,0,0,-96,20,60,40,Meter
-102011,Africa_Sinusoidal,0,0,15,,,,Meter
-102012,Asia_Lambert_Conformal_Conic,0,0,105,30,62,0,Meter
-102013,Europe_Albers_Equal_Area_Conic,0,0,10,43,62,30,Meter
-102014,Europe_Lambert_Conformal_Conic,0,0,10,43,62,30,Meter
-102015,South_America_Lambert_Conformal_Conic,0,0,-60,-5,-42,-32,Meter
-102016,North_Pole_Azimuthal_Equidistant,0,0,0,,,90,Meter
-102017,North_Pole_Lambert_Azimuthal_Equal_Area,0,0,0,,,90,Meter
-102018,North_Pole_Stereographic,0,0,0,1, ,90,Meter
-102019,South_Pole_Azimuthal_Equidistant,0,0,0,,,-90,Meter
-102020,South_Pole_Lambert_Azimuthal_Equal_Area,0,0,0,,,-90,Meter
-102021,South_Pole_Stereographic,0,0,0,1, ,-90,Meter
-102022,Africa_Albers_Equal_Area_Conic,0,0,25,20,-23,0,Meter
-102023,Africa_Equidistant_Conic,0,0,25,20,-23,0,Meter
-102024,Africa_Lambert_Conformal_Conic,0,0,25,20,-23,0,Meter
-102025,Asia_North_Albers_Equal_Area_Conic,0,0,95,15,65,30,Meter
-102026,Asia_North_Equidistant_Conic,0,0,95,15,65,30,Meter
-102027,Asia_North_Lambert_Conformal_Conic,0,0,95,15,65,30,Meter
-102028,Asia_South_Albers_Equal_Area_Conic,0,0,125,7,-32,-15,Meter
-102029,Asia_South_Equidistant_Conic,0,0,125,7,-32,-15,Meter
-102030,Asia_South_Lambert_Conformal_Conic,0,0,125,7,-32,-15,Meter
-102031,Europe_Equidistant_Conic,0,0,10,43,62,30,Meter
-102032,South_America_Equidistant_Conic,0,0,-60,-5,-42,-32,Meter
-102033,South_America_Albers_Equal_Area_Conic,0,0,-60,-5,-42,-32,Meter
-102034,North_Pole_Gnomonic,0,0,0,90,,,Meter
-102035,North_Pole_Orthographic,0,0,0,90,,,Meter
-102036,South_Pole_Gnomonic,0,0,0,-90,,,Meter
-102037,South_Pole_Orthographic,0,0,0,-90,,,Meter
-102038,The_World_From_Space,0,0,-72.53333333,42.53333333,,,Meter
-102039,USA_Contiguous_Albers_Equal_Area_Conic_USGS_version,0,0,-96,29.5,45.5,23,Meter
-102060,D48_Slovenia_TM,500000,-5000000,15,0.9999, ,0,Meter
-102063,Kandawala_Ceylon_Belt_Meters,160933.5605,160933.5605,80.77171111,1, ,7.000480278,Meter
-102064,Kandawala_Ceylon_Belt_Indian_Yards_1937,176000,176000,80.77171111,1, ,7.000480278,Yard_Indian_1937
-102068,EMEP_50_Kilometer_Grid,8,110,-32,60,,,50_Kilometers
-102069,EMEP_150_Kilometer_Grid,3,37,-32,60,,,150_Kilometers
-102070,Guernsey_Grid,47000,50000,-2.416666667,0.999997, ,49.5,Meter
-102071,AGD_1966_ACT_Grid_AGC_Zone,200000,4510193.494,149.0092948,1.000086, ,0,Meter
-102072,AGD_1966_ISG_54_2,300000,5000000,141,0.99994, ,0,Meter
-102073,AGD_1966_ISG_54_3,300000,5000000,143,0.99994, ,0,Meter
-102074,AGD_1966_ISG_55_1,300000,5000000,145,0.99994, ,0,Meter
-102075,AGD_1966_ISG_55_2,300000,5000000,147,0.99994, ,0,Meter
-102076,AGD_1966_ISG_55_3,300000,5000000,149,0.99994, ,0,Meter
-102077,AGD_1966_ISG_56_1,300000,5000000,151,0.99994, ,0,Meter
-102078,AGD_1966_ISG_56_2,300000,5000000,153,0.99994, ,0,Meter
-102079,AGD_1966_ISG_56_3,300000,5000000,155,0.99994, ,0,Meter
-102090,Bermuda_2000_National_Grid,550000,100000,-64.75,1, ,32,Meter
-102091,Monte_Mario_Italy_1,1500000,0,9,0.9996, ,0,Meter
-102092,Monte_Mario_Italy_2,2520000,0,15,0.9996, ,0,Meter
-102093,Roma_1940_Gauss_Boaga_Est,2520000,0,15,0.9996, ,0,Meter
-102094,Roma_1940_Gauss_Boaga_Ovest,1500000,0,9,0.9996, ,0,Meter
-102095,JAD_2001_Jamaica_Grid,750000,650000,-77,18,1,18,Meter
-102096,Bab_South_Palau_Azimuthal_Equidistant,50000,150000,134.4504449,,,7.351222111,Meter
-102097,ETRS_1989_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
-102098,ETRS_1989_UTM_Zone_27N,500000,0,-21,0.9996, ,0,Meter
-102099,ETRS_1989_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
-102101,NGO_1948_Norway_Zone_1,0,0,6.05625,1, ,58,Meter
-102102,NGO_1948_Norway_Zone_2,0,0,8.389583333,1, ,58,Meter
-102103,NGO_1948_Norway_Zone_3,0,0,10.72291667,1, ,58,Meter
-102104,NGO_1948_Norway_Zone_4,0,0,13.22291667,1, ,58,Meter
-102105,NGO_1948_Norway_Zone_5,0,0,16.88958333,1, ,58,Meter
-102106,NGO_1948_Norway_Zone_6,0,0,20.88958333,1, ,58,Meter
-102107,NGO_1948_Norway_Zone_7,0,0,24.88958333,1, ,58,Meter
-102108,NGO_1948_Norway_Zone_8,0,0,29.05625,1, ,58,Meter
-102110,RGF_1993_Lambert_93,700000,6600000,3,44,49,46.5,Meter
-102111,Chatham_Islands_1979_Map_Grid,350000,650000,-176.5,1, ,-44,Meter
-102112,NZGD_2000_Chatham_Island_Circuit,400000,800000,-176.5,1, ,-44,Meter
-102114,Old_Hawaiian_UTM_Zone_4N,500000,0,-159,0.9996, ,0,Meter
-102115,Old_Hawaiian_UTM_Zone_5N,500000,0,-153,0.9996, ,0,Meter
-102116,American_Samoa_1962_UTM_Zone_2S,500000,10000000,-171,0.9996, ,0,Meter
-102117,NAD_1927_Alaska_Albers_Meters,0,0,-154,55,65,50,Meter
-102118,NAD_1927_Georgia_Statewide_Albers,0,0,-83.5,29.5,45.5,23,Foot_US
-102119,NAD_1927_Texas_Statewide_Mapping_System,3000000,3000000,-100,27.41666667,34.91666667,31.16666667,Foot
-102120,NAD_1927_Michigan_GeoRef_Feet_US,8355401.583,-14284780.54,0.9996,337.25556,-86,45.30916667,Foot_US
-102121,NAD_1983_Michigan_GeoRef_Feet_US,8355401.583,-14284780.54,0.9996,337.25556,-86,45.30916667,Foot_US
-102122,NAD_1927_Michigan_GeoRef_Meters,2546731.496,-4354009.816,0.9996,337.25556,-86,45.30916667,Meter
-102123,NAD_1983_Michigan_GeoRef_Meters,2546731.496,-4354009.816,0.9996,337.25556,-86,45.30916667,Meter
-102124,NAD_1927_UTM_Zone_1N,500000,0,-177,0.9996, ,0,Meter
-102125,NAD_1927_UTM_Zone_2N,500000,0,-171,0.9996, ,0,Meter
-102126,NAD_1927_UTM_Zone_59N,500000,0,171,0.9996, ,0,Meter
-102127,NAD_1927_UTM_Zone_60N,500000,0,177,0.9996, ,0,Meter
-102128,NAD_1983_UTM_Zone_1N,500000,0,-177,0.9996, ,0,Meter
-102129,NAD_1983_UTM_Zone_2N,500000,0,-171,0.9996, ,0,Meter
-102130,NAD_1983_UTM_Zone_59N,500000,0,171,0.9996, ,0,Meter
-102131,NAD_1983_UTM_Zone_60N,500000,0,177,0.9996, ,0,Meter
-102132,NGO_1948_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
-102133,NGO_1948_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
-102134,NGO_1948_UTM_Zone_34N,500000,0,21,0.9996, ,0,Meter
-102135,NGO_1948_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
-102136,NGO_1948_Baerum_Kommune,19999.32,-202977.79,10.72291667,1, ,58,Meter
-102137,NGO_1948_Bergenhalvoen,100000,-200000,6.05625,1, ,58,Meter
-102138,NGO_1948_Oslo_Kommune,0,-212979.18,10.72291667,1, ,58,Meter
-102139,EUREF_FIN_TM35FIN,500000,0,27,0.9996, ,0,Meter
-102140,Hong_Kong_1980_Grid,836694.05,819069.8,114.1785556,1, ,22.31213333,Meter
-102141,Hong_Kong_1980_UTM_Zone_49N,500000,0,111,0.9996, ,0,Meter
-102142,Hong_Kong_1980_UTM_Zone_50N,500000,0,117,0.9996, ,0,Meter
-102143,QND_1995_UTM_39N,500000,0,51,0.9996, ,0,Meter
-102144,Merchich_Degree_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-102145,JGD_2000_UTM_Zone_51N,500000,0,123,0.9996, ,0,Meter
-102146,JGD_2000_UTM_Zone_52N,500000,0,129,0.9996, ,0,Meter
-102147,JGD_2000_UTM_Zone_53N,500000,0,135,0.9996, ,0,Meter
-102148,JGD_2000_UTM_Zone_54N,500000,0,141,0.9996, ,0,Meter
-102149,JGD_2000_UTM_Zone_55N,500000,0,147,0.9996, ,0,Meter
-102150,JGD_2000_UTM_Zone_56N,500000,0,153,0.9996, ,0,Meter
-102151,Tokyo_UTM_Zone_51N,500000,0,123,0.9996, ,0,Meter
-102152,Tokyo_UTM_Zone_52N,500000,0,129,0.9996, ,0,Meter
-102153,Tokyo_UTM_Zone_53N,500000,0,135,0.9996, ,0,Meter
-102154,Tokyo_UTM_Zone_54N,500000,0,141,0.9996, ,0,Meter
-102155,Tokyo_UTM_Zone_55N,500000,0,147,0.9996, ,0,Meter
-102156,Tokyo_UTM_Zone_56N,500000,0,153,0.9996, ,0,Meter
-102157,ETRS_1989_Kosovo_Grid,7500000,0,21,0.9999, ,0,Meter
-102158,Jordan_JTM,500000,-3000000,37,0.9998, ,0,Meter
-102159,Observatorio_Meteorologico_1965_Macau_Grid,20000,20000,113.5364694,1, ,22.21239722,Meter
-102160,Datum_73_Hayford_Gauss_IGeoE,200180.598,299913.01,-8.131906111,1, ,39.66666667,Meter
-102161,Datum_73_Hayford_Gauss_IPCC,180.598,-86.99,-8.131906111,1, ,39.66666667,Meter
-102162,Graciosa_Base_SW_1948_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
-102163,Lisboa_Bessel_Bonne,0,0,-8.131906111,39.66666667,,,Meter
-102164,Lisboa_Hayford_Gauss_IGeoE,200000,300000,-8.131906111,1, ,39.66666667,Meter
-102165,Lisboa_Hayford_Gauss_IPCC,0,0,-8.131906111,1, ,39.66666667,Meter
-102166,Observ_Meteorologico_1939_UTM_Zone_25N,500000,0,-33,0.9996, ,0,Meter
-102167,Porto_Santo_1936_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-102168,Sao_Braz_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
-102169,Selvagem_Grande_1938_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-102170,AGD_1966_VICGRID,2500000,4500000,145,-36,-38,-37,Meter
-102171,GDA_1994_VICGRID94,2500000,2500000,145,-36,-38,-37,Meter
-102172,GDA_1994_South_Australia_Lambert,1000000,2000000,135,-28,-36,-32,Meter
-102173,ETRS_1989_UWPP_1992,500000,-5300000,19,0.9993, ,0,Meter
-102174,ETRS_1989_UWPP_2000_PAS_5,5500000,0,15,0.999923, ,0,Meter
-102175,ETRS_1989_UWPP_2000_PAS_6,6500000,0,18,0.999923, ,0,Meter
-102176,ETRS_1989_UWPP_2000_PAS_7,7500000,0,21,0.999923, ,0,Meter
-102177,ETRS_1989_UWPP_2000_PAS_8,8500000,0,24,0.999923, ,0,Meter
-102178,NAD_1927_10TM_AEP_Forest,500000,0,-115,0.9992, ,0,Meter
-102179,NAD_1927_10TM_AEP_Resource,0,0,-115,0.9992, ,0,Meter
-102180,NAD_1927_3TM_111,0,0,-111,0.9999, ,0,Meter
-102181,NAD_1927_3TM_114,0,0,-114,0.9999, ,0,Meter
-102182,NAD_1927_3TM_117,0,0,-117,0.9999, ,0,Meter
-102183,NAD_1927_3TM_120,0,0,-120,0.9999, ,0,Meter
-102184,NAD_1983_10TM_AEP_Forest,500000,0,-115,0.9992, ,0,Meter
-102185,NAD_1983_10TM_AEP_Resource,0,0,-115,0.9992, ,0,Meter
-102186,NAD_1983_3TM_111,0,0,-111,0.9999, ,0,Meter
-102187,NAD_1983_3TM_114,0,0,-114,0.9999, ,0,Meter
-102188,NAD_1983_3TM_117,0,0,-117,0.9999, ,0,Meter
-102189,NAD_1983_3TM_120,0,0,-120,0.9999, ,0,Meter
-102190,NAD_1983_BC_Environment_Albers,1000000,0,-126,50,58.5,45,Meter
-102191,Nord_Maroc_Degree,500000,300000,-5.4,33.3,0.999625769,33.3,Meter
-102192,Sud_Maroc_Degree,500000,300000,-5.4,29.7,0.999615596,29.7,Meter
-102193,Sahara_Degree,1200000,400000,-5.4,26.1,0.9996,26.1,Meter
-102194,UWPP_1992,500000,-5300000,19,0.9993, ,0,Meter
-102195,UWPP_2000_PAS_5,5500000,0,15,0.999923, ,0,Meter
-102196,UWPP_2000_PAS_6,6500000,0,18,0.999923, ,0,Meter
-102197,UWPP_2000_PAS_7,7500000,0,21,0.999923, ,0,Meter
-102198,UWPP_2000_PAS_8,8500000,0,24,0.999923, ,0,Meter
-102200,NAD_1983_HARN_UTM_Zone_2S,500000,10000000,-171,0.9996, ,0,Meter
-102201,NAD_1983_HARN_Guam_Map_Grid,100000,200000,144.75,1, ,13.5,Meter
-102202,NAD_1983_HARN_UTM_Zone_4N,500000,0,-159,0.9996, ,0,Meter
-102203,NAD_1983_HARN_UTM_Zone_5N,500000,0,-153,0.9996, ,0,Meter
-102205,NAD_1983_HARN_UTM_Zone_11N,500000,0,-117,0.9996, ,0,Meter
-102206,NAD_1983_HARN_UTM_Zone_12N,500000,0,-111,0.9996, ,0,Meter
-102207,NAD_1983_HARN_UTM_Zone_13N,500000,0,-105,0.9996, ,0,Meter
-102208,NAD_1983_HARN_Maine_2000_East_Zone,700000,0,-67.875,0.99998, ,43.83333333,Meter
-102209,NAD_1983_HARN_Maine_2000_Central_Zone,500000,0,-69.125,0.99998, ,43.5,Meter
-102210,NAD_1983_HARN_Maine_2000_West_Zone,300000,0,-70.375,0.99998, ,42.83333333,Meter
-102211,NAD_1983_HARN_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
-102219,NAD_1983_Wisconsin_TM_US_Ft,1706033.333,-14698133.33,-90,0.9996, ,0,Foot_US
-102220,NAD_1983_HARN_Wisconsin_TM_US_Ft,1706033.333,-14698133.33,-90,0.9996, ,0,Foot_US
-102221,Ocotepeque_1935_Costa_Rica_Lambert_Norte,500000,271820.522,-84.33333333,11,9.933333333,10.46666667,Meter
-102222,Ocotepeque_1935_Costa_Rica_Lambert_Sur,500000,327987.436,-83.66666667,9.533333333,8.466666667,9,Meter
-102223,WGS_1984_Costa_Rica_TM_90,500000,0,-84,0.9996, ,0,Meter
-102224,MONREF_1997_UTM_Zone_46N,500000,0,93,0.9996, ,0,Meter
-102225,MONREF_1997_UTM_Zone_47N,500000,0,99,0.9996, ,0,Meter
-102226,MONREF_1997_UTM_Zone_48N,500000,0,105,0.9996, ,0,Meter
-102227,MONREF_1997_UTM_Zone_49N,500000,0,111,0.9996, ,0,Meter
-102228,MONREF_1997_UTM_Zone_50N,500000,0,117,0.9996, ,0,Meter
-102229,NAD_1983_HARN_StatePlane_Alabama_East_FIPS_0101,200000,0,-85.83333333,0.99996, ,30.5,Meter
-102230,NAD_1983_HARN_StatePlane_Alabama_West_FIPS_0102,600000,0,-87.5,0.999933333, ,30,Meter
-102231,Colombia_West_West_Zone,1000000,1000000,-80.08091667,1, ,4.599047222,Meter
-102232,Bogota_Ciudad_Bogota,92334.879,109320.965,-74.15,1.000399788, ,4.683333333,Meter
-102233,MAGNA_Ciudad_Bogota,92334.879,109320.965,-74.14659167,1.000399803, ,4.680486111,Meter
-102239,Guam_Geodetic_Triangulation_Network_1963,50000,50000,144.7487507,,,13.47246635,Meter
-102240,Guam_Geodetic_Network_1993,100000,200000,144.75,1, ,13.5,Meter
-102241,Pohnpei_Az_Eq_1971,80122.82,80747.24,158.2092992,,,6.965075694,Meter
-102242,Saipan_Az_Eq_1969,50000,50000,145.7112869,,,15.16755722,Meter
-102243,NAD_1983_HARN_StatePlane_California_III_FIPS_0403,2000000,500000,-120.5,37.06666667,38.43333333,36.5,Meter
-102244,NAD_1983_HARN_StatePlane_California_IV_FIPS_0404,2000000,500000,-119,36,37.25,35.33333333,Meter
-102245,NAD_1983_HARN_StatePlane_California_V_FIPS_0405,2000000,500000,-118,34.03333333,35.46666667,33.5,Meter
-102246,NAD_1983_HARN_StatePlane_California_VI_FIPS_0406,2000000,500000,-116.25,32.78333333,33.88333333,32.16666667,Meter
-102248,NAD_1983_HARN_StatePlane_Arizona_East_FIPS_0201,213360,0,-110.1666667,0.9999, ,31,Meter
-102249,NAD_1983_HARN_StatePlane_Arizona_Central_FIPS_0202,213360,0,-111.9166667,0.9999, ,31,Meter
-102250,NAD_1983_HARN_StatePlane_Arizona_West_FIPS_0203,213360,0,-113.75,0.999933333, ,31,Meter
-102251,NAD_1983_HARN_StatePlane_Arkansas_North_FIPS_0301,400000,0,-92,34.93333333,36.23333333,34.33333333,Meter
-102252,NAD_1983_HARN_StatePlane_Arkansas_South_FIPS_0302,400000,400000,-92,33.3,34.76666667,32.66666667,Meter
-102253,NAD_1983_HARN_StatePlane_Colorado_North_FIPS_0501,914401.8289,304800.6096,-105.5,39.71666667,40.78333333,39.33333333,Meter
-102254,NAD_1983_HARN_StatePlane_Colorado_Central_FIPS_0502,914401.8289,304800.6096,-105.5,38.45,39.75,37.83333333,Meter
-102255,NAD_1983_HARN_StatePlane_Colorado_South_FIPS_0503,914401.8289,304800.6096,-105.5,37.23333333,38.43333333,36.66666667,Meter
-102256,NAD_1983_HARN_StatePlane_Connecticut_FIPS_0600,304800.6096,152400.3048,-72.75,41.2,41.86666667,40.83333333,Meter
-102257,NAD_1983_HARN_StatePlane_Delaware_FIPS_0700,200000,0,-75.41666667,0.999995, ,38,Meter
-102258,NAD_1983_HARN_StatePlane_Florida_East_FIPS_0901,200000,0,-81,0.999941176, ,24.33333333,Meter
-102259,NAD_1983_HARN_StatePlane_Florida_West_FIPS_0902,200000,0,-82,0.999941176, ,24.33333333,Meter
-102260,NAD_1983_HARN_StatePlane_Florida_North_FIPS_0903,600000,0,-84.5,29.58333333,30.75,29,Meter
-102261,NAD_1983_HARN_StatePlane_Hawaii_1_FIPS_5101,500000,0,-155.5,0.999966667, ,18.83333333,Meter
-102262,NAD_1983_HARN_StatePlane_Hawaii_2_FIPS_5102,500000,0,-156.6666667,0.999966667, ,20.33333333,Meter
-102263,NAD_1983_HARN_StatePlane_Hawaii_3_FIPS_5103,500000,0,-158,0.99999, ,21.16666667,Meter
-102264,NAD_1983_HARN_StatePlane_Hawaii_4_FIPS_5104,500000,0,-159.5,0.99999, ,21.83333333,Meter
-102265,NAD_1983_HARN_StatePlane_Hawaii_5_FIPS_5105,500000,0,-160.1666667,1, ,21.66666667,Meter
-102266,NAD_1983_HARN_StatePlane_Georgia_East_FIPS_1001,200000,0,-82.16666667,0.9999, ,30,Meter
-102267,NAD_1983_HARN_StatePlane_Georgia_West_FIPS_1002,700000,0,-84.16666667,0.9999, ,30,Meter
-102268,NAD_1983_HARN_StatePlane_Idaho_East_FIPS_1101,200000,0,-112.1666667,0.999947368, ,41.66666667,Meter
-102269,NAD_1983_HARN_StatePlane_Idaho_Central_FIPS_1102,500000,0,-114,0.999947368, ,41.66666667,Meter
-102270,NAD_1983_HARN_StatePlane_Idaho_West_FIPS_1103,800000,0,-115.75,0.999933333, ,41.66666667,Meter
-102271,NAD_1983_HARN_StatePlane_Illinois_East_FIPS_1201,300000,0,-88.33333333,0.999975, ,36.66666667,Meter
-102272,NAD_1983_HARN_StatePlane_Illinois_West_FIPS_1202,700000,0,-90.16666667,0.999941176, ,36.66666667,Meter
-102273,NAD_1983_HARN_StatePlane_Indiana_East_FIPS_1301,100000,250000,-85.66666667,0.999966667, ,37.5,Meter
-102274,NAD_1983_HARN_StatePlane_Indiana_West_FIPS_1302,900000,250000,-87.08333333,0.999966667, ,37.5,Meter
-102275,NAD_1983_HARN_StatePlane_Iowa_North_FIPS_1401,1500000,1000000,-93.5,42.06666667,43.26666667,41.5,Meter
-102276,NAD_1983_HARN_StatePlane_Iowa_South_FIPS_1402,500000,0,-93.5,40.61666667,41.78333333,40,Meter
-102277,NAD_1983_HARN_StatePlane_Kansas_North_FIPS_1501,400000,0,-98,38.71666667,39.78333333,38.33333333,Meter
-102278,NAD_1983_HARN_StatePlane_Kansas_South_FIPS_1502,400000,400000,-98.5,37.26666667,38.56666667,36.66666667,Meter
-102279,NAD_1983_HARN_StatePlane_Kentucky_North_FIPS_1601,500000,0,-84.25,37.96666667,38.96666667,37.5,Meter
-102280,NAD_1983_HARN_StatePlane_Kentucky_South_FIPS_1602,500000,500000,-85.75,36.73333333,37.93333333,36.33333333,Meter
-102281,NAD_1983_HARN_StatePlane_Louisiana_North_FIPS_1701,1000000,0,-92.5,31.16666667,32.66666667,30.5,Meter
-102282,NAD_1983_HARN_StatePlane_Louisiana_South_FIPS_1702,1000000,0,-91.33333333,29.3,30.7,28.5,Meter
-102283,NAD_1983_HARN_StatePlane_Maine_East_FIPS_1801,300000,0,-68.5,0.9999, ,43.66666667,Meter
-102284,NAD_1983_HARN_StatePlane_Maine_West_FIPS_1802,900000,0,-70.16666667,0.999966667, ,42.83333333,Meter
-102285,NAD_1983_HARN_StatePlane_Maryland_FIPS_1900,400000,0,-77,38.3,39.45,37.66666667,Meter
-102286,NAD_1983_HARN_StatePlane_Massachusetts_Mainland_FIPS_2001,200000,750000,-71.5,41.71666667,42.68333333,41,Meter
-102287,NAD_1983_HARN_StatePlane_Massachusetts_Island_FIPS_2002,500000,0,-70.5,41.28333333,41.48333333,41,Meter
-102288,NAD_1983_HARN_StatePlane_Michigan_North_FIPS_2111,8000000,0,-87,45.48333333,47.08333333,44.78333333,Meter
-102289,NAD_1983_HARN_StatePlane_Michigan_Central_FIPS_2112,6000000,0,-84.36666667,44.18333333,45.7,43.31666667,Meter
-102290,NAD_1983_HARN_StatePlane_Michigan_South_FIPS_2113,4000000,0,-84.36666667,42.1,43.66666667,41.5,Meter
-102291,NAD_1983_HARN_StatePlane_Minnesota_North_FIPS_2201,800000,100000,-93.1,47.03333333,48.63333333,46.5,Meter
-102292,NAD_1983_HARN_StatePlane_Minnesota_Central_FIPS_2202,800000,100000,-94.25,45.61666667,47.05,45,Meter
-102293,NAD_1983_HARN_StatePlane_Minnesota_South_FIPS_2203,800000,100000,-94,43.78333333,45.21666667,43,Meter
-102294,NAD_1983_HARN_StatePlane_Mississippi_East_FIPS_2301,300000,0,-88.83333333,0.99995, ,29.5,Meter
-102295,NAD_1983_HARN_StatePlane_Mississippi_West_FIPS_2302,700000,0,-90.33333333,0.99995, ,29.5,Meter
-102296,NAD_1983_HARN_StatePlane_Missouri_East_FIPS_2401,250000,0,-90.5,0.999933333, ,35.83333333,Meter
-102297,NAD_1983_HARN_StatePlane_Missouri_Central_FIPS_2402,500000,0,-92.5,0.999933333, ,35.83333333,Meter
-102298,NAD_1983_HARN_StatePlane_Missouri_West_FIPS_2403,850000,0,-94.5,0.999941176, ,36.16666667,Meter
-102300,NAD_1983_HARN_StatePlane_Montana_FIPS_2500,600000,0,-109.5,45,49,44.25,Meter
-102304,NAD_1983_HARN_StatePlane_Nebraska_FIPS_2600,500000,0,-100,40,43,39.83333333,Meter
-102307,NAD_1983_HARN_StatePlane_Nevada_East_FIPS_2701,200000,8000000,-115.5833333,0.9999, ,34.75,Meter
-102308,NAD_1983_HARN_StatePlane_Nevada_Central_FIPS_2702,500000,6000000,-116.6666667,0.9999, ,34.75,Meter
-102309,NAD_1983_HARN_StatePlane_Nevada_West_FIPS_2703,800000,4000000,-118.5833333,0.9999, ,34.75,Meter
-102310,NAD_1983_HARN_StatePlane_New_Hampshire_FIPS_2800,300000,0,-71.66666667,0.999966667, ,42.5,Meter
-102311,NAD_1983_HARN_StatePlane_New_Jersey_FIPS_2900,150000,0,-74.5,0.9999, ,38.83333333,Meter
-102312,NAD_1983_HARN_StatePlane_New_Mexico_East_FIPS_3001,165000,0,-104.3333333,0.999909091, ,31,Meter
-102313,NAD_1983_HARN_StatePlane_New_Mexico_Central_FIPS_3002,500000,0,-106.25,0.9999, ,31,Meter
-102314,NAD_1983_HARN_StatePlane_New_Mexico_West_FIPS_3003,830000,0,-107.8333333,0.999916667, ,31,Meter
-102315,NAD_1983_HARN_StatePlane_New_York_East_FIPS_3101,150000,0,-74.5,0.9999, ,38.83333333,Meter
-102316,NAD_1983_HARN_StatePlane_New_York_Central_FIPS_3102,250000,0,-76.58333333,0.9999375, ,40,Meter
-102317,NAD_1983_HARN_StatePlane_New_York_West_FIPS_3103,350000,0,-78.58333333,0.9999375, ,40,Meter
-102318,NAD_1983_HARN_StatePlane_New_York_Long_Island_FIPS_3104,300000,0,-74,40.66666667,41.03333333,40.16666667,Meter
-102320,NAD_1983_HARN_StatePlane_North_Dakota_North_FIPS_3301,600000,0,-100.5,47.43333333,48.73333333,47,Meter
-102321,NAD_1983_HARN_StatePlane_North_Dakota_South_FIPS_3302,600000,0,-100.5,46.18333333,47.48333333,45.66666667,Meter
-102322,NAD_1983_HARN_StatePlane_Ohio_North_FIPS_3401,600000,0,-82.5,40.43333333,41.7,39.66666667,Meter
-102323,NAD_1983_HARN_StatePlane_Ohio_South_FIPS_3402,600000,0,-82.5,38.73333333,40.03333333,38,Meter
-102324,NAD_1983_HARN_StatePlane_Oklahoma_North_FIPS_3501,600000,0,-98,35.56666667,36.76666667,35,Meter
-102325,NAD_1983_HARN_StatePlane_Oklahoma_South_FIPS_3502,600000,0,-98,33.93333333,35.23333333,33.33333333,Meter
-102326,NAD_1983_HARN_StatePlane_Oregon_North_FIPS_3601,2500000,0,-120.5,44.33333333,46,43.66666667,Meter
-102327,NAD_1983_HARN_StatePlane_Oregon_South_FIPS_3602,1500000,0,-120.5,42.33333333,44,41.66666667,Meter
-102330,NAD_1983_HARN_StatePlane_Rhode_Island_FIPS_3800,100000,0,-71.5,0.99999375, ,41.08333333,Meter
-102334,NAD_1983_HARN_StatePlane_South_Dakota_North_FIPS_4001,600000,0,-100,44.41666667,45.68333333,43.83333333,Meter
-102335,NAD_1983_HARN_StatePlane_South_Dakota_South_FIPS_4002,600000,0,-100.3333333,42.83333333,44.4,42.33333333,Meter
-102336,NAD_1983_HARN_StatePlane_Tennessee_FIPS_4100,600000,0,-86,35.25,36.41666667,34.33333333,Meter
-102337,NAD_1983_HARN_StatePlane_Texas_North_FIPS_4201,200000,1000000,-101.5,34.65,36.18333333,34,Meter
-102338,NAD_1983_HARN_StatePlane_Texas_North_Central_FIPS_4202,600000,2000000,-98.5,32.13333333,33.96666667,31.66666667,Meter
-102339,NAD_1983_HARN_StatePlane_Texas_Central_FIPS_4203,700000,3000000,-100.3333333,30.11666667,31.88333333,29.66666667,Meter
-102340,NAD_1983_HARN_StatePlane_Texas_South_Central_FIPS_4204,600000,4000000,-99,28.38333333,30.28333333,27.83333333,Meter
-102341,NAD_1983_HARN_StatePlane_Texas_South_FIPS_4205,300000,5000000,-98.5,26.16666667,27.83333333,25.66666667,Meter
-102342,NAD_1983_HARN_StatePlane_Utah_North_FIPS_4301,500000,1000000,-111.5,40.71666667,41.78333333,40.33333333,Meter
-102343,NAD_1983_HARN_StatePlane_Utah_Central_FIPS_4302,500000,2000000,-111.5,39.01666667,40.65,38.33333333,Meter
-102344,NAD_1983_HARN_StatePlane_Utah_South_FIPS_4303,500000,3000000,-111.5,37.21666667,38.35,36.66666667,Meter
-102345,NAD_1983_HARN_StatePlane_Vermont_FIPS_4400,500000,0,-72.5,0.999964286, ,42.5,Meter
-102346,NAD_1983_HARN_StatePlane_Virginia_North_FIPS_4501,3500000,2000000,-78.5,38.03333333,39.2,37.66666667,Meter
-102347,NAD_1983_HARN_StatePlane_Virginia_South_FIPS_4502,3500000,1000000,-78.5,36.76666667,37.96666667,36.33333333,Meter
-102348,NAD_1983_HARN_StatePlane_Washington_North_FIPS_4601,500000,0,-120.8333333,47.5,48.73333333,47,Meter
-102349,NAD_1983_HARN_StatePlane_Washington_South_FIPS_4602,500000,0,-120.5,45.83333333,47.33333333,45.33333333,Meter
-102350,NAD_1983_HARN_StatePlane_West_Virginia_North_FIPS_4701,600000,0,-79.5,39,40.25,38.5,Meter
-102351,NAD_1983_HARN_StatePlane_West_Virginia_South_FIPS_4702,600000,0,-81,37.48333333,38.88333333,37,Meter
-102352,NAD_1983_HARN_StatePlane_Wisconsin_North_FIPS_4801,600000,0,-90,45.56666667,46.76666667,45.16666667,Meter
-102353,NAD_1983_HARN_StatePlane_Wisconsin_Central_FIPS_4802,600000,0,-90,44.25,45.5,43.83333333,Meter
-102354,NAD_1983_HARN_StatePlane_Wisconsin_South_FIPS_4803,600000,0,-90,42.73333333,44.06666667,42,Meter
-102355,NAD_1983_HARN_StatePlane_Wyoming_East_FIPS_4901,200000,0,-105.1666667,0.9999375, ,40.5,Meter
-102356,NAD_1983_HARN_StatePlane_Wyoming_East_Central_FIPS_4902,400000,100000,-107.3333333,0.9999375, ,40.5,Meter
-102357,NAD_1983_HARN_StatePlane_Wyoming_West_Central_FIPS_4903,600000,0,-108.75,0.9999375, ,40.5,Meter
-102358,NAD_1983_HARN_StatePlane_Wyoming_West_FIPS_4904,800000,100000,-110.0833333,0.9999375, ,40.5,Meter
-102361,NAD_1983_HARN_StatePlane_Puerto_Rico_Virgin_Islands_FIPS_5200,200000,200000,-66.43333333,18.03333333,18.43333333,17.83333333,Meter
-102363,NAD_1983_HARN_StatePlane_Kentucky_FIPS_1600,1500000,1000000,-85.75,37.08333333,38.66666667,36.33333333,Meter
-102421,WGS_1984_ARC_System_Zone_01,0,0,0,22.94791772,,,Meter
-102422,WGS_1984_ARC_System_Zone_02,0,0,0,41.12682127,,,Meter
-102423,WGS_1984_ARC_System_Zone_03,0,0,0,52.28859923,,,Meter
-102424,WGS_1984_ARC_System_Zone_04,0,0,0,60.32378942,,,Meter
-102425,WGS_1984_ARC_System_Zone_05,0,0,0,66.09421768,,,Meter
-102426,WGS_1984_ARC_System_Zone_06,0,0,0,70.10896259,,,Meter
-102427,WGS_1984_ARC_System_Zone_07,0,0,0,74.13230145,,,Meter
-102428,WGS_1984_ARC_System_Zone_08,0,0,0,78.1728375,,,Meter
-102429,WGS_1984_ARC_System_Zone_09,0,0,0,,,90,Meter
-102430,WGS_1984_ARC_System_Zone_10,0,0,0,-22.94791772,,,Meter
-102431,WGS_1984_ARC_System_Zone_11,0,0,0,-41.12682127,,,Meter
-102432,WGS_1984_ARC_System_Zone_12,0,0,0,-52.28859923,,,Meter
-102433,WGS_1984_ARC_System_Zone_13,0,0,0,-60.32378942,,,Meter
-102434,WGS_1984_ARC_System_Zone_14,0,0,0,-66.09421768,,,Meter
-102435,WGS_1984_ARC_System_Zone_15,0,0,0,-70.10896259,,,Meter
-102436,WGS_1984_ARC_System_Zone_16,0,0,0,-74.13230145,,,Meter
-102437,WGS_1984_ARC_System_Zone_17,0,0,0,-78.1728375,,,Meter
-102438,WGS_1984_ARC_System_Zone_18,0,0,0,,,-90,Meter
-102440,LKS_1992_Latvia_TM_0,500000,0,24,0.9996, ,0,Meter
-102441,TWD_1967_TM_Taiwan,250000,0,121,0.9999, ,0,Meter
-102442,TWD_1967_TM_Penghu,250000,0,119,0.9999, ,0,Meter
-102443,TWD_1997_TM_Taiwan,250000,0,121,0.9999, ,0,Meter
-102444,TWD_1997_TM_Penghu,250000,0,119,0.9999, ,0,Meter
-102461,NAD_1983_HARN_StatePlane_Hawaii_1_FIPS_5101_Feet,1640416.667,0,-155.5,0.999966667, ,18.83333333,Foot_US
-102462,NAD_1983_HARN_StatePlane_Hawaii_2_FIPS_5102_Feet,1640416.667,0,-156.6666667,0.999966667, ,20.33333333,Foot_US
-102463,NAD_1983_HARN_StatePlane_Hawaii_3_FIPS_5103_Feet,1640416.667,0,-158,0.99999, ,21.16666667,Foot_US
-102464,NAD_1983_HARN_StatePlane_Hawaii_4_FIPS_5104_Feet,1640416.667,0,-159.5,0.99999, ,21.83333333,Foot_US
-102465,NAD_1983_HARN_StatePlane_Hawaii_5_FIPS_5105_Feet,1640416.667,0,-160.1666667,1, ,21.66666667,Foot_US
-102466,NAD_1983_HARN_StatePlane_Minnesota_North_FIPS_2201_Feet,2624666.667,328083.3333,-93.1,47.03333333,48.63333333,46.5,Foot_US
-102467,NAD_1983_HARN_StatePlane_Minnesota_Central_FIPS_2202_Feet,2624666.667,328083.3333,-94.25,45.61666667,47.05,45,Foot_US
-102468,NAD_1983_HARN_StatePlane_Minnesota_South_FIPS_2203_Feet,2624666.667,328083.3333,-94,43.78333333,45.21666667,43,Foot_US
-102491,Nord_Algerie_Ancienne_Degree,500000,300000,2.7,36,0.999625544,36,Meter
-102492,Sud_Algerie_Ancienne_Degree,500000,300000,2.7,33.3,0.999625769,33.3,Meter
-102570,WGS_1984_Complex_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
-102571,WGS_1984_Complex_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
-102572,WGS_1984_Complex_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
-102573,WGS_1984_Complex_UTM_Zone_23N,500000,0,-45,0.9996, ,0,Meter
-102574,WGS_1984_Complex_UTM_Zone_24N,500000,0,-39,0.9996, ,0,Meter
-102575,WGS_1984_Complex_UTM_Zone_25N,500000,0,-33,0.9996, ,0,Meter
-102576,WGS_1984_Complex_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
-102577,WGS_1984_Complex_UTM_Zone_27N,500000,0,-21,0.9996, ,0,Meter
-102578,WGS_1984_Complex_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-102579,WGS_1984_Complex_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
-102580,WGS_1984_Complex_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
-102581,NTF_France_I_degrees,600000,1200000,2.337229167,49.5,0.999877341,49.5,Meter
-102582,NTF_France_II_degrees,600000,2200000,2.337229167,46.8,0.99987742,46.8,Meter
-102583,NTF_France_III_degrees,600000,3200000,2.337229167,44.1,0.999877499,44.1,Meter
-102584,NTF_France_IV_degrees,234.358,185861.369,2.337229167,42.165,0.99994471,42.165,Meter
-102591,Nord_Algerie_Degree,500135,300090,2.7,36,0.999625544,36,Meter
-102592,Sud_Algerie_Degree,500135,300090,2.7,33.3,0.999625769,33.3,Meter
-102601,NAD_1983_Texas_Centric_Mapping_System_Albers,1500000,6000000,-100,27.5,35,18,Meter
-102602,NAD_1983_Texas_Centric_Mapping_System_Lambert,1500000,5000000,-100,27.5,35,18,Meter
-102603,NAD_1983_Texas_Statewide_Mapping_System,1000000,1000000,-100,27.41666667,34.91666667,31.16666667,Meter
-102604,NAD_1983_Georgia_Statewide_Lambert,0,0,-83.5,31.41666667,34.28333333,0,Foot_US
-102605,NAD_1983_Idaho_TM,2500000,1200000,-114,0.9996, ,42,Meter
-102606,NAD_1983_Maine_2000_East_Zone,700000,0,-67.875,0.99998, ,43.83333333,Meter
-102607,NAD_1983_Maine_2000_Central_Zone,500000,0,-69.125,0.99998, ,43.5,Meter
-102608,NAD_1983_Maine_2000_West_Zone,300000,0,-70.375,0.99998, ,42.83333333,Meter
-102609,NAD_1983_Mississippi_TM,500000,1300000,-89.75,0.9998335, ,32.5,Meter
-102629,NAD_1983_StatePlane_Alabama_East_FIPS_0101_Feet,656166.6667,0,-85.83333333,0.99996, ,30.5,Foot_US
-102630,NAD_1983_StatePlane_Alabama_West_FIPS_0102_Feet,1968500,0,-87.5,0.999933333, ,30,Foot_US
-102631,NAD_1983_StatePlane_Alaska_1_FIPS_5001_Feet,16404166.67,-16404166.67,0.9999,-36.86989765,-133.6666667,57,Foot_US
-102632,NAD_1983_StatePlane_Alaska_2_FIPS_5002_Feet,1640416.667,0,-142,0.9999, ,54,Foot_US
-102633,NAD_1983_StatePlane_Alaska_3_FIPS_5003_Feet,1640416.667,0,-146,0.9999, ,54,Foot_US
-102634,NAD_1983_StatePlane_Alaska_4_FIPS_5004_Feet,1640416.667,0,-150,0.9999, ,54,Foot_US
-102635,NAD_1983_StatePlane_Alaska_5_FIPS_5005_Feet,1640416.667,0,-154,0.9999, ,54,Foot_US
-102636,NAD_1983_StatePlane_Alaska_6_FIPS_5006_Feet,1640416.667,0,-158,0.9999, ,54,Foot_US
-102637,NAD_1983_StatePlane_Alaska_7_FIPS_5007_Feet,1640416.667,0,-162,0.9999, ,54,Foot_US
-102638,NAD_1983_StatePlane_Alaska_8_FIPS_5008_Feet,1640416.667,0,-166,0.9999, ,54,Foot_US
-102639,NAD_1983_StatePlane_Alaska_9_FIPS_5009_Feet,1640416.667,0,-170,0.9999, ,54,Foot_US
-102640,NAD_1983_StatePlane_Alaska_10_FIPS_5010_Feet,3280833.333,0,-176,51.83333333,53.83333333,51,Foot_US
-102641,NAD_1983_StatePlane_California_I_FIPS_0401_Feet,6561666.667,1640416.667,-122,40,41.66666667,39.33333333,Foot_US
-102642,NAD_1983_StatePlane_California_II_FIPS_0402_Feet,6561666.667,1640416.667,-122,38.33333333,39.83333333,37.66666667,Foot_US
-102643,NAD_1983_StatePlane_California_III_FIPS_0403_Feet,6561666.667,1640416.667,-120.5,37.06666667,38.43333333,36.5,Foot_US
-102644,NAD_1983_StatePlane_California_IV_FIPS_0404_Feet,6561666.667,1640416.667,-119,36,37.25,35.33333333,Foot_US
-102645,NAD_1983_StatePlane_California_V_FIPS_0405_Feet,6561666.667,1640416.667,-118,34.03333333,35.46666667,33.5,Foot_US
-102646,NAD_1983_StatePlane_California_VI_FIPS_0406_Feet,6561666.667,1640416.667,-116.25,32.78333333,33.88333333,32.16666667,Foot_US
-102648,NAD_1983_StatePlane_Arizona_East_FIPS_0201_Feet,699998.6,0,-110.1666667,0.9999, ,31,Foot_US
-102649,NAD_1983_StatePlane_Arizona_Central_FIPS_0202_Feet,699998.6,0,-111.9166667,0.9999, ,31,Foot_US
-102650,NAD_1983_StatePlane_Arizona_West_FIPS_0203_Feet,699998.6,0,-113.75,0.999933333, ,31,Foot_US
-102651,NAD_1983_StatePlane_Arkansas_North_FIPS_0301_Feet,1312333.333,0,-92,34.93333333,36.23333333,34.33333333,Foot_US
-102652,NAD_1983_StatePlane_Arkansas_South_FIPS_0302_Feet,1312333.333,1312333.333,-92,33.3,34.76666667,32.66666667,Foot_US
-102653,NAD_1983_StatePlane_Colorado_North_FIPS_0501_Feet,3000000,1000000,-105.5,39.71666667,40.78333333,39.33333333,Foot_US
-102654,NAD_1983_StatePlane_Colorado_Central_FIPS_0502_Feet,3000000,1000000,-105.5,38.45,39.75,37.83333333,Foot_US
-102655,NAD_1983_StatePlane_Colorado_South_FIPS_0503_Feet,3000000,1000000,-105.5,37.23333333,38.43333333,36.66666667,Foot_US
-102656,NAD_1983_StatePlane_Connecticut_FIPS_0600_Feet,1000000,500000,-72.75,41.2,41.86666667,40.83333333,Foot_US
-102657,NAD_1983_StatePlane_Delaware_FIPS_0700_Feet,656166.6667,0,-75.41666667,0.999995, ,38,Foot_US
-102658,NAD_1983_StatePlane_Florida_East_FIPS_0901_Feet,656166.6667,0,-81,0.999941176, ,24.33333333,Foot_US
-102659,NAD_1983_StatePlane_Florida_West_FIPS_0902_Feet,656166.6667,0,-82,0.999941176, ,24.33333333,Foot_US
-102660,NAD_1983_StatePlane_Florida_North_FIPS_0903_Feet,1968500,0,-84.5,29.58333333,30.75,29,Foot_US
-102661,NAD_1983_StatePlane_Hawaii_1_FIPS_5101_Feet,1640416.667,0,-155.5,0.999966667, ,18.83333333,Foot_US
-102662,NAD_1983_StatePlane_Hawaii_2_FIPS_5102_Feet,1640416.667,0,-156.6666667,0.999966667, ,20.33333333,Foot_US
-102663,NAD_1983_StatePlane_Hawaii_3_FIPS_5103_Feet,1640416.667,0,-158,0.99999, ,21.16666667,Foot_US
-102664,NAD_1983_StatePlane_Hawaii_4_FIPS_5104_Feet,1640416.667,0,-159.5,0.99999, ,21.83333333,Foot_US
-102665,NAD_1983_StatePlane_Hawaii_5_FIPS_5105_Feet,1640416.667,0,-160.1666667,1, ,21.66666667,Foot_US
-102666,NAD_1983_StatePlane_Georgia_East_FIPS_1001_Feet,656166.6667,0,-82.16666667,0.9999, ,30,Foot_US
-102667,NAD_1983_StatePlane_Georgia_West_FIPS_1002_Feet,2296583.333,0,-84.16666667,0.9999, ,30,Foot_US
-102668,NAD_1983_StatePlane_Idaho_East_FIPS_1101_Feet,656166.6667,0,-112.1666667,0.999947368, ,41.66666667,Foot_US
-102669,NAD_1983_StatePlane_Idaho_Central_FIPS_1102_Feet,1640416.667,0,-114,0.999947368, ,41.66666667,Foot_US
-102670,NAD_1983_StatePlane_Idaho_West_FIPS_1103_Feet,2624666.667,0,-115.75,0.999933333, ,41.66666667,Foot_US
-102671,NAD_1983_StatePlane_Illinois_East_FIPS_1201_Feet,984250,0,-88.33333333,0.999975, ,36.66666667,Foot_US
-102672,NAD_1983_StatePlane_Illinois_West_FIPS_1202_Feet,2296583.333,0,-90.16666667,0.999941176, ,36.66666667,Foot_US
-102673,NAD_1983_StatePlane_Indiana_East_FIPS_1301_Feet,328083.3333,820208.3333,-85.66666667,0.999966667, ,37.5,Foot_US
-102674,NAD_1983_StatePlane_Indiana_West_FIPS_1302_Feet,2952750,820208.3333,-87.08333333,0.999966667, ,37.5,Foot_US
-102675,NAD_1983_StatePlane_Iowa_North_FIPS_1401_Feet,4921250,3280833.333,-93.5,42.06666667,43.26666667,41.5,Foot_US
-102676,NAD_1983_StatePlane_Iowa_South_FIPS_1402_Feet,1640416.667,0,-93.5,40.61666667,41.78333333,40,Foot_US
-102677,NAD_1983_StatePlane_Kansas_North_FIPS_1501_Feet,1312333.333,0,-98,38.71666667,39.78333333,38.33333333,Foot_US
-102678,NAD_1983_StatePlane_Kansas_South_FIPS_1502_Feet,1312333.333,1312333.333,-98.5,37.26666667,38.56666667,36.66666667,Foot_US
-102679,NAD_1983_StatePlane_Kentucky_North_FIPS_1601_Feet,1640416.667,0,-84.25,37.96666667,38.96666667,37.5,Foot_US
-102680,NAD_1983_StatePlane_Kentucky_South_FIPS_1602_Feet,1640416.667,1640416.667,-85.75,36.73333333,37.93333333,36.33333333,Foot_US
-102681,NAD_1983_StatePlane_Louisiana_North_FIPS_1701_Feet,3280833.333,0,-92.5,31.16666667,32.66666667,30.5,Foot_US
-102682,NAD_1983_StatePlane_Louisiana_South_FIPS_1702_Feet,3280833.333,0,-91.33333333,29.3,30.7,28.5,Foot_US
-102683,NAD_1983_StatePlane_Maine_East_FIPS_1801_Feet,984250,0,-68.5,0.9999, ,43.66666667,Foot_US
-102684,NAD_1983_StatePlane_Maine_West_FIPS_1802_Feet,2952750,0,-70.16666667,0.999966667, ,42.83333333,Foot_US
-102685,NAD_1983_StatePlane_Maryland_FIPS_1900_Feet,1312333.333,0,-77,38.3,39.45,37.66666667,Foot_US
-102686,NAD_1983_StatePlane_Massachusetts_Mainland_FIPS_2001_Feet,656166.6667,2460625,-71.5,41.71666667,42.68333333,41,Foot_US
-102687,NAD_1983_StatePlane_Massachusetts_Island_FIPS_2002_Feet,1640416.667,0,-70.5,41.28333333,41.48333333,41,Foot_US
-102688,NAD_1983_StatePlane_Michigan_North_FIPS_2111_Feet,26246666.67,0,-87,45.48333333,47.08333333,44.78333333,Foot_US
-102689,NAD_1983_StatePlane_Michigan_Central_FIPS_2112_Feet,19685000,0,-84.36666667,44.18333333,45.7,43.31666667,Foot_US
-102690,NAD_1983_StatePlane_Michigan_South_FIPS_2113_Feet,13123333.33,0,-84.36666667,42.1,43.66666667,41.5,Foot_US
-102691,NAD_1983_StatePlane_Minnesota_North_FIPS_2201_Feet,2624666.667,328083.3333,-93.1,47.03333333,48.63333333,46.5,Foot_US
-102692,NAD_1983_StatePlane_Minnesota_Central_FIPS_2202_Feet,2624666.667,328083.3333,-94.25,45.61666667,47.05,45,Foot_US
-102693,NAD_1983_StatePlane_Minnesota_South_FIPS_2203_Feet,2624666.667,328083.3333,-94,43.78333333,45.21666667,43,Foot_US
-102694,NAD_1983_StatePlane_Mississippi_East_FIPS_2301_Feet,984250,0,-88.83333333,0.99995, ,29.5,Foot_US
-102695,NAD_1983_StatePlane_Mississippi_West_FIPS_2302_Feet,2296583.333,0,-90.33333333,0.99995, ,29.5,Foot_US
-102696,NAD_1983_StatePlane_Missouri_East_FIPS_2401_Feet,820208.3333,0,-90.5,0.999933333, ,35.83333333,Foot_US
-102697,NAD_1983_StatePlane_Missouri_Central_FIPS_2402_Feet,1640416.667,0,-92.5,0.999933333, ,35.83333333,Foot_US
-102698,NAD_1983_StatePlane_Missouri_West_FIPS_2403_Feet,2788708.333,0,-94.5,0.999941176, ,36.16666667,Foot_US
-102700,NAD_1983_StatePlane_Montana_FIPS_2500_Feet,1968500,0,-109.5,45,49,44.25,Foot_US
-102704,NAD_1983_StatePlane_Nebraska_FIPS_2600_Feet,1640416.667,0,-100,40,43,39.83333333,Foot_US
-102707,NAD_1983_StatePlane_Nevada_East_FIPS_2701_Feet,656166.6667,26246666.67,-115.5833333,0.9999, ,34.75,Foot_US
-102708,NAD_1983_StatePlane_Nevada_Central_FIPS_2702_Feet,1640416.667,19685000,-116.6666667,0.9999, ,34.75,Foot_US
-102709,NAD_1983_StatePlane_Nevada_West_FIPS_2703_Feet,2624666.667,13123333.33,-118.5833333,0.9999, ,34.75,Foot_US
-102710,NAD_1983_StatePlane_New_Hampshire_FIPS_2800_Feet,984250,0,-71.66666667,0.999966667, ,42.5,Foot_US
-102711,NAD_1983_StatePlane_New_Jersey_FIPS_2900_Feet,492125,0,-74.5,0.9999, ,38.83333333,Foot_US
-102712,NAD_1983_StatePlane_New_Mexico_East_FIPS_3001_Feet,541337.5,0,-104.3333333,0.999909091, ,31,Foot_US
-102713,NAD_1983_StatePlane_New_Mexico_Central_FIPS_3002_Feet,1640416.667,0,-106.25,0.9999, ,31,Foot_US
-102714,NAD_1983_StatePlane_New_Mexico_West_FIPS_3003_Feet,2723091.667,0,-107.8333333,0.999916667, ,31,Foot_US
-102715,NAD_1983_StatePlane_New_York_East_FIPS_3101_Feet,492125,0,-74.5,0.9999, ,38.83333333,Foot_US
-102716,NAD_1983_StatePlane_New_York_Central_FIPS_3102_Feet,820208.3333,0,-76.58333333,0.9999375, ,40,Foot_US
-102717,NAD_1983_StatePlane_New_York_West_FIPS_3103_Feet,1148291.667,0,-78.58333333,0.9999375, ,40,Foot_US
-102718,NAD_1983_StatePlane_New_York_Long_Island_FIPS_3104_Feet,984250,0,-74,40.66666667,41.03333333,40.16666667,Foot_US
-102719,NAD_1983_StatePlane_North_Carolina_FIPS_3200_Feet,2000000.003,0,-79,34.33333333,36.16666667,33.75,Foot_US
-102720,NAD_1983_StatePlane_North_Dakota_North_FIPS_3301_Feet,1968500,0,-100.5,47.43333333,48.73333333,47,Foot_US
-102721,NAD_1983_StatePlane_North_Dakota_South_FIPS_3302_Feet,1968500,0,-100.5,46.18333333,47.48333333,45.66666667,Foot_US
-102722,NAD_1983_StatePlane_Ohio_North_FIPS_3401_Feet,1968500,0,-82.5,40.43333333,41.7,39.66666667,Foot_US
-102723,NAD_1983_StatePlane_Ohio_South_FIPS_3402_Feet,1968500,0,-82.5,38.73333333,40.03333333,38,Foot_US
-102724,NAD_1983_StatePlane_Oklahoma_North_FIPS_3501_Feet,1968500,0,-98,35.56666667,36.76666667,35,Foot_US
-102725,NAD_1983_StatePlane_Oklahoma_South_FIPS_3502_Feet,1968500,0,-98,33.93333333,35.23333333,33.33333333,Foot_US
-102726,NAD_1983_StatePlane_Oregon_North_FIPS_3601_Feet,8202083.333,0,-120.5,44.33333333,46,43.66666667,Foot_US
-102727,NAD_1983_StatePlane_Oregon_South_FIPS_3602_Feet,4921250,0,-120.5,42.33333333,44,41.66666667,Foot_US
-102728,NAD_1983_StatePlane_Pennsylvania_North_FIPS_3701_Feet,1968500,0,-77.75,40.88333333,41.95,40.16666667,Foot_US
-102729,NAD_1983_StatePlane_Pennsylvania_South_FIPS_3702_Feet,1968500,0,-77.75,39.93333333,40.96666667,39.33333333,Foot_US
-102730,NAD_1983_StatePlane_Rhode_Island_FIPS_3800_Feet,328083.3333,0,-71.5,0.99999375, ,41.08333333,Foot_US
-102733,NAD_1983_StatePlane_South_Carolina_FIPS_3900_Feet,1999996,0,-81,32.5,34.83333333,31.83333333,Foot_US
-102734,NAD_1983_StatePlane_South_Dakota_North_FIPS_4001_Feet,1968500,0,-100,44.41666667,45.68333333,43.83333333,Foot_US
-102735,NAD_1983_StatePlane_South_Dakota_South_FIPS_4002_Feet,1968500,0,-100.3333333,42.83333333,44.4,42.33333333,Foot_US
-102736,NAD_1983_StatePlane_Tennessee_FIPS_4100_Feet,1968500,0,-86,35.25,36.41666667,34.33333333,Foot_US
-102737,NAD_1983_StatePlane_Texas_North_FIPS_4201_Feet,656166.6667,3280833.333,-101.5,34.65,36.18333333,34,Foot_US
-102738,NAD_1983_StatePlane_Texas_North_Central_FIPS_4202_Feet,1968500,6561666.667,-98.5,32.13333333,33.96666667,31.66666667,Foot_US
-102739,NAD_1983_StatePlane_Texas_Central_FIPS_4203_Feet,2296583.333,9842500,-100.3333333,30.11666667,31.88333333,29.66666667,Foot_US
-102740,NAD_1983_StatePlane_Texas_South_Central_FIPS_4204_Feet,1968500,13123333.33,-99,28.38333333,30.28333333,27.83333333,Foot_US
-102741,NAD_1983_StatePlane_Texas_South_FIPS_4205_Feet,984250,16404166.67,-98.5,26.16666667,27.83333333,25.66666667,Foot_US
-102742,NAD_1983_StatePlane_Utah_North_FIPS_4301_Feet,1640416.667,3280833.333,-111.5,40.71666667,41.78333333,40.33333333,Foot_US
-102743,NAD_1983_StatePlane_Utah_Central_FIPS_4302_Feet,1640416.667,6561666.667,-111.5,39.01666667,40.65,38.33333333,Foot_US
-102744,NAD_1983_StatePlane_Utah_South_FIPS_4303_Feet,1640416.667,9842500,-111.5,37.21666667,38.35,36.66666667,Foot_US
-102745,NAD_1983_StatePlane_Vermont_FIPS_4400_Feet,1640416.667,0,-72.5,0.999964286, ,42.5,Foot_US
-102746,NAD_1983_StatePlane_Virginia_North_FIPS_4501_Feet,11482916.67,6561666.667,-78.5,38.03333333,39.2,37.66666667,Foot_US
-102747,NAD_1983_StatePlane_Virginia_South_FIPS_4502_Feet,11482916.67,3280833.333,-78.5,36.76666667,37.96666667,36.33333333,Foot_US
-102748,NAD_1983_StatePlane_Washington_North_FIPS_4601_Feet,1640416.667,0,-120.8333333,47.5,48.73333333,47,Foot_US
-102749,NAD_1983_StatePlane_Washington_South_FIPS_4602_Feet,1640416.667,0,-120.5,45.83333333,47.33333333,45.33333333,Foot_US
-102750,NAD_1983_StatePlane_West_Virginia_North_FIPS_4701_Feet,1968500,0,-79.5,39,40.25,38.5,Foot_US
-102751,NAD_1983_StatePlane_West_Virginia_South_FIPS_4702_Feet,1968500,0,-81,37.48333333,38.88333333,37,Foot_US
-102752,NAD_1983_StatePlane_Wisconsin_North_FIPS_4801_Feet,1968500,0,-90,45.56666667,46.76666667,45.16666667,Foot_US
-102753,NAD_1983_StatePlane_Wisconsin_Central_FIPS_4802_Feet,1968500,0,-90,44.25,45.5,43.83333333,Foot_US
-102754,NAD_1983_StatePlane_Wisconsin_South_FIPS_4803_Feet,1968500,0,-90,42.73333333,44.06666667,42,Foot_US
-102755,NAD_1983_StatePlane_Wyoming_East_FIPS_4901_Feet,656166.6667,0,-105.1666667,0.9999375, ,40.5,Foot_US
-102756,NAD_1983_StatePlane_Wyoming_East_Central_FIPS_4902_Feet,1312333.333,328083.3333,-107.3333333,0.9999375, ,40.5,Foot_US
-102757,NAD_1983_StatePlane_Wyoming_West_Central_FIPS_4903_Feet,1968500,0,-108.75,0.9999375, ,40.5,Foot_US
-102758,NAD_1983_StatePlane_Wyoming_West_FIPS_4904_Feet,2624666.667,328083.3333,-110.0833333,0.9999375, ,40.5,Foot_US
-102761,NAD_1983_StatePlane_Puerto_Rico_Virgin_Islands_FIPS_5200_Feet,656166.6667,656166.6667,-66.43333333,18.03333333,18.43333333,17.83333333,Foot_US
-102763,NAD_1983_StatePlane_Kentucky_FIPS_1600_Feet,4921250,3280833.333,-85.75,37.08333333,38.66666667,36.33333333,Foot_US
-102766,NAD_1983_StatePlane_Guam_FIPS_5400_Feet,164041.6667,164041.6667,144.7487507,,,13.47246635,Foot_US
-103528,ETRF_1989_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
-103529,ETRF_1989_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
-103530,ETRF_1989_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
-103531,ETRF_1989_UTM_Zone_31N,500000,0,3,0.9996, ,0,Meter
-103532,ETRF_1989_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
-103533,ETRF_1989_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
-103534,ETRF_1989_UTM_Zone_34N,500000,0,21,0.9996, ,0,Meter
-103535,ETRF_1989_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
-103536,ETRF_1989_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
-103537,ETRF_1989_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
-103538,ETRF_1989_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
-103584,ETRF_1989_TM_Baltic_1993,500000,0,24,0.9996, ,0,Meter
-103600,NAD_1983_HARN_Adj_MN_Aitkin_Meters,152409.3197,30481.86394,-93.41666667,1.000059153, ,46.15416667,Meter
-103601,NAD_1983_HARN_Adj_MN_Clay_Meters,152407.2113,30481.44225,-96.7,1.000045318, ,46.63,Meter
-103602,NAD_1983_HARN_Adj_MN_Clearwater_Meters,152411.3547,30482.27094,-95.36666667,1.000072506, ,47.15166667,Meter
-103603,NAD_1983_HARN_Adj_MN_Hubbard_Meters,152411.2096,30482.24192,-94.91666667,1.000071554, ,46.80361111,Meter
-103604,NAD_1983_HARN_Adj_MN_Lake_Meters,152411.8635,30482.37271,-91.4,1.000075845, ,47.06666667,Meter
-103605,NAD_1983_HARN_Adj_MN_Mille_Lacs_Meters,152408.5567,30481.71134,-93.61666667,1.000054146, ,45.55888889,Meter
-103606,NAD_1983_HARN_Adj_MN_Washington_Meters,152406.3759,30481.27519,-92.83333333,1.000039837, ,44.74583333,Meter
-103607,NAD_1983_HARN_Adj_MN_Wilkin_Meters,152407.7573,30481.55147,-96.51666667,1.000048901, ,46.02166667,Meter
-103608,NAD_1983_HARN_Adj_MN_Anoka_Meters,152400.3048,30480.06096,-93.26666667,45.06666667,45.36666667,45.03527778,Meter
-103609,NAD_1983_HARN_Adj_MN_Becker_Meters,152400.3048,30480.06096,-95.68333333,46.78333333,47.08333333,46.71777778,Meter
-103610,NAD_1983_HARN_Adj_MN_Beltrami_North_Meters,152400.3048,30480.06096,-95.01666667,48.11666667,48.46666667,48.02,Meter
-103611,NAD_1983_HARN_Adj_MN_Beltrami_South_Meters,152400.3048,30480.06096,-94.85,47.5,47.91666667,47.4125,Meter
-103612,NAD_1983_HARN_Adj_MN_Benton_Meters,152400.3048,30480.06096,-94.05,45.58333333,45.78333333,45.55916667,Meter
-103613,NAD_1983_HARN_Adj_MN_Big_Stone_Meters,152400.3048,30480.06096,-96.05,45.21666667,45.53333333,45.15222222,Meter
-103614,NAD_1983_HARN_Adj_MN_Blue_Earth_Meters,152400.3048,30480.06096,-94.26666667,43.93333333,44.36666667,43.84805556,Meter
-103615,NAD_1983_HARN_Adj_MN_Brown_Meters,152400.3048,30480.06096,-94.73333333,44.16666667,44.46666667,44.10805556,Meter
-103616,NAD_1983_HARN_Adj_MN_Carlton_Meters,152400.3048,30480.06096,-92.68333333,46.46666667,46.73333333,46.41722222,Meter
-103617,NAD_1983_HARN_Adj_MN_Carver_Meters,152400.3048,30480.06096,-93.76666667,44.68333333,44.9,44.63972222,Meter
-103618,NAD_1983_HARN_Adj_MN_Cass_North_Meters,152400.3048,30480.06096,-94.21666667,46.91666667,47.31666667,46.80361111,Meter
-103619,NAD_1983_HARN_Adj_MN_Cass_South_Meters,152400.3048,30480.06096,-94.46666667,46.26666667,46.73333333,46.15638889,Meter
-103620,NAD_1983_HARN_Adj_MN_Chippewa_Meters,152400.3048,30480.06096,-95.85,44.83333333,45.2,44.75277778,Meter
-103621,NAD_1983_HARN_Adj_MN_Chisago_Meters,152400.3048,30480.06096,-93.08333333,45.33333333,45.66666667,45.29638889,Meter
-103622,NAD_1983_HARN_Adj_MN_Cook_North_Meters,152400.3048,30480.06096,-90.25,47.93333333,48.16666667,47.88333333,Meter
-103623,NAD_1983_HARN_Adj_MN_Cook_South_Meters,152400.3048,30480.06096,-90.25,47.55,47.81666667,47.43888889,Meter
-103624,NAD_1983_HARN_Adj_MN_Cottonwood_Meters,152400.3048,30480.06096,-94.91666667,43.9,44.16666667,43.84805556,Meter
-103625,NAD_1983_HARN_Adj_MN_Crow_Wing_Meters,152400.3048,30480.06096,-94.46666667,46.26666667,46.73333333,46.15638889,Meter
-103626,NAD_1983_HARN_Adj_MN_Dakota_Meters,152400.3048,30480.06096,-93.31666667,44.51666667,44.91666667,44.47194444,Meter
-103627,NAD_1983_HARN_Adj_MN_Dodge_Meters,152400.3048,30480.06096,-92.91666667,43.88333333,44.13333333,43.83388889,Meter
-103628,NAD_1983_HARN_Adj_MN_Douglas_Meters,152400.3048,30480.06096,-96.05,45.8,46.05,45.75888889,Meter
-103629,NAD_1983_HARN_Adj_MN_Faribault_Meters,152400.3048,30480.06096,-93.95,43.56666667,43.8,43.5,Meter
-103630,NAD_1983_HARN_Adj_MN_Fillmore_Meters,152400.3048,30480.06096,-92.08333333,43.55,43.8,43.5,Meter
-103631,NAD_1983_HARN_Adj_MN_Freeborn_Meters,152400.3048,30480.06096,-93.95,43.56666667,43.8,43.5,Meter
-103632,NAD_1983_HARN_Adj_MN_Goodhue_Meters,152400.3048,30480.06096,-93.13333333,44.3,44.66666667,44.19472222,Meter
-103633,NAD_1983_HARN_Adj_MN_Grant_Meters,152400.3048,30480.06096,-96.05,45.8,46.05,45.75888889,Meter
-103634,NAD_1983_HARN_Adj_MN_Hennepin_Meters,152400.3048,30480.06096,-93.38333333,44.88333333,45.13333333,44.79111111,Meter
-103635,NAD_1983_HARN_Adj_MN_Houston_Meters,152400.3048,30480.06096,-91.46666667,43.56666667,43.8,43.5,Meter
-103636,NAD_1983_HARN_Adj_MN_Isanti_Meters,152400.3048,30480.06096,-93.08333333,45.33333333,45.66666667,45.29638889,Meter
-103637,NAD_1983_HARN_Adj_MN_Itasca_North_Meters,152400.3048,30480.06096,-93.73333333,47.56666667,47.81666667,47.5,Meter
-103638,NAD_1983_HARN_Adj_MN_Itasca_South_Meters,152400.3048,30480.06096,-93.73333333,47.08333333,47.41666667,47.02638889,Meter
-103639,NAD_1983_HARN_Adj_MN_Jackson_Meters,152400.3048,30480.06096,-93.95,43.56666667,43.8,43.5,Meter
-103640,NAD_1983_HARN_Adj_MN_Kanabec_Meters,152400.3048,30480.06096,-92.9,45.81666667,46.33333333,45.73,Meter
-103641,NAD_1983_HARN_Adj_MN_Kandiyohi_Meters,152400.3048,30480.06096,-94.75,44.96666667,45.33333333,44.89138889,Meter
-103642,NAD_1983_HARN_Adj_MN_Kittson_Meters,152400.3048,30480.06096,-96.15,48.6,48.93333333,48.54388889,Meter
-103643,NAD_1983_HARN_Adj_MN_Koochiching_Meters,152400.3048,30480.06096,-93.75,48,48.61666667,47.84583333,Meter
-103644,NAD_1983_HARN_Adj_MN_Lac_Qui_Parle_Meters,152400.3048,30480.06096,-95.85,44.83333333,45.2,44.75277778,Meter
-103647,NAD_1983_HARN_Adj_MN_Le_Sueur_Meters,152400.3048,30480.06096,-93.13333333,44.3,44.66666667,44.19472222,Meter
-103648,NAD_1983_HARN_Adj_MN_Lincoln_Meters,152400.3048,30480.06096,-96.26666667,44.28333333,44.61666667,44.19666667,Meter
-103649,NAD_1983_HARN_Adj_MN_Lyon_Meters,152400.3048,30480.06096,-95.85,44.25,44.58333333,44.19555556,Meter
-103650,NAD_1983_HARN_Adj_MN_McLeod_Meters,152400.3048,30480.06096,-94.63333333,44.53333333,44.91666667,44.45611111,Meter
-103651,NAD_1983_HARN_Adj_MN_Mahnomen_Meters,152400.3048,30480.06096,-95.81666667,47.2,47.45,47.15166667,Meter
-103652,NAD_1983_HARN_Adj_MN_Marshall_Meters,152400.3048,30480.06096,-96.38333333,48.23333333,48.48333333,48.17305556,Meter
-103653,NAD_1983_HARN_Adj_MN_Martin_Meters,152400.3048,30480.06096,-93.95,43.56666667,43.8,43.5,Meter
-103654,NAD_1983_HARN_Adj_MN_Meeker_Meters,152400.3048,30480.06096,-94.75,44.96666667,45.33333333,44.89138889,Meter
-103655,NAD_1983_HARN_Adj_MN_Morrison_Meters,152400.3048,30480.06096,-94.2,45.85,46.26666667,45.77388889,Meter
-103656,NAD_1983_HARN_Adj_MN_Mower_Meters,152400.3048,30480.06096,-93.95,43.56666667,43.8,43.5,Meter
-103657,NAD_1983_HARN_Adj_MN_Murray_Meters,152400.3048,30480.06096,-95.76666667,43.91666667,44.16666667,43.84805556,Meter
-103658,NAD_1983_HARN_Adj_MN_Nicollet_Meters,152400.3048,30480.06096,-94.26666667,43.93333333,44.36666667,43.84805556,Meter
-103659,NAD_1983_HARN_Adj_MN_Nobles_Meters,152400.3048,30480.06096,-95.95,43.56666667,43.8,43.5,Meter
-103660,NAD_1983_HARN_Adj_MN_Norman_Meters,152400.3048,30480.06096,-96.45,47.2,47.45,47.15055556,Meter
-103661,NAD_1983_HARN_Adj_MN_Olmsted_Meters,152400.3048,30480.06096,-92.91666667,43.88333333,44.13333333,43.83388889,Meter
-103662,NAD_1983_HARN_Adj_MN_Ottertail_Meters,152400.3048,30480.06096,-95.71666667,46.18333333,46.65,46.10638889,Meter
-103663,NAD_1983_HARN_Adj_MN_Pennington_Meters,152400.3048,30480.06096,-96.36666667,47.6,48.08333333,47.49888889,Meter
-103664,NAD_1983_HARN_Adj_MN_Pine_Meters,152400.3048,30480.06096,-92.9,45.81666667,46.33333333,45.73,Meter
-103665,NAD_1983_HARN_Adj_MN_Pipestone_Meters,152400.3048,30480.06096,-96.25,43.88333333,44.15,43.84916667,Meter
-103666,NAD_1983_HARN_Adj_MN_Polk_Meters,152400.3048,30480.06096,-96.36666667,47.6,48.08333333,47.49888889,Meter
-103667,NAD_1983_HARN_Adj_MN_Pope_Meters,152400.3048,30480.06096,-95.15,45.35,45.7,45.28277778,Meter
-103668,NAD_1983_HARN_Adj_MN_Ramsey_Meters,152400.3048,30480.06096,-93.38333333,44.88333333,45.13333333,44.79111111,Meter
-103669,NAD_1983_HARN_Adj_MN_Red_Lake_Meters,152400.3048,30480.06096,-96.36666667,47.6,48.08333333,47.49888889,Meter
-103670,NAD_1983_HARN_Adj_MN_Redwood_Meters,152400.3048,30480.06096,-95.23333333,44.26666667,44.56666667,44.19472222,Meter
-103671,NAD_1983_HARN_Adj_MN_Renville_Meters,152400.3048,30480.06096,-94.63333333,44.53333333,44.91666667,44.45611111,Meter
-103672,NAD_1983_HARN_Adj_MN_Rice_Meters,152400.3048,30480.06096,-93.13333333,44.3,44.66666667,44.19472222,Meter
-103673,NAD_1983_HARN_Adj_MN_Rock_Meters,152400.3048,30480.06096,-95.95,43.56666667,43.8,43.5,Meter
-103674,NAD_1983_HARN_Adj_MN_Roseau_Meters,152400.3048,30480.06096,-96.15,48.6,48.93333333,48.54388889,Meter
-103675,NAD_1983_HARN_Adj_MN_St_Louis_North_Meters,152400.3048,30480.06096,-92.45,47.98333333,48.53333333,47.83333333,Meter
-103676,NAD_1983_HARN_Adj_MN_St_Louis_Central_Meters,152400.3048,30480.06096,-92.45,47.33333333,47.75,47.25,Meter
-103677,NAD_1983_HARN_Adj_MN_St_Louis_South_Meters,152400.3048,30480.06096,-92.45,46.78333333,47.13333333,46.65,Meter
-103678,NAD_1983_HARN_Adj_MN_Scott_Meters,152400.3048,30480.06096,-93.31666667,44.51666667,44.91666667,44.47194444,Meter
-103679,NAD_1983_HARN_Adj_MN_Sherburne_Meters,152400.3048,30480.06096,-93.88333333,45.03333333,45.46666667,44.9775,Meter
-103680,NAD_1983_HARN_Adj_MN_Sibley_Meters,152400.3048,30480.06096,-94.63333333,44.53333333,44.91666667,44.45611111,Meter
-103681,NAD_1983_HARN_Adj_MN_Stearns_Meters,152400.3048,30480.06096,-95.15,45.35,45.7,45.28277778,Meter
-103682,NAD_1983_HARN_Adj_MN_Steele_Meters,152400.3048,30480.06096,-92.91666667,43.88333333,44.13333333,43.83388889,Meter
-103683,NAD_1983_HARN_Adj_MN_Stevens_Meters,152400.3048,30480.06096,-95.15,45.35,45.7,45.28277778,Meter
-103684,NAD_1983_HARN_Adj_MN_Swift_Meters,152400.3048,30480.06096,-96.05,45.21666667,45.53333333,45.15222222,Meter
-103685,NAD_1983_HARN_Adj_MN_Todd_Meters,152400.3048,30480.06096,-94.9,45.86666667,46.28333333,45.77333333,Meter
-103686,NAD_1983_HARN_Adj_MN_Traverse_Meters,152400.3048,30480.06096,-96.55,45.63333333,45.96666667,45.58555556,Meter
-103687,NAD_1983_HARN_Adj_MN_Wabasha_Meters,152400.3048,30480.06096,-92.26666667,44.15,44.41666667,44.10694444,Meter
-103688,NAD_1983_HARN_Adj_MN_Wadena_Meters,152400.3048,30480.06096,-94.46666667,46.26666667,46.73333333,46.15638889,Meter
-103689,NAD_1983_HARN_Adj_MN_Waseca_Meters,152400.3048,30480.06096,-92.91666667,43.88333333,44.13333333,43.83388889,Meter
-103690,NAD_1983_HARN_Adj_MN_Watonwan_Meters,152400.3048,30480.06096,-94.91666667,43.9,44.16666667,43.84805556,Meter
-103691,NAD_1983_HARN_Adj_MN_Winona_Meters,152400.3048,30480.06096,-91.61666667,43.9,44.13333333,43.84722222,Meter
-103692,NAD_1983_HARN_Adj_MN_Wright_Meters,152400.3048,30480.06096,-93.88333333,45.03333333,45.46666667,44.9775,Meter
-103693,NAD_1983_HARN_Adj_MN_Yellow_Medicine_Meters,152400.3048,30480.06096,-95.9,44.66666667,44.95,44.54166667,Meter
-103700,NAD_1983_HARN_Adj_MN_Aitkin_Feet,500029.5763,100005.9153,-93.41666667,1.000059153, ,46.15416667,Foot_US
-103701,NAD_1983_HARN_Adj_MN_Clay_Feet,500022.6589,100004.5318,-96.7,1.000045318, ,46.63,Foot_US
-103702,NAD_1983_HARN_Adj_MN_Clearwater_Feet,500036.2528,100007.2506,-95.36666667,1.000072506, ,47.15166667,Foot_US
-103703,NAD_1983_HARN_Adj_MN_Hubbard_Feet,500035.7768,100007.1554,-94.91666667,1.000071554, ,46.80361111,Foot_US
-103704,NAD_1983_HARN_Adj_MN_Lake_Feet,500037.9223,100007.5845,-91.4,1.000075845, ,47.06666667,Foot_US
-103705,NAD_1983_HARN_Adj_MN_Mille_Lacs_Feet,500027.0731,100005.4146,-93.61666667,1.000054146, ,45.55888889,Foot_US
-103706,NAD_1983_HARN_Adj_MN_Washington_Feet,500019.9184,100003.9837,-92.83333333,1.000039837, ,44.74583333,Foot_US
-103707,NAD_1983_HARN_Adj_MN_Wilkin_Feet,500024.4505,100004.8901,-96.51666667,1.000048901, ,46.02166667,Foot_US
-103708,NAD_1983_HARN_Adj_MN_Anoka_Feet,500000,100000,-93.26666667,45.06666667,45.36666667,45.03527778,Foot_US
-103709,NAD_1983_HARN_Adj_MN_Becker_Feet,500000,100000,-95.68333333,46.78333333,47.08333333,46.71777778,Foot_US
-103710,NAD_1983_HARN_Adj_MN_Beltrami_North_Feet,500000,100000,-95.01666667,48.11666667,48.46666667,48.02,Foot_US
-103711,NAD_1983_HARN_Adj_MN_Beltrami_South_Feet,500000,100000,-94.85,47.5,47.91666667,47.4125,Foot_US
-103712,NAD_1983_HARN_Adj_MN_Benton_Feet,500000,100000,-94.05,45.58333333,45.78333333,45.55916667,Foot_US
-103713,NAD_1983_HARN_Adj_MN_Big_Stone_Feet,500000,100000,-96.05,45.21666667,45.53333333,45.15222222,Foot_US
-103714,NAD_1983_HARN_Adj_MN_Blue_Earth_Feet,500000,100000,-94.26666667,43.93333333,44.36666667,43.84805556,Foot_US
-103715,NAD_1983_HARN_Adj_MN_Brown_Feet,500000,100000,-94.73333333,44.16666667,44.46666667,44.10805556,Foot_US
-103716,NAD_1983_HARN_Adj_MN_Carlton_Feet,500000,100000,-92.68333333,46.46666667,46.73333333,46.41722222,Foot_US
-103717,NAD_1983_HARN_Adj_MN_Carver_Feet,500000,100000,-93.76666667,44.68333333,44.9,44.63972222,Foot_US
-103718,NAD_1983_HARN_Adj_MN_Cass_North_Feet,500000,100000,-94.21666667,46.91666667,47.31666667,46.80361111,Foot_US
-103719,NAD_1983_HARN_Adj_MN_Cass_South_Feet,500000,100000,-94.46666667,46.26666667,46.73333333,46.15638889,Foot_US
-103720,NAD_1983_HARN_Adj_MN_Chippewa_Feet,500000,100000,-95.85,44.83333333,45.2,44.75277778,Foot_US
-103721,NAD_1983_HARN_Adj_MN_Chisago_Feet,500000,100000,-93.08333333,45.33333333,45.66666667,45.29638889,Foot_US
-103722,NAD_1983_HARN_Adj_MN_Cook_North_Feet,500000,100000,-90.25,47.93333333,48.16666667,47.88333333,Foot_US
-103723,NAD_1983_HARN_Adj_MN_Cook_South_Feet,500000,100000,-90.25,47.55,47.81666667,47.43888889,Foot_US
-103724,NAD_1983_HARN_Adj_MN_Cottonwood_Feet,500000,100000,-94.91666667,43.9,44.16666667,43.84805556,Foot_US
-103725,NAD_1983_HARN_Adj_MN_Crow_Wing_Feet,500000,100000,-94.46666667,46.26666667,46.73333333,46.15638889,Foot_US
-103726,NAD_1983_HARN_Adj_MN_Dakota_Feet,500000,100000,-93.31666667,44.51666667,44.91666667,44.47194444,Foot_US
-103727,NAD_1983_HARN_Adj_MN_Dodge_Feet,500000,100000,-92.91666667,43.88333333,44.13333333,43.83388889,Foot_US
-103728,NAD_1983_HARN_Adj_MN_Douglas_Feet,500000,100000,-96.05,45.8,46.05,45.75888889,Foot_US
-103729,NAD_1983_HARN_Adj_MN_Faribault_Feet,500000,100000,-93.95,43.56666667,43.8,43.5,Foot_US
-103730,NAD_1983_HARN_Adj_MN_Fillmore_Feet,500000,100000,-92.08333333,43.55,43.8,43.5,Foot_US
-103731,NAD_1983_HARN_Adj_MN_Freeborn_Feet,500000,100000,-93.95,43.56666667,43.8,43.5,Foot_US
-103732,NAD_1983_HARN_Adj_MN_Goodhue_Feet,500000,100000,-93.13333333,44.3,44.66666667,44.19472222,Foot_US
-103733,NAD_1983_HARN_Adj_MN_Grant_Feet,500000,100000,-96.05,45.8,46.05,45.75888889,Foot_US
-103734,NAD_1983_HARN_Adj_MN_Hennepin_Feet,500000,100000,-93.38333333,44.88333333,45.13333333,44.79111111,Foot_US
-103735,NAD_1983_HARN_Adj_MN_Houston_Feet,500000,100000,-91.46666667,43.56666667,43.8,43.5,Foot_US
-103736,NAD_1983_HARN_Adj_MN_Isanti_Feet,500000,100000,-93.08333333,45.33333333,45.66666667,45.29638889,Foot_US
-103737,NAD_1983_HARN_Adj_MN_Itasca_North_Feet,500000,100000,-93.73333333,47.56666667,47.81666667,47.5,Foot_US
-103738,NAD_1983_HARN_Adj_MN_Itasca_South_Feet,500000,100000,-93.73333333,47.08333333,47.41666667,47.02638889,Foot_US
-103739,NAD_1983_HARN_Adj_MN_Jackson_Feet,500000,100000,-93.95,43.56666667,43.8,43.5,Foot_US
-103740,NAD_1983_HARN_Adj_MN_Kanabec_Feet,500000,100000,-92.9,45.81666667,46.33333333,45.73,Foot_US
-103741,NAD_1983_HARN_Adj_MN_Kandiyohi_Feet,500000,100000,-94.75,44.96666667,45.33333333,44.89138889,Foot_US
-103742,NAD_1983_HARN_Adj_MN_Kittson_Feet,500000,100000,-96.15,48.6,48.93333333,48.54388889,Foot_US
-103743,NAD_1983_HARN_Adj_MN_Koochiching_Feet,500000,100000,-93.75,48,48.61666667,47.84583333,Foot_US
-103744,NAD_1983_HARN_Adj_MN_Lac_Qui_Parle_Feet,500000,100000,-95.85,44.83333333,45.2,44.75277778,Foot_US
-103747,NAD_1983_HARN_Adj_MN_Le_Sueur_Feet,500000,100000,-93.13333333,44.3,44.66666667,44.19472222,Foot_US
-103748,NAD_1983_HARN_Adj_MN_Lincoln_Feet,500000,100000,-96.26666667,44.28333333,44.61666667,44.19666667,Foot_US
-103749,NAD_1983_HARN_Adj_MN_Lyon_Feet,500000,100000,-95.85,44.25,44.58333333,44.19555556,Foot_US
-103750,NAD_1983_HARN_Adj_MN_McLeod_Feet,500000,100000,-94.63333333,44.53333333,44.91666667,44.45611111,Foot_US
-103751,NAD_1983_HARN_Adj_MN_Mahnomen_Feet,500000,100000,-95.81666667,47.2,47.45,47.15166667,Foot_US
-103752,NAD_1983_HARN_Adj_MN_Marshall_Feet,500000,100000,-96.38333333,48.23333333,48.48333333,48.17305556,Foot_US
-103753,NAD_1983_HARN_Adj_MN_Martin_Feet,500000,100000,-93.95,43.56666667,43.8,43.5,Foot_US
-103754,NAD_1983_HARN_Adj_MN_Meeker_Feet,500000,100000,-94.75,44.96666667,45.33333333,44.89138889,Foot_US
-103755,NAD_1983_HARN_Adj_MN_Morrison_Feet,500000,100000,-94.2,45.85,46.26666667,45.77388889,Foot_US
-103756,NAD_1983_HARN_Adj_MN_Mower_Feet,500000,100000,-93.95,43.56666667,43.8,43.5,Foot_US
-103757,NAD_1983_HARN_Adj_MN_Murray_Feet,500000,100000,-95.76666667,43.91666667,44.16666667,43.84805556,Foot_US
-103758,NAD_1983_HARN_Adj_MN_Nicollet_Feet,500000,100000,-94.26666667,43.93333333,44.36666667,43.84805556,Foot_US
-103759,NAD_1983_HARN_Adj_MN_Nobles_Feet,500000,100000,-95.95,43.56666667,43.8,43.5,Foot_US
-103760,NAD_1983_HARN_Adj_MN_Norman_Feet,500000,100000,-96.45,47.2,47.45,47.15055556,Foot_US
-103761,NAD_1983_HARN_Adj_MN_Olmsted_Feet,500000,100000,-92.91666667,43.88333333,44.13333333,43.83388889,Foot_US
-103762,NAD_1983_HARN_Adj_MN_Ottertail_Feet,500000,100000,-95.71666667,46.18333333,46.65,46.10638889,Foot_US
-103763,NAD_1983_HARN_Adj_MN_Pennington_Feet,500000,100000,-96.36666667,47.6,48.08333333,47.49888889,Foot_US
-103764,NAD_1983_HARN_Adj_MN_Pine_Feet,500000,100000,-92.9,45.81666667,46.33333333,45.73,Foot_US
-103765,NAD_1983_HARN_Adj_MN_Pipestone_Feet,500000,100000,-96.25,43.88333333,44.15,43.84916667,Foot_US
-103766,NAD_1983_HARN_Adj_MN_Polk_Feet,500000,100000,-96.36666667,47.6,48.08333333,47.49888889,Foot_US
-103767,NAD_1983_HARN_Adj_MN_Pope_Feet,500000,100000,-95.15,45.35,45.7,45.28277778,Foot_US
-103768,NAD_1983_HARN_Adj_MN_Ramsey_Feet,500000,100000,-93.38333333,44.88333333,45.13333333,44.79111111,Foot_US
-103769,NAD_1983_HARN_Adj_MN_Red_Lake_Feet,500000,100000,-96.36666667,47.6,48.08333333,47.49888889,Foot_US
-103770,NAD_1983_HARN_Adj_MN_Redwood_Feet,500000,100000,-95.23333333,44.26666667,44.56666667,44.19472222,Foot_US
-103771,NAD_1983_HARN_Adj_MN_Renville_Feet,500000,100000,-94.63333333,44.53333333,44.91666667,44.45611111,Foot_US
-103772,NAD_1983_HARN_Adj_MN_Rice_Feet,500000,100000,-93.13333333,44.3,44.66666667,44.19472222,Foot_US
-103773,NAD_1983_HARN_Adj_MN_Rock_Feet,500000,100000,-95.95,43.56666667,43.8,43.5,Foot_US
-103774,NAD_1983_HARN_Adj_MN_Roseau_Feet,500000,100000,-96.15,48.6,48.93333333,48.54388889,Foot_US
-103775,NAD_1983_HARN_Adj_MN_St_Louis_North_Feet,500000,100000,-92.45,47.98333333,48.53333333,47.83333333,Foot_US
-103776,NAD_1983_HARN_Adj_MN_St_Louis_Central_Feet,500000,100000,-92.45,47.33333333,47.75,47.25,Foot_US
-103777,NAD_1983_HARN_Adj_MN_St_Louis_South_Feet,500000,100000,-92.45,46.78333333,47.13333333,46.65,Foot_US
-103778,NAD_1983_HARN_Adj_MN_Scott_Feet,500000,100000,-93.31666667,44.51666667,44.91666667,44.47194444,Foot_US
-103779,NAD_1983_HARN_Adj_MN_Sherburne_Feet,500000,100000,-93.88333333,45.03333333,45.46666667,44.9775,Foot_US
-103780,NAD_1983_HARN_Adj_MN_Sibley_Feet,500000,100000,-94.63333333,44.53333333,44.91666667,44.45611111,Foot_US
-103781,NAD_1983_HARN_Adj_MN_Stearns_Feet,500000,100000,-95.15,45.35,45.7,45.28277778,Foot_US
-103782,NAD_1983_HARN_Adj_MN_Steele_Feet,500000,100000,-92.91666667,43.88333333,44.13333333,43.83388889,Foot_US
-103783,NAD_1983_HARN_Adj_MN_Stevens_Feet,500000,100000,-95.15,45.35,45.7,45.28277778,Foot_US
-103784,NAD_1983_HARN_Adj_MN_Swift_Feet,500000,100000,-96.05,45.21666667,45.53333333,45.15222222,Foot_US
-103785,NAD_1983_HARN_Adj_MN_Todd_Feet,500000,100000,-94.9,45.86666667,46.28333333,45.77333333,Foot_US
-103786,NAD_1983_HARN_Adj_MN_Traverse_Feet,500000,100000,-96.55,45.63333333,45.96666667,45.58555556,Foot_US
-103787,NAD_1983_HARN_Adj_MN_Wabasha_Feet,500000,100000,-92.26666667,44.15,44.41666667,44.10694444,Foot_US
-103788,NAD_1983_HARN_Adj_MN_Wadena_Feet,500000,100000,-94.46666667,46.26666667,46.73333333,46.15638889,Foot_US
-103789,NAD_1983_HARN_Adj_MN_Waseca_Feet,500000,100000,-92.91666667,43.88333333,44.13333333,43.83388889,Foot_US
-103790,NAD_1983_HARN_Adj_MN_Watonwan_Feet,500000,100000,-94.91666667,43.9,44.16666667,43.84805556,Foot_US
-103791,NAD_1983_HARN_Adj_MN_Winona_Feet,500000,100000,-91.61666667,43.9,44.13333333,43.84722222,Foot_US
-103792,NAD_1983_HARN_Adj_MN_Wright_Feet,500000,100000,-93.88333333,45.03333333,45.46666667,44.9775,Foot_US
-103793,NAD_1983_HARN_Adj_MN_Yellow_Medicine_Feet,500000,100000,-95.9,44.66666667,44.95,44.54166667,Foot_US
-103800,NAD_1983_HARN_Adj_WI_Adams_Meters,147218.6944,0,-90,0.999999, ,43.36666667,Meter
-103801,NAD_1983_HARN_Adj_WI_Ashland_Meters,172821.9456,0,-90.62222222,0.999997, ,45.70611111,Meter
-103802,NAD_1983_HARN_Adj_WI_Barron_Meters,93150,0,-91.85,0.999996, ,45.13333333,Meter
-103803,NAD_1983_HARN_Adj_WI_Brown_Meters,31599.99999,4599.98984,-88,1.00002, ,43,Meter
-103804,NAD_1983_HARN_Adj_WI_Buffalo_Meters,175260.3505,0,-91.79722222,1, ,43.48138889,Meter
-103805,NAD_1983_HARN_Adj_WI_Calumet_Meters,244754.8895,0,-88.5,0.999996, ,42.71944444,Meter
-103806,NAD_1983_HARN_Adj_WI_Clark_Meters,199949.1999,0,-90.70833333,0.999994, ,43.6,Meter
-103807,NAD_1983_HARN_Adj_WI_Dodge_Meters,263347.7267,0,-88.775,0.999997, ,41.47222222,Meter
-103808,NAD_1983_HARN_Adj_WI_Door_Meters,158801.1176,0,-87.27222222,0.999991, ,44.4,Meter
-103809,NAD_1983_HARN_Adj_WI_Douglas_Meters,59131.31826,0,-91.91666667,0.999995, ,45.88333333,Meter
-103810,NAD_1983_HARN_Adj_WI_Dunn_Meters,51816.10363,0,-91.89444444,0.999998, ,44.40833333,Meter
-103811,NAD_1983_HARN_Adj_WI_Florence_Meters,133502.667,0,-88.14166667,0.999993, ,45.43888889,Meter
-103812,NAD_1983_HARN_Adj_WI_Fond_du_Lac_Meters,244754.8895,0,-88.5,0.999996, ,42.71944444,Meter
-103813,NAD_1983_HARN_Adj_WI_Forest_Meters,275844.5517,0,-88.63333333,0.999996, ,44.00555556,Meter
-103814,NAD_1983_HARN_Adj_WI_Grant_Meters,242316.4846,0,-90.8,0.999997, ,41.41111111,Meter
-103815,NAD_1983_HARN_Adj_WI_Iowa_Meters,113081.0262,0,-90.16111111,0.999997, ,42.53888889,Meter
-103816,NAD_1983_HARN_Adj_WI_Iron_Meters,220980.442,0,-90.25555556,0.999996, ,45.43333333,Meter
-103817,NAD_1983_HARN_Adj_WI_Jefferson_Meters,263347.7267,0,-88.775,0.999997, ,41.47222222,Meter
-103818,NAD_1983_HARN_Adj_WI_Juneau_Meters,147218.6944,0,-90,0.999999, ,43.36666667,Meter
-103819,NAD_1983_HARN_Adj_WI_Kenosha_Meters,185928.3719,0,-87.89444444,0.999998, ,42.21666667,Meter
-103820,NAD_1983_HARN_Adj_WI_Kewaunee_Meters,79857.75972,0,-87.55,1, ,43.26666667,Meter
-103821,NAD_1983_HARN_Adj_WI_LaCrosse_Meters,130454.6609,0,-91.31666667,0.999994, ,43.45111111,Meter
-103822,NAD_1983_HARN_Adj_WI_Lincoln_Meters,116129.0323,0,-89.73333333,0.999998, ,44.84444444,Meter
-103823,NAD_1983_HARN_Adj_WI_Manitowoc_Meters,79857.75972,0,-87.55,1, ,43.26666667,Meter
-103824,NAD_1983_HARN_Adj_WI_Marinette_Meters,238658.8773,0,-87.71111111,0.999986, ,44.69166667,Meter
-103825,NAD_1983_HARN_Adj_WI_Menominee_Meters,105461.0109,0,-88.41666667,0.999994, ,44.71666667,Meter
-103826,NAD_1983_HARN_Adj_WI_Milwaukee_Meters,185928.3719,0,-87.89444444,0.999998, ,42.21666667,Meter
-103827,NAD_1983_HARN_Adj_WI_Oconto_Meters,182880.3658,0,-87.90833333,0.999991, ,44.39722222,Meter
-103828,NAD_1983_HARN_Adj_WI_Outagamie_Meters,244754.8895,0,-88.5,0.999996, ,42.71944444,Meter
-103829,NAD_1983_HARN_Adj_WI_Ozaukee_Meters,185928.3719,0,-87.89444444,0.999998, ,42.21666667,Meter
-103830,NAD_1983_HARN_Adj_WI_Polk_Meters,141732.2835,0,-92.63333333,1, ,44.66111111,Meter
-103831,NAD_1983_HARN_Adj_WI_Price_Meters,227990.856,0,-90.48888889,0.999998, ,44.55555556,Meter
-103832,NAD_1983_HARN_Adj_WI_Racine_Meters,185928.3719,0,-87.89444444,0.999998, ,42.21666667,Meter
-103833,NAD_1983_HARN_Adj_WI_Rock_Meters,146304.2926,0,-89.07222222,0.999996, ,41.94444444,Meter
-103834,NAD_1983_HARN_Adj_WI_Rusk_Meters,250546.1011,0,-91.06666667,0.999997, ,43.91944444,Meter
-103835,NAD_1983_HARN_Adj_WI_St_Croix_Meters,165506.731,0,-92.63333333,0.999995, ,44.03611111,Meter
-103836,NAD_1983_HARN_Adj_WI_Sauk_Meters,185623.5712,0,-89.9,0.999995, ,42.81944444,Meter
-103837,NAD_1983_HARN_Adj_WI_Shawano_Meters,262433.3249,0,-88.60555556,0.99999, ,44.03611111,Meter
-103838,NAD_1983_HARN_Adj_WI_Sheboygan_Meters,79857.75972,0,-87.55,1, ,43.26666667,Meter
-103839,NAD_1983_HARN_Adj_WI_Trempealeau_Meters,256946.9139,0,-91.36666667,0.999998, ,43.16111111,Meter
-103840,NAD_1983_HARN_Adj_WI_Washington_Meters,120091.4402,0,-88.06388889,0.999995, ,42.91805556,Meter
-103841,NAD_1983_HARN_Adj_WI_Waukesha_Meters,208788.4176,0,-88.225,0.999997, ,42.56944444,Meter
-103842,NAD_1983_HARN_Adj_WI_Waupaca_Meters,185013.97,0,-88.81666667,0.999996, ,43.42027778,Meter
-103843,NAD_1983_HARN_Adj_WI_Winnebago_Meters,244754.8895,0,-88.5,0.999996, ,42.71944444,Meter
-103844,NAD_1983_HARN_Adj_WI_Bayfield_Meters,228600.4572,0,-91.15277778,46.41388889,46.925,45.33333333,Meter
-103845,NAD_1983_HARN_Adj_WI_Burnett_Meters,64008.12802,0,-92.45777778,45.71388889,46.08333333,45.36388889,Meter
-103846,NAD_1983_HARN_Adj_WI_Chippewa_Meters,60045.72009,0,-91.29444444,44.81388889,45.14166667,44.58111111,Meter
-103847,NAD_1983_HARN_Adj_WI_Columbia_Meters,169164.3383,0,-89.39444444,43.33333333,43.59166667,42.45833333,Meter
-103848,NAD_1983_HARN_Adj_WI_Crawford_Meters,113690.6274,0,-90.93888889,43.05833333,43.34166667,42.71666667,Meter
-103849,NAD_1983_HARN_Adj_WI_Dane_Meters,247193.2944,0,-89.42222222,42.90833333,43.23055556,41.75,Meter
-103850,NAD_1983_HARN_Adj_WI_EauClaire_Meters,120091.4402,0,-91.28888889,44.73055556,45.01388889,44.04722222,Meter
-103851,NAD_1983_HARN_Adj_WI_Green_Meters,170078.7402,0,-89.83888889,42.48611111,42.78888889,42.225,Meter
-103852,NAD_1983_HARN_Adj_WI_GreenLake_Meters,150876.3018,0,-89.24166667,43.66666667,43.94722222,43.09444444,Meter
-103853,NAD_1983_HARN_Adj_WI_Jackson_Meters,125882.6518,0,-90.73888889,44.16388889,44.41944444,43.79444444,Meter
-103854,NAD_1983_HARN_Adj_WI_Lafayette_Meters,170078.7402,0,-89.83888889,42.48611111,42.78888889,42.225,Meter
-103855,NAD_1983_HARN_Adj_WI_Langlade_Meters,198425.1969,0,-89.03333333,45,45.30833333,44.20694444,Meter
-103856,NAD_1983_HARN_Adj_WI_Marathon_Meters,74676.14935,0,-89.77,44.74527778,45.05638889,44.40555556,Meter
-103857,NAD_1983_HARN_Adj_WI_Marquette_Meters,150876.3018,0,-89.24166667,43.66666667,43.94722222,43.09444444,Meter
-103858,NAD_1983_HARN_Adj_WI_Monroe_Meters,204521.209,0,-90.64166667,43.83888889,44.16111111,42.90277778,Meter
-103859,NAD_1983_HARN_Adj_WI_Oneida_Meters,70104.14021,0,-89.54444444,45.56666667,45.84166667,45.18611111,Meter
-103860,NAD_1983_HARN_Adj_WI_Pepin_Meters,167640.3353,0,-92.22777778,44.52222222,44.75,43.86194444,Meter
-103861,NAD_1983_HARN_Adj_WI_Pierce_Meters,167640.3353,0,-92.22777778,44.52222222,44.75,43.86194444,Meter
-103862,NAD_1983_HARN_Adj_WI_Portage_Meters,56388.11278,0,-89.5,44.18333333,44.65,43.96666667,Meter
-103863,NAD_1983_HARN_Adj_WI_Richland_Meters,202387.6048,0,-90.43055556,43.14166667,43.50277778,42.11388889,Meter
-103864,NAD_1983_HARN_Adj_WI_Sawyer_Meters,216713.2334,0,-91.11666667,45.71944444,46.08055556,44.81388889,Meter
-103865,NAD_1983_HARN_Adj_WI_Taylor_Meters,187147.5743,0,-90.48333333,45.05555556,45.3,44.20833333,Meter
-103866,NAD_1983_HARN_Adj_WI_Vernon_Meters,222504.445,0,-90.78333333,43.46666667,43.68333333,43.14722222,Meter
-103867,NAD_1983_HARN_Adj_WI_Vilas_Meters,134417.0688,0,-89.48888889,45.93055556,46.225,45.625,Meter
-103868,NAD_1983_HARN_Adj_WI_Walworth_Meters,232562.8651,0,-88.54166667,42.58888889,42.75,41.66944444,Meter
-103869,NAD_1983_HARN_Adj_WI_Washburn_Meters,234086.8682,0,-91.78333333,45.77222222,46.15,44.26666667,Meter
-103870,NAD_1983_HARN_Adj_WI_Waushara_Meters,120091.4402,0,-89.24166667,43.975,44.25277778,43.70833333,Meter
-103871,NAD_1983_HARN_Adj_WI_Wood_Meters,208483.617,0,-90,44.18055556,44.54444444,43.15138889,Meter
-103900,NAD_1983_HARN_Adj_WI_Adams_Feet,483000,0,-90,0.999999, ,43.36666667,Foot_US
-103901,NAD_1983_HARN_Adj_WI_Ashland_Feet,567000,0,-90.62222222,0.999997, ,45.70611111,Foot_US
-103902,NAD_1983_HARN_Adj_WI_Barron_Feet,305609.625,0,-91.85,0.999996, ,45.13333333,Foot_US
-103903,NAD_1983_HARN_Adj_WI_Brown_Feet,103674.3333,15091.8,-88,1.00002, ,43,Foot_US
-103904,NAD_1983_HARN_Adj_WI_Buffalo_Feet,575000,0,-91.79722222,1, ,43.48138889,Foot_US
-103905,NAD_1983_HARN_Adj_WI_Calumet_Feet,803000,0,-88.5,0.999996, ,42.71944444,Foot_US
-103906,NAD_1983_HARN_Adj_WI_Clark_Feet,656000,0,-90.70833333,0.999994, ,43.6,Foot_US
-103907,NAD_1983_HARN_Adj_WI_Dodge_Feet,864000,0,-88.775,0.999997, ,41.47222222,Foot_US
-103908,NAD_1983_HARN_Adj_WI_Door_Feet,521000,0,-87.27222222,0.999991, ,44.4,Foot_US
-103909,NAD_1983_HARN_Adj_WI_Douglas_Feet,194000,0,-91.91666667,0.999995, ,45.88333333,Foot_US
-103910,NAD_1983_HARN_Adj_WI_Dunn_Feet,170000,0,-91.89444444,0.999998, ,44.40833333,Foot_US
-103911,NAD_1983_HARN_Adj_WI_Florence_Feet,438000,0,-88.14166667,0.999993, ,45.43888889,Foot_US
-103912,NAD_1983_HARN_Adj_WI_Fond_du_Lac_Feet,803000,0,-88.5,0.999996, ,42.71944444,Foot_US
-103913,NAD_1983_HARN_Adj_WI_Forest_Feet,905000,0,-88.63333333,0.999996, ,44.00555556,Foot_US
-103914,NAD_1983_HARN_Adj_WI_Grant_Feet,795000,0,-90.8,0.999997, ,41.41111111,Foot_US
-103915,NAD_1983_HARN_Adj_WI_Iowa_Feet,371000,0,-90.16111111,0.999997, ,42.53888889,Foot_US
-103916,NAD_1983_HARN_Adj_WI_Iron_Feet,725000,0,-90.25555556,0.999996, ,45.43333333,Foot_US
-103917,NAD_1983_HARN_Adj_WI_Jefferson_Feet,864000,0,-88.775,0.999997, ,41.47222222,Foot_US
-103918,NAD_1983_HARN_Adj_WI_Juneau_Feet,483000,0,-90,0.999999, ,43.36666667,Foot_US
-103919,NAD_1983_HARN_Adj_WI_Kenosha_Feet,610000,0,-87.89444444,0.999998, ,42.21666667,Foot_US
-103920,NAD_1983_HARN_Adj_WI_Kewaunee_Feet,262000,0,-87.55,1, ,43.26666667,Foot_US
-103921,NAD_1983_HARN_Adj_WI_LaCrosse_Feet,428000,0,-91.31666667,0.999994, ,43.45111111,Foot_US
-103922,NAD_1983_HARN_Adj_WI_Lincoln_Feet,381000,0,-89.73333333,0.999998, ,44.84444444,Foot_US
-103923,NAD_1983_HARN_Adj_WI_Manitowoc_Feet,262000,0,-87.55,1, ,43.26666667,Foot_US
-103924,NAD_1983_HARN_Adj_WI_Marinette_Feet,783000,0,-87.71111111,0.999986, ,44.69166667,Foot_US
-103925,NAD_1983_HARN_Adj_WI_Menominee_Feet,346000,0,-88.41666667,0.999994, ,44.71666667,Foot_US
-103926,NAD_1983_HARN_Adj_WI_Milwaukee_Feet,610000,0,-87.89444444,0.999998, ,42.21666667,Foot_US
-103927,NAD_1983_HARN_Adj_WI_Oconto_Feet,600000,0,-87.90833333,0.999991, ,44.39722222,Foot_US
-103928,NAD_1983_HARN_Adj_WI_Outagamie_Feet,803000,0,-88.5,0.999996, ,42.71944444,Foot_US
-103929,NAD_1983_HARN_Adj_WI_Ozaukee_Feet,610000,0,-87.89444444,0.999998, ,42.21666667,Foot_US
-103930,NAD_1983_HARN_Adj_WI_Polk_Feet,465000,0,-92.63333333,1, ,44.66111111,Foot_US
-103931,NAD_1983_HARN_Adj_WI_Price_Feet,748000,0,-90.48888889,0.999998, ,44.55555556,Foot_US
-103932,NAD_1983_HARN_Adj_WI_Racine_Feet,610000,0,-87.89444444,0.999998, ,42.21666667,Foot_US
-103933,NAD_1983_HARN_Adj_WI_Rock_Feet,480000,0,-89.07222222,0.999996, ,41.94444444,Foot_US
-103934,NAD_1983_HARN_Adj_WI_Rusk_Feet,822000,0,-91.06666667,0.999997, ,43.91944444,Foot_US
-103935,NAD_1983_HARN_Adj_WI_St_Croix_Feet,543000,0,-92.63333333,0.999995, ,44.03611111,Foot_US
-103936,NAD_1983_HARN_Adj_WI_Sauk_Feet,609000,0,-89.9,0.999995, ,42.81944444,Foot_US
-103937,NAD_1983_HARN_Adj_WI_Shawano_Feet,861000,0,-88.60555556,0.99999, ,44.03611111,Foot_US
-103938,NAD_1983_HARN_Adj_WI_Sheboygan_Feet,262000,0,-87.55,1, ,43.26666667,Foot_US
-103939,NAD_1983_HARN_Adj_WI_Trempealeau_Feet,843000,0,-91.36666667,0.999998, ,43.16111111,Foot_US
-103940,NAD_1983_HARN_Adj_WI_Washington_Feet,394000,0,-88.06388889,0.999995, ,42.91805556,Foot_US
-103941,NAD_1983_HARN_Adj_WI_Waukesha_Feet,685000,0,-88.225,0.999997, ,42.56944444,Foot_US
-103942,NAD_1983_HARN_Adj_WI_Waupaca_Feet,607000,0,-88.81666667,0.999996, ,43.42027778,Foot_US
-103943,NAD_1983_HARN_Adj_WI_Winnebago_Feet,803000,0,-88.5,0.999996, ,42.71944444,Foot_US
-103944,NAD_1983_HARN_Adj_WI_Bayfield_Feet,750000,0,-91.15277778,46.41388889,46.925,45.33333333,Foot_US
-103945,NAD_1983_HARN_Adj_WI_Burnett_Feet,210000,0,-92.45777778,45.71388889,46.08333333,45.36388889,Foot_US
-103946,NAD_1983_HARN_Adj_WI_Chippewa_Feet,197000,0,-91.29444444,44.81388889,45.14166667,44.58111111,Foot_US
-103947,NAD_1983_HARN_Adj_WI_Columbia_Feet,555000,0,-89.39444444,43.33333333,43.59166667,42.45833333,Foot_US
-103948,NAD_1983_HARN_Adj_WI_Crawford_Feet,373000,0,-90.93888889,43.05833333,43.34166667,42.71666667,Foot_US
-103949,NAD_1983_HARN_Adj_WI_Dane_Feet,811000,0,-89.42222222,42.90833333,43.23055556,41.75,Foot_US
-103950,NAD_1983_HARN_Adj_WI_EauClaire_Feet,394000,0,-91.28888889,44.73055556,45.01388889,44.04722222,Foot_US
-103951,NAD_1983_HARN_Adj_WI_Green_Feet,558000,0,-89.83888889,42.48611111,42.78888889,42.225,Foot_US
-103952,NAD_1983_HARN_Adj_WI_GreenLake_Feet,495000,0,-89.24166667,43.66666667,43.94722222,43.09444444,Foot_US
-103953,NAD_1983_HARN_Adj_WI_Jackson_Feet,413000,0,-90.73888889,44.16388889,44.41944444,43.79444444,Foot_US
-103954,NAD_1983_HARN_Adj_WI_Lafayette_Feet,558000,0,-89.83888889,42.48611111,42.78888889,42.225,Foot_US
-103955,NAD_1983_HARN_Adj_WI_Langlade_Feet,651000,0,-89.03333333,45,45.30833333,44.20694444,Foot_US
-103956,NAD_1983_HARN_Adj_WI_Marathon_Feet,245000,0,-89.77,44.74527778,45.05638889,44.40555556,Foot_US
-103957,NAD_1983_HARN_Adj_WI_Marquette_Feet,495000,0,-89.24166667,43.66666667,43.94722222,43.09444444,Foot_US
-103958,NAD_1983_HARN_Adj_WI_Monroe_Feet,671000,0,-90.64166667,43.83888889,44.16111111,42.90277778,Foot_US
-103959,NAD_1983_HARN_Adj_WI_Oneida_Feet,230000,0,-89.54444444,45.56666667,45.84166667,45.18611111,Foot_US
-103960,NAD_1983_HARN_Adj_WI_Pepin_Feet,550000,0,-92.22777778,44.52222222,44.75,43.86194444,Foot_US
-103961,NAD_1983_HARN_Adj_WI_Pierce_Feet,550000,0,-92.22777778,44.52222222,44.75,43.86194444,Foot_US
-103962,NAD_1983_HARN_Adj_WI_Portage_Feet,185000,0,-89.5,44.18333333,44.65,43.96666667,Foot_US
-103963,NAD_1983_HARN_Adj_WI_Richland_Feet,664000,0,-90.43055556,43.14166667,43.50277778,42.11388889,Foot_US
-103964,NAD_1983_HARN_Adj_WI_Sawyer_Feet,711000,0,-91.11666667,45.71944444,46.08055556,44.81388889,Foot_US
-103965,NAD_1983_HARN_Adj_WI_Taylor_Feet,614000,0,-90.48333333,45.05555556,45.3,44.20833333,Foot_US
-103966,NAD_1983_HARN_Adj_WI_Vernon_Feet,730000,0,-90.78333333,43.46666667,43.68333333,43.14722222,Foot_US
-103967,NAD_1983_HARN_Adj_WI_Vilas_Feet,441000,0,-89.48888889,45.93055556,46.225,45.625,Foot_US
-103968,NAD_1983_HARN_Adj_WI_Walworth_Feet,763000,0,-88.54166667,42.58888889,42.75,41.66944444,Foot_US
-103969,NAD_1983_HARN_Adj_WI_Washburn_Feet,768000,0,-91.78333333,45.77222222,46.15,44.26666667,Foot_US
-103970,NAD_1983_HARN_Adj_WI_Waushara_Feet,394000,0,-89.24166667,43.975,44.25277778,43.70833333,Foot_US
-103971,NAD_1983_HARN_Adj_WI_Wood_Feet,684000,0,-90,44.18055556,44.54444444,43.15138889,Foot_US
+WKT_PCS
+COORD_REF_SYS_CODE,COORD_REF_SYS_NAME,FALSE_EASTING,FALSE_NORTHING,PARAMETER_VALUE_1,PARAMETER_VALUE_2,PARAMETER_VALUE_3,PARAMETER_VALUE_4,UNIT
+2000,Anguilla_1957_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
+2001,Antigua_1943_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
+2002,Dominica_1945_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
+2003,Grenada_1953_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
+2004,Montserrat_1958_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
+2005,St_Kitts_1955_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
+2006,St_Lucia_1955_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
+2007,St_Vincent_1945_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
+2008,NAD_1927_CGQ77_MTM_2_SCoPQ,304800,0,-55.5,0.9999, ,0,Meter
+2009,NAD_1927_CGQ77_MTM_3_SCoPQ,304800,0,-58.5,0.9999, ,0,Meter
+2010,NAD_1927_CGQ77_MTM_4_SCoPQ,304800,0,-61.5,0.9999, ,0,Meter
+2011,NAD_1927_CGQ77_MTM_5_SCoPQ,304800,0,-64.5,0.9999, ,0,Meter
+2012,NAD_1927_CGQ77_MTM_6_SCoPQ,304800,0,-67.5,0.9999, ,0,Meter
+2013,NAD_1927_CGQ77_MTM_7_SCoPQ,304800,0,-70.5,0.9999, ,0,Meter
+2014,NAD_1927_CGQ77_MTM_8_SCoPQ,304800,0,-73.5,0.9999, ,0,Meter
+2015,NAD_1927_CGQ77_MTM_9_SCoPQ,304800,0,-76.5,0.9999, ,0,Meter
+2016,NAD_1927_CGQ77_MTM_10_SCoPQ,304800,0,-79.5,0.9999, ,0,Meter
+2017,NAD_1927_DEF_1976_MTM_8,304800,0,-73.5,0.9999, ,0,Meter
+2018,NAD_1927_DEF_1976_MTM_9,304800,0,-76.5,0.9999, ,0,Meter
+2019,NAD_1927_DEF_1976_MTM_10,304800,0,-79.5,0.9999, ,0,Meter
+2020,NAD_1927_DEF_1976_MTM_11,304800,0,-82.5,0.9999, ,0,Meter
+2021,NAD_1927_DEF_1976_MTM_12,304800,0,-81,0.9999, ,0,Meter
+2022,NAD_1927_DEF_1976_MTM_13,304800,0,-84,0.9999, ,0,Meter
+2023,NAD_1927_DEF_1976_MTM_14,304800,0,-87,0.9999, ,0,Meter
+2024,NAD_1927_DEF_1976_MTM_15,304800,0,-90,0.9999, ,0,Meter
+2025,NAD_1927_DEF_1976_MTM_16,304800,0,-93,0.9999, ,0,Meter
+2026,NAD_1927_DEF_1976_MTM_17,304800,0,-96,0.9999, ,0,Meter
+2027,NAD_1927_DEF_1976_UTM_Zone_15N,500000,0,-93,0.9996, ,0,Meter
+2028,NAD_1927_DEF_1976_UTM_Zone_16N,500000,0,-87,0.9996, ,0,Meter
+2029,NAD_1927_DEF_1976_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
+2030,NAD_1927_DEF_1976_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+2031,NAD_1927_CGQ77_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
+2032,NAD_1927_CGQ77_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+2033,NAD_1927_CGQ77_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
+2034,NAD_1927_CGQ77_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+2035,NAD_1927_CGQ77_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+2036,NAD_1983_CSRS98_New_Brunswick_Stereographic,2500000,7500000,-66.5,0.999912, ,46.5,Meter
+2037,NAD_1983_CSRS98_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
+2038,NAD_1983_CSRS98_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+2039,Israel_TM_Grid,219529.584,626907.39,35.20451694,1.0000067, ,31.73439361,Meter
+2040,Locodjo_1965_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
+2041,Abidjan_1987_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
+2042,Locodjo_1965_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
+2043,Abidjan_1987_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
+2044,Hanoi_1972_GK_Zone_18,18500000,0,105,1, ,0,Meter
+2045,Hanoi_1972_GK_Zone_19,19500000,0,111,1, ,0,Meter
+2056,CH1903+_LV95,2600000,1200000,1,90,7.439583333,46.95240556,Meter
+2057,Rassadiran_Nakhl_e_Taqi,658377.437,3044969.194,0.999895934,0.571661194,52.60353917,27.56882881,Meter
+2058,ED_1950_ED77_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
+2059,ED_1950_ED77_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
+2060,ED_1950_ED77_UTM_Zone_40N,500000,0,57,0.9996, ,0,Meter
+2061,ED_1950_ED77_UTM_Zone_41N,500000,0,63,0.9996, ,0,Meter
+2062,Madrid_1870_Madrid_Spain,600000,600000,0,40,0.998808529,40,Meter
+2063,Dabola_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+2064,Dabola_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
+2066,Mount_Dillon_Tobago_Grid,187500,180000,-60.68600889,1, ,11.25217861,Link_Clarke
+2067,Naparima_1955_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+2068,ELD_1979_Libya_5,200000,0,9,0.9999, ,0,Meter
+2069,ELD_1979_Libya_6,200000,0,11,0.9999, ,0,Meter
+2070,ELD_1979_Libya_7,200000,0,13,0.9999, ,0,Meter
+2071,ELD_1979_Libya_8,200000,0,15,0.9999, ,0,Meter
+2072,ELD_1979_Libya_9,200000,0,17,0.9999, ,0,Meter
+2073,ELD_1979_Libya_10,200000,0,19,0.9999, ,0,Meter
+2074,ELD_1979_Libya_11,200000,0,21,0.9999, ,0,Meter
+2075,ELD_1979_Libya_12,200000,0,23,0.9999, ,0,Meter
+2076,ELD_1979_Libya_13,200000,0,25,0.9999, ,0,Meter
+2077,ELD_1979_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
+2078,ELD_1979_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
+2079,ELD_1979_UTM_Zone_34N,500000,0,21,0.9996, ,0,Meter
+2080,ELD_1979_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
+2081,Chos_Malal_1914_Argentina_2,2500000,0,-69,1, ,-90,Meter
+2082,Pampa_del_Castillo_Argentina_2,2500000,0,-69,1, ,-90,Meter
+2083,Hito_XVIII_1963_Argentina_2,2500000,0,-69,1, ,-90,Meter
+2084,Hito_XVIII_1963_UTM_19S,500000,10000000,-69,0.9996, ,0,Meter
+2085,NAD_1927_Cuba_Norte,500000,280296.016,-81,22.35,0.99993602,22.35,Meter
+2086,NAD_1927_Cuba_Sur,500000,229126.939,-76.83333333,20.71666667,0.99994848,20.71666667,Meter
+2087,ELD_1979_TM_12_NE,500000,0,12,0.9996, ,0,Meter
+2088,Carthage_TM_11_NE,500000,0,11,0.9996, ,0,Meter
+2089,Yemen_NGN_1996_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
+2090,Yemen_NGN_1996_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
+2091,South_Yemen_GK_Zone_8,8500000,0,45,1, ,0,Meter
+2092,South_Yemen_GK_Zone_9,9500000,0,51,1, ,0,Meter
+2093,Hanoi_1972_GK_106_NE,500000,0,106,1, ,0,Meter
+2094,WGS_1972_BE_TM_106_NE,500000,0,106,0.9996, ,0,Meter
+2095,Bissau_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+2096,Korean_1985_Korea_East_Belt,200000,500000,129,1, ,38,Meter
+2097,Korean_1985_Korea_Central_Belt,200000,500000,127,1, ,38,Meter
+2098,Korean_1985_Korea_West_Belt,200000,500000,125,1, ,38,Meter
+2099,Qatar_1948_Qatar_Grid,100000,100000,50.76138889,1, ,25.38236111,Meter
+2100,Greek_Grid,500000,0,24,0.9996, ,0,Meter
+2101,Lake_Maracaibo_Grid_M1,0,-52684.972,-71.60561778,10.16666667,1,10.16666667,Meter
+2102,Lake_Maracaibo_Grid,200000,147315.028,-71.60561778,10.16666667,1,10.16666667,Meter
+2103,Lake_Maracaibo_Grid_M3,500000,447315.028,-71.60561778,10.16666667,1,10.16666667,Meter
+2104,Lake_Maracaibo_La_Rosa_Grid,-17044,-23139.97,-71.60561778,10.16666667,1,10.16666667,Meter
+2105,NZGD_2000_Mount_Eden_Circuit,400000,800000,174.7641667,0.9999, ,-36.87972222,Meter
+2106,NZGD_2000_Bay_of_Plenty_Circuit,400000,800000,176.4661111,1, ,-37.76111111,Meter
+2107,NZGD_2000_Poverty_Bay_Circuit,400000,800000,177.8855556,1, ,-38.62444444,Meter
+2108,NZGD_2000_Hawkes_Bay_Circuit,400000,800000,176.6736111,1, ,-39.65083333,Meter
+2109,NZGD_2000_Taranaki_Circuit,400000,800000,174.2277778,1, ,-39.13555556,Meter
+2110,NZGD_2000_Tuhirangi_Circuit,400000,800000,175.64,1, ,-39.51222222,Meter
+2111,NZGD_2000_Wanganui_Circuit,400000,800000,175.4880556,1, ,-40.24194444,Meter
+2112,NZGD_2000_Wairarapa_Circuit,400000,800000,175.6472222,1, ,-40.92527778,Meter
+2113,NZGD_2000_Wellington_Circuit,400000,800000,174.7763889,1, ,-41.30111111,Meter
+2114,NZGD_2000_Collingwood_Circuit,400000,800000,172.6719444,1, ,-40.71472222,Meter
+2115,NZGD_2000_Nelson_Circuit,400000,800000,173.2991667,1, ,-41.27444444,Meter
+2116,NZGD_2000_Karamea_Circuit,400000,800000,172.1088889,1, ,-41.28972222,Meter
+2117,NZGD_2000_Buller_Circuit,400000,800000,171.5811111,1, ,-41.81055556,Meter
+2118,NZGD_2000_Grey_Circuit,400000,800000,171.5497222,1, ,-42.33361111,Meter
+2119,NZGD_2000_Amuri_Circuit,400000,800000,173.01,1, ,-42.68888889,Meter
+2120,NZGD_2000_Marlborough_Circuit,400000,800000,173.8019444,1, ,-41.54444444,Meter
+2121,NZGD_2000_Hokitika_Circuit,400000,800000,170.9797222,1, ,-42.88611111,Meter
+2122,NZGD_2000_Okarito_Circuit,400000,800000,170.2608333,1, ,-43.11,Meter
+2123,NZGD_2000_Jacksons_Bay_Circuit,400000,800000,168.6061111,1, ,-43.97777778,Meter
+2124,NZGD_2000_Mount_Pleasant_Circuit,400000,800000,172.7269444,1, ,-43.59055556,Meter
+2125,NZGD_2000_Gawler_Circuit,400000,800000,171.3605556,1, ,-43.74861111,Meter
+2126,NZGD_2000_Timaru_Circuit,400000,800000,171.0572222,1, ,-44.40194444,Meter
+2127,NZGD_2000_Lindis_Peak_Circuit,400000,800000,169.4675,1, ,-44.735,Meter
+2128,NZGD_2000_Mount_Nicholas_Circuit,400000,800000,168.3986111,1, ,-45.13277778,Meter
+2129,NZGD_2000_Mount_York_Circuit,400000,800000,167.7386111,1, ,-45.56361111,Meter
+2130,NZGD_2000_Observation_Point_Circuit,400000,800000,170.6283333,1, ,-45.81611111,Meter
+2131,NZGD_2000_North_Taieri_Circuit,400000,800000,170.2825,0.99996, ,-45.86138889,Meter
+2132,NZGD_2000_Bluff_Circuit,400000,800000,168.3427778,1, ,-46.6,Meter
+2133,NZGD_2000_UTM_Zone_58S,500000,10000000,165,0.9996, ,0,Meter
+2134,NZGD_2000_UTM_Zone_59S,500000,10000000,171,0.9996, ,0,Meter
+2135,NZGD_2000_UTM_Zone_60S,500000,10000000,177,0.9996, ,0,Meter
+2136,Accra_Ghana_Grid,900000,0,-1,0.99975, ,4.666666667,Foot_Gold_Coast
+2137,Accra_TM_1_NW,500000,0,-1,0.9996, ,0,Meter
+2138,NAD_1927_CGQ77_Quebec_Lambert,0,0,-68.5,46,60,44,Meter
+2139,NAD_1983_CSRS98_MTM_2_SCoPQ,304800,0,-55.5,0.9999, ,0,Meter
+2140,NAD_1983_CRS98_MTM_3,304800,0,-58.5,0.9999, ,0,Meter
+2141,NAD_1983_CRS98_MTM_4,304800,0,-61.5,0.9999, ,0,Meter
+2142,NAD_1983_CRS98_MTM_5,304800,0,-64.5,0.9999, ,0,Meter
+2143,NAD_1983_CRS98_MTM_6,304800,0,-67.5,0.9999, ,0,Meter
+2144,NAD_1983_CRS98_MTM_7,304800,0,-70.5,0.9999, ,0,Meter
+2145,NAD_1983_CRS98_MTM_8,304800,0,-73.5,0.9999, ,0,Meter
+2146,NAD_1983_CRS98_MTM_9,304800,0,-76.5,0.9999, ,0,Meter
+2147,NAD_1983_CRS98_MTM_10,304800,0,-79.5,0.9999, ,0,Meter
+2148,NAD_1983_CSRS98_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+2149,NAD_1983_CSRS98_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+2150,NAD_1983_CSRS98_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
+2151,NAD_1983_CSRS98_UTM_Zone_13N,500000,0,-105,0.9996, ,0,Meter
+2152,NAD_1983_CSRS98_UTM_Zone_12N,500000,0,-111,0.9996, ,0,Meter
+2153,NAD_1983_CSRS98_UTM_Zone_11N,500000,0,-117,0.9996, ,0,Meter
+2154,RGF_1993_Lambert_93,700000,6600000,3,44,49,46.5,Meter
+2155,Samoa_1962_Samoa_Lambert,500000,312234.65,-170,-14.26666667,1,-14.26666667,Foot_US
+2157,IRENET95_Irish_Transverse_Mercator,600000,750000,-8,0.99982, ,53.5,Meter
+2158,IRENET95_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
+2159,Sierra_Leone_1924_New_Colony_Grid,500000,0,-12,1, ,6.666666667,Foot_Gold_Coast
+2160,Sierra_Leone_1924_New_War_Office_Grid,800000,600000,-12,1, ,6.666666667,Foot_Gold_Coast
+2161,Sierra_Leone_1968_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+2162,Sierra_Leone_1968_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
+2163,US_National_Atlas_Equal_Area,0,0,-100,,,45,Meter
+2164,Locodjo_1965_TM_5_NW,500000,0,-5,0.9996, ,0,Meter
+2165,Abidjan_1987_TM_5_NW,500000,0,-5,0.9996, ,0,Meter
+2166,Pulkovo_1942_Adj_1983_3_Degree_GK_Zone_3,3500000,0,9,1, ,0,Meter
+2167,Pulkovo_1942_Adj_1983_3_Degree_GK_Zone_4,4500000,0,12,1, ,0,Meter
+2168,Pulkovo_1942_Adj_1983_3_Degree_GK_Zone_5,5500000,0,15,1, ,0,Meter
+2169,Luxembourg_1930_Gauss,80000,100000,6.166666667,1, ,49.83333333,Meter
+2170,MGI_Slovenia_Grid,500000,0,15,0.9999, ,0,Meter
+2176,ETRS_1989_Poland_CS2000_Zone_5,5500000,0,15,0.999923, ,0,Meter
+2177,ETRS_1989_Poland_CS2000_Zone_6,6500000,0,18,0.999923, ,0,Meter
+2178,ETRS_1989_Poland_CS2000_Zone_7,7500000,0,21,0.999923, ,0,Meter
+2179,ETRS_1989_Poland_CS2000_Zone_8,8500000,0,24,0.999923, ,0,Meter
+2180,ETRS_1989_Poland_CS92,500000,-5300000,19,0.9993, ,0,Meter
+2181,ED_1950_Turkey_9,9500000,0,27,0.9996, ,0,Meter
+2182,ED_1950_Turkey_10,10500000,0,30,0.9996, ,0,Meter
+2183,ED_1950_Turkey_11,11500000,0,33,0.9996, ,0,Meter
+2184,ED_1950_Turkey_12,12500000,0,36,0.9996, ,0,Meter
+2185,ED_1950_Turkey_13,13500000,0,39,0.9996, ,0,Meter
+2186,ED_1950_Turkey_14,14500000,0,42,0.9996, ,0,Meter
+2187,ED_1950_Turkey_15,15500000,0,45,0.9996, ,0,Meter
+2192,ED_1950_France_EuroLambert,600000,2200000,2.337229167,46.8,0.99987742,46.8,Meter
+2193,NZGD_2000_New_Zealand_Transverse_Mercator,1600000,10000000,173,0.9996, ,0,Meter
+2195,NAD_1983_HARN_UTM_Zone_2S,500000,10000000,-171,0.9996, ,0,Meter
+2196,ETRS_1989_Kp2000_Jutland,200000,0,9.5,0.99995, ,0,Meter
+2197,ETRS_1989_Kp2000_Zealand,500000,0,12,0.99995, ,0,Meter
+2198,ETRS_1989_Kp2000_Bornholm,900000,0,15,1, ,0,Meter
+2200,ATS_1977_New_Brunswick_Stereographic,300000,800000,-66.5,0.999912, ,46.5,Meter
+2201,REGVEN_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+2202,REGVEN_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
+2203,REGVEN_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+2206,ED_1950_3_Degree_GK_Zone_9,9500000,0,27,1, ,0,Meter
+2207,ED_1950_3_Degree_GK_Zone_10,10500000,0,30,1, ,0,Meter
+2208,ED_1950_3_Degree_GK_Zone_11,11500000,0,33,1, ,0,Meter
+2209,ED_1950_3_Degree_GK_Zone_12,12500000,0,36,1, ,0,Meter
+2210,ED_1950_3_Degree_GK_Zone_13,13500000,0,39,1, ,0,Meter
+2211,ED_1950_3_Degree_GK_Zone_14,14500000,0,42,1, ,0,Meter
+2212,ED_1950_3_Degree_GK_Zone_15,15500000,0,45,1, ,0,Meter
+2213,ETRS_1989_TM_30_NE,500000,0,30,0.9996, ,0,Meter
+2214,Douala_1948_AEF_West,1000000,1000000,10.5,0.999, ,0,Meter
+2215,Manoca_1962_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
+2216,Qornoq_1927_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
+2217,Qornoq_1927_UTM_Zone_23N,500000,0,-45,0.9996, ,0,Meter
+2219,ATS_1977_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
+2220,ATS_1977_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+2222,NAD_1983_StatePlane_Arizona_East_FIPS_0201_Feet_Intl,700000,0,-110.1666667,0.9999, ,31,Foot
+2223,NAD_1983_StatePlane_Arizona_Central_FIPS_0202_Feet_Intl,700000,0,-111.9166667,0.9999, ,31,Foot
+2224,NAD_1983_StatePlane_Arizona_West_FIPS_0203_Feet_Intl,700000,0,-113.75,0.999933333, ,31,Foot
+2225,NAD_1983_StatePlane_California_I_FIPS_0401_Feet,6561666.667,1640416.667,-122,40,41.66666667,39.33333333,Foot_US
+2226,NAD_1983_StatePlane_California_II_FIPS_0402_Feet,6561666.667,1640416.667,-122,38.33333333,39.83333333,37.66666667,Foot_US
+2227,NAD_1983_StatePlane_California_III_FIPS_0403_Feet,6561666.667,1640416.667,-120.5,37.06666667,38.43333333,36.5,Foot_US
+2228,NAD_1983_StatePlane_California_IV_FIPS_0404_Feet,6561666.667,1640416.667,-119,36,37.25,35.33333333,Foot_US
+2229,NAD_1983_StatePlane_California_V_FIPS_0405_Feet,6561666.667,1640416.667,-118,34.03333333,35.46666667,33.5,Foot_US
+2230,NAD_1983_StatePlane_California_VI_FIPS_0406_Feet,6561666.667,1640416.667,-116.25,32.78333333,33.88333333,32.16666667,Foot_US
+2231,NAD_1983_StatePlane_Colorado_North_FIPS_0501_Feet,3000000,1000000,-105.5,39.71666667,40.78333333,39.33333333,Foot_US
+2232,NAD_1983_StatePlane_Colorado_Central_FIPS_0502_Feet,3000000,1000000,-105.5,38.45,39.75,37.83333333,Foot_US
+2233,NAD_1983_StatePlane_Colorado_South_FIPS_0503_Feet,3000000,1000000,-105.5,37.23333333,38.43333333,36.66666667,Foot_US
+2234,NAD_1983_StatePlane_Connecticut_FIPS_0600_Feet,1000000,500000,-72.75,41.2,41.86666667,40.83333333,Foot_US
+2235,NAD_1983_StatePlane_Delaware_FIPS_0700_Feet,656166.6667,0,-75.41666667,0.999995, ,38,Foot_US
+2236,NAD_1983_StatePlane_Florida_East_FIPS_0901_Feet,656166.6667,0,-81,0.999941176, ,24.33333333,Foot_US
+2237,NAD_1983_StatePlane_Florida_West_FIPS_0902_Feet,656166.6667,0,-82,0.999941176, ,24.33333333,Foot_US
+2238,NAD_1983_StatePlane_Florida_North_FIPS_0903_Feet,1968500,0,-84.5,29.58333333,30.75,29,Foot_US
+2239,NAD_1983_StatePlane_Georgia_East_FIPS_1001_Feet,656166.6667,0,-82.16666667,0.9999, ,30,Foot_US
+2240,NAD_1983_StatePlane_Georgia_West_FIPS_1002_Feet,2296583.333,0,-84.16666667,0.9999, ,30,Foot_US
+2241,NAD_1983_StatePlane_Idaho_East_FIPS_1101_Feet,656166.6667,0,-112.1666667,0.999947368, ,41.66666667,Foot_US
+2242,NAD_1983_StatePlane_Idaho_Central_FIPS_1102_Feet,1640416.667,0,-114,0.999947368, ,41.66666667,Foot_US
+2243,NAD_1983_StatePlane_Idaho_West_FIPS_1103_Feet,2624666.667,0,-115.75,0.999933333, ,41.66666667,Foot_US
+2246,NAD_1983_StatePlane_Kentucky_North_FIPS_1601_Feet,1640416.667,0,-84.25,37.96666667,38.96666667,37.5,Foot_US
+2247,NAD_1983_StatePlane_Kentucky_South_FIPS_1602_Feet,1640416.667,1640416.667,-85.75,36.73333333,37.93333333,36.33333333,Foot_US
+2248,NAD_1983_StatePlane_Maryland_FIPS_1900_Feet,1312333.333,0,-77,38.3,39.45,37.66666667,Foot_US
+2249,NAD_1983_StatePlane_Massachusetts_Mainland_FIPS_2001_Feet,656166.6667,2460625,-71.5,41.71666667,42.68333333,41,Foot_US
+2250,NAD_1983_StatePlane_Massachusetts_Island_FIPS_2002_Feet,1640416.667,0,-70.5,41.28333333,41.48333333,41,Foot_US
+2251,NAD_1983_StatePlane_Michigan_North_FIPS_2111_Feet_Intl,26246719.16,0,-87,45.48333333,47.08333333,44.78333333,Foot
+2252,NAD_1983_StatePlane_Michigan_Central_FIPS_2112_Feet_Intl,19685039.37,0,-84.36666667,44.18333333,45.7,43.31666667,Foot
+2253,NAD_1983_StatePlane_Michigan_South_FIPS_2113_Feet_Intl,13123359.58,0,-84.36666667,42.1,43.66666667,41.5,Foot
+2254,NAD_1983_StatePlane_Mississippi_East_FIPS_2301_Feet,984250,0,-88.83333333,0.99995, ,29.5,Foot_US
+2255,NAD_1983_StatePlane_Mississippi_West_FIPS_2302_Feet,2296583.333,0,-90.33333333,0.99995, ,29.5,Foot_US
+2256,NAD_1983_StatePlane_Montana_FIPS_2500_Feet_Intl,1968503.937,0,-109.5,45,49,44.25,Foot
+2257,NAD_1983_StatePlane_New_Mexico_East_FIPS_3001_Feet,541337.5,0,-104.3333333,0.999909091, ,31,Foot_US
+2258,NAD_1983_StatePlane_New_Mexico_Central_FIPS_3002_Feet,1640416.667,0,-106.25,0.9999, ,31,Foot_US
+2259,NAD_1983_StatePlane_New_Mexico_West_FIPS_3003_Feet,2723091.667,0,-107.8333333,0.999916667, ,31,Foot_US
+2260,NAD_1983_StatePlane_New_York_East_FIPS_3101_Feet,492125,0,-74.5,0.9999, ,38.83333333,Foot_US
+2261,NAD_1983_StatePlane_New_York_Central_FIPS_3102_Feet,820208.3333,0,-76.58333333,0.9999375, ,40,Foot_US
+2262,NAD_1983_StatePlane_New_York_West_FIPS_3103_Feet,1148291.667,0,-78.58333333,0.9999375, ,40,Foot_US
+2263,NAD_1983_StatePlane_New_York_Long_Island_FIPS_3104_Feet,984250,0,-74,40.66666667,41.03333333,40.16666667,Foot_US
+2264,NAD_1983_StatePlane_North_Carolina_FIPS_3200_Feet,2000000.003,0,-79,34.33333333,36.16666667,33.75,Foot_US
+2265,NAD_1983_StatePlane_North_Dakota_North_FIPS_3301_Feet_Intl,1968503.937,0,-100.5,47.43333333,48.73333333,47,Foot
+2266,NAD_1983_StatePlane_North_Dakota_South_FIPS_3302_Feet_Intl,1968503.937,0,-100.5,46.18333333,47.48333333,45.66666667,Foot
+2267,NAD_1983_StatePlane_Oklahoma_North_FIPS_3501_Feet,1968500,0,-98,35.56666667,36.76666667,35,Foot_US
+2268,NAD_1983_StatePlane_Oklahoma_South_FIPS_3502_Feet,1968500,0,-98,33.93333333,35.23333333,33.33333333,Foot_US
+2269,NAD_1983_StatePlane_Oregon_North_FIPS_3601_Feet_Intl,8202099.738,0,-120.5,44.33333333,46,43.66666667,Foot
+2270,NAD_1983_StatePlane_Oregon_South_FIPS_3602_Feet_Intl,4921259.843,0,-120.5,42.33333333,44,41.66666667,Foot
+2271,NAD_1983_StatePlane_Pennsylvania_North_FIPS_3701_Feet,1968500,0,-77.75,40.88333333,41.95,40.16666667,Foot_US
+2272,NAD_1983_StatePlane_Pennsylvania_South_FIPS_3702_Feet,1968500,0,-77.75,39.93333333,40.96666667,39.33333333,Foot_US
+2273,NAD_1983_StatePlane_South_Carolina_FIPS_3900_Feet_Intl,2000000,0,-81,32.5,34.83333333,31.83333333,Foot
+2274,NAD_1983_StatePlane_Tennessee_FIPS_4100_Feet,1968500,0,-86,35.25,36.41666667,34.33333333,Foot_US
+2275,NAD_1983_StatePlane_Texas_North_FIPS_4201_Feet,656166.6667,3280833.333,-101.5,34.65,36.18333333,34,Foot_US
+2276,NAD_1983_StatePlane_Texas_North_Central_FIPS_4202_Feet,1968500,6561666.667,-98.5,32.13333333,33.96666667,31.66666667,Foot_US
+2277,NAD_1983_StatePlane_Texas_Central_FIPS_4203_Feet,2296583.333,9842500,-100.3333333,30.11666667,31.88333333,29.66666667,Foot_US
+2278,NAD_1983_StatePlane_Texas_South_Central_FIPS_4204_Feet,1968500,13123333.33,-99,28.38333333,30.28333333,27.83333333,Foot_US
+2279,NAD_1983_StatePlane_Texas_South_FIPS_4205_Feet,984250,16404166.67,-98.5,26.16666667,27.83333333,25.66666667,Foot_US
+2280,NAD_1983_StatePlane_Utah_North_FIPS_4301_Feet_Intl,1640419.948,3280839.895,-111.5,40.71666667,41.78333333,40.33333333,Foot
+2281,NAD_1983_StatePlane_Utah_Central_FIPS_4302_Feet_Intl,1640419.948,6561679.79,-111.5,39.01666667,40.65,38.33333333,Foot
+2282,NAD_1983_StatePlane_Utah_South_FIPS_4303_Feet_Intl,1640419.948,9842519.685,-111.5,37.21666667,38.35,36.66666667,Foot
+2283,NAD_1983_StatePlane_Virginia_North_FIPS_4501_Feet,11482916.67,6561666.667,-78.5,38.03333333,39.2,37.66666667,Foot_US
+2284,NAD_1983_StatePlane_Virginia_South_FIPS_4502_Feet,11482916.67,3280833.333,-78.5,36.76666667,37.96666667,36.33333333,Foot_US
+2285,NAD_1983_StatePlane_Washington_North_FIPS_4601_Feet,1640416.667,0,-120.8333333,47.5,48.73333333,47,Foot_US
+2286,NAD_1983_StatePlane_Washington_South_FIPS_4602_Feet,1640416.667,0,-120.5,45.83333333,47.33333333,45.33333333,Foot_US
+2287,NAD_1983_StatePlane_Wisconsin_North_FIPS_4801_Feet,1968500,0,-90,45.56666667,46.76666667,45.16666667,Foot_US
+2288,NAD_1983_StatePlane_Wisconsin_Central_FIPS_4802_Feet,1968500,0,-90,44.25,45.5,43.83333333,Foot_US
+2289,NAD_1983_StatePlane_Wisconsin_South_FIPS_4803_Feet,1968500,0,-90,42.73333333,44.06666667,42,Foot_US
+2290,Prince_Edward_Island_Stereographic,700000,400000,-63,0.999912, ,47.25,Meter
+2291,NAD_1983_CSRS98_Prince_Edward_Island,400000,800000,-63,0.999912, ,47.25,Meter
+2294,ATS_1977_MTM_4_Nova_Scotia,4500000,0,-61.5,0.9999, ,0,Meter
+2295,ATS_1977_MTM_5_Nova_Scotia,5500000,0,-64.5,0.9999, ,0,Meter
+2308,Batavia_TM_109_SE,500000,10000000,109,0.9996, ,0,Meter
+2309,WGS_1984_TM_116_SE,500000,10000000,116,0.9996, ,0,Meter
+2310,WGS_1984_TM_132_SE,500000,10000000,132,0.9996, ,0,Meter
+2311,WGS_1984_TM_6_NE,500000,10000000,6,0.9996, ,0,Meter
+2312,Garoua_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
+2313,Kousseri_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
+2314,Trinidad_1903_Trinidad_Grid_Feet_Clarke,283800,214500,-61.33333333,1, ,10.44166667,Foot_Clarke
+2315,Campo_Inchauspe_UTM_19S,500000,10000000,-69,0.9996, ,0,Meter
+2316,Campo_Inchauspe_UTM_20S,500000,10000000,-63,0.9996, ,0,Meter
+2317,PSAD_1956_ICN_Regional,1000000,1000000,-66,3,9,6,Meter
+2318,Ain_el_Abd_Aramco_Lambert,0,0,48,17,33,25.08951,Meter
+2319,ED_1950_TM27,500000,0,27,1, ,0,Meter
+2320,ED_1950_TM30,500000,0,30,1, ,0,Meter
+2321,ED_1950_TM33,500000,0,33,1, ,0,Meter
+2322,ED_1950_TM36,500000,0,36,1, ,0,Meter
+2323,ED_1950_TM39,500000,0,39,1, ,0,Meter
+2324,ED_1950_TM42,500000,0,42,1, ,0,Meter
+2325,ED_1950_TM45,500000,0,45,1, ,0,Meter
+2326,Hong_Kong_1980_Grid,836694.05,819069.8,114.1785556,1, ,22.31213333,Meter
+2327,Xian_1980_GK_Zone_13,13500000,0,75,1, ,0,Meter
+2328,Xian_1980_GK_Zone_14,14500000,0,81,1, ,0,Meter
+2329,Xian_1980_GK_Zone_15,15500000,0,87,1, ,0,Meter
+2330,Xian_1980_GK_Zone_16,16500000,0,93,1, ,0,Meter
+2331,Xian_1980_GK_Zone_17,17500000,0,99,1, ,0,Meter
+2332,Xian_1980_GK_Zone_18,18500000,0,105,1, ,0,Meter
+2333,Xian_1980_GK_Zone_19,19500000,0,111,1, ,0,Meter
+2334,Xian_1980_GK_Zone_20,20500000,0,117,1, ,0,Meter
+2335,Xian_1980_GK_Zone_21,21500000,0,123,1, ,0,Meter
+2336,Xian_1980_GK_Zone_22,22500000,0,129,1, ,0,Meter
+2337,Xian_1980_GK_Zone_23,23500000,0,135,1, ,0,Meter
+2338,Xian_1980_GK_CM_75E,500000,0,75,1, ,0,Meter
+2339,Xian_1980_GK_CM_81E,500000,0,81,1, ,0,Meter
+2340,Xian_1980_GK_CM_87E,500000,0,87,1, ,0,Meter
+2341,Xian_1980_GK_CM_93E,500000,0,93,1, ,0,Meter
+2342,Xian_1980_GK_CM_99E,500000,0,99,1, ,0,Meter
+2343,Xian_1980_GK_CM_105E,500000,0,105,1, ,0,Meter
+2344,Xian_1980_GK_CM_111E,500000,0,111,1, ,0,Meter
+2345,Xian_1980_GK_CM_117E,500000,0,117,1, ,0,Meter
+2346,Xian_1980_GK_CM_123E,500000,0,123,1, ,0,Meter
+2347,Xian_1980_GK_CM_129E,500000,0,129,1, ,0,Meter
+2348,Xian_1980_GK_CM_135E,500000,0,135,1, ,0,Meter
+2349,Xian_1980_3_Degree_GK_Zone_25,25500000,0,75,1, ,0,Meter
+2350,Xian_1980_3_Degree_GK_Zone_26,26500000,0,78,1, ,0,Meter
+2351,Xian_1980_3_Degree_GK_Zone_27,27500000,0,81,1, ,0,Meter
+2352,Xian_1980_3_Degree_GK_Zone_28,28500000,0,84,1, ,0,Meter
+2353,Xian_1980_3_Degree_GK_Zone_29,29500000,0,87,1, ,0,Meter
+2354,Xian_1980_3_Degree_GK_Zone_30,30500000,0,90,1, ,0,Meter
+2355,Xian_1980_3_Degree_GK_Zone_31,31500000,0,93,1, ,0,Meter
+2356,Xian_1980_3_Degree_GK_Zone_32,32500000,0,96,1, ,0,Meter
+2357,Xian_1980_3_Degree_GK_Zone_33,33500000,0,99,1, ,0,Meter
+2358,Xian_1980_3_Degree_GK_Zone_34,34500000,0,102,1, ,0,Meter
+2359,Xian_1980_3_Degree_GK_Zone_35,35500000,0,105,1, ,0,Meter
+2360,Xian_1980_3_Degree_GK_Zone_36,36500000,0,108,1, ,0,Meter
+2361,Xian_1980_3_Degree_GK_Zone_37,37500000,0,111,1, ,0,Meter
+2362,Xian_1980_3_Degree_GK_Zone_38,38500000,0,114,1, ,0,Meter
+2363,Xian_1980_3_Degree_GK_Zone_39,39500000,0,117,1, ,0,Meter
+2364,Xian_1980_3_Degree_GK_Zone_40,40500000,0,120,1, ,0,Meter
+2365,Xian_1980_3_Degree_GK_Zone_41,41500000,0,123,1, ,0,Meter
+2366,Xian_1980_3_Degree_GK_Zone_42,42500000,0,126,1, ,0,Meter
+2367,Xian_1980_3_Degree_GK_Zone_43,43500000,0,129,1, ,0,Meter
+2368,Xian_1980_3_Degree_GK_Zone_44,44500000,0,132,1, ,0,Meter
+2369,Xian_1980_3_Degree_GK_Zone_45,45500000,0,135,1, ,0,Meter
+2370,Xian_1980_3_Degree_GK_CM_75E,500000,0,75,1, ,0,Meter
+2371,Xian_1980_3_Degree_GK_CM_78E,500000,0,78,1, ,0,Meter
+2372,Xian_1980_3_Degree_GK_CM_81E,500000,0,81,1, ,0,Meter
+2373,Xian_1980_3_Degree_GK_CM_84E,500000,0,84,1, ,0,Meter
+2374,Xian_1980_3_Degree_GK_CM_87E,500000,0,87,1, ,0,Meter
+2375,Xian_1980_3_Degree_GK_CM_90E,500000,0,90,1, ,0,Meter
+2376,Xian_1980_3_Degree_GK_CM_93E,500000,0,93,1, ,0,Meter
+2377,Xian_1980_3_Degree_GK_CM_96E,500000,0,96,1, ,0,Meter
+2378,Xian_1980_3_Degree_GK_CM_99E,500000,0,99,1, ,0,Meter
+2379,Xian_1980_3_Degree_GK_CM_102E,500000,0,102,1, ,0,Meter
+2380,Xian_1980_3_Degree_GK_CM_105E,500000,0,105,1, ,0,Meter
+2381,Xian_1980_3_Degree_GK_CM_108E,500000,0,108,1, ,0,Meter
+2382,Xian_1980_3_Degree_GK_CM_111E,500000,0,111,1, ,0,Meter
+2383,Xian_1980_3_Degree_GK_CM_114E,500000,0,114,1, ,0,Meter
+2384,Xian_1980_3_Degree_GK_CM_117E,500000,0,117,1, ,0,Meter
+2385,Xian_1980_3_Degree_GK_CM_120E,500000,0,120,1, ,0,Meter
+2386,Xian_1980_3_Degree_GK_CM_123E,500000,0,123,1, ,0,Meter
+2387,Xian_1980_3_Degree_GK_CM_126E,500000,0,126,1, ,0,Meter
+2388,Xian_1980_3_Degree_GK_CM_129E,500000,0,129,1, ,0,Meter
+2389,Xian_1980_3_Degree_GK_CM_132E,500000,0,132,1, ,0,Meter
+2390,Xian_1980_3_Degree_GK_CM_135E,500000,0,135,1, ,0,Meter
+2391,Finland_Zone_1,1500000,0,21,1, ,0,Meter
+2392,Finland_Zone_2,2500000,0,24,1, ,0,Meter
+2393,Finland_Zone_3,3500000,0,27,1, ,0,Meter
+2394,Finland_Zone_4,4500000,0,30,1, ,0,Meter
+2395,South_Yemen_GK_Zone_8,8500000,0,45,1, ,0,Meter
+2396,South_Yemen_GK_Zone_9,9500000,0,51,1, ,0,Meter
+2397,Pulkovo_1942_Adj_1983_3_Degree_GK_Zone_3,3500000,0,9,1, ,0,Meter
+2398,Pulkovo_1942_Adj_1983_3_Degree_GK_Zone_4,4500000,0,12,1, ,0,Meter
+2399,Pulkovo_1942_Adj_1983_3_Degree_GK_Zone_5,5500000,0,15,1, ,0,Meter
+2400,RT90_25_gon_W,1500000,0,15.80827778,1, ,0,Meter
+2401,Beijing_1954_3_Degree_GK_Zone_25,25500000,0,75,1, ,0,Meter
+2402,Beijing_1954_3_Degree_GK_Zone_26,26500000,0,78,1, ,0,Meter
+2403,Beijing_1954_3_Degree_GK_Zone_27,27500000,0,81,1, ,0,Meter
+2404,Beijing_1954_3_Degree_GK_Zone_28,28500000,0,84,1, ,0,Meter
+2405,Beijing_1954_3_Degree_GK_Zone_29,29500000,0,87,1, ,0,Meter
+2406,Beijing_1954_3_Degree_GK_Zone_30,30500000,0,90,1, ,0,Meter
+2407,Beijing_1954_3_Degree_GK_Zone_31,31500000,0,93,1, ,0,Meter
+2408,Beijing_1954_3_Degree_GK_Zone_32,32500000,0,96,1, ,0,Meter
+2409,Beijing_1954_3_Degree_GK_Zone_33,33500000,0,99,1, ,0,Meter
+2410,Beijing_1954_3_Degree_GK_Zone_34,34500000,0,102,1, ,0,Meter
+2411,Beijing_1954_3_Degree_GK_Zone_35,35500000,0,105,1, ,0,Meter
+2412,Beijing_1954_3_Degree_GK_Zone_36,36500000,0,108,1, ,0,Meter
+2413,Beijing_1954_3_Degree_GK_Zone_37,37500000,0,111,1, ,0,Meter
+2414,Beijing_1954_3_Degree_GK_Zone_38,38500000,0,114,1, ,0,Meter
+2415,Beijing_1954_3_Degree_GK_Zone_39,39500000,0,117,1, ,0,Meter
+2416,Beijing_1954_3_Degree_GK_Zone_40,40500000,0,120,1, ,0,Meter
+2417,Beijing_1954_3_Degree_GK_Zone_41,41500000,0,123,1, ,0,Meter
+2418,Beijing_1954_3_Degree_GK_Zone_42,42500000,0,126,1, ,0,Meter
+2419,Beijing_1954_3_Degree_GK_Zone_43,43500000,0,129,1, ,0,Meter
+2420,Beijing_1954_3_Degree_GK_Zone_44,44500000,0,132,1, ,0,Meter
+2421,Beijing_1954_3_Degree_GK_Zone_45,45500000,0,135,1, ,0,Meter
+2422,Beijing_1954_3_Degree_GK_CM_75E,500000,0,75,1, ,0,Meter
+2423,Beijing_1954_3_Degree_GK_CM_78E,500000,0,78,1, ,0,Meter
+2424,Beijing_1954_3_Degree_GK_CM_81E,500000,0,81,1, ,0,Meter
+2425,Beijing_1954_3_Degree_GK_CM_84E,500000,0,84,1, ,0,Meter
+2426,Beijing_1954_3_Degree_GK_CM_87E,500000,0,87,1, ,0,Meter
+2427,Beijing_1954_3_Degree_GK_CM_90E,500000,0,90,1, ,0,Meter
+2428,Beijing_1954_3_Degree_GK_CM_93E,500000,0,93,1, ,0,Meter
+2429,Beijing_1954_3_Degree_GK_CM_96E,500000,0,96,1, ,0,Meter
+2430,Beijing_1954_3_Degree_GK_CM_99E,500000,0,99,1, ,0,Meter
+2431,Beijing_1954_3_Degree_GK_CM_102E,500000,0,102,1, ,0,Meter
+2432,Beijing_1954_3_Degree_GK_CM_105E,500000,0,105,1, ,0,Meter
+2433,Beijing_1954_3_Degree_GK_CM_108E,500000,0,108,1, ,0,Meter
+2434,Beijing_1954_3_Degree_GK_CM_111E,500000,0,111,1, ,0,Meter
+2435,Beijing_1954_3_Degree_GK_CM_114E,500000,0,114,1, ,0,Meter
+2436,Beijing_1954_3_Degree_GK_CM_117E,500000,0,117,1, ,0,Meter
+2437,Beijing_1954_3_Degree_GK_CM_120E,500000,0,120,1, ,0,Meter
+2438,Beijing_1954_3_Degree_GK_CM_123E,500000,0,123,1, ,0,Meter
+2439,Beijing_1954_3_Degree_GK_CM_126E,500000,0,126,1, ,0,Meter
+2440,Beijing_1954_3_Degree_GK_CM_129E,500000,0,129,1, ,0,Meter
+2441,Beijing_1954_3_Degree_GK_CM_132E,500000,0,132,1, ,0,Meter
+2442,Beijing_1954_3_Degree_GK_CM_135E,500000,0,135,1, ,0,Meter
+2443,JGD_2000_Japan_Zone_1,0,0,129.5,0.9999, ,33,Meter
+2444,JGD_2000_Japan_Zone_2,0,0,131,0.9999, ,33,Meter
+2445,JGD_2000_Japan_Zone_3,0,0,132.1666667,0.9999, ,36,Meter
+2446,JGD_2000_Japan_Zone_4,0,0,133.5,0.9999, ,33,Meter
+2447,JGD_2000_Japan_Zone_5,0,0,134.3333333,0.9999, ,36,Meter
+2448,JGD_2000_Japan_Zone_6,0,0,136,0.9999, ,36,Meter
+2449,JGD_2000_Japan_Zone_7,0,0,137.1666667,0.9999, ,36,Meter
+2450,JGD_2000_Japan_Zone_8,0,0,138.5,0.9999, ,36,Meter
+2451,JGD_2000_Japan_Zone_9,0,0,139.8333333,0.9999, ,36,Meter
+2452,JGD_2000_Japan_Zone_10,0,0,140.8333333,0.9999, ,40,Meter
+2453,JGD_2000_Japan_Zone_11,0,0,140.25,0.9999, ,44,Meter
+2454,JGD_2000_Japan_Zone_12,0,0,142.25,0.9999, ,44,Meter
+2455,JGD_2000_Japan_Zone_13,0,0,144.25,0.9999, ,44,Meter
+2456,JGD_2000_Japan_Zone_14,0,0,142,0.9999, ,26,Meter
+2457,JGD_2000_Japan_Zone_15,0,0,127.5,0.9999, ,26,Meter
+2458,JGD_2000_Japan_Zone_16,0,0,124,0.9999, ,26,Meter
+2459,JGD_2000_Japan_Zone_17,0,0,131,0.9999, ,26,Meter
+2460,JGD_2000_Japan_Zone_18,0,0,136,0.9999, ,20,Meter
+2461,JGD_2000_Japan_Zone_19,0,0,154,0.9999, ,26,Meter
+2462,Albanian_1987_GK_Zone_4,4500000,0,21,1, ,0,Meter
+2523,Pulkovo_1942_3_Degree_GK_Zone_7,7500000,0,21,1, ,0,Meter
+2524,Pulkovo_1942_3_Degree_GK_Zone_8,8500000,0,24,1, ,0,Meter
+2525,Pulkovo_1942_3_Degree_GK_Zone_9,9500000,0,27,1, ,0,Meter
+2526,Pulkovo_1942_3_Degree_GK_Zone_10,10500000,0,30,1, ,0,Meter
+2527,Pulkovo_1942_3_Degree_GK_Zone_11,11500000,0,33,1, ,0,Meter
+2528,Pulkovo_1942_3_Degree_GK_Zone_12,12500000,0,36,1, ,0,Meter
+2529,Pulkovo_1942_3_Degree_GK_Zone_13,13500000,0,39,1, ,0,Meter
+2530,Pulkovo_1942_3_Degree_GK_Zone_14,14500000,0,42,1, ,0,Meter
+2531,Pulkovo_1942_3_Degree_GK_Zone_15,15500000,0,45,1, ,0,Meter
+2532,Pulkovo_1942_3_Degree_GK_Zone_16,16500000,0,48,1, ,0,Meter
+2533,Pulkovo_1942_3_Degree_GK_Zone_17,17500000,0,51,1, ,0,Meter
+2534,Pulkovo_1942_3_Degree_GK_Zone_18,18500000,0,54,1, ,0,Meter
+2535,Pulkovo_1942_3_Degree_GK_Zone_19,19500000,0,57,1, ,0,Meter
+2536,Pulkovo_1942_3_Degree_GK_Zone_20,20500000,0,60,1, ,0,Meter
+2537,Pulkovo_1942_3_Degree_GK_Zone_21,21500000,0,63,1, ,0,Meter
+2538,Pulkovo_1942_3_Degree_GK_Zone_22,22500000,0,66,1, ,0,Meter
+2539,Pulkovo_1942_3_Degree_GK_Zone_23,23500000,0,69,1, ,0,Meter
+2540,Pulkovo_1942_3_Degree_GK_Zone_24,24500000,0,72,1, ,0,Meter
+2541,Pulkovo_1942_3_Degree_GK_Zone_25,25500000,0,75,1, ,0,Meter
+2542,Pulkovo_1942_3_Degree_GK_Zone_26,26500000,0,78,1, ,0,Meter
+2543,Pulkovo_1942_3_Degree_GK_Zone_27,27500000,0,81,1, ,0,Meter
+2544,Pulkovo_1942_3_Degree_GK_Zone_28,28500000,0,84,1, ,0,Meter
+2545,Pulkovo_1942_3_Degree_GK_Zone_29,29500000,0,87,1, ,0,Meter
+2546,Pulkovo_1942_3_Degree_GK_Zone_30,30500000,0,90,1, ,0,Meter
+2547,Pulkovo_1942_3_Degree_GK_Zone_31,31500000,0,93,1, ,0,Meter
+2548,Pulkovo_1942_3_Degree_GK_Zone_32,32500000,0,96,1, ,0,Meter
+2549,Pulkovo_1942_3_Degree_GK_Zone_33,33500000,0,99,1, ,0,Meter
+2550,Samboja_UTM_Zone_50S,500000,10000000,117,0.9996, ,0,Meter
+2551,Pulkovo_1942_3_Degree_GK_Zone_34,34500000,0,102,1, ,0,Meter
+2552,Pulkovo_1942_3_Degree_GK_Zone_35,35500000,0,105,1, ,0,Meter
+2553,Pulkovo_1942_3_Degree_GK_Zone_36,36500000,0,108,1, ,0,Meter
+2554,Pulkovo_1942_3_Degree_GK_Zone_37,37500000,0,111,1, ,0,Meter
+2555,Pulkovo_1942_3_Degree_GK_Zone_38,38500000,0,114,1, ,0,Meter
+2556,Pulkovo_1942_3_Degree_GK_Zone_39,39500000,0,117,1, ,0,Meter
+2557,Pulkovo_1942_3_Degree_GK_Zone_40,40500000,0,120,1, ,0,Meter
+2558,Pulkovo_1942_3_Degree_GK_Zone_41,41500000,0,123,1, ,0,Meter
+2559,Pulkovo_1942_3_Degree_GK_Zone_42,42500000,0,126,1, ,0,Meter
+2560,Pulkovo_1942_3_Degree_GK_Zone_43,43500000,0,129,1, ,0,Meter
+2561,Pulkovo_1942_3_Degree_GK_Zone_44,44500000,0,132,1, ,0,Meter
+2562,Pulkovo_1942_3_Degree_GK_Zone_45,45500000,0,135,1, ,0,Meter
+2563,Pulkovo_1942_3_Degree_GK_Zone_46,46500000,0,138,1, ,0,Meter
+2564,Pulkovo_1942_3_Degree_GK_Zone_47,47500000,0,141,1, ,0,Meter
+2565,Pulkovo_1942_3_Degree_GK_Zone_48,48500000,0,144,1, ,0,Meter
+2566,Pulkovo_1942_3_Degree_GK_Zone_49,49500000,0,147,1, ,0,Meter
+2567,Pulkovo_1942_3_Degree_GK_Zone_50,50500000,0,150,1, ,0,Meter
+2568,Pulkovo_1942_3_Degree_GK_Zone_51,51500000,0,153,1, ,0,Meter
+2569,Pulkovo_1942_3_Degree_GK_Zone_52,52500000,0,156,1, ,0,Meter
+2570,Pulkovo_1942_3_Degree_GK_Zone_53,53500000,0,159,1, ,0,Meter
+2571,Pulkovo_1942_3_Degree_GK_Zone_54,54500000,0,162,1, ,0,Meter
+2572,Pulkovo_1942_3_Degree_GK_Zone_55,55500000,0,165,1, ,0,Meter
+2573,Pulkovo_1942_3_Degree_GK_Zone_56,56500000,0,168,1, ,0,Meter
+2574,Pulkovo_1942_3_Degree_GK_Zone_57,57500000,0,171,1, ,0,Meter
+2575,Pulkovo_1942_3_Degree_GK_Zone_58,58500000,0,174,1, ,0,Meter
+2576,Pulkovo_1942_3_Degree_GK_Zone_59,59500000,0,177,1, ,0,Meter
+2577,Pulkovo_1942_3_Degree_GK_Zone_60,60500000,0,180,1, ,0,Meter
+2578,Pulkovo_1942_3_Degree_GK_Zone_61,61500000,0,-177,1, ,0,Meter
+2579,Pulkovo_1942_3_Degree_GK_Zone_62,62500000,0,-174,1, ,0,Meter
+2580,Pulkovo_1942_3_Degree_GK_Zone_63,63500000,0,-171,1, ,0,Meter
+2581,Pulkovo_1942_3_Degree_GK_Zone_64,64500000,0,-168,1, ,0,Meter
+2582,Pulkovo_1942_3_Degree_GK_CM_21E,500000,0,21,1, ,0,Meter
+2583,Pulkovo_1942_3_Degree_GK_CM_24E,500000,0,24,1, ,0,Meter
+2584,Pulkovo_1942_3_Degree_GK_CM_27E,500000,0,27,1, ,0,Meter
+2585,Pulkovo_1942_3_Degree_GK_CM_30E,500000,0,30,1, ,0,Meter
+2586,Pulkovo_1942_3_Degree_GK_CM_33E,500000,0,33,1, ,0,Meter
+2587,Pulkovo_1942_3_Degree_GK_CM_36E,500000,0,36,1, ,0,Meter
+2588,Pulkovo_1942_3_Degree_GK_CM_39E,500000,0,39,1, ,0,Meter
+2589,Pulkovo_1942_3_Degree_GK_CM_42E,500000,0,42,1, ,0,Meter
+2590,Pulkovo_1942_3_Degree_GK_CM_45E,500000,0,45,1, ,0,Meter
+2591,Pulkovo_1942_3_Degree_GK_CM_48E,500000,0,48,1, ,0,Meter
+2592,Pulkovo_1942_3_Degree_GK_CM_51E,500000,0,51,1, ,0,Meter
+2593,Pulkovo_1942_3_Degree_GK_CM_54E,500000,0,54,1, ,0,Meter
+2594,Pulkovo_1942_3_Degree_GK_CM_57E,500000,0,57,1, ,0,Meter
+2595,Pulkovo_1942_3_Degree_GK_CM_60E,500000,0,60,1, ,0,Meter
+2596,Pulkovo_1942_3_Degree_GK_CM_63E,500000,0,63,1, ,0,Meter
+2597,Pulkovo_1942_3_Degree_GK_CM_66E,500000,0,66,1, ,0,Meter
+2598,Pulkovo_1942_3_Degree_GK_CM_69E,500000,0,69,1, ,0,Meter
+2599,Pulkovo_1942_3_Degree_GK_CM_72E,500000,0,72,1, ,0,Meter
+2600,Lietuvos_Koordinaciu_Sistema,500000,0,24,0.9998, ,0,Meter
+2601,Pulkovo_1942_3_Degree_GK_CM_75E,500000,0,75,1, ,0,Meter
+2602,Pulkovo_1942_3_Degree_GK_CM_78E,500000,0,78,1, ,0,Meter
+2603,Pulkovo_1942_3_Degree_GK_CM_81E,500000,0,81,1, ,0,Meter
+2604,Pulkovo_1942_3_Degree_GK_CM_84E,500000,0,84,1, ,0,Meter
+2605,Pulkovo_1942_3_Degree_GK_CM_87E,500000,0,87,1, ,0,Meter
+2606,Pulkovo_1942_3_Degree_GK_CM_90E,500000,0,90,1, ,0,Meter
+2607,Pulkovo_1942_3_Degree_GK_CM_93E,500000,0,93,1, ,0,Meter
+2608,Pulkovo_1942_3_Degree_GK_CM_96E,500000,0,96,1, ,0,Meter
+2609,Pulkovo_1942_3_Degree_GK_CM_99E,500000,0,99,1, ,0,Meter
+2610,Pulkovo_1942_3_Degree_GK_CM_102E,500000,0,102,1, ,0,Meter
+2611,Pulkovo_1942_3_Degree_GK_CM_105E,500000,0,105,1, ,0,Meter
+2612,Pulkovo_1942_3_Degree_GK_CM_108E,500000,0,108,1, ,0,Meter
+2613,Pulkovo_1942_3_Degree_GK_CM_111E,500000,0,111,1, ,0,Meter
+2614,Pulkovo_1942_3_Degree_GK_CM_114E,500000,0,114,1, ,0,Meter
+2615,Pulkovo_1942_3_Degree_GK_CM_117E,500000,0,117,1, ,0,Meter
+2616,Pulkovo_1942_3_Degree_GK_CM_120E,500000,0,120,1, ,0,Meter
+2617,Pulkovo_1942_3_Degree_GK_CM_123E,500000,0,123,1, ,0,Meter
+2618,Pulkovo_1942_3_Degree_GK_CM_126E,500000,0,126,1, ,0,Meter
+2619,Pulkovo_1942_3_Degree_GK_CM_129E,500000,0,129,1, ,0,Meter
+2620,Pulkovo_1942_3_Degree_GK_CM_132E,500000,0,132,1, ,0,Meter
+2621,Pulkovo_1942_3_Degree_GK_CM_135E,500000,0,135,1, ,0,Meter
+2622,Pulkovo_1942_3_Degree_GK_CM_138E,500000,0,138,1, ,0,Meter
+2623,Pulkovo_1942_3_Degree_GK_CM_141E,500000,0,141,1, ,0,Meter
+2624,Pulkovo_1942_3_Degree_GK_CM_144E,500000,0,144,1, ,0,Meter
+2625,Pulkovo_1942_3_Degree_GK_CM_147E,500000,0,147,1, ,0,Meter
+2626,Pulkovo_1942_3_Degree_GK_CM_150E,500000,0,150,1, ,0,Meter
+2627,Pulkovo_1942_3_Degree_GK_CM_153E,500000,0,153,1, ,0,Meter
+2628,Pulkovo_1942_3_Degree_GK_CM_156E,500000,0,156,1, ,0,Meter
+2629,Pulkovo_1942_3_Degree_GK_CM_159E,500000,0,159,1, ,0,Meter
+2630,Pulkovo_1942_3_Degree_GK_CM_162E,500000,0,162,1, ,0,Meter
+2631,Pulkovo_1942_3_Degree_GK_CM_165E,500000,0,165,1, ,0,Meter
+2632,Pulkovo_1942_3_Degree_GK_CM_168E,500000,0,168,1, ,0,Meter
+2633,Pulkovo_1942_3_Degree_GK_CM_171E,500000,0,171,1, ,0,Meter
+2634,Pulkovo_1942_3_Degree_GK_CM_174E,500000,0,174,1, ,0,Meter
+2635,Pulkovo_1942_3_Degree_GK_CM_177E,500000,0,177,1, ,0,Meter
+2636,Pulkovo_1942_3_Degree_GK_CM_180E,500000,0,180,1, ,0,Meter
+2637,Pulkovo_1942_3_Degree_GK_CM_177W,500000,0,-177,1, ,0,Meter
+2638,Pulkovo_1942_3_Degree_GK_CM_174W,500000,0,-174,1, ,0,Meter
+2639,Pulkovo_1942_3_Degree_GK_CM_171W,500000,0,-171,1, ,0,Meter
+2640,Pulkovo_1942_3_Degree_GK_CM_168W,500000,0,-168,1, ,0,Meter
+2641,Pulkovo_1995_3_Degree_GK_Zone_7,7500000,0,21,1, ,0,Meter
+2642,Pulkovo_1995_3_Degree_GK_Zone_8,8500000,0,24,1, ,0,Meter
+2643,Pulkovo_1995_3_Degree_GK_Zone_9,9500000,0,27,1, ,0,Meter
+2644,Pulkovo_1995_3_Degree_GK_Zone_10,10500000,0,30,1, ,0,Meter
+2645,Pulkovo_1995_3_Degree_GK_Zone_11,11500000,0,33,1, ,0,Meter
+2646,Pulkovo_1995_3_Degree_GK_Zone_12,12500000,0,36,1, ,0,Meter
+2647,Pulkovo_1995_3_Degree_GK_Zone_13,13500000,0,39,1, ,0,Meter
+2648,Pulkovo_1995_3_Degree_GK_Zone_14,14500000,0,42,1, ,0,Meter
+2649,Pulkovo_1995_3_Degree_GK_Zone_15,15500000,0,45,1, ,0,Meter
+2650,Pulkovo_1995_3_Degree_GK_Zone_16,16500000,0,48,1, ,0,Meter
+2651,Pulkovo_1995_3_Degree_GK_Zone_17,17500000,0,51,1, ,0,Meter
+2652,Pulkovo_1995_3_Degree_GK_Zone_18,18500000,0,54,1, ,0,Meter
+2653,Pulkovo_1995_3_Degree_GK_Zone_19,19500000,0,57,1, ,0,Meter
+2654,Pulkovo_1995_3_Degree_GK_Zone_20,20500000,0,60,1, ,0,Meter
+2655,Pulkovo_1995_3_Degree_GK_Zone_21,21500000,0,63,1, ,0,Meter
+2656,Pulkovo_1995_3_Degree_GK_Zone_22,22500000,0,66,1, ,0,Meter
+2657,Pulkovo_1995_3_Degree_GK_Zone_23,23500000,0,69,1, ,0,Meter
+2658,Pulkovo_1995_3_Degree_GK_Zone_24,24500000,0,72,1, ,0,Meter
+2659,Pulkovo_1995_3_Degree_GK_Zone_25,25500000,0,75,1, ,0,Meter
+2660,Pulkovo_1995_3_Degree_GK_Zone_26,26500000,0,78,1, ,0,Meter
+2661,Pulkovo_1995_3_Degree_GK_Zone_27,27500000,0,81,1, ,0,Meter
+2662,Pulkovo_1995_3_Degree_GK_Zone_28,28500000,0,84,1, ,0,Meter
+2663,Pulkovo_1995_3_Degree_GK_Zone_29,29500000,0,87,1, ,0,Meter
+2664,Pulkovo_1995_3_Degree_GK_Zone_30,30500000,0,90,1, ,0,Meter
+2665,Pulkovo_1995_3_Degree_GK_Zone_31,31500000,0,93,1, ,0,Meter
+2666,Pulkovo_1995_3_Degree_GK_Zone_32,32500000,0,96,1, ,0,Meter
+2667,Pulkovo_1995_3_Degree_GK_Zone_33,33500000,0,99,1, ,0,Meter
+2668,Pulkovo_1995_3_Degree_GK_Zone_34,34500000,0,102,1, ,0,Meter
+2669,Pulkovo_1995_3_Degree_GK_Zone_35,35500000,0,105,1, ,0,Meter
+2670,Pulkovo_1995_3_Degree_GK_Zone_36,36500000,0,108,1, ,0,Meter
+2671,Pulkovo_1995_3_Degree_GK_Zone_37,37500000,0,111,1, ,0,Meter
+2672,Pulkovo_1995_3_Degree_GK_Zone_38,38500000,0,114,1, ,0,Meter
+2673,Pulkovo_1995_3_Degree_GK_Zone_39,39500000,0,117,1, ,0,Meter
+2674,Pulkovo_1995_3_Degree_GK_Zone_40,40500000,0,120,1, ,0,Meter
+2675,Pulkovo_1995_3_Degree_GK_Zone_41,41500000,0,123,1, ,0,Meter
+2676,Pulkovo_1995_3_Degree_GK_Zone_42,42500000,0,126,1, ,0,Meter
+2677,Pulkovo_1995_3_Degree_GK_Zone_43,43500000,0,129,1, ,0,Meter
+2678,Pulkovo_1995_3_Degree_GK_Zone_44,44500000,0,132,1, ,0,Meter
+2679,Pulkovo_1995_3_Degree_GK_Zone_45,45500000,0,135,1, ,0,Meter
+2680,Pulkovo_1995_3_Degree_GK_Zone_46,46500000,0,138,1, ,0,Meter
+2681,Pulkovo_1995_3_Degree_GK_Zone_47,47500000,0,141,1, ,0,Meter
+2682,Pulkovo_1995_3_Degree_GK_Zone_48,48500000,0,144,1, ,0,Meter
+2683,Pulkovo_1995_3_Degree_GK_Zone_49,49500000,0,147,1, ,0,Meter
+2684,Pulkovo_1995_3_Degree_GK_Zone_50,50500000,0,150,1, ,0,Meter
+2685,Pulkovo_1995_3_Degree_GK_Zone_51,51500000,0,153,1, ,0,Meter
+2686,Pulkovo_1995_3_Degree_GK_Zone_52,52500000,0,156,1, ,0,Meter
+2687,Pulkovo_1995_3_Degree_GK_Zone_53,53500000,0,159,1, ,0,Meter
+2688,Pulkovo_1995_3_Degree_GK_Zone_54,54500000,0,162,1, ,0,Meter
+2689,Pulkovo_1995_3_Degree_GK_Zone_55,55500000,0,165,1, ,0,Meter
+2690,Pulkovo_1995_3_Degree_GK_Zone_56,56500000,0,168,1, ,0,Meter
+2691,Pulkovo_1995_3_Degree_GK_Zone_57,57500000,0,171,1, ,0,Meter
+2692,Pulkovo_1995_3_Degree_GK_Zone_58,58500000,0,174,1, ,0,Meter
+2693,Pulkovo_1995_3_Degree_GK_Zone_59,59500000,0,177,1, ,0,Meter
+2694,Pulkovo_1995_3_Degree_GK_Zone_60,60500000,0,180,1, ,0,Meter
+2695,Pulkovo_1995_3_Degree_GK_Zone_61,61500000,0,-177,1, ,0,Meter
+2696,Pulkovo_1995_3_Degree_GK_Zone_62,62500000,0,-174,1, ,0,Meter
+2697,Pulkovo_1995_3_Degree_GK_Zone_63,63500000,0,-171,1, ,0,Meter
+2698,Pulkovo_1995_3_Degree_GK_Zone_64,64500000,0,-168,1, ,0,Meter
+2699,Pulkovo_1995_3_Degree_GK_CM_21E,500000,0,21,1, ,0,Meter
+2700,Pulkovo_1995_3_Degree_GK_CM_24E,500000,0,24,1, ,0,Meter
+2701,Pulkovo_1995_3_Degree_GK_CM_27E,500000,0,27,1, ,0,Meter
+2702,Pulkovo_1995_3_Degree_GK_CM_30E,500000,0,30,1, ,0,Meter
+2703,Pulkovo_1995_3_Degree_GK_CM_33E,500000,0,33,1, ,0,Meter
+2704,Pulkovo_1995_3_Degree_GK_CM_36E,500000,0,36,1, ,0,Meter
+2705,Pulkovo_1995_3_Degree_GK_CM_39E,500000,0,39,1, ,0,Meter
+2706,Pulkovo_1995_3_Degree_GK_CM_42E,500000,0,42,1, ,0,Meter
+2707,Pulkovo_1995_3_Degree_GK_CM_45E,500000,0,45,1, ,0,Meter
+2708,Pulkovo_1995_3_Degree_GK_CM_48E,500000,0,48,1, ,0,Meter
+2709,Pulkovo_1995_3_Degree_GK_CM_51E,500000,0,51,1, ,0,Meter
+2710,Pulkovo_1995_3_Degree_GK_CM_54E,500000,0,54,1, ,0,Meter
+2711,Pulkovo_1995_3_Degree_GK_CM_57E,500000,0,57,1, ,0,Meter
+2712,Pulkovo_1995_3_Degree_GK_CM_60E,500000,0,60,1, ,0,Meter
+2713,Pulkovo_1995_3_Degree_GK_CM_63E,500000,0,63,1, ,0,Meter
+2714,Pulkovo_1995_3_Degree_GK_CM_66E,500000,0,66,1, ,0,Meter
+2715,Pulkovo_1995_3_Degree_GK_CM_69E,500000,0,69,1, ,0,Meter
+2716,Pulkovo_1995_3_Degree_GK_CM_72E,500000,0,72,1, ,0,Meter
+2717,Pulkovo_1995_3_Degree_GK_CM_75E,500000,0,75,1, ,0,Meter
+2718,Pulkovo_1995_3_Degree_GK_CM_78E,500000,0,78,1, ,0,Meter
+2719,Pulkovo_1995_3_Degree_GK_CM_81E,500000,0,81,1, ,0,Meter
+2720,Pulkovo_1995_3_Degree_GK_CM_84E,500000,0,84,1, ,0,Meter
+2721,Pulkovo_1995_3_Degree_GK_CM_87E,500000,0,87,1, ,0,Meter
+2722,Pulkovo_1995_3_Degree_GK_CM_90E,500000,0,90,1, ,0,Meter
+2723,Pulkovo_1995_3_Degree_GK_CM_93E,500000,0,93,1, ,0,Meter
+2724,Pulkovo_1995_3_Degree_GK_CM_96E,500000,0,96,1, ,0,Meter
+2725,Pulkovo_1995_3_Degree_GK_CM_99E,500000,0,99,1, ,0,Meter
+2726,Pulkovo_1995_3_Degree_GK_CM_102E,500000,0,102,1, ,0,Meter
+2727,Pulkovo_1995_3_Degree_GK_CM_105E,500000,0,105,1, ,0,Meter
+2728,Pulkovo_1995_3_Degree_GK_CM_108E,500000,0,108,1, ,0,Meter
+2729,Pulkovo_1995_3_Degree_GK_CM_111E,500000,0,111,1, ,0,Meter
+2730,Pulkovo_1995_3_Degree_GK_CM_114E,500000,0,114,1, ,0,Meter
+2731,Pulkovo_1995_3_Degree_GK_CM_117E,500000,0,117,1, ,0,Meter
+2732,Pulkovo_1995_3_Degree_GK_CM_120E,500000,0,120,1, ,0,Meter
+2733,Pulkovo_1995_3_Degree_GK_CM_123E,500000,0,123,1, ,0,Meter
+2734,Pulkovo_1995_3_Degree_GK_CM_126E,500000,0,126,1, ,0,Meter
+2735,Pulkovo_1995_3_Degree_GK_CM_129E,500000,0,129,1, ,0,Meter
+2736,Tete_UTM_Zone_36S,500000,10000000,33,0.9996, ,0,Meter
+2737,Tete_UTM_Zone_37S,500000,10000000,39,0.9996, ,0,Meter
+2738,Pulkovo_1995_3_Degree_GK_CM_132E,500000,0,132,1, ,0,Meter
+2739,Pulkovo_1995_3_Degree_GK_CM_135E,500000,0,135,1, ,0,Meter
+2740,Pulkovo_1995_3_Degree_GK_CM_138E,500000,0,138,1, ,0,Meter
+2741,Pulkovo_1995_3_Degree_GK_CM_141E,500000,0,141,1, ,0,Meter
+2742,Pulkovo_1995_3_Degree_GK_CM_144E,500000,0,144,1, ,0,Meter
+2743,Pulkovo_1995_3_Degree_GK_CM_147E,500000,0,147,1, ,0,Meter
+2744,Pulkovo_1995_3_Degree_GK_CM_150E,500000,0,150,1, ,0,Meter
+2745,Pulkovo_1995_3_Degree_GK_CM_153E,500000,0,153,1, ,0,Meter
+2746,Pulkovo_1995_3_Degree_GK_CM_156E,500000,0,156,1, ,0,Meter
+2747,Pulkovo_1995_3_Degree_GK_CM_159E,500000,0,159,1, ,0,Meter
+2748,Pulkovo_1995_3_Degree_GK_CM_162E,500000,0,162,1, ,0,Meter
+2749,Pulkovo_1995_3_Degree_GK_CM_165E,500000,0,165,1, ,0,Meter
+2750,Pulkovo_1995_3_Degree_GK_CM_168E,500000,0,168,1, ,0,Meter
+2751,Pulkovo_1995_3_Degree_GK_CM_171E,500000,0,171,1, ,0,Meter
+2752,Pulkovo_1995_3_Degree_GK_CM_174E,500000,0,174,1, ,0,Meter
+2753,Pulkovo_1995_3_Degree_GK_CM_177E,500000,0,177,1, ,0,Meter
+2754,Pulkovo_1995_3_Degree_GK_CM_180E,500000,0,180,1, ,0,Meter
+2755,Pulkovo_1995_3_Degree_GK_CM_177W,500000,0,-177,1, ,0,Meter
+2756,Pulkovo_1995_3_Degree_GK_CM_174W,500000,0,-174,1, ,0,Meter
+2757,Pulkovo_1995_3_Degree_GK_CM_171W,500000,0,-171,1, ,0,Meter
+2758,Pulkovo_1995_3_Degree_GK_CM_168W,500000,0,-168,1, ,0,Meter
+2759,NAD_1983_HARN_StatePlane_Alabama_East_FIPS_0101,200000,0,-85.83333333,0.99996, ,30.5,Meter
+2760,NAD_1983_HARN_StatePlane_Alabama_West_FIPS_0102,600000,0,-87.5,0.999933333, ,30,Meter
+2761,NAD_1983_HARN_StatePlane_Arizona_East_FIPS_0201,213360,0,-110.1666667,0.9999, ,31,Meter
+2762,NAD_1983_HARN_StatePlane_Arizona_Central_FIPS_0202,213360,0,-111.9166667,0.9999, ,31,Meter
+2763,NAD_1983_HARN_StatePlane_Arizona_West_FIPS_0203,213360,0,-113.75,0.999933333, ,31,Meter
+2764,NAD_1983_HARN_StatePlane_Arkansas_North_FIPS_0301,400000,0,-92,34.93333333,36.23333333,34.33333333,Meter
+2765,NAD_1983_HARN_StatePlane_Arkansas_South_FIPS_0302,400000,400000,-92,33.3,34.76666667,32.66666667,Meter
+2766,NAD_1983_HARN_StatePlane_California_I_FIPS_0401,2000000,500000,-122,40,41.66666667,39.33333333,Meter
+2767,NAD_1983_HARN_StatePlane_California_II_FIPS_0402,2000000,500000,-122,38.33333333,39.83333333,37.66666667,Meter
+2768,NAD_1983_HARN_StatePlane_California_III_FIPS_0403,2000000,500000,-120.5,37.06666667,38.43333333,36.5,Meter
+2769,NAD_1983_HARN_StatePlane_California_IV_FIPS_0404,2000000,500000,-119,36,37.25,35.33333333,Meter
+2770,NAD_1983_HARN_StatePlane_California_V_FIPS_0405,2000000,500000,-118,34.03333333,35.46666667,33.5,Meter
+2771,NAD_1983_HARN_StatePlane_California_VI_FIPS_0406,2000000,500000,-116.25,32.78333333,33.88333333,32.16666667,Meter
+2772,NAD_1983_HARN_StatePlane_Colorado_North_FIPS_0501,914401.8289,304800.6096,-105.5,39.71666667,40.78333333,39.33333333,Meter
+2773,NAD_1983_HARN_StatePlane_Colorado_Central_FIPS_0502,914401.8289,304800.6096,-105.5,38.45,39.75,37.83333333,Meter
+2774,NAD_1983_HARN_StatePlane_Colorado_South_FIPS_0503,914401.8289,304800.6096,-105.5,37.23333333,38.43333333,36.66666667,Meter
+2775,NAD_1983_HARN_StatePlane_Connecticut_FIPS_0600,304800.6096,152400.3048,-72.75,41.2,41.86666667,40.83333333,Meter
+2776,NAD_1983_HARN_StatePlane_Delaware_FIPS_0700,200000,0,-75.41666667,0.999995, ,38,Meter
+2777,NAD_1983_HARN_StatePlane_Florida_East_FIPS_0901,200000,0,-81,0.999941176, ,24.33333333,Meter
+2778,NAD_1983_HARN_StatePlane_Florida_West_FIPS_0902,200000,0,-82,0.999941176, ,24.33333333,Meter
+2779,NAD_1983_HARN_StatePlane_Florida_North_FIPS_0903,600000,0,-84.5,29.58333333,30.75,29,Meter
+2780,NAD_1983_HARN_StatePlane_Georgia_East_FIPS_1001,200000,0,-82.16666667,0.9999, ,30,Meter
+2781,NAD_1983_HARN_StatePlane_Georgia_West_FIPS_1002,700000,0,-84.16666667,0.9999, ,30,Meter
+2782,NAD_1983_HARN_StatePlane_Hawaii_1_FIPS_5101,500000,0,-155.5,0.999966667, ,18.83333333,Meter
+2783,NAD_1983_HARN_StatePlane_Hawaii_2_FIPS_5102,500000,0,-156.6666667,0.999966667, ,20.33333333,Meter
+2784,NAD_1983_HARN_StatePlane_Hawaii_3_FIPS_5103,500000,0,-158,0.99999, ,21.16666667,Meter
+2785,NAD_1983_HARN_StatePlane_Hawaii_4_FIPS_5104,500000,0,-159.5,0.99999, ,21.83333333,Meter
+2786,NAD_1983_HARN_StatePlane_Hawaii_5_FIPS_5105,500000,0,-160.1666667,1, ,21.66666667,Meter
+2787,NAD_1983_HARN_StatePlane_Idaho_East_FIPS_1101,200000,0,-112.1666667,0.999947368, ,41.66666667,Meter
+2788,NAD_1983_HARN_StatePlane_Idaho_Central_FIPS_1102,500000,0,-114,0.999947368, ,41.66666667,Meter
+2789,NAD_1983_HARN_StatePlane_Idaho_West_FIPS_1103,800000,0,-115.75,0.999933333, ,41.66666667,Meter
+2790,NAD_1983_HARN_StatePlane_Illinois_East_FIPS_1201,300000,0,-88.33333333,0.999975, ,36.66666667,Meter
+2791,NAD_1983_HARN_StatePlane_Illinois_West_FIPS_1202,700000,0,-90.16666667,0.999941176, ,36.66666667,Meter
+2792,NAD_1983_HARN_StatePlane_Indiana_East_FIPS_1301,100000,250000,-85.66666667,0.999966667, ,37.5,Meter
+2793,NAD_1983_HARN_StatePlane_Indiana_West_FIPS_1302,900000,250000,-87.08333333,0.999966667, ,37.5,Meter
+2794,NAD_1983_HARN_StatePlane_Iowa_North_FIPS_1401,1500000,1000000,-93.5,42.06666667,43.26666667,41.5,Meter
+2795,NAD_1983_HARN_StatePlane_Iowa_South_FIPS_1402,500000,0,-93.5,40.61666667,41.78333333,40,Meter
+2796,NAD_1983_HARN_StatePlane_Kansas_North_FIPS_1501,400000,0,-98,38.71666667,39.78333333,38.33333333,Meter
+2797,NAD_1983_HARN_StatePlane_Kansas_South_FIPS_1502,400000,400000,-98.5,37.26666667,38.56666667,36.66666667,Meter
+2798,NAD_1983_HARN_StatePlane_Kentucky_North_FIPS_1601,500000,0,-84.25,37.96666667,38.96666667,37.5,Meter
+2799,NAD_1983_HARN_StatePlane_Kentucky_South_FIPS_1602,500000,500000,-85.75,36.73333333,37.93333333,36.33333333,Meter
+2800,NAD_1983_HARN_StatePlane_Louisiana_North_FIPS_1701,1000000,0,-92.5,31.16666667,32.66666667,30.5,Meter
+2801,NAD_1983_HARN_StatePlane_Louisiana_South_FIPS_1702,1000000,0,-91.33333333,29.3,30.7,28.5,Meter
+2802,NAD_1983_HARN_StatePlane_Maine_East_FIPS_1801,300000,0,-68.5,0.9999, ,43.66666667,Meter
+2803,NAD_1983_HARN_StatePlane_Maine_West_FIPS_1802,900000,0,-70.16666667,0.999966667, ,42.83333333,Meter
+2804,NAD_1983_HARN_StatePlane_Maryland_FIPS_1900,400000,0,-77,38.3,39.45,37.66666667,Meter
+2805,NAD_1983_HARN_StatePlane_Massachusetts_Mainland_FIPS_2001,200000,750000,-71.5,41.71666667,42.68333333,41,Meter
+2806,NAD_1983_HARN_StatePlane_Massachusetts_Island_FIPS_2002,500000,0,-70.5,41.28333333,41.48333333,41,Meter
+2807,NAD_1983_HARN_StatePlane_Michigan_North_FIPS_2111,8000000,0,-87,45.48333333,47.08333333,44.78333333,Meter
+2808,NAD_1983_HARN_StatePlane_Michigan_Central_FIPS_2112,6000000,0,-84.36666667,44.18333333,45.7,43.31666667,Meter
+2809,NAD_1983_HARN_StatePlane_Michigan_South_FIPS_2113,4000000,0,-84.36666667,42.1,43.66666667,41.5,Meter
+2810,NAD_1983_HARN_StatePlane_Minnesota_North_FIPS_2201,800000,100000,-93.1,47.03333333,48.63333333,46.5,Meter
+2811,NAD_1983_HARN_StatePlane_Minnesota_Central_FIPS_2202,800000,100000,-94.25,45.61666667,47.05,45,Meter
+2812,NAD_1983_HARN_StatePlane_Minnesota_South_FIPS_2203,800000,100000,-94,43.78333333,45.21666667,43,Meter
+2813,NAD_1983_HARN_StatePlane_Mississippi_East_FIPS_2301,300000,0,-88.83333333,0.99995, ,29.5,Meter
+2814,NAD_1983_HARN_StatePlane_Mississippi_West_FIPS_2302,700000,0,-90.33333333,0.99995, ,29.5,Meter
+2815,NAD_1983_HARN_StatePlane_Missouri_East_FIPS_2401,250000,0,-90.5,0.999933333, ,35.83333333,Meter
+2816,NAD_1983_HARN_StatePlane_Missouri_Central_FIPS_2402,500000,0,-92.5,0.999933333, ,35.83333333,Meter
+2817,NAD_1983_HARN_StatePlane_Missouri_West_FIPS_2403,850000,0,-94.5,0.999941176, ,36.16666667,Meter
+2818,NAD_1983_HARN_StatePlane_Montana_FIPS_2500,600000,0,-109.5,45,49,44.25,Meter
+2819,NAD_1983_HARN_StatePlane_Nebraska_FIPS_2600,500000,0,-100,40,43,39.83333333,Meter
+2820,NAD_1983_HARN_StatePlane_Nevada_East_FIPS_2701,200000,8000000,-115.5833333,0.9999, ,34.75,Meter
+2821,NAD_1983_HARN_StatePlane_Nevada_Central_FIPS_2702,500000,6000000,-116.6666667,0.9999, ,34.75,Meter
+2822,NAD_1983_HARN_StatePlane_Nevada_West_FIPS_2703,800000,4000000,-118.5833333,0.9999, ,34.75,Meter
+2823,NAD_1983_HARN_StatePlane_New_Hampshire_FIPS_2800,300000,0,-71.66666667,0.999966667, ,42.5,Meter
+2824,NAD_1983_HARN_StatePlane_New_Jersey_FIPS_2900,150000,0,-74.5,0.9999, ,38.83333333,Meter
+2825,NAD_1983_HARN_StatePlane_New_Mexico_East_FIPS_3001,165000,0,-104.3333333,0.999909091, ,31,Meter
+2826,NAD_1983_HARN_StatePlane_New_Mexico_Central_FIPS_3002,500000,0,-106.25,0.9999, ,31,Meter
+2827,NAD_1983_HARN_StatePlane_New_Mexico_West_FIPS_3003,830000,0,-107.8333333,0.999916667, ,31,Meter
+2828,NAD_1983_HARN_StatePlane_New_York_East_FIPS_3101,150000,0,-74.5,0.9999, ,38.83333333,Meter
+2829,NAD_1983_HARN_StatePlane_New_York_Central_FIPS_3102,250000,0,-76.58333333,0.9999375, ,40,Meter
+2830,NAD_1983_HARN_StatePlane_New_York_West_FIPS_3103,350000,0,-78.58333333,0.9999375, ,40,Meter
+2831,NAD_1983_HARN_StatePlane_New_York_Long_Island_FIPS_3104,300000,0,-74,40.66666667,41.03333333,40.16666667,Meter
+2832,NAD_1983_HARN_StatePlane_North_Dakota_North_FIPS_3301,600000,0,-100.5,47.43333333,48.73333333,47,Meter
+2833,NAD_1983_HARN_StatePlane_North_Dakota_South_FIPS_3302,600000,0,-100.5,46.18333333,47.48333333,45.66666667,Meter
+2834,NAD_1983_HARN_StatePlane_Ohio_North_FIPS_3401,600000,0,-82.5,40.43333333,41.7,39.66666667,Meter
+2835,NAD_1983_HARN_StatePlane_Ohio_South_FIPS_3402,600000,0,-82.5,38.73333333,40.03333333,38,Meter
+2836,NAD_1983_HARN_StatePlane_Oklahoma_North_FIPS_3501,600000,0,-98,35.56666667,36.76666667,35,Meter
+2837,NAD_1983_HARN_StatePlane_Oklahoma_South_FIPS_3502,600000,0,-98,33.93333333,35.23333333,33.33333333,Meter
+2838,NAD_1983_HARN_StatePlane_Oregon_North_FIPS_3601,2500000,0,-120.5,44.33333333,46,43.66666667,Meter
+2839,NAD_1983_HARN_StatePlane_Oregon_South_FIPS_3602,1500000,0,-120.5,42.33333333,44,41.66666667,Meter
+2840,NAD_1983_HARN_StatePlane_Rhode_Island_FIPS_3800,100000,0,-71.5,0.99999375, ,41.08333333,Meter
+2841,NAD_1983_HARN_StatePlane_South_Dakota_North_FIPS_4001,600000,0,-100,44.41666667,45.68333333,43.83333333,Meter
+2842,NAD_1983_HARN_StatePlane_South_Dakota_South_FIPS_4002,600000,0,-100.3333333,42.83333333,44.4,42.33333333,Meter
+2843,NAD_1983_HARN_StatePlane_Tennessee_FIPS_4100,600000,0,-86,35.25,36.41666667,34.33333333,Meter
+2844,NAD_1983_HARN_StatePlane_Texas_North_FIPS_4201,200000,1000000,-101.5,34.65,36.18333333,34,Meter
+2845,NAD_1983_HARN_StatePlane_Texas_North_Central_FIPS_4202,600000,2000000,-98.5,32.13333333,33.96666667,31.66666667,Meter
+2846,NAD_1983_HARN_StatePlane_Texas_Central_FIPS_4203,700000,3000000,-100.3333333,30.11666667,31.88333333,29.66666667,Meter
+2847,NAD_1983_HARN_StatePlane_Texas_South_Central_FIPS_4204,600000,4000000,-99,28.38333333,30.28333333,27.83333333,Meter
+2848,NAD_1983_HARN_StatePlane_Texas_South_FIPS_4205,300000,5000000,-98.5,26.16666667,27.83333333,25.66666667,Meter
+2849,NAD_1983_HARN_StatePlane_Utah_North_FIPS_4301,500000,1000000,-111.5,40.71666667,41.78333333,40.33333333,Meter
+2850,NAD_1983_HARN_StatePlane_Utah_Central_FIPS_4302,500000,2000000,-111.5,39.01666667,40.65,38.33333333,Meter
+2851,NAD_1983_HARN_StatePlane_Utah_South_FIPS_4303,500000,3000000,-111.5,37.21666667,38.35,36.66666667,Meter
+2852,NAD_1983_HARN_StatePlane_Vermont_FIPS_4400,500000,0,-72.5,0.999964286, ,42.5,Meter
+2853,NAD_1983_HARN_StatePlane_Virginia_North_FIPS_4501,3500000,2000000,-78.5,38.03333333,39.2,37.66666667,Meter
+2854,NAD_1983_HARN_StatePlane_Virginia_South_FIPS_4502,3500000,1000000,-78.5,36.76666667,37.96666667,36.33333333,Meter
+2855,NAD_1983_HARN_StatePlane_Washington_North_FIPS_4601,500000,0,-120.8333333,47.5,48.73333333,47,Meter
+2856,NAD_1983_HARN_StatePlane_Washington_South_FIPS_4602,500000,0,-120.5,45.83333333,47.33333333,45.33333333,Meter
+2857,NAD_1983_HARN_StatePlane_West_Virginia_North_FIPS_4701,600000,0,-79.5,39,40.25,38.5,Meter
+2858,NAD_1983_HARN_StatePlane_West_Virginia_South_FIPS_4702,600000,0,-81,37.48333333,38.88333333,37,Meter
+2859,NAD_1983_HARN_StatePlane_Wisconsin_North_FIPS_4801,600000,0,-90,45.56666667,46.76666667,45.16666667,Meter
+2860,NAD_1983_HARN_StatePlane_Wisconsin_Central_FIPS_4802,600000,0,-90,44.25,45.5,43.83333333,Meter
+2861,NAD_1983_HARN_StatePlane_Wisconsin_South_FIPS_4803,600000,0,-90,42.73333333,44.06666667,42,Meter
+2862,NAD_1983_HARN_StatePlane_Wyoming_East_FIPS_4901,200000,0,-105.1666667,0.9999375, ,40.5,Meter
+2863,NAD_1983_HARN_StatePlane_Wyoming_East_Central_FIPS_4902,400000,100000,-107.3333333,0.9999375, ,40.5,Meter
+2864,NAD_1983_HARN_StatePlane_Wyoming_West_Central_FIPS_4903,600000,0,-108.75,0.9999375, ,40.5,Meter
+2865,NAD_1983_HARN_StatePlane_Wyoming_West_FIPS_4904,800000,100000,-110.0833333,0.9999375, ,40.5,Meter
+2866,NAD_1983_HARN_StatePlane_Puerto_Rico_Virgin_Islands_FIPS_5200,200000,200000,-66.43333333,18.03333333,18.43333333,17.83333333,Meter
+2867,NAD_1983_HARN_StatePlane_Arizona_East_FIPS_0201_Feet_Intl,700000,0,-110.1666667,0.9999, ,31,Foot
+2868,NAD_1983_HARN_StatePlane_Arizona_Central_FIPS_0202_Feet_Intl,700000,0,-111.9166667,0.9999, ,31,Foot
+2869,NAD_1983_HARN_StatePlane_Arizona_West_FIPS_0203_Feet_Intl,700000,0,-113.75,0.999933333, ,31,Foot
+2870,NAD_1983_HARN_StatePlane_California_I_FIPS_0401_Feet,6561666.667,1640416.667,-122,40,41.66666667,39.33333333,Foot_US
+2871,NAD_1983_HARN_StatePlane_California_II_FIPS_0402_Feet,6561666.667,1640416.667,-122,38.33333333,39.83333333,37.66666667,Foot_US
+2872,NAD_1983_HARN_StatePlane_California_III_FIPS_0403_Feet,6561666.667,1640416.667,-120.5,37.06666667,38.43333333,36.5,Foot_US
+2873,NAD_1983_HARN_StatePlane_California_IV_FIPS_0404_Feet,6561666.667,1640416.667,-119,36,37.25,35.33333333,Foot_US
+2874,NAD_1983_HARN_StatePlane_California_V_FIPS_0405_Feet,6561666.667,1640416.667,-118,34.03333333,35.46666667,33.5,Foot_US
+2875,NAD_1983_HARN_StatePlane_California_VI_FIPS_0406_Feet,6561666.667,1640416.667,-116.25,32.78333333,33.88333333,32.16666667,Foot_US
+2876,NAD_1983_HARN_StatePlane_Colorado_North_FIPS_0501_Feet,3000000,1000000,-105.5,39.71666667,40.78333333,39.33333333,Foot_US
+2877,NAD_1983_HARN_StatePlane_Colorado_Central_FIPS_0502_Feet,3000000,1000000,-105.5,38.45,39.75,37.83333333,Foot_US
+2878,NAD_1983_HARN_StatePlane_Colorado_South_FIPS_0503_Feet,3000000,1000000,-105.5,37.23333333,38.43333333,36.66666667,Foot_US
+2879,NAD_1983_HARN_StatePlane_Connecticut_FIPS_0600_Feet,1000000,500000,-72.75,41.2,41.86666667,40.83333333,Foot_US
+2880,NAD_1983_HARN_StatePlane_Delaware_FIPS_0700_Feet,656166.6667,0,-75.41666667,0.999995, ,38,Foot_US
+2881,NAD_1983_HARN_StatePlane_Florida_East_FIPS_0901_Feet,656166.6667,0,-81,0.999941176, ,24.33333333,Foot_US
+2882,NAD_1983_HARN_StatePlane_Florida_West_FIPS_0902_Feet,656166.6667,0,-82,0.999941176, ,24.33333333,Foot_US
+2883,NAD_1983_HARN_StatePlane_Florida_North_FIPS_0903_Feet,1968500,0,-84.5,29.58333333,30.75,29,Foot_US
+2884,NAD_1983_HARN_StatePlane_Georgia_East_FIPS_1001_Feet,656166.6667,0,-82.16666667,0.9999, ,30,Foot_US
+2885,NAD_1983_HARN_StatePlane_Georgia_West_FIPS_1002_Feet,2296583.333,0,-84.16666667,0.9999, ,30,Foot_US
+2886,NAD_1983_HARN_StatePlane_Idaho_East_FIPS_1101_Feet,656166.6667,0,-112.1666667,0.999947368, ,41.66666667,Foot_US
+2887,NAD_1983_HARN_StatePlane_Idaho_Central_FIPS_1102_Feet,1640416.667,0,-114,0.999947368, ,41.66666667,Foot_US
+2888,NAD_1983_HARN_StatePlane_Idaho_West_FIPS_1103_Feet,2624666.667,0,-115.75,0.999933333, ,41.66666667,Foot_US
+2891,NAD_1983_HARN_StatePlane_Kentucky_North_FIPS_1601_Feet,1640416.667,0,-84.25,37.96666667,38.96666667,37.5,Foot_US
+2892,NAD_1983_HARN_StatePlane_Kentucky_South_FIPS_1602_Feet,1640416.667,1640416.667,-85.75,36.73333333,37.93333333,36.33333333,Foot_US
+2893,NAD_1983_HARN_StatePlane_Maryland_FIPS_1900_Feet,1312333.333,0,-77,38.3,39.45,37.66666667,Foot_US
+2894,NAD_1983_HARN_StatePlane_Massachusetts_Mainland_FIPS_2001_Feet,656166.6667,2460625,-71.5,41.71666667,42.68333333,41,Foot_US
+2895,NAD_1983_HARN_StatePlane_Massachusetts_Island_FIPS_2002_Feet,1640416.667,0,-70.5,41.28333333,41.48333333,41,Foot_US
+2896,NAD_1983_HARN_StatePlane_Michigan_North_FIPS_2111_Feet_Intl,26246719.16,0,-87,45.48333333,47.08333333,44.78333333,Foot
+2897,NAD_1983_HARN_StatePlane_Michigan_Central_FIPS_2112_Feet_Intl,19685039.37,0,-84.36666667,44.18333333,45.7,43.31666667,Foot
+2898,NAD_1983_HARN_StatePlane_Michigan_South_FIPS_2113_Feet_Intl,13123359.58,0,-84.36666667,42.1,43.66666667,41.5,Foot
+2899,NAD_1983_HARN_StatePlane_Mississippi_East_FIPS_2301_Feet,984250,0,-88.83333333,0.99995, ,29.5,Foot_US
+2900,NAD_1983_HARN_StatePlane_Mississippi_West_FIPS_2302_Feet,2296583.333,0,-90.33333333,0.99995, ,29.5,Foot_US
+2901,NAD_1983_HARN_StatePlane_Montana_FIPS_2500_Feet_Intl,1968503.937,0,-109.5,45,49,44.25,Foot
+2902,NAD_1983_HARN_StatePlane_New_Mexico_East_FIPS_3001_Feet,541337.5,0,-104.3333333,0.999909091, ,31,Foot_US
+2903,NAD_1983_HARN_StatePlane_New_Mexico_Central_FIPS_3002_Feet,1640416.667,0,-106.25,0.9999, ,31,Foot_US
+2904,NAD_1983_HARN_StatePlane_New_Mexico_West_FIPS_3003_Feet,2723091.667,0,-107.8333333,0.999916667, ,31,Foot_US
+2905,NAD_1983_HARN_StatePlane_New_York_East_FIPS_3101_Feet,492125,0,-74.5,0.9999, ,38.83333333,Foot_US
+2906,NAD_1983_HARN_StatePlane_New_York_Central_FIPS_3102_Feet,820208.3333,0,-76.58333333,0.9999375, ,40,Foot_US
+2907,NAD_1983_HARN_StatePlane_New_York_West_FIPS_3103_Feet,1148291.667,0,-78.58333333,0.9999375, ,40,Foot_US
+2908,NAD_1983_HARN_StatePlane_New_York_Long_Island_FIPS_3104_Feet,984250,0,-74,40.66666667,41.03333333,40.16666667,Foot_US
+2909,NAD_1983_HARN_StatePlane_North_Dakota_North_FIPS_3301_Feet_Intl,1968503.937,0,-100.5,47.43333333,48.73333333,47,Foot
+2910,NAD_1983_HARN_StatePlane_North_Dakota_South_FIPS_3302_Feet_Intl,1968503.937,0,-100.5,46.18333333,47.48333333,45.66666667,Foot
+2911,NAD_1983_HARN_StatePlane_Oklahoma_North_FIPS_3501_Feet,1968500,0,-98,35.56666667,36.76666667,35,Foot_US
+2912,NAD_1983_HARN_StatePlane_Oklahoma_South_FIPS_3502_Feet,1968500,0,-98,33.93333333,35.23333333,33.33333333,Foot_US
+2913,NAD_1983_HARN_StatePlane_Oregon_North_FIPS_3601_Feet_Intl,8202099.738,0,-120.5,44.33333333,46,43.66666667,Foot
+2914,NAD_1983_HARN_StatePlane_Oregon_South_FIPS_3602_Feet_Intl,4921259.843,0,-120.5,42.33333333,44,41.66666667,Foot
+2915,NAD_1983_HARN_StatePlane_Tennessee_FIPS_4100_Feet,1968500,0,-86,35.25,36.41666667,34.33333333,Foot_US
+2916,NAD_1983_HARN_StatePlane_Texas_North_FIPS_4201_Feet,656166.6667,3280833.333,-101.5,34.65,36.18333333,34,Foot_US
+2917,NAD_1983_HARN_StatePlane_Texas_North_Central_FIPS_4202_Feet,1968500,6561666.667,-98.5,32.13333333,33.96666667,31.66666667,Foot_US
+2918,NAD_1983_HARN_StatePlane_Texas_Central_FIPS_4203_Feet,2296583.333,9842500,-100.3333333,30.11666667,31.88333333,29.66666667,Foot_US
+2919,NAD_1983_HARN_StatePlane_Texas_South_Central_FIPS_4204_Feet,1968500,13123333.33,-99,28.38333333,30.28333333,27.83333333,Foot_US
+2920,NAD_1983_HARN_StatePlane_Texas_South_FIPS_4205_Feet,984250,16404166.67,-98.5,26.16666667,27.83333333,25.66666667,Foot_US
+2921,NAD_1983_HARN_StatePlane_Utah_North_FIPS_4301_Feet_Intl,1640419.948,3280839.895,-111.5,40.71666667,41.78333333,40.33333333,Foot
+2922,NAD_1983_HARN_StatePlane_Utah_Central_FIPS_4302_Feet_Intl,1640419.948,6561679.79,-111.5,39.01666667,40.65,38.33333333,Foot
+2923,NAD_1983_HARN_StatePlane_Utah_South_FIPS_4303_Feet_Intl,1640419.948,9842519.685,-111.5,37.21666667,38.35,36.66666667,Foot
+2924,NAD_1983_HARN_StatePlane_Virginia_North_FIPS_4501_Feet,11482916.67,6561666.667,-78.5,38.03333333,39.2,37.66666667,Foot_US
+2925,NAD_1983_HARN_StatePlane_Virginia_South_FIPS_4502_Feet,11482916.67,3280833.333,-78.5,36.76666667,37.96666667,36.33333333,Foot_US
+2926,NAD_1983_HARN_StatePlane_Washington_North_FIPS_4601_Feet,1640416.667,0,-120.8333333,47.5,48.73333333,47,Foot_US
+2927,NAD_1983_HARN_StatePlane_Washington_South_FIPS_4602_Feet,1640416.667,0,-120.5,45.83333333,47.33333333,45.33333333,Foot_US
+2928,NAD_1983_HARN_StatePlane_Wisconsin_North_FIPS_4801_Feet,1968500,0,-90,45.56666667,46.76666667,45.16666667,Foot_US
+2929,NAD_1983_HARN_StatePlane_Wisconsin_Central_FIPS_4802_Feet,1968500,0,-90,44.25,45.5,43.83333333,Foot_US
+2930,NAD_1983_HARN_StatePlane_Wisconsin_South_FIPS_4803_Feet,1968500,0,-90,42.73333333,44.06666667,42,Foot_US
+2931,Beduaram_TM_13_NE,500000,0,13,0.9996, ,0,Meter
+2932,QND_1995_Qatar_National_Grid,200000,300000,51.21666667,0.99999, ,24.45,Meter
+2933,Gunung_Segara_UTM_Zone_50S,500000,10000000,117,0.9996, ,0,Meter
+2935,Pulkovo_1942_CS63_Zone_A1,1300000,0,41.53333333,1, ,0.116666667,Meter
+2936,Pulkovo_1942_CS63_Zone_A2,2300000,0,44.53333333,1, ,0.116666667,Meter
+2937,Pulkovo_1942_CS63_Zone_A3,3300000,0,47.53333333,1, ,0.116666667,Meter
+2938,Pulkovo_1942_CS63_Zone_A4,4300000,0,50.53333333,1, ,0.116666667,Meter
+2939,Pulkovo_1942_CS63_Zone_K2,2300000,0,50.76666667,1, ,0.133333333,Meter
+2940,Pulkovo_1942_CS63_Zone_K3,3300000,0,53.76666667,1, ,0.133333333,Meter
+2941,Pulkovo_1942_CS63_Zone_K4,4300000,0,56.76666667,1, ,0.133333333,Meter
+2942,Porto_Santo_1936_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+2943,Selvagem_Grande_1938_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+2964,NAD_1927_Alaska_Albers_Feet,0,0,-154,55,65,50,Foot_US
+2965,NAD_1983_StatePlane_Indiana_East_FIPS_1301_Feet,328083.3333,820208.3333,-85.66666667,0.999966667, ,37.5,Foot_US
+2966,NAD_1983_StatePlane_Indiana_West_FIPS_1302_Feet,2952750,820208.3333,-87.08333333,0.999966667, ,37.5,Foot_US
+2967,NAD_1983_HARN_StatePlane_Indiana_East_FIPS_1301_Feet,328083.3333,820208.3333,-85.66666667,0.999966667, ,37.5,Foot_US
+2968,NAD_1983_HARN_StatePlane_Indiana_West_FIPS_1302_Feet,2952750,820208.3333,-87.08333333,0.999966667, ,37.5,Foot_US
+2969,Fort_Marigot_UTM_20N,500000,0,-63,0.9996, ,0,Meter
+2970,Sainte_Anne_UTM_20N,500000,0,-63,0.9996, ,0,Meter
+2971,CSG_1967_UTM_22N,500000,0,-51,0.9996, ,0,Meter
+2972,RGFG_1995_UTM_22N,500000,0,-51,0.9996, ,0,Meter
+2973,Fort_Desaix_UTM_20N,500000,0,-63,0.9996, ,0,Meter
+2975,RGR_1992_UTM_40S,500000,10000000,57,0.9996, ,0,Meter
+2976,Tahiti_1952_UTM_6S,500000,10000000,-147,0.9996, ,0,Meter
+2977,Tahaa_1954_UTM_5S,500000,10000000,-153,0.9996, ,0,Meter
+2978,IGN72_Nuku_Hiva_UTM_7S,500000,10000000,-141,0.9996, ,0,Meter
+2979,K0_1949_UTM_42S,500000,10000000,69,0.9996, ,0,Meter
+2980,Combani_1950_UTM_38S,500000,10000000,45,0.9996, ,0,Meter
+2981,IGN56_Lifou_UTM_58S,500000,10000000,165,0.9996, ,0,Meter
+2982,IGN72_Grande_Terre_UTM_58S,500000,10000000,165,0.9996, ,0,Meter
+2983,ST87_Ouvea_UTM_58S,500000,10000000,165,0.9996, ,0,Meter
+2984,RGNC_1991_Lambert_New_Caledonia,400000,300000,166,-20.66666667,-22.33333333,-21.5,Meter
+2985,Petrels_1972_Terre_Adelie_Polar_Stereographic,300000,-2299363.488,140,-67,,,Meter
+2986,Perroud_1950_Terre_Adelie_Polar_Stereographic,300000,-2299363.488,140,-67,,,Meter
+2987,Saint_Pierre_et_Miquelon_1950_UTM_21N,500000,0,-57,0.9996, ,0,Meter
+2988,MOP78_UTM_1S,500000,10000000,-177,0.9996, ,0,Meter
+2989,RRAF_1991_UTM_20N,500000,0,-63,0.9996, ,0,Meter
+2990,Reunion_1947_TM_Reunion,50000,160000,55.53333333,1, ,-21.11666667,Meter
+2991,NAD_1983_Oregon_Statewide_Lambert,400000,0,-120.5,43,45.5,41.75,Meter
+2992,NAD_1983_Oregon_Statewide_Lambert_Feet_Intl,1312335.958,0,-120.5,43,45.5,41.75,Foot
+2993,NAD_1983_HARN_Oregon_Statewide_Lambert,400000,0,-120.5,43,45.5,41.75,Meter
+2994,NAD_1983_HARN_Oregon_Statewide_Lambert_Feet_Intl,1312335.958,0,-120.5,43,45.5,41.75,Foot
+2995,IGN53_Mare_UTM_58S,500000,10000000,165,0.9996, ,0,Meter
+2996,ST84_Ile_des_Pins_UTM_58S,500000,10000000,165,0.9996, ,0,Meter
+2997,ST71_Belep_UTM_58S,500000,10000000,165,0.9996, ,0,Meter
+2998,NEA74_Noumea_UTM_58S,500000,10000000,165,0.9996, ,0,Meter
+2999,Grand_Comoros_UTM_38S,500000,10000000,45,0.9996, ,0,Meter
+3000,Gunung_Segara_NEIEZ,3900000,900000,110,4.454051546,,,Meter
+3001,Batavia_NEIEZ,3900000,900000,110,4.454051546,,,Meter
+3002,Makassar_NEIEZ,3900000,900000,110,4.454051546,,,Meter
+3003,Monte_Mario_Italy_1,1500000,0,9,0.9996, ,0,Meter
+3004,Monte_Mario_Italy_2,2520000,0,15,0.9996, ,0,Meter
+3005,NAD_1983_BC_Environment_Albers,1000000,0,-126,50,58.5,45,Meter
+3006,SWEREF99_TM,500000,0,15,0.9996, ,0,Meter
+3007,SWEREF99_12_00,150000,0,12,1, ,0,Meter
+3008,SWEREF99_13_30,150000,0,13.5,1, ,0,Meter
+3009,SWEREF99_15_00,150000,0,15,1, ,0,Meter
+3010,SWEREF99_16_30,150000,0,16.5,1, ,0,Meter
+3011,SWEREF99_18_00,150000,0,18,1, ,0,Meter
+3012,SWEREF99_14_15,150000,0,14.25,1, ,0,Meter
+3013,SWEREF99_15_45,150000,0,15.75,1, ,0,Meter
+3014,SWEREF99_17_15,150000,0,17.25,1, ,0,Meter
+3015,SWEREF99_18_45,150000,0,18.75,1, ,0,Meter
+3016,SWEREF99_20_15,150000,0,20.25,1, ,0,Meter
+3017,SWEREF99_21_45,150000,0,21.75,1, ,0,Meter
+3018,SWEREF99_23_15,150000,0,23.25,1, ,0,Meter
+3019,RT90_75_gon_V,1500000,0,11.30827778,1, ,0,Meter
+3020,RT90_5_gon_V,1500000,0,13.55827778,1, ,0,Meter
+3021,RT90_25_gon_V,1500000,0,15.80827778,1, ,0,Meter
+3022,RT90_0_gon,1500000,0,18.05827778,1, ,0,Meter
+3023,RT90_25_gon_O,1500000,0,20.30827778,1, ,0,Meter
+3024,RT90_5_gon_O,1500000,0,22.55827778,1, ,0,Meter
+3025,RT38_75_gon_V,1500000,0,11.30827778,1, ,0,Meter
+3026,RT38_5_gon_V,1500000,0,13.55827778,1, ,0,Meter
+3027,RT38_25_gon_V,1500000,0,15.80827778,1, ,0,Meter
+3028,RT38_0_gon,1500000,0,18.05827778,1, ,0,Meter
+3029,RT38_25_gon_O,1500000,0,20.30827778,1, ,0,Meter
+3030,RT38_5_gon_O,1500000,0,22.55827778,1, ,0,Meter
+3031,WGS_1984_Antarctic_Polar_Stereographic,0,0,0,-71,,,Meter
+3032,WGS_1984_Australian_Antarctic_Polar_Stereographic,6000000,6000000,70,-71,,,Meter
+3033,WGS_1984_Australian_Antarctic_Lambert,6000000,6000000,70,-68.5,-74.5,-50,Meter
+3034,ETRS_1989_LCC,4000000,2800000,10,35,65,52,Meter
+3035,ETRS_1989_LAEA,4321000,3210000,10,,,52,Meter
+3036,Moznet_UTM_Zone_36S,500000,10000000,33,0.9996, ,0,Meter
+3037,Moznet_UTM_Zone_37S,500000,10000000,39,0.9996, ,0,Meter
+3054,Hjorsey_1955_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
+3055,Hjorsey_1955_UTM_Zone_27N,500000,0,-21,0.9996, ,0,Meter
+3056,Hjorsey_1955_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+3057,ISN_1993_Lambert_1993,500000,500000,-19,64.25,65.75,65,Meter
+3058,Helle_1954_Jan_Mayen_Grid,50000,-7800000,-8.5,1, ,0,Meter
+3059,LKS_1992_Latvia_TM,500000,-6000000,24,0.9996, ,0,Meter
+3061,Porto_Santo_1995_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+3062,Azores_Oriental_1995_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
+3063,Azores_Central_1995_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
+3064,IGM_1995_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
+3065,IGM_1995_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
+3066,ED_1950_Jordan_TM,500000,-3000000,37,0.9998, ,0,Meter
+3067,EUREF_FIN_TM35FIN,500000,0,27,0.9996, ,0,Meter
+3068,DHDN_Soldner_Berlin,40000,10000,13.62720367,1, ,52.41864828,Meter
+3069,NAD_1927_Wisconsin_TM,500000,-4500000,-90,0.9996, ,0,Meter
+3070,NAD_1983_Wisconsin_TM,520000,-4480000,-90,0.9996, ,0,Meter
+3071,NAD_1983_HARN_Wisconsin_TM,520000,-4480000,-90,0.9996, ,0,Meter
+3072,NAD_1983_Maine_2000_East_Zone,700000,0,-67.875,0.99998, ,43.83333333,Meter
+3073,NAD_1983_Maine_2000_Central_Zone,500000,0,-69.125,0.99998, ,43.5,Meter
+3074,NAD_1983_Maine_2000_West_Zone,300000,0,-70.375,0.99998, ,42.83333333,Meter
+3075,NAD_1983_HARN_Maine_2000_East_Zone,700000,0,-67.875,0.99998, ,43.83333333,Meter
+3076,NAD_1983_HARN_Maine_2000_Central_Zone,500000,0,-69.125,0.99998, ,43.5,Meter
+3077,NAD_1983_HARN_Maine_2000_West_Zone,300000,0,-70.375,0.99998, ,42.83333333,Meter
+3078,NAD_1983_Michigan_GeoRef_Meters,2546731.496,-4354009.816,0.9996,337.25556,-86,45.30916667,Meter
+3079,NAD_1983_HARN_Michigan_GeoRef_Meters,2546731.496,-4354009.816,0.9996,337.25556,-86,45.30916667,Meter
+3080,NAD_1927_Texas_Statewide_Mapping_System,3000000,3000000,-100,27.41666667,34.91666667,31.16666667,Foot
+3081,NAD_1983_Texas_Statewide_Mapping_System,1000000,1000000,-100,27.41666667,34.91666667,31.16666667,Meter
+3082,NAD_1983_Texas_Centric_Mapping_System_Lambert,1500000,5000000,-100,27.5,35,18,Meter
+3083,NAD_1983_Texas_Centric_Mapping_System_Albers,1500000,6000000,-100,27.5,35,18,Meter
+3084,NAD_1983_HARN_Texas_Centric_Mapping_System_Lambert,1500000,5000000,-100,27.5,35,18,Meter
+3085,NAD_1983_HARN_Texas_Centric_Mapping_System_Albers,1500000,6000000,-100,27.5,35,18,Meter
+3086,NAD_1983_Florida_GDL_Albers,400000,0,-84,24,31.5,24,Meter
+3087,NAD_1983_HARN_Florida_GDL_Albers,400000,0,-84,24,31.5,24,Meter
+3088,NAD_1983_StatePlane_Kentucky_FIPS_1600,1500000,1000000,-85.75,37.08333333,38.66666667,36.33333333,Meter
+3089,NAD_1983_StatePlane_Kentucky_FIPS_1600_Feet,4921250,3280833.333,-85.75,37.08333333,38.66666667,36.33333333,Foot_US
+3090,NAD_1983_HARN_StatePlane_Kentucky_FIPS_1600,1500000,1000000,-85.75,37.08333333,38.66666667,36.33333333,Meter
+3091,NAD_1983_HARN_StatePlane_Kentucky_FIPS_1600_Feet,4921250,3280833.333,-85.75,37.08333333,38.66666667,36.33333333,Foot_US
+3092,Tokyo_UTM_Zone_51N,500000,0,123,0.9996, ,0,Meter
+3093,Tokyo_UTM_Zone_52N,500000,0,129,0.9996, ,0,Meter
+3094,Tokyo_UTM_Zone_53N,500000,0,135,0.9996, ,0,Meter
+3095,Tokyo_UTM_Zone_54N,500000,0,141,0.9996, ,0,Meter
+3096,Tokyo_UTM_Zone_55N,500000,0,147,0.9996, ,0,Meter
+3097,JGD_2000_UTM_Zone_51N,500000,0,123,0.9996, ,0,Meter
+3098,JGD_2000_UTM_Zone_52N,500000,0,129,0.9996, ,0,Meter
+3099,JGD_2000_UTM_Zone_53N,500000,0,135,0.9996, ,0,Meter
+3100,JGD_2000_UTM_Zone_54N,500000,0,141,0.9996, ,0,Meter
+3101,JGD_2000_UTM_Zone_55N,500000,0,147,0.9996, ,0,Meter
+3102,Samoa_1962_Samoa_Lambert,500000,312234.65,-170,-14.26666667,1,-14.26666667,Foot_US
+3106,Gulshan_303_Bangladesh_TM,500000,0,90,0.9996, ,0,Meter
+3107,GDA_1994_South_Australia_Lambert,1000000,2000000,135,-28,-36,-32,Meter
+3108,ETRS_1989_Guernsey_Grid,47000,50000,-2.416666667,0.999997, ,49.5,Meter
+3109,ETRS_1989_Jersey_Transverse_Mercator,40000,70000,-2.135,0.9999999, ,49.225,Meter
+3110,AGD_1966_VICGRID,2500000,4500000,145,-36,-38,-37,Meter
+3111,GDA_1994_VICGRID94,2500000,2500000,145,-36,-38,-37,Meter
+3112,GDA_1994_Geoscience_Australia_Lambert,0,0,134,-18,-36,0,Meter
+3113,GDA_1994_BCSG02,50000,100000,153,0.99999, ,-28,Meter
+3114,MAGNA_Colombia_Oeste_Oeste,1000000,1000000,-80.07750792,1, ,4.596200417,Meter
+3115,MAGNA_Colombia_Oeste,1000000,1000000,-77.07750792,1, ,4.596200417,Meter
+3116,MAGNA_Colombia_Bogota,1000000,1000000,-74.07750792,1, ,4.596200417,Meter
+3117,MAGNA_Colombia_Este,1000000,1000000,-71.07750792,1, ,4.596200417,Meter
+3118,MAGNA_Colombia_Este_Este,1000000,1000000,-68.07750792,1, ,4.596200417,Meter
+3119,Douala_1948_AEF_West,1000000,1000000,10.5,0.999, ,0,Meter
+3121,Philippines_Zone_I,500000,0,117,0.99995, ,0,Meter
+3122,Philippines_Zone_II,500000,0,119,0.99995, ,0,Meter
+3123,Philippines_Zone_III,500000,0,121,0.99995, ,0,Meter
+3124,Philippines_Zone_IV,500000,0,123,0.99995, ,0,Meter
+3125,Philippines_Zone_V,500000,0,125,0.99995, ,0,Meter
+3126,ETRS_1989_ETRS-GK19FIN,500000,0,19,1, ,0,Meter
+3127,ETRS_1989_ETRS-GK20FIN,500000,0,20,1, ,0,Meter
+3128,ETRS_1989_ETRS-GK21FIN,500000,0,21,1, ,0,Meter
+3129,ETRS_1989_ETRS-GK22FIN,500000,0,22,1, ,0,Meter
+3130,ETRS_1989_ETRS-GK23FIN,500000,0,23,1, ,0,Meter
+3131,ETRS_1989_ETRS-GK24FIN,500000,0,24,1, ,0,Meter
+3132,ETRS_1989_ETRS-GK25FIN,500000,0,25,1, ,0,Meter
+3133,ETRS_1989_ETRS-GK26FIN,500000,0,26,1, ,0,Meter
+3134,ETRS_1989_ETRS-GK27FIN,500000,0,27,1, ,0,Meter
+3135,ETRS_1989_ETRS-GK28FIN,500000,0,28,1, ,0,Meter
+3136,ETRS_1989_ETRS-GK29FIN,500000,0,29,1, ,0,Meter
+3137,ETRS_1989_ETRS-GK30FIN,500000,0,30,1, ,0,Meter
+3138,ETRS_1989_ETRS-GK31FIN,500000,0,31,1, ,0,Meter
+3148,Indian_1960_UTM_Zone_48N,500000,0,105,0.9996, ,0,Meter
+3149,Indian_1960_UTM_Zone_49N,500000,0,111,0.9996, ,0,Meter
+3176,Indian_1960_TM_106NE,500000,0,106,0.9996, ,0,Meter
+3200,FD_1958_Iraq,1500000,1166200,45,32.5,0.998786408,32.5,Meter
+3294,WGS_1984_USGS_Transantarctic_Mountains,0,0,162,-76.66666667,-79.33333333,-78,Meter
+3296,RGPF_UTM_Zone_5S,500000,10000000,-153,0.9996, ,0,Meter
+3297,RGPF_UTM_Zone_6S,500000,10000000,-147,0.9996, ,0,Meter
+3298,RGPF_UTM_Zone_7S,500000,10000000,-141,0.9996, ,0,Meter
+3299,RGPF_UTM_Zone_8S,500000,10000000,-135,0.9996, ,0,Meter
+3300,Estonian_Coordinate_System_of_1992,500000,6375000,24,58,59.33333333,57.51755393,Meter
+3301,Estonia_1997_Estonia_National_Grid,500000,6375000,24,58,59.33333333,57.51755393,Meter
+3302,IGN63_Hiva_Oa_UTM_Zone_7S,500000,10000000,-141,0.9996, ,0,Meter
+3303,Fatu_Iva_1972_UTM_Zone_7S,500000,10000000,-141,0.9996, ,0,Meter
+3304,Tahiti_1979_UTM_Zone_6S,500000,10000000,-147,0.9996, ,0,Meter
+3305,Moorea_1987_UTM_Zone_6S,500000,10000000,-147,0.9996, ,0,Meter
+3306,Maupiti_1983_UTM_Zone_5S,500000,10000000,-153,0.9996, ,0,Meter
+3307,Nakhl-e_Ghanem_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
+3308,GDA_1994_NSW_lambert,9300000,4500000,147,-30.75,-35.75,-33.25,Meter
+3309,NAD_1927_California_Teale_Albers,0,-4000000,-120,34,40.5,0,Meter
+3310,NAD_1983_California_Teale_Albers,0,-4000000,-120,34,40.5,0,Meter
+3311,NAD_1983_HARN_California_Teale_Albers,0,-4000000,-120,34,40.5,0,Meter
+3312,CSG_1967_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+3313,RGFG_1995_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+3314,Katanga_1955_Katanga_Lambert,0,0,26,-6.5,-11.5,0,Meter
+3315,Katanga_1955_Katanga_TM,0,0,26,0.9998, ,-9,Meter
+3316,Kasai_1953_Congo_TM_Zone_22,500000,10000000,22,0.9999, ,0,Meter
+3317,Kasai_1953_Congo_TM_Zone_24,500000,10000000,24,0.9999, ,0,Meter
+3318,IGC_1962_Congo_TM_Zone_12,500000,10000000,12,0.9999, ,0,Meter
+3319,IGC_1962_Congo_TM_Zone_14,500000,10000000,14,0.9999, ,0,Meter
+3320,IGC_1962_Congo_TM_Zone_16,500000,10000000,16,0.9999, ,0,Meter
+3321,IGC_1962_Congo_TM_Zone_18,500000,10000000,18,0.9999, ,0,Meter
+3322,IGC_1962_Congo_TM_Zone_20,500000,10000000,20,0.9999, ,0,Meter
+3323,IGC_1962_Congo_TM_Zone_22,500000,10000000,22,0.9999, ,0,Meter
+3324,IGC_1962_Congo_TM_Zone_24,500000,10000000,24,0.9999, ,0,Meter
+3325,IGC_1962_Congo_TM_Zone_26,500000,10000000,26,0.9999, ,0,Meter
+3326,IGC_1962_Congo_TM_Zone_28,500000,10000000,28,0.9999, ,0,Meter
+3327,IGC_1962_Congo_TM_Zone_30,500000,10000000,30,0.9999, ,0,Meter
+3328,Pulkovo_1942_Adj_1958_GUGiK-80,500000,500000,19.16666667,0.99714, ,52.16666667,Meter
+3329,Pulkovo_1942_Adj_1958_3_Degree_GK_Zone_5,5500000,0,15,1, ,0,Meter
+3330,Pulkovo_1942_Adj_1958_3_Degree_GK_Zone_6,6500000,0,18,1, ,0,Meter
+3331,Pulkovo_1942_Adj_1958_3_Degree_GK_Zone_7,7500000,0,21,1, ,0,Meter
+3332,Pulkovo_1942_Adj_1958_3_Degree_GK_Zone_8,8500000,0,24,1, ,0,Meter
+3333,Pulkovo_1942_Adj_1958_GK_Zone_3,3500000,0,15,1, ,0,Meter
+3334,Pulkovo_1942_Adj_1958_GK_Zone_4,4500000,0,21,1, ,0,Meter
+3335,Pulkovo_1942_Adj_1958_GK_Zone_5,5500000,0,27,1, ,0,Meter
+3336,Kerguelen_Island_1949_UTM_42S,500000,10000000,69,0.9996, ,0,Meter
+3339,IGCB_1955_Congo_TM_Zone_12,500000,10000000,12,0.9999, ,0,Meter
+3340,IGCB_1955_Congo_TM_Zone_14,500000,10000000,14,0.9999, ,0,Meter
+3341,IGCB_1955_Congo_TM_Zone_16,500000,10000000,16,0.9999, ,0,Meter
+3342,IGCB_1955_UTM_Zone_33S,500000,10000000,15,0.9996, ,0,Meter
+3343,Mauritania_1999_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+3344,Mauritania_1999_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
+3345,Mauritania_1999_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
+3347,NAD_1983_Statistics_Canada_Lambert,6200000,3000000,-91.86666667,49,77,63.390675,Meter
+3349,WGS_1984_PDC_Mercator,0,0,-150,0,,,Meter
+3350,Pulkovo_1942_CS63_Zone_K0,250000,0,21.95,1, ,0.1,Meter
+3351,Pulkovo_1942_CS63_Zone_K1,1250000,0,24.95,1, ,0.1,Meter
+3352,Pulkovo_1942_CS63_Zone_K2,2250000,0,27.95,1, ,0.1,Meter
+3353,Mhast_Onshore_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
+3354,Mhast_Offshore_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
+3355,Egypt_Gulf_of_Suez_S-650_TL_Red_Belt,615000,810000,31,1, ,30,Meter
+3356,Grand_Cayman_1959_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
+3357,Little_Cayman_1961_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
+3358,NAD_1983_HARN_StatePlane_North_Carolina_FIPS_3200,609601.2192,0,-79,34.33333333,36.16666667,33.75,Meter
+3359,NAD_1983_HARN_StatePlane_North_Carolina_FIPS_3200_Feet,2000000,0,-79,34.33333333,36.16666667,33.75,Foot_US
+3360,NAD_1983_HARN_StatePlane_South_Carolina_FIPS_3900,609600,0,-81,32.5,34.83333333,31.83333333,Meter
+3361,NAD_1983_HARN_StatePlane_South_Carolina_FIPS_3900_Feet_Intl,2000000,0,-81,32.5,34.83333333,31.83333333,Foot
+3362,NAD_1983_HARN_StatePlane_Pennsylvania_North_FIPS_3701,600000,0,-77.75,40.88333333,41.95,40.16666667,Meter
+3363,NAD_1983_HARN_StatePlane_Pennsylvania_North_FIPS_3701_Feet,1968500,0,-77.75,40.88333333,41.95,40.16666667,Foot_US
+3364,NAD_1983_HARN_StatePlane_Pennsylvania_South_FIPS_3702,600000,0,-77.75,39.93333333,40.96666667,39.33333333,Meter
+3365,NAD_1983_HARN_StatePlane_Pennsylvania_South_FIPS_3702_Feet,1968500,0,-77.75,39.93333333,40.96666667,39.33333333,Foot_US
+3366,Hong_Kong_1963_Grid,132033.92,62565.96,114.1785556,1, ,22.31213333,Foot_Clarke
+3370,NAD_1927_UTM_Zone_59N,500000,0,171,0.9996, ,0,Meter
+3371,NAD_1927_UTM_Zone_60N,500000,0,177,0.9996, ,0,Meter
+3372,NAD_1983_UTM_Zone_59N,500000,0,171,0.9996, ,0,Meter
+3373,NAD_1983_UTM_Zone_60N,500000,0,177,0.9996, ,0,Meter
+3377,GDM_2000_State_Cassini_Johor,-14810.562,8758.32,103.4279362,1, ,2.121679744,Meter
+3378,GDM_2000_State_Cassini_Negeri_Sembilan_&_Melaka,3673.785,-4240.573,101.974905,1, ,2.682347636,Meter
+3379,GDM_2000_State_Cassini_Pahang,-7368.228,6485.858,102.368299,1, ,3.769388089,Meter
+3380,GDM_2000_State_Cassini_Selangor,-34836.161,56464.049,101.3891079,1, ,3.68464905,Meter
+3381,GDM_2000_State_Cassini_Terengganu,19594.245,3371.895,103.0702756,1, ,4.9762852,Meter
+3382,GDM_2000_State_Cassini_Pulau_Pinang_&_Seberang_Perai,-23.414,62.283,100.344377,1, ,5.421517542,Meter
+3383,GDM_2000_State_Cassini_Perlis,0,0,100.6363711,1, ,5.964672714,Meter
+3384,GDM_2000_State_Cassini_Perak,-1.769,133454.779,100.8154106,1, ,4.859063022,Meter
+3385,GDM_2000_State_Cassini_Kelantan,13227.851,8739.894,102.2952417,1, ,5.972543658,Meter
+3439,PDO_1993_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
+3440,PDO_1993_UTM_Zone_40N,500000,0,57,0.9996, ,0,Meter
+3561,Old_Hawaiian_StatePlane_Hawaii_1_FIPS_5101,500000,0,-155.5,0.999966667, ,18.83333333,Foot_US
+3562,Old_Hawaiian_StatePlane_Hawaii_2_FIPS_5102,500000,0,-156.6666667,0.999966667, ,20.33333333,Foot_US
+3563,Old_Hawaiian_StatePlane_Hawaii_3_FIPS_5103,500000,0,-158,0.99999, ,21.16666667,Foot_US
+3564,Old_Hawaiian_StatePlane_Hawaii_4_FIPS_5104,500000,0,-159.5,0.99999, ,21.83333333,Foot_US
+3565,Old_Hawaiian_StatePlane_Hawaii_5_FIPS_5105,500000,0,-160.1666667,1, ,21.66666667,Foot_US
+3920,Puerto_Rico_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+3991,Puerto_Rico_StatePlane_Puerto_Rico_FIPS_5201,500000,0,-66.43333333,18.03333333,18.43333333,17.83333333,Foot_US
+3992,Puerto_Rico_StatePlane_Virgin_Islands_St_Croix_FIPS_5202,500000,100000,-66.43333333,18.03333333,18.43333333,17.83333333,Foot_US
+20002,Pulkovo_1995_GK_Zone_2,2500000,0,9,1, ,0,Meter
+20003,Pulkovo_1995_GK_Zone_3,3500000,0,15,1, ,0,Meter
+20004,Pulkovo_1995_GK_Zone_4,4500000,0,21,1, ,0,Meter
+20005,Pulkovo_1995_GK_Zone_5,5500000,0,27,1, ,0,Meter
+20006,Pulkovo_1995_GK_Zone_6,6500000,0,33,1, ,0,Meter
+20007,Pulkovo_1995_GK_Zone_7,7500000,0,39,1, ,0,Meter
+20008,Pulkovo_1995_GK_Zone_8,8500000,0,45,1, ,0,Meter
+20009,Pulkovo_1995_GK_Zone_9,9500000,0,51,1, ,0,Meter
+20010,Pulkovo_1995_GK_Zone_10,10500000,0,57,1, ,0,Meter
+20011,Pulkovo_1995_GK_Zone_11,11500000,0,63,1, ,0,Meter
+20012,Pulkovo_1995_GK_Zone_12,12500000,0,69,1, ,0,Meter
+20013,Pulkovo_1995_GK_Zone_13,13500000,0,75,1, ,0,Meter
+20014,Pulkovo_1995_GK_Zone_14,14500000,0,81,1, ,0,Meter
+20015,Pulkovo_1995_GK_Zone_15,15500000,0,87,1, ,0,Meter
+20016,Pulkovo_1995_GK_Zone_16,16500000,0,93,1, ,0,Meter
+20017,Pulkovo_1995_GK_Zone_17,17500000,0,99,1, ,0,Meter
+20018,Pulkovo_1995_GK_Zone_18,18500000,0,105,1, ,0,Meter
+20019,Pulkovo_1995_GK_Zone_19,19500000,0,111,1, ,0,Meter
+20020,Pulkovo_1995_GK_Zone_20,20500000,0,117,1, ,0,Meter
+20021,Pulkovo_1995_GK_Zone_21,21500000,0,123,1, ,0,Meter
+20022,Pulkovo_1995_GK_Zone_22,22500000,0,129,1, ,0,Meter
+20023,Pulkovo_1995_GK_Zone_23,23500000,0,135,1, ,0,Meter
+20024,Pulkovo_1995_GK_Zone_24,24500000,0,141,1, ,0,Meter
+20025,Pulkovo_1995_GK_Zone_25,25500000,0,147,1, ,0,Meter
+20026,Pulkovo_1995_GK_Zone_26,26500000,0,153,1, ,0,Meter
+20027,Pulkovo_1995_GK_Zone_27,27500000,0,159,1, ,0,Meter
+20028,Pulkovo_1995_GK_Zone_28,28500000,0,165,1, ,0,Meter
+20029,Pulkovo_1995_GK_Zone_29,29500000,0,171,1, ,0,Meter
+20030,Pulkovo_1995_GK_Zone_30,30500000,0,177,1, ,0,Meter
+20031,Pulkovo_1995_GK_Zone_31,31500000,0,-177,1, ,0,Meter
+20032,Pulkovo_1995_GK_Zone_32,32500000,0,-171,1, ,0,Meter
+20062,Pulkovo_1995_GK_Zone_2N,500000,0,9,1, ,0,Meter
+20063,Pulkovo_1995_GK_Zone_3N,500000,0,15,1, ,0,Meter
+20064,Pulkovo_1995_GK_Zone_4N,500000,0,21,1, ,0,Meter
+20065,Pulkovo_1995_GK_Zone_5N,500000,0,27,1, ,0,Meter
+20066,Pulkovo_1995_GK_Zone_6N,500000,0,33,1, ,0,Meter
+20067,Pulkovo_1995_GK_Zone_7N,500000,0,39,1, ,0,Meter
+20068,Pulkovo_1995_GK_Zone_8N,500000,0,45,1, ,0,Meter
+20069,Pulkovo_1995_GK_Zone_9N,500000,0,51,1, ,0,Meter
+20070,Pulkovo_1995_GK_Zone_10N,500000,0,57,1, ,0,Meter
+20071,Pulkovo_1995_GK_Zone_11N,500000,0,63,1, ,0,Meter
+20072,Pulkovo_1995_GK_Zone_12N,500000,0,69,1, ,0,Meter
+20073,Pulkovo_1995_GK_Zone_13N,500000,0,75,1, ,0,Meter
+20074,Pulkovo_1995_GK_Zone_14N,500000,0,81,1, ,0,Meter
+20075,Pulkovo_1995_GK_Zone_15N,500000,0,87,1, ,0,Meter
+20076,Pulkovo_1995_GK_Zone_16N,500000,0,93,1, ,0,Meter
+20077,Pulkovo_1995_GK_Zone_17N,500000,0,99,1, ,0,Meter
+20078,Pulkovo_1995_GK_Zone_18N,500000,0,105,1, ,0,Meter
+20079,Pulkovo_1995_GK_Zone_19N,500000,0,111,1, ,0,Meter
+20080,Pulkovo_1995_GK_Zone_20N,500000,0,117,1, ,0,Meter
+20081,Pulkovo_1995_GK_Zone_21N,500000,0,123,1, ,0,Meter
+20082,Pulkovo_1995_GK_Zone_22N,500000,0,129,1, ,0,Meter
+20083,Pulkovo_1995_GK_Zone_23N,500000,0,135,1, ,0,Meter
+20084,Pulkovo_1995_GK_Zone_24N,500000,0,141,1, ,0,Meter
+20085,Pulkovo_1995_GK_Zone_25N,500000,0,147,1, ,0,Meter
+20086,Pulkovo_1995_GK_Zone_26N,500000,0,153,1, ,0,Meter
+20087,Pulkovo_1995_GK_Zone_27N,500000,0,159,1, ,0,Meter
+20088,Pulkovo_1995_GK_Zone_28N,500000,0,165,1, ,0,Meter
+20089,Pulkovo_1995_GK_Zone_29N,500000,0,171,1, ,0,Meter
+20090,Pulkovo_1995_GK_Zone_30N,500000,0,177,1, ,0,Meter
+20091,Pulkovo_1995_GK_Zone_31N,500000,0,-177,1, ,0,Meter
+20092,Pulkovo_1995_GK_Zone_32N,500000,0,-171,1, ,0,Meter
+20135,Adindan_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
+20136,Adindan_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
+20137,Adindan_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
+20138,Adindan_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
+20248,AGD_1966_AMG_Zone_48,500000,10000000,105,0.9996, ,0,Meter
+20249,AGD_1966_AMG_Zone_49,500000,10000000,111,0.9996, ,0,Meter
+20250,AGD_1966_AMG_Zone_50,500000,10000000,117,0.9996, ,0,Meter
+20251,AGD_1966_AMG_Zone_51,500000,10000000,123,0.9996, ,0,Meter
+20252,AGD_1966_AMG_Zone_52,500000,10000000,129,0.9996, ,0,Meter
+20253,AGD_1966_AMG_Zone_53,500000,10000000,135,0.9996, ,0,Meter
+20254,AGD_1966_AMG_Zone_54,500000,10000000,141,0.9996, ,0,Meter
+20255,AGD_1966_AMG_Zone_55,500000,10000000,147,0.9996, ,0,Meter
+20256,AGD_1966_AMG_Zone_56,500000,10000000,153,0.9996, ,0,Meter
+20257,AGD_1966_AMG_Zone_57,500000,10000000,159,0.9996, ,0,Meter
+20258,AGD_1966_AMG_Zone_58,500000,10000000,165,0.9996, ,0,Meter
+20348,AGD_1984_AMG_Zone_48,500000,10000000,105,0.9996, ,0,Meter
+20349,AGD_1984_AMG_Zone_49,500000,10000000,111,0.9996, ,0,Meter
+20350,AGD_1984_AMG_Zone_50,500000,10000000,117,0.9996, ,0,Meter
+20351,AGD_1984_AMG_Zone_51,500000,10000000,123,0.9996, ,0,Meter
+20352,AGD_1984_AMG_Zone_52,500000,10000000,129,0.9996, ,0,Meter
+20353,AGD_1984_AMG_Zone_53,500000,10000000,135,0.9996, ,0,Meter
+20354,AGD_1984_AMG_Zone_54,500000,10000000,141,0.9996, ,0,Meter
+20355,AGD_1984_AMG_Zone_55,500000,10000000,147,0.9996, ,0,Meter
+20356,AGD_1984_AMG_Zone_56,500000,10000000,153,0.9996, ,0,Meter
+20357,AGD_1984_AMG_Zone_57,500000,10000000,159,0.9996, ,0,Meter
+20358,AGD_1984_AMG_Zone_58,500000,10000000,165,0.9996, ,0,Meter
+20436,Ain_el_Abd_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
+20437,Ain_el_Abd_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
+20438,Ain_el_Abd_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
+20439,Ain_el_Abd_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
+20440,Ain_el_Abd_UTM_Zone_40N,500000,0,57,0.9996, ,0,Meter
+20499,Bahrain_State_Grid,500000,0,51,0.9996, ,0,Meter
+20538,Afgooye_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
+20539,Afgooye_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
+20790,Portuguese_National_Grid,200000,300000,1,1, ,39.66666667,Meter
+20822,Aratu_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
+20823,Aratu_UTM_Zone_23S,500000,10000000,-45,0.9996, ,0,Meter
+20824,Aratu_UTM_Zone_24S,500000,10000000,-39,0.9996, ,0,Meter
+20934,Arc_1950_UTM_Zone_34S,500000,10000000,21,0.9996, ,0,Meter
+20935,Arc_1950_UTM_Zone_35S,500000,10000000,27,0.9996, ,0,Meter
+20936,Arc_1950_UTM_Zone_36S,500000,10000000,33,0.9996, ,0,Meter
+21035,Arc_1960_UTM_Zone_35S,500000,10000000,27,0.9996, ,0,Meter
+21036,Arc_1960_UTM_Zone_36S,500000,10000000,33,0.9996, ,0,Meter
+21037,Arc_1960_UTM_Zone_37S,500000,10000000,39,0.9996, ,0,Meter
+21095,Arc_1960_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
+21096,Arc_1960_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
+21097,Arc_1960_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
+21148,Batavia_UTM_Zone_48S,500000,10000000,105,0.9996, ,0,Meter
+21149,Batavia_UTM_Zone_49S,500000,10000000,111,0.9996, ,0,Meter
+21150,Batavia_UTM_Zone_50S,500000,10000000,117,0.9996, ,0,Meter
+21291,Barbados_1938_British_West_Indies_Grid,400000,0,-62,0.9995, ,0,Meter
+21292,Barbados_1938_Barbados_Grid,30000,75000,-59.55972222,0.9999986, ,13.17638889,Meter
+21413,Beijing_1954_GK_Zone_13,13500000,0,75,1, ,0,Meter
+21414,Beijing_1954_GK_Zone_14,14500000,0,81,1, ,0,Meter
+21415,Beijing_1954_GK_Zone_15,15500000,0,87,1, ,0,Meter
+21416,Beijing_1954_GK_Zone_16,16500000,0,93,1, ,0,Meter
+21417,Beijing_1954_GK_Zone_17,17500000,0,99,1, ,0,Meter
+21418,Beijing_1954_GK_Zone_18,18500000,0,105,1, ,0,Meter
+21419,Beijing_1954_GK_Zone_19,19500000,0,111,1, ,0,Meter
+21420,Beijing_1954_GK_Zone_20,20500000,0,117,1, ,0,Meter
+21421,Beijing_1954_GK_Zone_21,21500000,0,123,1, ,0,Meter
+21422,Beijing_1954_GK_Zone_22,22500000,0,129,1, ,0,Meter
+21423,Beijing_1954_GK_Zone_23,23500000,0,135,1, ,0,Meter
+21473,Beijing_1954_GK_Zone_13N,500000,0,75,1, ,0,Meter
+21474,Beijing_1954_GK_Zone_14N,500000,0,81,1, ,0,Meter
+21475,Beijing_1954_GK_Zone_15N,500000,0,87,1, ,0,Meter
+21476,Beijing_1954_GK_Zone_16N,500000,0,93,1, ,0,Meter
+21477,Beijing_1954_GK_Zone_17N,500000,0,99,1, ,0,Meter
+21478,Beijing_1954_GK_Zone_18N,500000,0,105,1, ,0,Meter
+21479,Beijing_1954_GK_Zone_19N,500000,0,111,1, ,0,Meter
+21480,Beijing_1954_GK_Zone_20N,500000,0,117,1, ,0,Meter
+21481,Beijing_1954_GK_Zone_21N,500000,0,123,1, ,0,Meter
+21482,Beijing_1954_GK_Zone_22N,500000,0,129,1, ,0,Meter
+21483,Beijing_1954_GK_Zone_23N,500000,0,135,1, ,0,Meter
+21500,Belge_Lambert_1950,150000,5400000,0,49.83333333,51.16666667,90,Meter
+21780,Bern_1898_Bern_LV03C,0,0,1,90,0,46.95240556,Meter
+21781,CH1903_LV03,600000,200000,1,90,7.439583333,46.95240556,Meter
+21817,Bogota_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
+21818,Bogota_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+21891,Colombia_West_Zone,1000000,1000000,-77.08091667,1, ,4.599047222,Meter
+21892,Colombia_Bogota_Zone,1000000,1000000,-74.08091667,1, ,4.599047222,Meter
+21893,Colombia_East_Central_Zone,1000000,1000000,-71.08091667,1, ,4.599047222,Meter
+21894,Colombia_East_Zone,1000000,1000000,-68.08091667,1, ,4.599047222,Meter
+21896,Colombia_West_Zone,1000000,1000000,-77.08091667,1, ,4.599047222,Meter
+21897,Colombia_Bogota_Zone,1000000,1000000,-74.08091667,1, ,4.599047222,Meter
+21898,Colombia_East_Central_Zone,1000000,1000000,-71.08091667,1, ,4.599047222,Meter
+21899,Colombia_East_Zone,1000000,1000000,-68.08091667,1, ,4.599047222,Meter
+22032,Camacupa_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
+22033,Camacupa_UTM_Zone_33S,500000,10000000,15,0.9996, ,0,Meter
+22091,Camacupa_TM_11_30_SE,500000,10000000,11.5,0.9996, ,0,Meter
+22092,Camacupa_TM_12_SE,500000,10000000,12,0.9996, ,0,Meter
+22171,POSGAR_1998_Argentina_Zone_1,1500000,0,-72,1, ,-90,Meter
+22172,POSGAR_1998_Argentina_Zone_2,2500000,0,-69,1, ,-90,Meter
+22173,POSGAR_1998_Argentina_Zone_3,3500000,0,-66,1, ,-90,Meter
+22174,POSGAR_1998_Argentina_Zone_4,4500000,0,-63,1, ,-90,Meter
+22175,POSGAR_1998_Argentina_Zone_5,5500000,0,-60,1, ,-90,Meter
+22176,POSGAR_1998_Argentina_Zone_6,6500000,0,-57,1, ,-90,Meter
+22177,POSGAR_1998_Argentina_Zone_7,7500000,0,-54,1, ,-90,Meter
+22181,POSGAR_1994_Argentina_Zone_1,1500000,0,-72,1, ,-90,Meter
+22182,POSGAR_1994_Argentina_Zone_2,2500000,0,-69,1, ,-90,Meter
+22183,POSGAR_1994_Argentina_Zone_3,3500000,0,-66,1, ,-90,Meter
+22184,POSGAR_1994_Argentina_Zone_4,4500000,0,-63,1, ,-90,Meter
+22185,POSGAR_1994_Argentina_Zone_5,5500000,0,-60,1, ,-90,Meter
+22186,POSGAR_1994_Argentina_Zone_6,6500000,0,-57,1, ,-90,Meter
+22187,POSGAR_1994_Argentina_Zone_7,7500000,0,-54,1, ,-90,Meter
+22191,Argentina_Zone_1,1500000,0,-72,1, ,-90,Meter
+22192,Argentina_Zone_2,2500000,0,-69,1, ,-90,Meter
+22193,Argentina_Zone_3,3500000,0,-66,1, ,-90,Meter
+22194,Argentina_Zone_4,4500000,0,-63,1, ,-90,Meter
+22195,Argentina_Zone_5,5500000,0,-60,1, ,-90,Meter
+22196,Argentina_Zone_6,6500000,0,-57,1, ,-90,Meter
+22197,Argentina_Zone_7,7500000,0,-54,1, ,-90,Meter
+22234,Cape_UTM_Zone_34S,500000,10000000,21,0.9996, ,0,Meter
+22235,Cape_UTM_Zone_35S,500000,10000000,27,0.9996, ,0,Meter
+22236,Cape_UTM_Zone_36S,500000,10000000,33,0.9996, ,0,Meter
+22332,Carthage_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
+22391,Nord_Tunisie,500000,300000,11,40,0.999625544,40,Meter
+22392,Sud_Tunisie,500000,300000,11,37,0.999625769,37,Meter
+22521,Corrego_Alegre_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
+22522,Corrego_Alegre_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
+22523,Corrego_Alegre_UTM_Zone_23S,500000,10000000,-45,0.9996, ,0,Meter
+22524,Corrego_Alegre_UTM_Zone_24S,500000,10000000,-39,0.9996, ,0,Meter
+22525,Corrego_Alegre_UTM_Zone_25S,500000,10000000,-33,0.9996, ,0,Meter
+22700,Deir_ez_Zor_Levant_Zone,0,0,39.15,0.9995341, ,34.2,Meter
+22770,Deir_ez_Zor_Syria_Lambert,300000,300000,37.35,34.65,0.9996256,34.65,Meter
+22780,Deir_ez_Zor_Levant_Stereographic,0,0,39.15,0.9995341, ,34.2,Meter
+22832,Douala_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
+22991,Egypt_Blue_Belt,300000,1100000,35,1, ,30,Meter
+22992,Egypt_Red_Belt,615000,810000,31,1, ,30,Meter
+22993,Egypt_Purple_Belt,700000,200000,27,1, ,30,Meter
+22994,Egypt_Extended_Purple_Belt,700000,1200000,27,1, ,30,Meter
+23028,ED_1950_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+23029,ED_1950_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
+23030,ED_1950_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
+23031,ED_1950_UTM_Zone_31N,500000,0,3,0.9996, ,0,Meter
+23032,ED_1950_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
+23033,ED_1950_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
+23034,ED_1950_UTM_Zone_34N,500000,0,21,0.9996, ,0,Meter
+23035,ED_1950_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
+23036,ED_1950_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
+23037,ED_1950_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
+23038,ED_1950_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
+23090,ED_1950_TM_0_N,500000,0,0,0.9996, ,0,Meter
+23095,ED_1950_TM_5_NE,500000,0,5,0.9996, ,0,Meter
+23239,Fahud_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
+23240,Fahud_UTM_Zone_40N,500000,0,57,0.9996, ,0,Meter
+23433,Garoua_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
+23700,Hungarian_1972_Egyseges_Orszagos_Vetuleti,650000,200000,0.99993,90,19.04857178,47.14439372,Meter
+23846,Indonesian_1974_UTM_Zone_46N,500000,0,93,0.9996, ,0,Meter
+23847,Indonesian_1974_UTM_Zone_47N,500000,0,99,0.9996, ,0,Meter
+23848,Indonesian_1974_UTM_Zone_48N,500000,0,105,0.9996, ,0,Meter
+23849,Indonesian_1974_UTM_Zone_49N,500000,0,111,0.9996, ,0,Meter
+23850,Indonesian_1974_UTM_Zone_50N,500000,0,117,0.9996, ,0,Meter
+23851,Indonesian_1974_UTM_Zone_51N,500000,0,123,0.9996, ,0,Meter
+23852,Indonesian_1974_UTM_Zone_52N,500000,0,129,0.9996, ,0,Meter
+23853,Indonesian_1974_UTM_Zone_53N,500000,0,135,0.9996, ,0,Meter
+23886,Indonesian_1974_UTM_Zone_46S,500000,10000000,93,0.9996, ,0,Meter
+23887,Indonesian_1974_UTM_Zone_47S,500000,10000000,99,0.9996, ,0,Meter
+23888,Indonesian_1974_UTM_Zone_48S,500000,10000000,105,0.9996, ,0,Meter
+23889,Indonesian_1974_UTM_Zone_49S,500000,10000000,111,0.9996, ,0,Meter
+23890,Indonesian_1974_UTM_Zone_50S,500000,10000000,117,0.9996, ,0,Meter
+23891,Indonesian_1974_UTM_Zone_51S,500000,10000000,123,0.9996, ,0,Meter
+23892,Indonesian_1974_UTM_Zone_52S,500000,10000000,129,0.9996, ,0,Meter
+23893,Indonesian_1974_UTM_Zone_53S,500000,10000000,135,0.9996, ,0,Meter
+23894,Indonesian_1974_UTM_Zone_54S,500000,10000000,141,0.9996, ,0,Meter
+23946,Indian_1954_UTM_Zone_46N,500000,0,93,0.9996, ,0,Meter
+23947,Indian_1954_UTM_Zone_47N,500000,0,99,0.9996, ,0,Meter
+23948,Indian_1954_UTM_Zone_48N,500000,0,105,0.9996, ,0,Meter
+24047,Indian_1975_UTM_Zone_47N,500000,0,99,0.9996, ,0,Meter
+24048,Indian_1975_UTM_Zone_48N,500000,0,105,0.9996, ,0,Meter
+24100,Jamaica_1875_Old_Grid,550000,400000,-77,18,1,18,Meter
+24200,Jamaica_Grid,250000,150000,-77,18,1,18,Meter
+24305,Kalianpur_1937_UTM_Zone_45N,500000,0,87,0.9996, ,0,Meter
+24306,Kalianpur_1937_UTM_Zone_46N,500000,0,93,0.9996, ,0,Meter
+24311,Kalianpur_1962_UTM_Zone_41N,500000,0,63,0.9996, ,0,Meter
+24312,Kalianpur_1962_UTM_Zone_42N,500000,0,69,0.9996, ,0,Meter
+24313,Kalianpur_1962_UTM_Zone_43N,500000,0,75,0.9996, ,0,Meter
+24342,Kalianpur_1975_UTM_Zone_42N,500000,0,69,0.9996, ,0,Meter
+24343,Kalianpur_1975_UTM_Zone_43N,500000,0,75,0.9996, ,0,Meter
+24344,Kalianpur_1975_UTM_Zone_44N,500000,0,81,0.9996, ,0,Meter
+24345,Kalianpur_1975_UTM_Zone_45N,500000,0,87,0.9996, ,0,Meter
+24346,Kalianpur_1975_UTM_Zone_46N,500000,0,93,0.9996, ,0,Meter
+24347,Kalianpur_1975_UTM_Zone_47N,500000,0,99,0.9996, ,0,Meter
+24370,Kalianpur_1880_India_Zone_0,2355500,2590000,68,39.5,0.99846154,39.5,Yard_Indian
+24371,Kalianpur_1880_India_Zone_I,3000000,1000000,68,32.5,0.99878641,32.5,Yard_Indian
+24372,Kalianpur_1880_India_Zone_IIa,3000000,1000000,74,26,0.99878641,26,Yard_Indian
+24373,Kalianpur_1880_India_Zone_III,3000000,1000000,80,19,0.99878641,19,Yard_Indian
+24374,Kalianpur_1880_India_Zone_IV,3000000,1000000,80,12,0.99878641,12,Yard_Indian
+24375,Kalianpur_1937_India_Zone_IIb,2743195.5,914398.5,90,26,0.99878641,26,Meter
+24376,Kalianpur_1962_India_Zone_I,2743196.4,914398.8,68,32.5,0.99878641,32.5,Meter
+24377,Kalianpur_1962_India_Zone_IIa,2743196.4,914398.8,74,26,0.99878641,26,Meter
+24378,Kalianpur_1975_India_Zone_I,2743185.69,914395.23,68,32.5,0.99878641,32.5,Meter
+24379,Kalianpur_1975_India_Zone_IIa,2743185.69,914395.23,74,26,0.99878641,26,Meter
+24380,Kalianpur_1975_India_Zone_IIb,2743185.69,914395.23,90,26,0.99878641,26,Meter
+24381,Kalianpur_1975_India_Zone_III,2743185.69,914395.23,80,19,0.99878641,19,Meter
+24382,Kalianpur_1880_India_Zone_IIb,3000000,1000000,90,26,0.99878641,26,Yard_Indian
+24383,Kalianpur_1975_India_Zone_IV,2743185.69,914395.23,80,12,0.99878641,12,Meter
+24500,Kertau_Singapore_Grid,30000,30000,103.8530022,1, ,1.287646667,Meter
+24547,Kertau_UTM_Zone_47N,500000,0,99,0.9996, ,0,Meter
+24548,Kertau_UTM_Zone_48N,500000,0,105,0.9996, ,0,Meter
+24600,KOC_Lambert,1500000,1166200,45,32.5,0.998786408,32.5,Meter
+24718,La_Canoa_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+24719,La_Canoa_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
+24720,La_Canoa_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+24721,La_Canoa_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+24817,PSAD_1956_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
+24818,PSAD_1956_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+24819,PSAD_1956_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
+24820,PSAD_1956_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+24821,PSAD_1956_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+24877,PSAD_1956_UTM_Zone_17S,500000,10000000,-81,0.9996, ,0,Meter
+24878,PSAD_1956_UTM_Zone_18S,500000,10000000,-75,0.9996, ,0,Meter
+24879,PSAD_1956_UTM_Zone_19S,500000,10000000,-69,0.9996, ,0,Meter
+24880,PSAD_1956_UTM_Zone_20S,500000,10000000,-63,0.9996, ,0,Meter
+24881,PSAD_1956_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
+24882,PSAD_1956_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
+24891,Peru_West_Zone,222000,1426834.743,-80.5,0.99983008, ,-6,Meter
+24892,Peru_Central_Zone,720000,1039979.159,-76,0.99932994, ,-9.5,Meter
+24893,Peru_East_Zone,1324000,1040084.558,-70.5,0.99952992, ,-9.5,Meter
+25000,Ghana_Metre_Grid,274319.51,0,-1,0.99975, ,4.666666667,Meter
+25231,Lome_UTM_Zone_31N,500000,0,3,0.9996, ,0,Meter
+25391,Philippines_Zone_I,500000,0,117,0.99995, ,0,Meter
+25392,Philippines_Zone_II,500000,0,119,0.99995, ,0,Meter
+25393,Philippines_Zone_III,500000,0,121,0.99995, ,0,Meter
+25394,Philippines_Zone_IV,500000,0,123,0.99995, ,0,Meter
+25395,Philippines_Zone_V,500000,0,125,0.99995, ,0,Meter
+25828,ETRS_1989_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+25829,ETRS_1989_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
+25830,ETRS_1989_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
+25831,ETRS_1989_UTM_Zone_31N,500000,0,3,0.9996, ,0,Meter
+25832,ETRS_1989_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
+25833,ETRS_1989_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
+25834,ETRS_1989_UTM_Zone_34N,500000,0,21,0.9996, ,0,Meter
+25835,ETRS_1989_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
+25836,ETRS_1989_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
+25837,ETRS_1989_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
+25838,ETRS_1989_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
+25884,ETRS_1989_TM_Baltic_1993,500000,0,24,0.9996, ,0,Meter
+25932,Malongo_1987_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
+26191,Nord_Maroc,500000,300000,-6,37,0.999625769,37,Meter
+26192,Sud_Maroc,500000,300000,-6,33,0.999615596,33,Meter
+26193,Sahara,1200000,400000,-6,29,0.9996,29,Meter
+26194,Merchich_Sahara_Nord,1200000,400000,-6,29,0.999616304,29,Meter
+26195,Merchich_Sahara_Sud,1500000,400000,-6,25,0.999616437,25,Meter
+26237,Massawa_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
+26331,Minna_UTM_Zone_31N,500000,0,3,0.9996, ,0,Meter
+26332,Minna_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
+26391,Nigeria_West_Belt,230738.26,0,4.5,0.99975, ,4,Meter
+26392,Nigeria_Mid_Belt,670553.98,0,8.5,0.99975, ,4,Meter
+26393,Nigeria_East_Belt,1110369.7,0,12.5,0.99975, ,4,Meter
+26432,Mhast_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
+26591,Monte_Mario_Rome_Italy_1,1500000,0,-3.45233333,0.9996, ,0,Meter
+26592,Monte_Mario_Rome_Italy_2,2520000,0,2.54766667,0.9996, ,0,Meter
+26632,Mporaloko_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
+26692,Mporaloko_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
+26701,NAD_1927_UTM_Zone_1N,500000,0,-177,0.9996, ,0,Meter
+26702,NAD_1927_UTM_Zone_2N,500000,0,-171,0.9996, ,0,Meter
+26703,NAD_1927_UTM_Zone_3N,500000,0,-165,0.9996, ,0,Meter
+26704,NAD_1927_UTM_Zone_4N,500000,0,-159,0.9996, ,0,Meter
+26705,NAD_1927_UTM_Zone_5N,500000,0,-153,0.9996, ,0,Meter
+26706,NAD_1927_UTM_Zone_6N,500000,0,-147,0.9996, ,0,Meter
+26707,NAD_1927_UTM_Zone_7N,500000,0,-141,0.9996, ,0,Meter
+26708,NAD_1927_UTM_Zone_8N,500000,0,-135,0.9996, ,0,Meter
+26709,NAD_1927_UTM_Zone_9N,500000,0,-129,0.9996, ,0,Meter
+26710,NAD_1927_UTM_Zone_10N,500000,0,-123,0.9996, ,0,Meter
+26711,NAD_1927_UTM_Zone_11N,500000,0,-117,0.9996, ,0,Meter
+26712,NAD_1927_UTM_Zone_12N,500000,0,-111,0.9996, ,0,Meter
+26713,NAD_1927_UTM_Zone_13N,500000,0,-105,0.9996, ,0,Meter
+26714,NAD_1927_UTM_Zone_14N,500000,0,-99,0.9996, ,0,Meter
+26715,NAD_1927_UTM_Zone_15N,500000,0,-93,0.9996, ,0,Meter
+26716,NAD_1927_UTM_Zone_16N,500000,0,-87,0.9996, ,0,Meter
+26717,NAD_1927_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
+26718,NAD_1927_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+26719,NAD_1927_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
+26720,NAD_1927_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+26721,NAD_1927_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+26722,NAD_1927_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
+26729,NAD_1927_StatePlane_Alabama_East_FIPS_0101,500000,0,-85.83333333,0.99996, ,30.5,Foot_US
+26730,NAD_1927_StatePlane_Alabama_West_FIPS_0102,500000,0,-87.5,0.999933333, ,30,Foot_US
+26731,NAD_1927_StatePlane_Alaska_1_FIPS_5001,16404166.67,-16404166.67,0.9999,-36.86989765,-133.6666667,57,Foot_US
+26732,NAD_1927_StatePlane_Alaska_2_FIPS_5002,500000,0,-142,0.9999, ,54,Foot_US
+26733,NAD_1927_StatePlane_Alaska_3_FIPS_5003,500000,0,-146,0.9999, ,54,Foot_US
+26734,NAD_1927_StatePlane_Alaska_4_FIPS_5004,500000,0,-150,0.9999, ,54,Foot_US
+26735,NAD_1927_StatePlane_Alaska_5_FIPS_5005,500000,0,-154,0.9999, ,54,Foot_US
+26736,NAD_1927_StatePlane_Alaska_6_FIPS_5006,500000,0,-158,0.9999, ,54,Foot_US
+26737,NAD_1927_StatePlane_Alaska_7_FIPS_5007,700000,0,-162,0.9999, ,54,Foot_US
+26738,NAD_1927_StatePlane_Alaska_8_FIPS_5008,500000,0,-166,0.9999, ,54,Foot_US
+26739,NAD_1927_StatePlane_Alaska_9_FIPS_5009,600000,0,-170,0.9999, ,54,Foot_US
+26740,NAD_1927_StatePlane_Alaska_10_FIPS_5010,3000000,0,-176,51.83333333,53.83333333,51,Foot_US
+26741,NAD_1927_StatePlane_California_I_FIPS_0401,2000000,0,-122,40,41.66666667,39.33333333,Foot_US
+26742,NAD_1927_StatePlane_California_II_FIPS_0402,2000000,0,-122,38.33333333,39.83333333,37.66666667,Foot_US
+26743,NAD_1927_StatePlane_California_III_FIPS_0403,2000000,0,-120.5,37.06666667,38.43333333,36.5,Foot_US
+26744,NAD_1927_StatePlane_California_IV_FIPS_0404,2000000,0,-119,36,37.25,35.33333333,Foot_US
+26745,NAD_1927_StatePlane_California_V_FIPS_0405,2000000,0,-118,34.03333333,35.46666667,33.5,Foot_US
+26746,NAD_1927_StatePlane_California_VI_FIPS_0406,2000000,0,-116.25,32.78333333,33.88333333,32.16666667,Foot_US
+26748,NAD_1927_StatePlane_Arizona_East_FIPS_0201,500000,0,-110.1666667,0.9999, ,31,Foot_US
+26749,NAD_1927_StatePlane_Arizona_Central_FIPS_0202,500000,0,-111.9166667,0.9999, ,31,Foot_US
+26750,NAD_1927_StatePlane_Arizona_West_FIPS_0203,500000,0,-113.75,0.999933333, ,31,Foot_US
+26751,NAD_1927_StatePlane_Arkansas_North_FIPS_0301,2000000,0,-92,34.93333333,36.23333333,34.33333333,Foot_US
+26752,NAD_1927_StatePlane_Arkansas_South_FIPS_0302,2000000,0,-92,33.3,34.76666667,32.66666667,Foot_US
+26753,NAD_1927_StatePlane_Colorado_North_FIPS_0501,2000000,0,-105.5,39.71666667,40.78333333,39.33333333,Foot_US
+26754,NAD_1927_StatePlane_Colorado_Central_FIPS_0502,2000000,0,-105.5,38.45,39.75,37.83333333,Foot_US
+26755,NAD_1927_StatePlane_Colorado_South_FIPS_0503,2000000,0,-105.5,37.23333333,38.43333333,36.66666667,Foot_US
+26756,NAD_1927_StatePlane_Connecticut_FIPS_0600,600000,0,-72.75,41.2,41.86666667,40.83333333,Foot_US
+26757,NAD_1927_StatePlane_Delaware_FIPS_0700,500000,0,-75.41666667,0.999995, ,38,Foot_US
+26758,NAD_1927_StatePlane_Florida_East_FIPS_0901,500000,0,-81,0.999941176, ,24.33333333,Foot_US
+26759,NAD_1927_StatePlane_Florida_West_FIPS_0902,500000,0,-82,0.999941176, ,24.33333333,Foot_US
+26760,NAD_1927_StatePlane_Florida_North_FIPS_0903,2000000,0,-84.5,29.58333333,30.75,29,Foot_US
+26761,NAD_1927_StatePlane_Hawaii_1_FIPS_5101,500000,0,-155.5,0.999966667, ,18.83333333,Foot_US
+26762,NAD_1927_StatePlane_Hawaii_2_FIPS_5102,500000,0,-156.6666667,0.999966667, ,20.33333333,Foot_US
+26763,NAD_1927_StatePlane_Hawaii_3_FIPS_5103,500000,0,-158,0.99999, ,21.16666667,Foot_US
+26764,NAD_1927_StatePlane_Hawaii_4_FIPS_5104,500000,0,-159.5,0.99999, ,21.83333333,Foot_US
+26765,NAD_1927_StatePlane_Hawaii_5_FIPS_5105,500000,0,-160.1666667,1, ,21.66666667,Foot_US
+26766,NAD_1927_StatePlane_Georgia_East_FIPS_1001,500000,0,-82.16666667,0.9999, ,30,Foot_US
+26767,NAD_1927_StatePlane_Georgia_West_FIPS_1002,500000,0,-84.16666667,0.9999, ,30,Foot_US
+26768,NAD_1927_StatePlane_Idaho_East_FIPS_1101,500000,0,-112.1666667,0.999947368, ,41.66666667,Foot_US
+26769,NAD_1927_StatePlane_Idaho_Central_FIPS_1102,500000,0,-114,0.999947368, ,41.66666667,Foot_US
+26770,NAD_1927_StatePlane_Idaho_West_FIPS_1103,500000,0,-115.75,0.999933333, ,41.66666667,Foot_US
+26771,NAD_1927_StatePlane_Illinois_East_FIPS_1201,500000,0,-88.33333333,0.999975, ,36.66666667,Foot_US
+26772,NAD_1927_StatePlane_Illinois_West_FIPS_1202,500000,0,-90.16666667,0.999941176, ,36.66666667,Foot_US
+26773,NAD_1927_StatePlane_Indiana_East_FIPS_1301,500000,0,-85.66666667,0.999966667, ,37.5,Foot_US
+26774,NAD_1927_StatePlane_Indiana_West_FIPS_1302,500000,0,-87.08333333,0.999966667, ,37.5,Foot_US
+26775,NAD_1927_StatePlane_Iowa_North_FIPS_1401,2000000,0,-93.5,42.06666667,43.26666667,41.5,Foot_US
+26776,NAD_1927_StatePlane_Iowa_South_FIPS_1402,2000000,0,-93.5,40.61666667,41.78333333,40,Foot_US
+26777,NAD_1927_StatePlane_Kansas_North_FIPS_1501,2000000,0,-98,38.71666667,39.78333333,38.33333333,Foot_US
+26778,NAD_1927_StatePlane_Kansas_South_FIPS_1502,2000000,0,-98.5,37.26666667,38.56666667,36.66666667,Foot_US
+26779,NAD_1927_StatePlane_Kentucky_North_FIPS_1601,2000000,0,-84.25,37.96666667,38.96666667,37.5,Foot_US
+26780,NAD_1927_StatePlane_Kentucky_South_FIPS_1602,2000000,0,-85.75,36.73333333,37.93333333,36.33333333,Foot_US
+26781,NAD_1927_StatePlane_Louisiana_North_FIPS_1701,2000000,0,-92.5,31.16666667,32.66666667,30.66666667,Foot_US
+26782,NAD_1927_StatePlane_Louisiana_South_FIPS_1702,2000000,0,-91.33333333,29.3,30.7,28.66666667,Foot_US
+26783,NAD_1927_StatePlane_Maine_East_FIPS_1801,500000,0,-68.5,0.9999, ,43.83333333,Foot_US
+26784,NAD_1927_StatePlane_Maine_West_FIPS_1802,500000,0,-70.16666667,0.999966667, ,42.83333333,Foot_US
+26785,NAD_1927_StatePlane_Maryland_FIPS_1900,800000,0,-77,38.3,39.45,37.83333333,Foot_US
+26786,NAD_1927_StatePlane_Massachusetts_Mainland_FIPS_2001,600000,0,-71.5,41.71666667,42.68333333,41,Foot_US
+26787,NAD_1927_StatePlane_Massachusetts_Island_FIPS_2002,200000,0,-70.5,41.28333333,41.48333333,41,Foot_US
+26788,NAD_1927_StatePlane_Michigan_North_FIPS_2111,2000000,0,-87,45.48333333,47.08333333,44.78333333,Foot_US
+26789,NAD_1927_StatePlane_Michigan_Central_FIPS_2112,2000000,0,-84.33333333,44.18333333,45.7,43.31666667,Foot_US
+26790,NAD_1927_StatePlane_Michigan_South_FIPS_2113,2000000,0,-84.33333333,42.1,43.66666667,41.5,Foot_US
+26791,NAD_1927_StatePlane_Minnesota_North_FIPS_2201,2000000,0,-93.1,47.03333333,48.63333333,46.5,Foot_US
+26792,NAD_1927_StatePlane_Minnesota_Central_FIPS_2202,2000000,0,-94.25,45.61666667,47.05,45,Foot_US
+26793,NAD_1927_StatePlane_Minnesota_South_FIPS_2203,2000000,0,-94,43.78333333,45.21666667,43,Foot_US
+26794,NAD_1927_StatePlane_Mississippi_East_FIPS_2301,500000,0,-88.83333333,0.99996, ,29.66666667,Foot_US
+26795,NAD_1927_StatePlane_Mississippi_West_FIPS_2302,500000,0,-90.33333333,0.999941176, ,30.5,Foot_US
+26796,NAD_1927_StatePlane_Missouri_East_FIPS_2401,500000,0,-90.5,0.999933333, ,35.83333333,Foot_US
+26797,NAD_1927_StatePlane_Missouri_Central_FIPS_2402,500000,0,-92.5,0.999933333, ,35.83333333,Foot_US
+26798,NAD_1927_StatePlane_Missouri_West_FIPS_2403,500000,0,-94.5,0.999941176, ,36.16666667,Foot_US
+26801,NAD_Michigan_StatePlane_Michigan_East_Old_FIPS_2101,500000,0,-83.66666667,0.999942857, ,41.5,Foot_US
+26802,NAD_Michigan_StatePlane_Michigan_Central_Old_FIPS_2102,500000,0,-85.75,0.999909091, ,41.5,Foot_US
+26803,NAD_Michigan_StatePlane_Michigan_West_Old_FIPS_2103,500000,0,-88.75,0.999909091, ,41.5,Foot_US
+26811,NAD_Michigan_StatePlane_Michigan_North_FIPS_2111,2000000,0,-87,45.48333333,47.08333333,44.78333333,Foot_US
+26812,NAD_Michigan_StatePlane_Michigan_Central_FIPS_2112,2000000,0,-84.33333333,44.18333333,45.7,43.31666667,Foot_US
+26813,NAD_Michigan_StatePlane_Michigan_South_FIPS_2113,2000000,0,-84.33333333,42.1,43.66666667,41.5,Foot_US
+26901,NAD_1983_UTM_Zone_1N,500000,0,-177,0.9996, ,0,Meter
+26902,NAD_1983_UTM_Zone_2N,500000,0,-171,0.9996, ,0,Meter
+26903,NAD_1983_UTM_Zone_3N,500000,0,-165,0.9996, ,0,Meter
+26904,NAD_1983_UTM_Zone_4N,500000,0,-159,0.9996, ,0,Meter
+26905,NAD_1983_UTM_Zone_5N,500000,0,-153,0.9996, ,0,Meter
+26906,NAD_1983_UTM_Zone_6N,500000,0,-147,0.9996, ,0,Meter
+26907,NAD_1983_UTM_Zone_7N,500000,0,-141,0.9996, ,0,Meter
+26908,NAD_1983_UTM_Zone_8N,500000,0,-135,0.9996, ,0,Meter
+26909,NAD_1983_UTM_Zone_9N,500000,0,-129,0.9996, ,0,Meter
+26910,NAD_1983_UTM_Zone_10N,500000,0,-123,0.9996, ,0,Meter
+26911,NAD_1983_UTM_Zone_11N,500000,0,-117,0.9996, ,0,Meter
+26912,NAD_1983_UTM_Zone_12N,500000,0,-111,0.9996, ,0,Meter
+26913,NAD_1983_UTM_Zone_13N,500000,0,-105,0.9996, ,0,Meter
+26914,NAD_1983_UTM_Zone_14N,500000,0,-99,0.9996, ,0,Meter
+26915,NAD_1983_UTM_Zone_15N,500000,0,-93,0.9996, ,0,Meter
+26916,NAD_1983_UTM_Zone_16N,500000,0,-87,0.9996, ,0,Meter
+26917,NAD_1983_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
+26918,NAD_1983_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+26919,NAD_1983_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
+26920,NAD_1983_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+26921,NAD_1983_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+26922,NAD_1983_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
+26923,NAD_1983_UTM_Zone_23N,500000,0,-45,0.9996, ,0,Meter
+26929,NAD_1983_StatePlane_Alabama_East_FIPS_0101,200000,0,-85.83333333,0.99996, ,30.5,Meter
+26930,NAD_1983_StatePlane_Alabama_West_FIPS_0102,600000,0,-87.5,0.999933333, ,30,Meter
+26931,NAD_1983_StatePlane_Alaska_1_FIPS_5001,5000000,-5000000,0.9999,-36.86989765,-133.6666667,57,Meter
+26932,NAD_1983_StatePlane_Alaska_2_FIPS_5002,500000,0,-142,0.9999, ,54,Meter
+26933,NAD_1983_StatePlane_Alaska_3_FIPS_5003,500000,0,-146,0.9999, ,54,Meter
+26934,NAD_1983_StatePlane_Alaska_4_FIPS_5004,500000,0,-150,0.9999, ,54,Meter
+26935,NAD_1983_StatePlane_Alaska_5_FIPS_5005,500000,0,-154,0.9999, ,54,Meter
+26936,NAD_1983_StatePlane_Alaska_6_FIPS_5006,500000,0,-158,0.9999, ,54,Meter
+26937,NAD_1983_StatePlane_Alaska_7_FIPS_5007,500000,0,-162,0.9999, ,54,Meter
+26938,NAD_1983_StatePlane_Alaska_8_FIPS_5008,500000,0,-166,0.9999, ,54,Meter
+26939,NAD_1983_StatePlane_Alaska_9_FIPS_5009,500000,0,-170,0.9999, ,54,Meter
+26940,NAD_1983_StatePlane_Alaska_10_FIPS_5010,1000000,0,-176,51.83333333,53.83333333,51,Meter
+26941,NAD_1983_StatePlane_California_I_FIPS_0401,2000000,500000,-122,40,41.66666667,39.33333333,Meter
+26942,NAD_1983_StatePlane_California_II_FIPS_0402,2000000,500000,-122,38.33333333,39.83333333,37.66666667,Meter
+26943,NAD_1983_StatePlane_California_III_FIPS_0403,2000000,500000,-120.5,37.06666667,38.43333333,36.5,Meter
+26944,NAD_1983_StatePlane_California_IV_FIPS_0404,2000000,500000,-119,36,37.25,35.33333333,Meter
+26945,NAD_1983_StatePlane_California_V_FIPS_0405,2000000,500000,-118,34.03333333,35.46666667,33.5,Meter
+26946,NAD_1983_StatePlane_California_VI_FIPS_0406,2000000,500000,-116.25,32.78333333,33.88333333,32.16666667,Meter
+26948,NAD_1983_StatePlane_Arizona_East_FIPS_0201,213360,0,-110.1666667,0.9999, ,31,Meter
+26949,NAD_1983_StatePlane_Arizona_Central_FIPS_0202,213360,0,-111.9166667,0.9999, ,31,Meter
+26950,NAD_1983_StatePlane_Arizona_West_FIPS_0203,213360,0,-113.75,0.999933333, ,31,Meter
+26951,NAD_1983_StatePlane_Arkansas_North_FIPS_0301,400000,0,-92,34.93333333,36.23333333,34.33333333,Meter
+26952,NAD_1983_StatePlane_Arkansas_South_FIPS_0302,400000,400000,-92,33.3,34.76666667,32.66666667,Meter
+26953,NAD_1983_StatePlane_Colorado_North_FIPS_0501,914401.8289,304800.6096,-105.5,39.71666667,40.78333333,39.33333333,Meter
+26954,NAD_1983_StatePlane_Colorado_Central_FIPS_0502,914401.8289,304800.6096,-105.5,38.45,39.75,37.83333333,Meter
+26955,NAD_1983_StatePlane_Colorado_South_FIPS_0503,914401.8289,304800.6096,-105.5,37.23333333,38.43333333,36.66666667,Meter
+26956,NAD_1983_StatePlane_Connecticut_FIPS_0600,304800.6096,152400.3048,-72.75,41.2,41.86666667,40.83333333,Meter
+26957,NAD_1983_StatePlane_Delaware_FIPS_0700,200000,0,-75.41666667,0.999995, ,38,Meter
+26958,NAD_1983_StatePlane_Florida_East_FIPS_0901,200000,0,-81,0.999941176, ,24.33333333,Meter
+26959,NAD_1983_StatePlane_Florida_West_FIPS_0902,200000,0,-82,0.999941176, ,24.33333333,Meter
+26960,NAD_1983_StatePlane_Florida_North_FIPS_0903,600000,0,-84.5,29.58333333,30.75,29,Meter
+26961,NAD_1983_StatePlane_Hawaii_1_FIPS_5101,500000,0,-155.5,0.999966667, ,18.83333333,Meter
+26962,NAD_1983_StatePlane_Hawaii_2_FIPS_5102,500000,0,-156.6666667,0.999966667, ,20.33333333,Meter
+26963,NAD_1983_StatePlane_Hawaii_3_FIPS_5103,500000,0,-158,0.99999, ,21.16666667,Meter
+26964,NAD_1983_StatePlane_Hawaii_4_FIPS_5104,500000,0,-159.5,0.99999, ,21.83333333,Meter
+26965,NAD_1983_StatePlane_Hawaii_5_FIPS_5105,500000,0,-160.1666667,1, ,21.66666667,Meter
+26966,NAD_1983_StatePlane_Georgia_East_FIPS_1001,200000,0,-82.16666667,0.9999, ,30,Meter
+26967,NAD_1983_StatePlane_Georgia_West_FIPS_1002,700000,0,-84.16666667,0.9999, ,30,Meter
+26968,NAD_1983_StatePlane_Idaho_East_FIPS_1101,200000,0,-112.1666667,0.999947368, ,41.66666667,Meter
+26969,NAD_1983_StatePlane_Idaho_Central_FIPS_1102,500000,0,-114,0.999947368, ,41.66666667,Meter
+26970,NAD_1983_StatePlane_Idaho_West_FIPS_1103,800000,0,-115.75,0.999933333, ,41.66666667,Meter
+26971,NAD_1983_StatePlane_Illinois_East_FIPS_1201,300000,0,-88.33333333,0.999975, ,36.66666667,Meter
+26972,NAD_1983_StatePlane_Illinois_West_FIPS_1202,700000,0,-90.16666667,0.999941176, ,36.66666667,Meter
+26973,NAD_1983_StatePlane_Indiana_East_FIPS_1301,100000,250000,-85.66666667,0.999966667, ,37.5,Meter
+26974,NAD_1983_StatePlane_Indiana_West_FIPS_1302,900000,250000,-87.08333333,0.999966667, ,37.5,Meter
+26975,NAD_1983_StatePlane_Iowa_North_FIPS_1401,1500000,1000000,-93.5,42.06666667,43.26666667,41.5,Meter
+26976,NAD_1983_StatePlane_Iowa_South_FIPS_1402,500000,0,-93.5,40.61666667,41.78333333,40,Meter
+26977,NAD_1983_StatePlane_Kansas_North_FIPS_1501,400000,0,-98,38.71666667,39.78333333,38.33333333,Meter
+26978,NAD_1983_StatePlane_Kansas_South_FIPS_1502,400000,400000,-98.5,37.26666667,38.56666667,36.66666667,Meter
+26979,NAD_1983_StatePlane_Kentucky_North_FIPS_1601,500000,0,-84.25,37.96666667,38.96666667,37.5,Meter
+26980,NAD_1983_StatePlane_Kentucky_South_FIPS_1602,500000,500000,-85.75,36.73333333,37.93333333,36.33333333,Meter
+26981,NAD_1983_StatePlane_Louisiana_North_FIPS_1701,1000000,0,-92.5,31.16666667,32.66666667,30.5,Meter
+26982,NAD_1983_StatePlane_Louisiana_South_FIPS_1702,1000000,0,-91.33333333,29.3,30.7,28.5,Meter
+26983,NAD_1983_StatePlane_Maine_East_FIPS_1801,300000,0,-68.5,0.9999, ,43.66666667,Meter
+26984,NAD_1983_StatePlane_Maine_West_FIPS_1802,900000,0,-70.16666667,0.999966667, ,42.83333333,Meter
+26985,NAD_1983_StatePlane_Maryland_FIPS_1900,400000,0,-77,38.3,39.45,37.66666667,Meter
+26986,NAD_1983_StatePlane_Massachusetts_Mainland_FIPS_2001,200000,750000,-71.5,41.71666667,42.68333333,41,Meter
+26987,NAD_1983_StatePlane_Massachusetts_Island_FIPS_2002,500000,0,-70.5,41.28333333,41.48333333,41,Meter
+26988,NAD_1983_StatePlane_Michigan_North_FIPS_2111,8000000,0,-87,45.48333333,47.08333333,44.78333333,Meter
+26989,NAD_1983_StatePlane_Michigan_Central_FIPS_2112,6000000,0,-84.36666667,44.18333333,45.7,43.31666667,Meter
+26990,NAD_1983_StatePlane_Michigan_South_FIPS_2113,4000000,0,-84.36666667,42.1,43.66666667,41.5,Meter
+26991,NAD_1983_StatePlane_Minnesota_North_FIPS_2201,800000,100000,-93.1,47.03333333,48.63333333,46.5,Meter
+26992,NAD_1983_StatePlane_Minnesota_Central_FIPS_2202,800000,100000,-94.25,45.61666667,47.05,45,Meter
+26993,NAD_1983_StatePlane_Minnesota_South_FIPS_2203,800000,100000,-94,43.78333333,45.21666667,43,Meter
+26994,NAD_1983_StatePlane_Mississippi_East_FIPS_2301,300000,0,-88.83333333,0.99995, ,29.5,Meter
+26995,NAD_1983_StatePlane_Mississippi_West_FIPS_2302,700000,0,-90.33333333,0.99995, ,29.5,Meter
+26996,NAD_1983_StatePlane_Missouri_East_FIPS_2401,250000,0,-90.5,0.999933333, ,35.83333333,Meter
+26997,NAD_1983_StatePlane_Missouri_Central_FIPS_2402,500000,0,-92.5,0.999933333, ,35.83333333,Meter
+26998,NAD_1983_StatePlane_Missouri_West_FIPS_2403,850000,0,-94.5,0.999941176, ,36.16666667,Meter
+27038,Nahrwan_1967_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
+27039,Nahrwan_1967_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
+27040,Nahrwan_1967_UTM_Zone_40N,500000,0,57,0.9996, ,0,Meter
+27120,Naparima_1972_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+27200,GD_1949_New_Zealand_Map_Grid,2510000,6023150,173,,,-41,Meter
+27205,NZGD_1949_Mount_Eden_Circuit,300000,700000,174.7643394,0.9999, ,-36.87986528,Meter
+27206,NZGD_1949_Bay_of_Plenty_Circuit,300000,700000,176.4661973,1, ,-37.76124981,Meter
+27207,NZGD_1949_Poverty_Bay_Circuit,300000,700000,177.8856363,1, ,-38.62470278,Meter
+27208,NZGD_1949_Hawkes_Bay_Circuit,300000,700000,176.6736805,1, ,-39.65092931,Meter
+27209,NZGD_1949_Taranaki_Circuit,300000,700000,174.2280118,1, ,-39.13575831,Meter
+27210,NZGD_1949_Tuhirangi_Circuit,300000,700000,175.6400368,1, ,-39.51247039,Meter
+27211,NZGD_1949_Wanganui_Circuit,300000,700000,175.4880996,1, ,-40.24194714,Meter
+27212,NZGD_1949_Wairarapa_Circuit,300000,700000,175.6473497,1, ,-40.92553264,Meter
+27213,NZGD_1949_Wellington_Circuit,300000,700000,174.7766231,1, ,-41.30131964,Meter
+27214,NZGD_1949_Collingwood_Circuit,300000,700000,172.6720465,1, ,-40.71475906,Meter
+27215,NZGD_1949_Nelson_Circuit,300000,700000,173.2993168,1, ,-41.27454472,Meter
+27216,NZGD_1949_Karamea_Circuit,300000,700000,172.1090282,1, ,-41.28991153,Meter
+27217,NZGD_1949_Buller_Circuit,300000,700000,171.5812601,1, ,-41.81080286,Meter
+27218,NZGD_1949_Grey_Circuit,300000,700000,171.5497713,1, ,-42.33369428,Meter
+27219,NZGD_1949_Amuri_Circuit,300000,700000,173.0101334,1, ,-42.68911658,Meter
+27220,NZGD_1949_Marlborough_Circuit,300000,700000,173.8020741,1, ,-41.54448667,Meter
+27221,NZGD_1949_Hokitika_Circuit,300000,700000,170.9799935,1, ,-42.88632236,Meter
+27222,NZGD_1949_Okarito_Circuit,300000,700000,170.2609258,1, ,-43.11012814,Meter
+27223,NZGD_1949_Jacksons_Bay_Circuit,300000,700000,168.606267,1, ,-43.97780289,Meter
+27224,NZGD_1949_Mount_Pleasant_Circuit,300000,700000,172.7271936,1, ,-43.59063758,Meter
+27225,NZGD_1949_Gawler_Circuit,300000,700000,171.3607485,1, ,-43.74871156,Meter
+27226,NZGD_1949_Timaru_Circuit,300000,700000,171.0572508,1, ,-44.40222036,Meter
+27227,NZGD_1949_Lindis_Peak_Circuit,300000,700000,169.4677551,1, ,-44.73526797,Meter
+27228,NZGD_1949_Mount_Nicholas_Circuit,300000,700000,168.3986412,1, ,-45.13290258,Meter
+27229,NZGD_1949_Mount_York_Circuit,300000,700000,167.7388618,1, ,-45.56372617,Meter
+27230,NZGD_1949_Observation_Point_Circuit,300000,700000,170.6285952,1, ,-45.81619661,Meter
+27231,NZGD_1949_North_Taieri_Circuit,300000,700000,170.2825891,0.99996, ,-45.86151336,Meter
+27232,NZGD_1949_Bluff_Circuit,300002.66,699999.58,168.342872,1, ,-46.60000961,Meter
+27258,NZGD_1949_UTM_Zone_58S,500000,10000000,165,0.9996, ,0,Meter
+27259,NZGD_1949_UTM_Zone_59S,500000,10000000,171,0.9996, ,0,Meter
+27260,NZGD_1949_UTM_Zone_60S,500000,10000000,177,0.9996, ,0,Meter
+27291,New_Zealand_North_Island,300000,400000,175.5,1, ,-39,Yard_Sears
+27292,New_Zealand_South_Island,500000,500000,171.5,1, ,-44,Yard_Sears
+27391,NGO_1948_Oslo_Norway_Zone_1,0,0,-4.666666667,1, ,58,Meter
+27392,NGO_1948_Oslo_Norway_Zone_2,0,0,-2.333333333,1, ,58,Meter
+27393,NGO_1948_Oslo_Norway_Zone_3,0,0,0,1, ,58,Meter
+27394,NGO_1948_Oslo_Norway_Zone_4,0,0,2.5,1, ,58,Meter
+27395,NGO_1948_Oslo_Norway_Zone_5,0,0,6.166666667,1, ,58,Meter
+27396,NGO_1948_Oslo_Norway_Zone_6,0,0,10.16666667,1, ,58,Meter
+27397,NGO_1948_Oslo_Norway_Zone_7,0,0,14.16666667,1, ,58,Meter
+27398,NGO_1948_Oslo_Norway_Zone_8,0,0,18.33333333,1, ,58,Meter
+27429,Datum_73_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
+27492,Datum_73_Modified_Portuguese_Grid,180.598,-86.99,-8.131906111,1, ,39.66666667,Meter
+27500,Nord_de_Guerre,500000,300000,6,55,0.99950908,55,Meter
+27581,NTF_Paris_France_I,600000,1200000,0,55,0.999877341,55,Meter
+27582,NTF_Paris_France_II,600000,2200000,0,52,0.99987742,52,Meter
+27583,NTF_Paris_France_III,600000,3200000,0,49,0.999877499,49,Meter
+27584,NTF_Paris_France_IV,234.358,185861.369,0,46.85,0.99994471,46.85,Meter
+27591,NTF_Paris_Nord_France,600000,200000,0,55,0.999877341,55,Meter
+27592,NTF_Paris_Centre_France,600000,200000,0,52,0.99987742,52,Meter
+27593,NTF_Paris_Sud_France,600000,200000,0,49,0.999877499,49,Meter
+27594,NTF_Paris_Corse,234.358,185861.369,0,46.85,0.99994471,46.85,Meter
+27700,British_National_Grid,400000,-100000,-2,0.999601272, ,49,Meter
+28191,Palestine_1923_Palestine_Grid,170251.555,126867.909,35.21208056,1, ,31.73409694,Meter
+28192,Palestine_1923_Palestine_Belt,170251.555,1126867.909,35.21208056,1, ,31.73409694,Meter
+28193,Palestine_1923_Israel_CS_Grid,170251.555,1126867.909,35.21208056,1, ,31.73409694,Meter
+28232,Pointe_Noire_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
+28348,GDA_1994_MGA_Zone_48,500000,10000000,105,0.9996, ,0,Meter
+28349,GDA_1994_MGA_Zone_49,500000,10000000,111,0.9996, ,0,Meter
+28350,GDA_1994_MGA_Zone_50,500000,10000000,117,0.9996, ,0,Meter
+28351,GDA_1994_MGA_Zone_51,500000,10000000,123,0.9996, ,0,Meter
+28352,GDA_1994_MGA_Zone_52,500000,10000000,129,0.9996, ,0,Meter
+28353,GDA_1994_MGA_Zone_53,500000,10000000,135,0.9996, ,0,Meter
+28354,GDA_1994_MGA_Zone_54,500000,10000000,141,0.9996, ,0,Meter
+28355,GDA_1994_MGA_Zone_55,500000,10000000,147,0.9996, ,0,Meter
+28356,GDA_1994_MGA_Zone_56,500000,10000000,153,0.9996, ,0,Meter
+28357,GDA_1994_MGA_Zone_57,500000,10000000,159,0.9996, ,0,Meter
+28358,GDA_1994_MGA_Zone_58,500000,10000000,165,0.9996, ,0,Meter
+28402,Pulkovo_1942_GK_Zone_2,2500000,0,9,1, ,0,Meter
+28403,Pulkovo_1942_GK_Zone_3,3500000,0,15,1, ,0,Meter
+28404,Pulkovo_1942_GK_Zone_4,4500000,0,21,1, ,0,Meter
+28405,Pulkovo_1942_GK_Zone_5,5500000,0,27,1, ,0,Meter
+28406,Pulkovo_1942_GK_Zone_6,6500000,0,33,1, ,0,Meter
+28407,Pulkovo_1942_GK_Zone_7,7500000,0,39,1, ,0,Meter
+28408,Pulkovo_1942_GK_Zone_8,8500000,0,45,1, ,0,Meter
+28409,Pulkovo_1942_GK_Zone_9,9500000,0,51,1, ,0,Meter
+28410,Pulkovo_1942_GK_Zone_10,10500000,0,57,1, ,0,Meter
+28411,Pulkovo_1942_GK_Zone_11,11500000,0,63,1, ,0,Meter
+28412,Pulkovo_1942_GK_Zone_12,12500000,0,69,1, ,0,Meter
+28413,Pulkovo_1942_GK_Zone_13,13500000,0,75,1, ,0,Meter
+28414,Pulkovo_1942_GK_Zone_14,14500000,0,81,1, ,0,Meter
+28415,Pulkovo_1942_GK_Zone_15,15500000,0,87,1, ,0,Meter
+28416,Pulkovo_1942_GK_Zone_16,16500000,0,93,1, ,0,Meter
+28417,Pulkovo_1942_GK_Zone_17,17500000,0,99,1, ,0,Meter
+28418,Pulkovo_1942_GK_Zone_18,18500000,0,105,1, ,0,Meter
+28419,Pulkovo_1942_GK_Zone_19,19500000,0,111,1, ,0,Meter
+28420,Pulkovo_1942_GK_Zone_20,20500000,0,117,1, ,0,Meter
+28421,Pulkovo_1942_GK_Zone_21,21500000,0,123,1, ,0,Meter
+28422,Pulkovo_1942_GK_Zone_22,22500000,0,129,1, ,0,Meter
+28423,Pulkovo_1942_GK_Zone_23,23500000,0,135,1, ,0,Meter
+28424,Pulkovo_1942_GK_Zone_24,24500000,0,141,1, ,0,Meter
+28425,Pulkovo_1942_GK_Zone_25,25500000,0,147,1, ,0,Meter
+28426,Pulkovo_1942_GK_Zone_26,26500000,0,153,1, ,0,Meter
+28427,Pulkovo_1942_GK_Zone_27,27500000,0,159,1, ,0,Meter
+28428,Pulkovo_1942_GK_Zone_28,28500000,0,165,1, ,0,Meter
+28429,Pulkovo_1942_GK_Zone_29,29500000,0,171,1, ,0,Meter
+28430,Pulkovo_1942_GK_Zone_30,30500000,0,177,1, ,0,Meter
+28431,Pulkovo_1942_GK_Zone_31,31500000,0,-177,1, ,0,Meter
+28432,Pulkovo_1942_GK_Zone_32,32500000,0,-171,1, ,0,Meter
+28462,Pulkovo_1942_GK_Zone_2N,500000,0,9,1, ,0,Meter
+28463,Pulkovo_1942_GK_Zone_3N,500000,0,15,1, ,0,Meter
+28464,Pulkovo_1942_GK_Zone_4N,500000,0,21,1, ,0,Meter
+28465,Pulkovo_1942_GK_Zone_5N,500000,0,27,1, ,0,Meter
+28466,Pulkovo_1942_GK_Zone_6N,500000,0,33,1, ,0,Meter
+28467,Pulkovo_1942_GK_Zone_7N,500000,0,39,1, ,0,Meter
+28468,Pulkovo_1942_GK_Zone_8N,500000,0,45,1, ,0,Meter
+28469,Pulkovo_1942_GK_Zone_9N,500000,0,51,1, ,0,Meter
+28470,Pulkovo_1942_GK_Zone_10N,500000,0,57,1, ,0,Meter
+28471,Pulkovo_1942_GK_Zone_11N,500000,0,63,1, ,0,Meter
+28472,Pulkovo_1942_GK_Zone_12N,500000,0,69,1, ,0,Meter
+28473,Pulkovo_1942_GK_Zone_13N,500000,0,75,1, ,0,Meter
+28474,Pulkovo_1942_GK_Zone_14N,500000,0,81,1, ,0,Meter
+28475,Pulkovo_1942_GK_Zone_15N,500000,0,87,1, ,0,Meter
+28476,Pulkovo_1942_GK_Zone_16N,500000,0,93,1, ,0,Meter
+28477,Pulkovo_1942_GK_Zone_17N,500000,0,99,1, ,0,Meter
+28478,Pulkovo_1942_GK_Zone_18N,500000,0,105,1, ,0,Meter
+28479,Pulkovo_1942_GK_Zone_19N,500000,0,111,1, ,0,Meter
+28480,Pulkovo_1942_GK_Zone_20N,500000,0,117,1, ,0,Meter
+28481,Pulkovo_1942_GK_Zone_21N,500000,0,123,1, ,0,Meter
+28482,Pulkovo_1942_GK_Zone_22N,500000,0,129,1, ,0,Meter
+28483,Pulkovo_1942_GK_Zone_23N,500000,0,135,1, ,0,Meter
+28484,Pulkovo_1942_GK_Zone_24N,500000,0,141,1, ,0,Meter
+28485,Pulkovo_1942_GK_Zone_25N,500000,0,147,1, ,0,Meter
+28486,Pulkovo_1942_GK_Zone_26N,500000,0,153,1, ,0,Meter
+28487,Pulkovo_1942_GK_Zone_27N,500000,0,159,1, ,0,Meter
+28488,Pulkovo_1942_GK_Zone_28N,500000,0,165,1, ,0,Meter
+28489,Pulkovo_1942_GK_Zone_29N,500000,0,171,1, ,0,Meter
+28490,Pulkovo_1942_GK_Zone_30N,500000,0,177,1, ,0,Meter
+28491,Pulkovo_1942_GK_Zone_31N,500000,0,-177,1, ,0,Meter
+28492,Pulkovo_1942_GK_Zone_32N,500000,0,-171,1, ,0,Meter
+28600,Qatar_National_Grid,200000,300000,51.21666667,0.99999, ,24.45,Meter
+28991,RD_Old,0,0,5.387638889,0.9999079, ,52.15616056,Meter
+28992,RD_New,155000,463000,5.387638889,0.9999079, ,52.15616056,Meter
+29100,SAD_1969_Brazil_Polyconic,5000000,10000000,-54,,,0,Meter
+29101,SAD_1969_Brazil_Polyconic,5000000,10000000,-54,,,0,Meter
+29118,SAD_1969_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+29119,SAD_1969_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
+29120,SAD_1969_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+29121,SAD_1969_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+29122,SAD_1969_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
+29168,SAD_1969_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+29169,SAD_1969_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
+29170,SAD_1969_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+29171,SAD_1969_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+29172,SAD_1969_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
+29177,SAD_1969_UTM_Zone_17S,500000,10000000,-81,0.9996, ,0,Meter
+29178,SAD_1969_UTM_Zone_18S,500000,10000000,-75,0.9996, ,0,Meter
+29179,SAD_1969_UTM_Zone_19S,500000,10000000,-69,0.9996, ,0,Meter
+29180,SAD_1969_UTM_Zone_20S,500000,10000000,-63,0.9996, ,0,Meter
+29181,SAD_1969_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
+29182,SAD_1969_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
+29183,SAD_1969_UTM_Zone_23S,500000,10000000,-45,0.9996, ,0,Meter
+29184,SAD_1969_UTM_Zone_24S,500000,10000000,-39,0.9996, ,0,Meter
+29185,SAD_1969_UTM_Zone_25S,500000,10000000,-33,0.9996, ,0,Meter
+29187,SAD_1969_UTM_Zone_17S,500000,10000000,-81,0.9996, ,0,Meter
+29188,SAD_1969_UTM_Zone_18S,500000,10000000,-75,0.9996, ,0,Meter
+29189,SAD_1969_UTM_Zone_19S,500000,10000000,-69,0.9996, ,0,Meter
+29190,SAD_1969_UTM_Zone_20S,500000,10000000,-63,0.9996, ,0,Meter
+29191,SAD_1969_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
+29192,SAD_1969_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
+29193,SAD_1969_UTM_Zone_23S,500000,10000000,-45,0.9996, ,0,Meter
+29194,SAD_1969_UTM_Zone_24S,500000,10000000,-39,0.9996, ,0,Meter
+29195,SAD_1969_UTM_Zone_25S,500000,10000000,-33,0.9996, ,0,Meter
+29220,Sapper_Hill_1943_UTM_Zone_20S,500000,10000000,-63,0.9996, ,0,Meter
+29221,Sapper_Hill_1943_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
+29333,Schwarzeck_UTM_Zone_33S,500000,10000000,15,0.9996, ,0,Meter
+29635,Sudan_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
+29636,Sudan_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
+29738,Tananarive_1925_UTM_Zone_38S,500000,10000000,45,0.9996, ,0,Meter
+29739,Tananarive_1925_UTM_Zone_39S,500000,10000000,51,0.9996, ,0,Meter
+29849,Timbalai_1948_UTM_Zone_49N,500000,0,111,0.9996, ,0,Meter
+29850,Timbalai_1948_UTM_Zone_50N,500000,0,117,0.9996, ,0,Meter
+29900,TM65_Irish_Grid,200000,250000,-8,1.000035, ,53.5,Meter
+29901,OSNI_1952_Irish_National_Grid,200000,250000,-8,1.000035, ,53.5,Meter
+29902,TM65_Irish_Grid,200000,250000,-8,1.000035, ,53.5,Meter
+29903,TM75_Irish_Grid,200000,250000,-8,1.000035, ,53.5,Meter
+30161,Japan_Zone_1,0,0,129.5,0.9999, ,33,Meter
+30162,Japan_Zone_2,0,0,131,0.9999, ,33,Meter
+30163,Japan_Zone_3,0,0,132.1666667,0.9999, ,36,Meter
+30164,Japan_Zone_4,0,0,133.5,0.9999, ,33,Meter
+30165,Japan_Zone_5,0,0,134.3333333,0.9999, ,36,Meter
+30166,Japan_Zone_6,0,0,136,0.9999, ,36,Meter
+30167,Japan_Zone_7,0,0,137.1666667,0.9999, ,36,Meter
+30168,Japan_Zone_8,0,0,138.5,0.9999, ,36,Meter
+30169,Japan_Zone_9,0,0,139.8333333,0.9999, ,36,Meter
+30170,Japan_Zone_10,0,0,140.8333333,0.9999, ,40,Meter
+30171,Japan_Zone_11,0,0,140.25,0.9999, ,44,Meter
+30172,Japan_Zone_12,0,0,142.25,0.9999, ,44,Meter
+30173,Japan_Zone_13,0,0,144.25,0.9999, ,44,Meter
+30174,Japan_Zone_14,0,0,142,0.9999, ,26,Meter
+30175,Japan_Zone_15,0,0,127.5,0.9999, ,26,Meter
+30176,Japan_Zone_16,0,0,124,0.9999, ,26,Meter
+30177,Japan_Zone_17,0,0,131,0.9999, ,26,Meter
+30178,Japan_Zone_18,0,0,136,0.9999, ,20,Meter
+30179,Japan_Zone_19,0,0,154,0.9999, ,26,Meter
+30200,Trinidad_1903_Trinidad_Grid,430000,325000,-61.33333333,1, ,10.44166667,Link_Clarke
+30339,TC_1948_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
+30340,TC_1948_UTM_Zone_40N,500000,0,57,0.9996, ,0,Meter
+30491,Nord_Algerie_Ancienne,500000,300000,3,40,0.999625544,40,Meter
+30492,Sud_Algerie_Ancienne,500000,300000,3,37,0.999625769,37,Meter
+30493,Voirol_1879_Nord_Algerie_Ancienne,500000,300000,3,40,0.999625544,40,Meter
+30494,Voirol_1879_Sud_Algerie_Ancienne,500000,300000,3,37,0.999625769,37,Meter
+30591,Nord_Algerie,500135,300090,3,40,0.999625544,40,Meter
+30592,Sud_Algerie,500135,300090,3,37,0.999625769,37,Meter
+30729,Nord_Sahara_1959_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
+30730,Nord_Sahara_1959_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
+30731,Nord_Sahara_1959_UTM_Zone_31N,500000,0,3,0.9996, ,0,Meter
+30732,Nord_Sahara_1959_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
+30800,Swedish_National_Grid,1500000,0,-2.25,1, ,0,Meter
+31028,Yoff_1972_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+31121,Zanderij_1972_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+31154,Zanderij_TM_54_NW,500000,0,-54,0.9996, ,0,Meter
+31170,Zanderij_Suriname_Old_TM,500000,0,-55.68333333,0.9996, ,0,Meter
+31171,Zanderij_Suriname_TM,500000,0,-55.68333333,0.9999, ,0,Meter
+31265,MGI_3_Degree_Gauss_Zone_5,5500000,0,15,1, ,0,Meter
+31266,MGI_3_Degree_Gauss_Zone_6,6500000,0,18,1, ,0,Meter
+31267,MGI_3_Degree_Gauss_Zone_7,7500000,0,21,1, ,0,Meter
+31268,MGI_3_Degree_Gauss_Zone_8,8500000,0,24,1, ,0,Meter
+31275,MGI_Balkans_5,5500000,0,15,0.9999, ,0,Meter
+31276,MGI_Balkans_6,6500000,0,18,0.9999, ,0,Meter
+31277,MGI_Balkans_7,7500000,0,21,0.9999, ,0,Meter
+31278,MGI_Balkans_8,8500000,0,24,0.9999, ,0,Meter
+31279,MGI_Balkans_8,8500000,0,24,0.9999, ,0,Meter
+31281,Austria_West_Zone,0,0,28,1, ,0,Meter
+31282,Austria_Central_Zone,0,0,31,1, ,0,Meter
+31283,Austria_East_Zone,0,0,34,1, ,0,Meter
+31284,MGI_M28,150000,0,10.33333333,1, ,0,Meter
+31285,MGI_M31,450000,0,13.33333333,1, ,0,Meter
+31286,MGI_M34,750000,0,16.33333333,1, ,0,Meter
+31287,MGI_Austria_Lambert,400000,400000,13.33333333,46,49,47.5,Meter
+31291,Austria_West_Zone,0,0,28,1, ,0,Meter
+31292,Austria_Central_Zone,0,0,31,1, ,0,Meter
+31293,Austria_East_Zone,0,0,34,1, ,0,Meter
+31294,MGI_M28,150000,0,10.33333333,1, ,0,Meter
+31295,MGI_M31,450000,0,13.33333333,1, ,0,Meter
+31296,MGI_M34,750000,0,16.33333333,1, ,0,Meter
+31297,MGI_Austria_Lambert,400000,400000,13.33333333,46,49,47.5,Meter
+31370,Belge_Lambert_1972,150000.0126,5400088.438,4.367486667,49.8333339,51.16666723,90,Meter
+31461,DHDN_3_Degree_Gauss_Zone_1,1500000,0,3,1, ,0,Meter
+31462,DHDN_3_Degree_Gauss_Zone_2,2500000,0,6,1, ,0,Meter
+31463,DHDN_3_Degree_Gauss_Zone_3,3500000,0,9,1, ,0,Meter
+31464,DHDN_3_Degree_Gauss_Zone_4,4500000,0,12,1, ,0,Meter
+31465,DHDN_3_Degree_Gauss_Zone_5,5500000,0,15,1, ,0,Meter
+31466,DHDN_3_Degree_Gauss_Zone_2,2500000,0,6,1, ,0,Meter
+31467,DHDN_3_Degree_Gauss_Zone_3,3500000,0,9,1, ,0,Meter
+31468,DHDN_3_Degree_Gauss_Zone_4,4500000,0,12,1, ,0,Meter
+31469,DHDN_3_Degree_Gauss_Zone_5,5500000,0,15,1, ,0,Meter
+31491,Germany_Zone_1,1500000,0,3,1, ,0,Meter
+31492,Germany_Zone_2,2500000,0,6,1, ,0,Meter
+31493,Germany_Zone_3,3500000,0,9,1, ,0,Meter
+31494,Germany_Zone_4,4500000,0,12,1, ,0,Meter
+31495,Germany_Zone_5,5500000,0,15,1, ,0,Meter
+31528,Conakry_1905_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+31529,Conakry_1905_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
+31600,Stereo_33,500000,500000,25.39246589,0.9996667, ,45.9,Meter
+31700,Stereo_70,500000,500000,25,0.99975, ,46,Meter
+31838,NGN_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
+31839,NGN_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
+31900,KUDAMS_KTM,500000,0,48,0.9996, ,0,Meter
+31901,KUDAMS_KTM,500000,0,48,1, ,0,Meter
+31917,SIRGAS_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
+31918,SIRGAS_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+31919,SIRGAS_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
+31920,SIRGAS_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+31921,SIRGAS_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+31922,SIRGAS_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
+31971,SIRGAS_2000_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
+31972,SIRGAS_2000_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+31973,SIRGAS_2000_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
+31974,SIRGAS_2000_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+31975,SIRGAS_2000_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+31976,SIRGAS_2000_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
+31977,SIRGAS_2000_UTM_Zone_17S,500000,10000000,-81,0.9996, ,0,Meter
+31978,SIRGAS_2000_UTM_Zone_18S,500000,10000000,-75,0.9996, ,0,Meter
+31979,SIRGAS_2000_UTM_Zone_19S,500000,10000000,-69,0.9996, ,0,Meter
+31980,SIRGAS_2000_UTM_Zone_20S,500000,10000000,-63,0.9996, ,0,Meter
+31981,SIRGAS_2000_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
+31982,SIRGAS_2000_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
+31983,SIRGAS_2000_UTM_Zone_23S,500000,10000000,-45,0.9996, ,0,Meter
+31984,SIRGAS_2000_UTM_Zone_24S,500000,10000000,-39,0.9996, ,0,Meter
+31985,SIRGAS_2000_UTM_Zone_25S,500000,10000000,-33,0.9996, ,0,Meter
+31986,SIRGAS_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
+31987,SIRGAS_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+31988,SIRGAS_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
+31989,SIRGAS_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+31990,SIRGAS_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+31991,SIRGAS_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
+31992,SIRGAS_UTM_Zone_17S,500000,10000000,-81,0.9996, ,0,Meter
+31993,SIRGAS_UTM_Zone_18S,500000,10000000,-75,0.9996, ,0,Meter
+31994,SIRGAS_UTM_Zone_19S,500000,10000000,-69,0.9996, ,0,Meter
+31995,SIRGAS_UTM_Zone_20S,500000,10000000,-63,0.9996, ,0,Meter
+31996,SIRGAS_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
+31997,SIRGAS_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
+31998,SIRGAS_UTM_Zone_23S,500000,10000000,-45,0.9996, ,0,Meter
+31999,SIRGAS_UTM_Zone_24S,500000,10000000,-39,0.9996, ,0,Meter
+32000,SIRGAS_UTM_Zone_25S,500000,10000000,-33,0.9996, ,0,Meter
+32001,NAD_1927_StatePlane_Montana_North_FIPS_2501,2000000,0,-109.5,47.85,48.71666667,47,Foot_US
+32002,NAD_1927_StatePlane_Montana_Central_FIPS_2502,2000000,0,-109.5,46.45,47.88333333,45.83333333,Foot_US
+32003,NAD_1927_StatePlane_Montana_South_FIPS_2503,2000000,0,-109.5,44.86666667,46.4,44,Foot_US
+32005,NAD_1927_StatePlane_Nebraska_North_FIPS_2601,2000000,0,-100,41.85,42.81666667,41.33333333,Foot_US
+32006,NAD_1927_StatePlane_Nebraska_South_FIPS_2602,2000000,0,-99.5,40.28333333,41.71666667,39.66666667,Foot_US
+32007,NAD_1927_StatePlane_Nevada_East_FIPS_2701,500000,0,-115.5833333,0.9999, ,34.75,Foot_US
+32008,NAD_1927_StatePlane_Nevada_Central_FIPS_2702,500000,0,-116.6666667,0.9999, ,34.75,Foot_US
+32009,NAD_1927_StatePlane_Nevada_West_FIPS_2703,500000,0,-118.5833333,0.9999, ,34.75,Foot_US
+32010,NAD_1927_StatePlane_New_Hampshire_FIPS_2800,500000,0,-71.66666667,0.999966667, ,42.5,Foot_US
+32011,NAD_1927_StatePlane_New_Jersey_FIPS_2900,2000000,0,-74.66666667,0.999975, ,38.83333333,Foot_US
+32012,NAD_1927_StatePlane_New_Mexico_East_FIPS_3001,500000,0,-104.3333333,0.999909091, ,31,Foot_US
+32013,NAD_1927_StatePlane_New_Mexico_Central_FIPS_3002,500000,0,-106.25,0.9999, ,31,Foot_US
+32014,NAD_1927_StatePlane_New_Mexico_West_FIPS_3003,500000,0,-107.8333333,0.999916667, ,31,Foot_US
+32015,NAD_1927_StatePlane_New_York_East_FIPS_3101,500000,0,-74.33333333,0.999966667, ,40,Foot_US
+32016,NAD_1927_StatePlane_New_York_Central_FIPS_3102,500000,0,-76.58333333,0.9999375, ,40,Foot_US
+32017,NAD_1927_StatePlane_New_York_West_FIPS_3103,500000,0,-78.58333333,0.9999375, ,40,Foot_US
+32018,NAD_1927_StatePlane_New_York_Long_Island_FIPS_3104,2000000,100000,-74,40.66666667,41.03333333,40.5,Foot_US
+32019,NAD_1927_StatePlane_North_Carolina_FIPS_3200,2000000,0,-79,34.33333333,36.16666667,33.75,Foot_US
+32020,NAD_1927_StatePlane_North_Dakota_North_FIPS_3301,2000000,0,-100.5,47.43333333,48.73333333,47,Foot_US
+32021,NAD_1927_StatePlane_North_Dakota_South_FIPS_3302,2000000,0,-100.5,46.18333333,47.48333333,45.66666667,Foot_US
+32022,NAD_1927_StatePlane_Ohio_North_FIPS_3401,2000000,0,-82.5,40.43333333,41.7,39.66666667,Foot_US
+32023,NAD_1927_StatePlane_Ohio_South_FIPS_3402,2000000,0,-82.5,38.73333333,40.03333333,38,Foot_US
+32024,NAD_1927_StatePlane_Oklahoma_North_FIPS_3501,2000000,0,-98,35.56666667,36.76666667,35,Foot_US
+32025,NAD_1927_StatePlane_Oklahoma_South_FIPS_3502,2000000,0,-98,33.93333333,35.23333333,33.33333333,Foot_US
+32026,NAD_1927_StatePlane_Oregon_North_FIPS_3601,2000000,0,-120.5,44.33333333,46,43.66666667,Foot_US
+32027,NAD_1927_StatePlane_Oregon_South_FIPS_3602,2000000,0,-120.5,42.33333333,44,41.66666667,Foot_US
+32028,NAD_1927_StatePlane_Pennsylvania_North_FIPS_3701,2000000,0,-77.75,40.88333333,41.95,40.16666667,Foot_US
+32029,NAD_1927_StatePlane_Pennsylvania_South_FIPS_3702,2000000,0,-77.75,39.93333333,40.96666667,39.33333333,Foot_US
+32030,NAD_1927_StatePlane_Rhode_Island_FIPS_3800,500000,0,-71.5,0.99999375, ,41.08333333,Foot_US
+32031,NAD_1927_StatePlane_South_Carolina_North_FIPS_3901,2000000,0,-81,33.76666667,34.96666667,33,Foot_US
+32033,NAD_1927_StatePlane_South_Carolina_South_FIPS_3902,2000000,0,-81,32.33333333,33.66666667,31.83333333,Foot_US
+32034,NAD_1927_StatePlane_South_Dakota_North_FIPS_4001,2000000,0,-100,44.41666667,45.68333333,43.83333333,Foot_US
+32035,NAD_1927_StatePlane_South_Dakota_South_FIPS_4002,2000000,0,-100.3333333,42.83333333,44.4,42.33333333,Foot_US
+32036,NAD_1927_StatePlane_Tennessee_FIPS_4100,2000000,100000,-86,35.25,36.41666667,34.66666667,Foot_US
+32037,NAD_1927_StatePlane_Texas_North_FIPS_4201,2000000,0,-101.5,34.65,36.18333333,34,Foot_US
+32038,NAD_1927_StatePlane_Texas_North_Central_FIPS_4202,2000000,0,-97.5,32.13333333,33.96666667,31.66666667,Foot_US
+32039,NAD_1927_StatePlane_Texas_Central_FIPS_4203,2000000,0,-100.3333333,30.11666667,31.88333333,29.66666667,Foot_US
+32040,NAD_1927_StatePlane_Texas_South_Central_FIPS_4204,2000000,0,-99,28.38333333,30.28333333,27.83333333,Foot_US
+32041,NAD_1927_StatePlane_Texas_South_FIPS_4205,2000000,0,-98.5,26.16666667,27.83333333,25.66666667,Foot_US
+32042,NAD_1927_StatePlane_Utah_North_FIPS_4301,2000000,0,-111.5,40.71666667,41.78333333,40.33333333,Foot_US
+32043,NAD_1927_StatePlane_Utah_Central_FIPS_4302,2000000,0,-111.5,39.01666667,40.65,38.33333333,Foot_US
+32044,NAD_1927_StatePlane_Utah_South_FIPS_4303,2000000,0,-111.5,37.21666667,38.35,36.66666667,Foot_US
+32045,NAD_1927_StatePlane_Vermont_FIPS_3400,500000,0,-72.5,0.999964286, ,42.5,Foot_US
+32046,NAD_1927_StatePlane_Virginia_North_FIPS_4501,2000000,0,-78.5,38.03333333,39.2,37.66666667,Foot_US
+32047,NAD_1927_StatePlane_Virginia_South_FIPS_4502,2000000,0,-78.5,36.76666667,37.96666667,36.33333333,Foot_US
+32048,NAD_1927_StatePlane_Washington_North_FIPS_4601,2000000,0,-120.8333333,47.5,48.73333333,47,Foot_US
+32049,NAD_1927_StatePlane_Washington_South_FIPS_4602,2000000,0,-120.5,45.83333333,47.33333333,45.33333333,Foot_US
+32050,NAD_1927_StatePlane_West_Virginia_North_FIPS_4701,2000000,0,-79.5,39,40.25,38.5,Foot_US
+32051,NAD_1927_StatePlane_West_Virginia_South_FIPS_4702,2000000,0,-81,37.48333333,38.88333333,37,Foot_US
+32052,NAD_1927_StatePlane_Wisconsin_North_FIPS_4801,2000000,0,-90,45.56666667,46.76666667,45.16666667,Foot_US
+32053,NAD_1927_StatePlane_Wisconsin_Central_FIPS_4802,2000000,0,-90,44.25,45.5,43.83333333,Foot_US
+32054,NAD_1927_StatePlane_Wisconsin_South_FIPS_4803,2000000,0,-90,42.73333333,44.06666667,42,Foot_US
+32055,NAD_1927_StatePlane_Wyoming_East_FIPS_4901,500000,0,-105.1666667,0.999941176, ,40.66666667,Foot_US
+32056,NAD_1927_StatePlane_Wyoming_East_Central_FIPS_4902,500000,0,-107.3333333,0.999941176, ,40.66666667,Foot_US
+32057,NAD_1927_StatePlane_Wyoming_West_Central_FIPS_4903,500000,0,-108.75,0.999941176, ,40.66666667,Foot_US
+32058,NAD_1927_StatePlane_Wyoming_West_FIPS_4904,500000,0,-110.0833333,0.999941176, ,40.66666667,Foot_US
+32059,NAD_1927_StatePlane_Puerto_Rico_FIPS_5201,500000,0,-66.43333333,18.03333333,18.43333333,17.83333333,Foot_US
+32060,NAD_1927_StatePlane_Virgin_Islands_St_Croix_FIPS_5202,500000,100000,-66.43333333,18.03333333,18.43333333,17.83333333,Foot_US
+32061,NAD_1927_Guatemala_Norte,500000,292209.579,-90.33333333,16.81666667,0.99992226,16.81666667,Meter
+32062,NAD_1927_Guatemala_Sur,500000,325992.681,-90.33333333,14.9,0.99989906,14.9,Meter
+32074,NAD_1927_BLM_Zone_14N,1640416.667,0,-99,0.9996, ,0,Foot_US
+32075,NAD_1927_BLM_Zone_15N,1640416.667,0,-93,0.9996, ,0,Foot_US
+32076,NAD_1927_BLM_Zone_16N,1640416.667,0,-87,0.9996, ,0,Foot_US
+32077,NAD_1927_BLM_Zone_17N,1640416.667,0,-81,0.9996, ,0,Foot_US
+32081,NAD_1927_MTM_1,304800,0,-53,0.9999, ,0,Meter
+32082,NAD_1927_MTM_2,304800,0,-56,0.9999, ,0,Meter
+32083,NAD_1927_MTM_3,304800,0,-58.5,0.9999, ,0,Meter
+32084,NAD_1927_MTM_4,304800,0,-61.5,0.9999, ,0,Meter
+32085,NAD_1927_MTM_5,304800,0,-64.5,0.9999, ,0,Meter
+32086,NAD_1927_MTM_6,304800,0,-67.5,0.9999, ,0,Meter
+32098,NAD_1927_Quebec_Lambert,0,0,-68.5,46,60,44,Meter
+32100,NAD_1983_StatePlane_Montana_FIPS_2500,600000,0,-109.5,45,49,44.25,Meter
+32104,NAD_1983_StatePlane_Nebraska_FIPS_2600,500000,0,-100,40,43,39.83333333,Meter
+32107,NAD_1983_StatePlane_Nevada_East_FIPS_2701,200000,8000000,-115.5833333,0.9999, ,34.75,Meter
+32108,NAD_1983_StatePlane_Nevada_Central_FIPS_2702,500000,6000000,-116.6666667,0.9999, ,34.75,Meter
+32109,NAD_1983_StatePlane_Nevada_West_FIPS_2703,800000,4000000,-118.5833333,0.9999, ,34.75,Meter
+32110,NAD_1983_StatePlane_New_Hampshire_FIPS_2800,300000,0,-71.66666667,0.999966667, ,42.5,Meter
+32111,NAD_1983_StatePlane_New_Jersey_FIPS_2900,150000,0,-74.5,0.9999, ,38.83333333,Meter
+32112,NAD_1983_StatePlane_New_Mexico_East_FIPS_3001,165000,0,-104.3333333,0.999909091, ,31,Meter
+32113,NAD_1983_StatePlane_New_Mexico_Central_FIPS_3002,500000,0,-106.25,0.9999, ,31,Meter
+32114,NAD_1983_StatePlane_New_Mexico_West_FIPS_3003,830000,0,-107.8333333,0.999916667, ,31,Meter
+32115,NAD_1983_StatePlane_New_York_East_FIPS_3101,150000,0,-74.5,0.9999, ,38.83333333,Meter
+32116,NAD_1983_StatePlane_New_York_Central_FIPS_3102,250000,0,-76.58333333,0.9999375, ,40,Meter
+32117,NAD_1983_StatePlane_New_York_West_FIPS_3103,350000,0,-78.58333333,0.9999375, ,40,Meter
+32118,NAD_1983_StatePlane_New_York_Long_Island_FIPS_3104,300000,0,-74,40.66666667,41.03333333,40.16666667,Meter
+32119,NAD_1983_StatePlane_North_Carolina_FIPS_3200,609601.22,0,-79,34.33333333,36.16666667,33.75,Meter
+32120,NAD_1983_StatePlane_North_Dakota_North_FIPS_3301,600000,0,-100.5,47.43333333,48.73333333,47,Meter
+32121,NAD_1983_StatePlane_North_Dakota_South_FIPS_3302,600000,0,-100.5,46.18333333,47.48333333,45.66666667,Meter
+32122,NAD_1983_StatePlane_Ohio_North_FIPS_3401,600000,0,-82.5,40.43333333,41.7,39.66666667,Meter
+32123,NAD_1983_StatePlane_Ohio_South_FIPS_3402,600000,0,-82.5,38.73333333,40.03333333,38,Meter
+32124,NAD_1983_StatePlane_Oklahoma_North_FIPS_3501,600000,0,-98,35.56666667,36.76666667,35,Meter
+32125,NAD_1983_StatePlane_Oklahoma_South_FIPS_3502,600000,0,-98,33.93333333,35.23333333,33.33333333,Meter
+32126,NAD_1983_StatePlane_Oregon_North_FIPS_3601,2500000,0,-120.5,44.33333333,46,43.66666667,Meter
+32127,NAD_1983_StatePlane_Oregon_South_FIPS_3602,1500000,0,-120.5,42.33333333,44,41.66666667,Meter
+32128,NAD_1983_StatePlane_Pennsylvania_North_FIPS_3701,600000,0,-77.75,40.88333333,41.95,40.16666667,Meter
+32129,NAD_1983_StatePlane_Pennsylvania_South_FIPS_3702,600000,0,-77.75,39.93333333,40.96666667,39.33333333,Meter
+32130,NAD_1983_StatePlane_Rhode_Island_FIPS_3800,100000,0,-71.5,0.99999375, ,41.08333333,Meter
+32133,NAD_1983_StatePlane_South_Carolina_FIPS_3900,609600,0,-81,32.5,34.83333333,31.83333333,Meter
+32134,NAD_1983_StatePlane_South_Dakota_North_FIPS_4001,600000,0,-100,44.41666667,45.68333333,43.83333333,Meter
+32135,NAD_1983_StatePlane_South_Dakota_South_FIPS_4002,600000,0,-100.3333333,42.83333333,44.4,42.33333333,Meter
+32136,NAD_1983_StatePlane_Tennessee_FIPS_4100,600000,0,-86,35.25,36.41666667,34.33333333,Meter
+32137,NAD_1983_StatePlane_Texas_North_FIPS_4201,200000,1000000,-101.5,34.65,36.18333333,34,Meter
+32138,NAD_1983_StatePlane_Texas_North_Central_FIPS_4202,600000,2000000,-98.5,32.13333333,33.96666667,31.66666667,Meter
+32139,NAD_1983_StatePlane_Texas_Central_FIPS_4203,700000,3000000,-100.3333333,30.11666667,31.88333333,29.66666667,Meter
+32140,NAD_1983_StatePlane_Texas_South_Central_FIPS_4204,600000,4000000,-99,28.38333333,30.28333333,27.83333333,Meter
+32141,NAD_1983_StatePlane_Texas_South_FIPS_4205,300000,5000000,-98.5,26.16666667,27.83333333,25.66666667,Meter
+32142,NAD_1983_StatePlane_Utah_North_FIPS_4301,500000,1000000,-111.5,40.71666667,41.78333333,40.33333333,Meter
+32143,NAD_1983_StatePlane_Utah_Central_FIPS_4302,500000,2000000,-111.5,39.01666667,40.65,38.33333333,Meter
+32144,NAD_1983_StatePlane_Utah_South_FIPS_4303,500000,3000000,-111.5,37.21666667,38.35,36.66666667,Meter
+32145,NAD_1983_StatePlane_Vermont_FIPS_4400,500000,0,-72.5,0.999964286, ,42.5,Meter
+32146,NAD_1983_StatePlane_Virginia_North_FIPS_4501,3500000,2000000,-78.5,38.03333333,39.2,37.66666667,Meter
+32147,NAD_1983_StatePlane_Virginia_South_FIPS_4502,3500000,1000000,-78.5,36.76666667,37.96666667,36.33333333,Meter
+32148,NAD_1983_StatePlane_Washington_North_FIPS_4601,500000,0,-120.8333333,47.5,48.73333333,47,Meter
+32149,NAD_1983_StatePlane_Washington_South_FIPS_4602,500000,0,-120.5,45.83333333,47.33333333,45.33333333,Meter
+32150,NAD_1983_StatePlane_West_Virginia_North_FIPS_4701,600000,0,-79.5,39,40.25,38.5,Meter
+32151,NAD_1983_StatePlane_West_Virginia_South_FIPS_4702,600000,0,-81,37.48333333,38.88333333,37,Meter
+32152,NAD_1983_StatePlane_Wisconsin_North_FIPS_4801,600000,0,-90,45.56666667,46.76666667,45.16666667,Meter
+32153,NAD_1983_StatePlane_Wisconsin_Central_FIPS_4802,600000,0,-90,44.25,45.5,43.83333333,Meter
+32154,NAD_1983_StatePlane_Wisconsin_South_FIPS_4803,600000,0,-90,42.73333333,44.06666667,42,Meter
+32155,NAD_1983_StatePlane_Wyoming_East_FIPS_4901,200000,0,-105.1666667,0.9999375, ,40.5,Meter
+32156,NAD_1983_StatePlane_Wyoming_East_Central_FIPS_4902,400000,100000,-107.3333333,0.9999375, ,40.5,Meter
+32157,NAD_1983_StatePlane_Wyoming_West_Central_FIPS_4903,600000,0,-108.75,0.9999375, ,40.5,Meter
+32158,NAD_1983_StatePlane_Wyoming_West_FIPS_4904,800000,100000,-110.0833333,0.9999375, ,40.5,Meter
+32161,NAD_1983_StatePlane_Puerto_Rico_Virgin_Islands_FIPS_5200,200000,200000,-66.43333333,18.03333333,18.43333333,17.83333333,Meter
+32180,NAD_1983_MTM_2_SCoPQ,304800,0,-55.5,0.9999, ,0,Meter
+32181,NAD_1983_MTM_1,304800,0,-53,0.9999, ,0,Meter
+32182,NAD_1983_MTM_2,304800,0,-56,0.9999, ,0,Meter
+32183,NAD_1983_MTM_3,304800,0,-58.5,0.9999, ,0,Meter
+32184,NAD_1983_MTM_4,304800,0,-61.5,0.9999, ,0,Meter
+32185,NAD_1983_MTM_5,304800,0,-64.5,0.9999, ,0,Meter
+32186,NAD_1983_MTM_6,304800,0,-67.5,0.9999, ,0,Meter
+32187,NAD_1983_MTM_7,304800,0,-70.5,0.9999, ,0,Meter
+32188,NAD_1983_MTM_8,304800,0,-73.5,0.9999, ,0,Meter
+32189,NAD_1983_MTM_9,304800,0,-76.5,0.9999, ,0,Meter
+32190,NAD_1983_MTM_10,304800,0,-79.5,0.9999, ,0,Meter
+32191,NAD_1983_MTM_11,304800,0,-82.5,0.9999, ,0,Meter
+32192,NAD_1983_MTM_12,304800,0,-81,0.9999, ,0,Meter
+32193,NAD_1983_MTM_13,304800,0,-84,0.9999, ,0,Meter
+32194,NAD_1983_MTM_14,304800,0,-87,0.9999, ,0,Meter
+32195,NAD_1983_MTM_15,304800,0,-90,0.9999, ,0,Meter
+32196,NAD_1983_MTM_16,304800,0,-93,0.9999, ,0,Meter
+32197,NAD_1983_MTM_17,304800,0,-96,0.9999, ,0,Meter
+32198,NAD_1983_Quebec_Lambert,0,0,-68.5,46,60,44,Meter
+32201,WGS_1972_UTM_Zone_1N,500000,0,-177,0.9996, ,0,Meter
+32202,WGS_1972_UTM_Zone_2N,500000,0,-171,0.9996, ,0,Meter
+32203,WGS_1972_UTM_Zone_3N,500000,0,-165,0.9996, ,0,Meter
+32204,WGS_1972_UTM_Zone_4N,500000,0,-159,0.9996, ,0,Meter
+32205,WGS_1972_UTM_Zone_5N,500000,0,-153,0.9996, ,0,Meter
+32206,WGS_1972_UTM_Zone_6N,500000,0,-147,0.9996, ,0,Meter
+32207,WGS_1972_UTM_Zone_7N,500000,0,-141,0.9996, ,0,Meter
+32208,WGS_1972_UTM_Zone_8N,500000,0,-135,0.9996, ,0,Meter
+32209,WGS_1972_UTM_Zone_9N,500000,0,-129,0.9996, ,0,Meter
+32210,WGS_1972_UTM_Zone_10N,500000,0,-123,0.9996, ,0,Meter
+32211,WGS_1972_UTM_Zone_11N,500000,0,-117,0.9996, ,0,Meter
+32212,WGS_1972_UTM_Zone_12N,500000,0,-111,0.9996, ,0,Meter
+32213,WGS_1972_UTM_Zone_13N,500000,0,-105,0.9996, ,0,Meter
+32214,WGS_1972_UTM_Zone_14N,500000,0,-99,0.9996, ,0,Meter
+32215,WGS_1972_UTM_Zone_15N,500000,0,-93,0.9996, ,0,Meter
+32216,WGS_1972_UTM_Zone_16N,500000,0,-87,0.9996, ,0,Meter
+32217,WGS_1972_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
+32218,WGS_1972_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+32219,WGS_1972_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
+32220,WGS_1972_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+32221,WGS_1972_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+32222,WGS_1972_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
+32223,WGS_1972_UTM_Zone_23N,500000,0,-45,0.9996, ,0,Meter
+32224,WGS_1972_UTM_Zone_24N,500000,0,-39,0.9996, ,0,Meter
+32225,WGS_1972_UTM_Zone_25N,500000,0,-33,0.9996, ,0,Meter
+32226,WGS_1972_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
+32227,WGS_1972_UTM_Zone_27N,500000,0,-21,0.9996, ,0,Meter
+32228,WGS_1972_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+32229,WGS_1972_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
+32230,WGS_1972_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
+32231,WGS_1972_UTM_Zone_31N,500000,0,3,0.9996, ,0,Meter
+32232,WGS_1972_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
+32233,WGS_1972_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
+32234,WGS_1972_UTM_Zone_34N,500000,0,21,0.9996, ,0,Meter
+32235,WGS_1972_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
+32236,WGS_1972_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
+32237,WGS_1972_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
+32238,WGS_1972_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
+32239,WGS_1972_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
+32240,WGS_1972_UTM_Zone_40N,500000,0,57,0.9996, ,0,Meter
+32241,WGS_1972_UTM_Zone_41N,500000,0,63,0.9996, ,0,Meter
+32242,WGS_1972_UTM_Zone_42N,500000,0,69,0.9996, ,0,Meter
+32243,WGS_1972_UTM_Zone_43N,500000,0,75,0.9996, ,0,Meter
+32244,WGS_1972_UTM_Zone_44N,500000,0,81,0.9996, ,0,Meter
+32245,WGS_1972_UTM_Zone_45N,500000,0,87,0.9996, ,0,Meter
+32246,WGS_1972_UTM_Zone_46N,500000,0,93,0.9996, ,0,Meter
+32247,WGS_1972_UTM_Zone_47N,500000,0,99,0.9996, ,0,Meter
+32248,WGS_1972_UTM_Zone_48N,500000,0,105,0.9996, ,0,Meter
+32249,WGS_1972_UTM_Zone_49N,500000,0,111,0.9996, ,0,Meter
+32250,WGS_1972_UTM_Zone_50N,500000,0,117,0.9996, ,0,Meter
+32251,WGS_1972_UTM_Zone_51N,500000,0,123,0.9996, ,0,Meter
+32252,WGS_1972_UTM_Zone_52N,500000,0,129,0.9996, ,0,Meter
+32253,WGS_1972_UTM_Zone_53N,500000,0,135,0.9996, ,0,Meter
+32254,WGS_1972_UTM_Zone_54N,500000,0,141,0.9996, ,0,Meter
+32255,WGS_1972_UTM_Zone_55N,500000,0,147,0.9996, ,0,Meter
+32256,WGS_1972_UTM_Zone_56N,500000,0,153,0.9996, ,0,Meter
+32257,WGS_1972_UTM_Zone_57N,500000,0,159,0.9996, ,0,Meter
+32258,WGS_1972_UTM_Zone_58N,500000,0,165,0.9996, ,0,Meter
+32259,WGS_1972_UTM_Zone_59N,500000,0,171,0.9996, ,0,Meter
+32260,WGS_1972_UTM_Zone_60N,500000,0,177,0.9996, ,0,Meter
+32301,WGS_1972_UTM_Zone_1S,500000,10000000,-177,0.9996, ,0,Meter
+32302,WGS_1972_UTM_Zone_2S,500000,10000000,-171,0.9996, ,0,Meter
+32303,WGS_1972_UTM_Zone_3S,500000,10000000,-165,0.9996, ,0,Meter
+32304,WGS_1972_UTM_Zone_4S,500000,10000000,-159,0.9996, ,0,Meter
+32305,WGS_1972_UTM_Zone_5S,500000,10000000,-153,0.9996, ,0,Meter
+32306,WGS_1972_UTM_Zone_6S,500000,10000000,-147,0.9996, ,0,Meter
+32307,WGS_1972_UTM_Zone_7S,500000,10000000,-141,0.9996, ,0,Meter
+32308,WGS_1972_UTM_Zone_8S,500000,10000000,-135,0.9996, ,0,Meter
+32309,WGS_1972_UTM_Zone_9S,500000,10000000,-129,0.9996, ,0,Meter
+32310,WGS_1972_UTM_Zone_10S,500000,10000000,-123,0.9996, ,0,Meter
+32311,WGS_1972_UTM_Zone_11S,500000,10000000,-117,0.9996, ,0,Meter
+32312,WGS_1972_UTM_Zone_12S,500000,10000000,-111,0.9996, ,0,Meter
+32313,WGS_1972_UTM_Zone_13S,500000,10000000,-105,0.9996, ,0,Meter
+32314,WGS_1972_UTM_Zone_14S,500000,10000000,-99,0.9996, ,0,Meter
+32315,WGS_1972_UTM_Zone_15S,500000,10000000,-93,0.9996, ,0,Meter
+32316,WGS_1972_UTM_Zone_16S,500000,10000000,-87,0.9996, ,0,Meter
+32317,WGS_1972_UTM_Zone_17S,500000,10000000,-81,0.9996, ,0,Meter
+32318,WGS_1972_UTM_Zone_18S,500000,10000000,-75,0.9996, ,0,Meter
+32319,WGS_1972_UTM_Zone_19S,500000,10000000,-69,0.9996, ,0,Meter
+32320,WGS_1972_UTM_Zone_20S,500000,10000000,-63,0.9996, ,0,Meter
+32321,WGS_1972_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
+32322,WGS_1972_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
+32323,WGS_1972_UTM_Zone_23S,500000,10000000,-45,0.9996, ,0,Meter
+32324,WGS_1972_UTM_Zone_24S,500000,10000000,-39,0.9996, ,0,Meter
+32325,WGS_1972_UTM_Zone_25S,500000,10000000,-33,0.9996, ,0,Meter
+32326,WGS_1972_UTM_Zone_26S,500000,10000000,-27,0.9996, ,0,Meter
+32327,WGS_1972_UTM_Zone_27S,500000,10000000,-21,0.9996, ,0,Meter
+32328,WGS_1972_UTM_Zone_28S,500000,10000000,-15,0.9996, ,0,Meter
+32329,WGS_1972_UTM_Zone_29S,500000,10000000,-9,0.9996, ,0,Meter
+32330,WGS_1972_UTM_Zone_30S,500000,10000000,-3,0.9996, ,0,Meter
+32331,WGS_1972_UTM_Zone_31S,500000,10000000,3,0.9996, ,0,Meter
+32332,WGS_1972_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
+32333,WGS_1972_UTM_Zone_33S,500000,10000000,15,0.9996, ,0,Meter
+32334,WGS_1972_UTM_Zone_34S,500000,10000000,21,0.9996, ,0,Meter
+32335,WGS_1972_UTM_Zone_35S,500000,10000000,27,0.9996, ,0,Meter
+32336,WGS_1972_UTM_Zone_36S,500000,10000000,33,0.9996, ,0,Meter
+32337,WGS_1972_UTM_Zone_37S,500000,10000000,39,0.9996, ,0,Meter
+32338,WGS_1972_UTM_Zone_38S,500000,10000000,45,0.9996, ,0,Meter
+32339,WGS_1972_UTM_Zone_39S,500000,10000000,51,0.9996, ,0,Meter
+32340,WGS_1972_UTM_Zone_40S,500000,10000000,57,0.9996, ,0,Meter
+32341,WGS_1972_UTM_Zone_41S,500000,10000000,63,0.9996, ,0,Meter
+32342,WGS_1972_UTM_Zone_42S,500000,10000000,69,0.9996, ,0,Meter
+32343,WGS_1972_UTM_Zone_43S,500000,10000000,75,0.9996, ,0,Meter
+32344,WGS_1972_UTM_Zone_44S,500000,10000000,81,0.9996, ,0,Meter
+32345,WGS_1972_UTM_Zone_45S,500000,10000000,87,0.9996, ,0,Meter
+32346,WGS_1972_UTM_Zone_46S,500000,10000000,93,0.9996, ,0,Meter
+32347,WGS_1972_UTM_Zone_47S,500000,10000000,99,0.9996, ,0,Meter
+32348,WGS_1972_UTM_Zone_48S,500000,10000000,105,0.9996, ,0,Meter
+32349,WGS_1972_UTM_Zone_49S,500000,10000000,111,0.9996, ,0,Meter
+32350,WGS_1972_UTM_Zone_50S,500000,10000000,117,0.9996, ,0,Meter
+32351,WGS_1972_UTM_Zone_51S,500000,10000000,123,0.9996, ,0,Meter
+32352,WGS_1972_UTM_Zone_52S,500000,10000000,129,0.9996, ,0,Meter
+32353,WGS_1972_UTM_Zone_53S,500000,10000000,135,0.9996, ,0,Meter
+32354,WGS_1972_UTM_Zone_54S,500000,10000000,141,0.9996, ,0,Meter
+32355,WGS_1972_UTM_Zone_55S,500000,10000000,147,0.9996, ,0,Meter
+32356,WGS_1972_UTM_Zone_56S,500000,10000000,153,0.9996, ,0,Meter
+32357,WGS_1972_UTM_Zone_57S,500000,10000000,159,0.9996, ,0,Meter
+32358,WGS_1972_UTM_Zone_58S,500000,10000000,165,0.9996, ,0,Meter
+32359,WGS_1972_UTM_Zone_59S,500000,10000000,171,0.9996, ,0,Meter
+32360,WGS_1972_UTM_Zone_60S,500000,10000000,177,0.9996, ,0,Meter
+32601,WGS_1984_UTM_Zone_1N,500000,0,-177,0.9996, ,0,Meter
+32602,WGS_1984_UTM_Zone_2N,500000,0,-171,0.9996, ,0,Meter
+32603,WGS_1984_UTM_Zone_3N,500000,0,-165,0.9996, ,0,Meter
+32604,WGS_1984_UTM_Zone_4N,500000,0,-159,0.9996, ,0,Meter
+32605,WGS_1984_UTM_Zone_5N,500000,0,-153,0.9996, ,0,Meter
+32606,WGS_1984_UTM_Zone_6N,500000,0,-147,0.9996, ,0,Meter
+32607,WGS_1984_UTM_Zone_7N,500000,0,-141,0.9996, ,0,Meter
+32608,WGS_1984_UTM_Zone_8N,500000,0,-135,0.9996, ,0,Meter
+32609,WGS_1984_UTM_Zone_9N,500000,0,-129,0.9996, ,0,Meter
+32610,WGS_1984_UTM_Zone_10N,500000,0,-123,0.9996, ,0,Meter
+32611,WGS_1984_UTM_Zone_11N,500000,0,-117,0.9996, ,0,Meter
+32612,WGS_1984_UTM_Zone_12N,500000,0,-111,0.9996, ,0,Meter
+32613,WGS_1984_UTM_Zone_13N,500000,0,-105,0.9996, ,0,Meter
+32614,WGS_1984_UTM_Zone_14N,500000,0,-99,0.9996, ,0,Meter
+32615,WGS_1984_UTM_Zone_15N,500000,0,-93,0.9996, ,0,Meter
+32616,WGS_1984_UTM_Zone_16N,500000,0,-87,0.9996, ,0,Meter
+32617,WGS_1984_UTM_Zone_17N,500000,0,-81,0.9996, ,0,Meter
+32618,WGS_1984_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+32619,WGS_1984_UTM_Zone_19N,500000,0,-69,0.9996, ,0,Meter
+32620,WGS_1984_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+32621,WGS_1984_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+32622,WGS_1984_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
+32623,WGS_1984_UTM_Zone_23N,500000,0,-45,0.9996, ,0,Meter
+32624,WGS_1984_UTM_Zone_24N,500000,0,-39,0.9996, ,0,Meter
+32625,WGS_1984_UTM_Zone_25N,500000,0,-33,0.9996, ,0,Meter
+32626,WGS_1984_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
+32627,WGS_1984_UTM_Zone_27N,500000,0,-21,0.9996, ,0,Meter
+32628,WGS_1984_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+32629,WGS_1984_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
+32630,WGS_1984_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
+32631,WGS_1984_UTM_Zone_31N,500000,0,3,0.9996, ,0,Meter
+32632,WGS_1984_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
+32633,WGS_1984_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
+32634,WGS_1984_UTM_Zone_34N,500000,0,21,0.9996, ,0,Meter
+32635,WGS_1984_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
+32636,WGS_1984_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
+32637,WGS_1984_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
+32638,WGS_1984_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
+32639,WGS_1984_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
+32640,WGS_1984_UTM_Zone_40N,500000,0,57,0.9996, ,0,Meter
+32641,WGS_1984_UTM_Zone_41N,500000,0,63,0.9996, ,0,Meter
+32642,WGS_1984_UTM_Zone_42N,500000,0,69,0.9996, ,0,Meter
+32643,WGS_1984_UTM_Zone_43N,500000,0,75,0.9996, ,0,Meter
+32644,WGS_1984_UTM_Zone_44N,500000,0,81,0.9996, ,0,Meter
+32645,WGS_1984_UTM_Zone_45N,500000,0,87,0.9996, ,0,Meter
+32646,WGS_1984_UTM_Zone_46N,500000,0,93,0.9996, ,0,Meter
+32647,WGS_1984_UTM_Zone_47N,500000,0,99,0.9996, ,0,Meter
+32648,WGS_1984_UTM_Zone_48N,500000,0,105,0.9996, ,0,Meter
+32649,WGS_1984_UTM_Zone_49N,500000,0,111,0.9996, ,0,Meter
+32650,WGS_1984_UTM_Zone_50N,500000,0,117,0.9996, ,0,Meter
+32651,WGS_1984_UTM_Zone_51N,500000,0,123,0.9996, ,0,Meter
+32652,WGS_1984_UTM_Zone_52N,500000,0,129,0.9996, ,0,Meter
+32653,WGS_1984_UTM_Zone_53N,500000,0,135,0.9996, ,0,Meter
+32654,WGS_1984_UTM_Zone_54N,500000,0,141,0.9996, ,0,Meter
+32655,WGS_1984_UTM_Zone_55N,500000,0,147,0.9996, ,0,Meter
+32656,WGS_1984_UTM_Zone_56N,500000,0,153,0.9996, ,0,Meter
+32657,WGS_1984_UTM_Zone_57N,500000,0,159,0.9996, ,0,Meter
+32658,WGS_1984_UTM_Zone_58N,500000,0,165,0.9996, ,0,Meter
+32659,WGS_1984_UTM_Zone_59N,500000,0,171,0.9996, ,0,Meter
+32660,WGS_1984_UTM_Zone_60N,500000,0,177,0.9996, ,0,Meter
+32661,UPS_North,2000000,2000000,0,0.994, ,90,Meter
+32701,WGS_1984_UTM_Zone_1S,500000,10000000,-177,0.9996, ,0,Meter
+32702,WGS_1984_UTM_Zone_2S,500000,10000000,-171,0.9996, ,0,Meter
+32703,WGS_1984_UTM_Zone_3S,500000,10000000,-165,0.9996, ,0,Meter
+32704,WGS_1984_UTM_Zone_4S,500000,10000000,-159,0.9996, ,0,Meter
+32705,WGS_1984_UTM_Zone_5S,500000,10000000,-153,0.9996, ,0,Meter
+32706,WGS_1984_UTM_Zone_6S,500000,10000000,-147,0.9996, ,0,Meter
+32707,WGS_1984_UTM_Zone_7S,500000,10000000,-141,0.9996, ,0,Meter
+32708,WGS_1984_UTM_Zone_8S,500000,10000000,-135,0.9996, ,0,Meter
+32709,WGS_1984_UTM_Zone_9S,500000,10000000,-129,0.9996, ,0,Meter
+32710,WGS_1984_UTM_Zone_10S,500000,10000000,-123,0.9996, ,0,Meter
+32711,WGS_1984_UTM_Zone_11S,500000,10000000,-117,0.9996, ,0,Meter
+32712,WGS_1984_UTM_Zone_12S,500000,10000000,-111,0.9996, ,0,Meter
+32713,WGS_1984_UTM_Zone_13S,500000,10000000,-105,0.9996, ,0,Meter
+32714,WGS_1984_UTM_Zone_14S,500000,10000000,-99,0.9996, ,0,Meter
+32715,WGS_1984_UTM_Zone_15S,500000,10000000,-93,0.9996, ,0,Meter
+32716,WGS_1984_UTM_Zone_16S,500000,10000000,-87,0.9996, ,0,Meter
+32717,WGS_1984_UTM_Zone_17S,500000,10000000,-81,0.9996, ,0,Meter
+32718,WGS_1984_UTM_Zone_18S,500000,10000000,-75,0.9996, ,0,Meter
+32719,WGS_1984_UTM_Zone_19S,500000,10000000,-69,0.9996, ,0,Meter
+32720,WGS_1984_UTM_Zone_20S,500000,10000000,-63,0.9996, ,0,Meter
+32721,WGS_1984_UTM_Zone_21S,500000,10000000,-57,0.9996, ,0,Meter
+32722,WGS_1984_UTM_Zone_22S,500000,10000000,-51,0.9996, ,0,Meter
+32723,WGS_1984_UTM_Zone_23S,500000,10000000,-45,0.9996, ,0,Meter
+32724,WGS_1984_UTM_Zone_24S,500000,10000000,-39,0.9996, ,0,Meter
+32725,WGS_1984_UTM_Zone_25S,500000,10000000,-33,0.9996, ,0,Meter
+32726,WGS_1984_UTM_Zone_26S,500000,10000000,-27,0.9996, ,0,Meter
+32727,WGS_1984_UTM_Zone_27S,500000,10000000,-21,0.9996, ,0,Meter
+32728,WGS_1984_UTM_Zone_28S,500000,10000000,-15,0.9996, ,0,Meter
+32729,WGS_1984_UTM_Zone_29S,500000,10000000,-9,0.9996, ,0,Meter
+32730,WGS_1984_UTM_Zone_30S,500000,10000000,-3,0.9996, ,0,Meter
+32731,WGS_1984_UTM_Zone_31S,500000,10000000,3,0.9996, ,0,Meter
+32732,WGS_1984_UTM_Zone_32S,500000,10000000,9,0.9996, ,0,Meter
+32733,WGS_1984_UTM_Zone_33S,500000,10000000,15,0.9996, ,0,Meter
+32734,WGS_1984_UTM_Zone_34S,500000,10000000,21,0.9996, ,0,Meter
+32735,WGS_1984_UTM_Zone_35S,500000,10000000,27,0.9996, ,0,Meter
+32736,WGS_1984_UTM_Zone_36S,500000,10000000,33,0.9996, ,0,Meter
+32737,WGS_1984_UTM_Zone_37S,500000,10000000,39,0.9996, ,0,Meter
+32738,WGS_1984_UTM_Zone_38S,500000,10000000,45,0.9996, ,0,Meter
+32739,WGS_1984_UTM_Zone_39S,500000,10000000,51,0.9996, ,0,Meter
+32740,WGS_1984_UTM_Zone_40S,500000,10000000,57,0.9996, ,0,Meter
+32741,WGS_1984_UTM_Zone_41S,500000,10000000,63,0.9996, ,0,Meter
+32742,WGS_1984_UTM_Zone_42S,500000,10000000,69,0.9996, ,0,Meter
+32743,WGS_1984_UTM_Zone_43S,500000,10000000,75,0.9996, ,0,Meter
+32744,WGS_1984_UTM_Zone_44S,500000,10000000,81,0.9996, ,0,Meter
+32745,WGS_1984_UTM_Zone_45S,500000,10000000,87,0.9996, ,0,Meter
+32746,WGS_1984_UTM_Zone_46S,500000,10000000,93,0.9996, ,0,Meter
+32747,WGS_1984_UTM_Zone_47S,500000,10000000,99,0.9996, ,0,Meter
+32748,WGS_1984_UTM_Zone_48S,500000,10000000,105,0.9996, ,0,Meter
+32749,WGS_1984_UTM_Zone_49S,500000,10000000,111,0.9996, ,0,Meter
+32750,WGS_1984_UTM_Zone_50S,500000,10000000,117,0.9996, ,0,Meter
+32751,WGS_1984_UTM_Zone_51S,500000,10000000,123,0.9996, ,0,Meter
+32752,WGS_1984_UTM_Zone_52S,500000,10000000,129,0.9996, ,0,Meter
+32753,WGS_1984_UTM_Zone_53S,500000,10000000,135,0.9996, ,0,Meter
+32754,WGS_1984_UTM_Zone_54S,500000,10000000,141,0.9996, ,0,Meter
+32755,WGS_1984_UTM_Zone_55S,500000,10000000,147,0.9996, ,0,Meter
+32756,WGS_1984_UTM_Zone_56S,500000,10000000,153,0.9996, ,0,Meter
+32757,WGS_1984_UTM_Zone_57S,500000,10000000,159,0.9996, ,0,Meter
+32758,WGS_1984_UTM_Zone_58S,500000,10000000,165,0.9996, ,0,Meter
+32759,WGS_1984_UTM_Zone_59S,500000,10000000,171,0.9996, ,0,Meter
+32760,WGS_1984_UTM_Zone_60S,500000,10000000,177,0.9996, ,0,Meter
+32761,UPS_South,2000000,2000000,0,0.994, ,-90,Meter
+32766,WGS_1984_TM_36_SE,500000,10000000,36,0.9996, ,0,Meter
+53001,Sphere_Plate_Carree,0,0,0,,,,Meter
+53002,Sphere_Equidistant_Cylindrical,0,0,0,60,,,Meter
+53003,Sphere_Miller_Cylindrical,0,0,0,,,,Meter
+53004,Sphere_Mercator,0,0,0,0,,,Meter
+53008,Sphere_Sinusoidal,0,0,0,,,,Meter
+53009,Sphere_Mollweide,0,0,0,,,,Meter
+53010,Sphere_Eckert_VI,0,0,0,,,,Meter
+53011,Sphere_Eckert_V,0,0,0,,,,Meter
+53012,Sphere_Eckert_IV,0,0,0,,,,Meter
+53013,Sphere_Eckert_III,0,0,0,,,,Meter
+53014,Sphere_Eckert_II,0,0,0,,,,Meter
+53015,Sphere_Eckert_I,0,0,0,,,,Meter
+53016,Sphere_Gall_Stereographic,0,0,0,,,,Meter
+53017,Sphere_Behrmann,0,0,0,,,,Meter
+53018,Sphere_Winkel_I,0,0,0,50.45977625,,,Meter
+53019,Sphere_Winkel_II,0,0,0,50.45977625,,,Meter
+53021,Sphere_Polyconic,0,0,0,0,,,Meter
+53022,Sphere_Quartic_Authalic,0,0,0,,,,Meter
+53023,Sphere_Loximuthal,0,0,0,40,,,Meter
+53024,Sphere_Bonne,0,0,0,60,,,Meter
+53026,Sphere_Stereographic,0,0,0,1, ,0,Meter
+53027,Sphere_Equidistant_Conic,0,0,0,60,60,0,Meter
+53028,Sphere_Cassini,0,0,0,1, ,0,Meter
+53029,Sphere_Van_der_Grinten_I,0,0,0,,,,Meter
+53030,Sphere_Robinson,0,0,0,,,,Meter
+53031,Sphere_Two_Point_Equidistant,0,0,0,60,0,60,Meter
+53032,Sphere_Azimuthal_Equidistant,0,0,0,,,0,Meter
+53034,Sphere_Cylindrical_Equal_Area,0,0,0,0,,,Meter
+53042,Sphere_Winkel_Tripel_NGS,0,0,0,50.467,,,Meter
+53043,Sphere_Aitoff,0,0,0,,,,Meter
+53044,Sphere_Hammer_Aitoff,0,0,0,,,,Meter
+53045,Sphere_Flat_Polar_Quartic,0,0,0,,,,Meter
+53046,Sphere_Craster_Parabolic,0,0,0,,,,Meter
+53048,Sphere_Times,0,0,0,,,,Meter
+54001,World_Plate_Carree,0,0,0,Meter,,,
+54002,World_Equidistant_Cylindrical,0,0,0,60,,,Meter
+54003,World_Miller_Cylindrical,0,0,0,,,,Meter
+54004,World_Mercator,0,0,0,0,,,Meter
+54008,World_Sinusoidal,0,0,0,,,,Meter
+54009,World_Mollweide,0,0,0,,,,Meter
+54010,World_Eckert_VI,0,0,0,,,,Meter
+54011,World_Eckert_V,0,0,0,,,,Meter
+54012,World_Eckert_IV,0,0,0,,,,Meter
+54013,World_Eckert_III,0,0,0,,,,Meter
+54014,World_Eckert_II,0,0,0,,,,Meter
+54015,World_Eckert_I,0,0,0,,,,Meter
+54016,World_Gall_Stereographic,0,0,0,,,,Meter
+54017,World_Behrmann,0,0,0,,,,Meter
+54018,World_Winkel_I,0,0,0,50.45977625,,,Meter
+54019,World_Winkel_II,0,0,0,50.45977625,,,Meter
+54021,World_Polyconic,0,0,0,,,0,Meter
+54022,World_Quartic_Authalic,0,0,0,,,,Meter
+54024,World_Bonne,0,0,0,60,,,Meter
+54026,World_Stereographic,0,0,0,1, ,0,Meter
+54027,World_Equidistant_Conic,0,0,0,60,60,0,Meter
+54028,World_Cassini,0,0,0,1, ,0,Meter
+54029,World_Van_der_Grinten_I,0,0,0,,,,Meter
+54030,World_Robinson,0,0,0,,,,Meter
+54031,World_Two_Point_Equidistant,0,0,0,60,0,60,Meter
+54032,World_Azimuthal_Equidistant,0,0,0,,,0,Meter
+54034,World_Cylindrical_Equal_Area,0,0,0,0,,,Meter
+54042,World_Winkel_Tripel_NGS,0,0,0,50.467,,,Meter
+54043,World_Aitoff,0,0,0,,,,Meter
+54044,World_Hammer_Aitoff,0,0,0,,,,Meter
+54045,World_Flat_Polar_Quartic,0,0,0,,,,Meter
+54046,World_Craster_Parabolic,0,0,0,,,,Meter
+54048,World_Times,0,0,0,,,,Meter
+54049,World_Vertical_Perspective,0,0,0,0,35800000,,Meter
+54050,World_Fuller,0,0,0,Meter,,,Meter
+54051,World_Cube,0,0,0,1,,,Meter
+54052,World_Goode_Homolosine_Land,0,0,0,1,,,Meter
+54053,World_Goode_Homolosine_Ocean,0,0,-160,2,,,Meter
+65061,NAD_1927_StatePlane_Guam_FIPS_5400,164041.6667,164041.6667,144.7487507,13.47246635,Foot_US,,
+65062,American_Samoa_1962_StatePlane_American_Samoa_FIPS_5300,500000,312234.65,-170,-14.26666667,1,-14.26666667,Foot_US
+65161,NAD_1983_StatePlane_Guam_FIPS_5400,50000,50000,144.7487507,,,13.47246635,Meter
+65163,NAD_1983_StatePlane_Kentucky_FIPS_1600,1500000,1000000,-85.75,37.08333333,38.66666667,36.33333333,Meter
+102001,Canada_Albers_Equal_Area_Conic,0,0,-96,50,70,40,Meter
+102002,Canada_Lambert_Conformal_Conic,0,0,-96,50,70,40,Meter
+102003,USA_Contiguous_Albers_Equal_Area_Conic,0,0,-96,29.5,45.5,37.5,Meter
+102004,USA_Contiguous_Lambert_Conformal_Conic,0,0,-96,33,45,39,Meter
+102005,USA_Contiguous_Equidistant_Conic,0,0,-96,33,45,39,Meter
+102006,Alaska_Albers_Equal_Area_Conic,0,0,-154,55,65,50,Meter
+102007,Hawaii_Albers_Equal_Area_Conic,0,0,-157,8,18,13,Meter
+102008,North_America_Albers_Equal_Area_Conic,0,0,-96,20,60,40,Meter
+102009,North_America_Lambert_Conformal_Conic,0,0,-96,20,60,40,Meter
+102010,North_America_Equidistant_Conic,0,0,-96,20,60,40,Meter
+102011,Africa_Sinusoidal,0,0,15,,,,Meter
+102012,Asia_Lambert_Conformal_Conic,0,0,105,30,62,0,Meter
+102013,Europe_Albers_Equal_Area_Conic,0,0,10,43,62,30,Meter
+102014,Europe_Lambert_Conformal_Conic,0,0,10,43,62,30,Meter
+102015,South_America_Lambert_Conformal_Conic,0,0,-60,-5,-42,-32,Meter
+102016,North_Pole_Azimuthal_Equidistant,0,0,0,,,90,Meter
+102017,North_Pole_Lambert_Azimuthal_Equal_Area,0,0,0,,,90,Meter
+102018,North_Pole_Stereographic,0,0,0,1, ,90,Meter
+102019,South_Pole_Azimuthal_Equidistant,0,0,0,,,-90,Meter
+102020,South_Pole_Lambert_Azimuthal_Equal_Area,0,0,0,,,-90,Meter
+102021,South_Pole_Stereographic,0,0,0,1, ,-90,Meter
+102022,Africa_Albers_Equal_Area_Conic,0,0,25,20,-23,0,Meter
+102023,Africa_Equidistant_Conic,0,0,25,20,-23,0,Meter
+102024,Africa_Lambert_Conformal_Conic,0,0,25,20,-23,0,Meter
+102025,Asia_North_Albers_Equal_Area_Conic,0,0,95,15,65,30,Meter
+102026,Asia_North_Equidistant_Conic,0,0,95,15,65,30,Meter
+102027,Asia_North_Lambert_Conformal_Conic,0,0,95,15,65,30,Meter
+102028,Asia_South_Albers_Equal_Area_Conic,0,0,125,7,-32,-15,Meter
+102029,Asia_South_Equidistant_Conic,0,0,125,7,-32,-15,Meter
+102030,Asia_South_Lambert_Conformal_Conic,0,0,125,7,-32,-15,Meter
+102031,Europe_Equidistant_Conic,0,0,10,43,62,30,Meter
+102032,South_America_Equidistant_Conic,0,0,-60,-5,-42,-32,Meter
+102033,South_America_Albers_Equal_Area_Conic,0,0,-60,-5,-42,-32,Meter
+102034,North_Pole_Gnomonic,0,0,0,90,,,Meter
+102035,North_Pole_Orthographic,0,0,0,90,,,Meter
+102036,South_Pole_Gnomonic,0,0,0,-90,,,Meter
+102037,South_Pole_Orthographic,0,0,0,-90,,,Meter
+102038,The_World_From_Space,0,0,-72.53333333,42.53333333,,,Meter
+102039,USA_Contiguous_Albers_Equal_Area_Conic_USGS_version,0,0,-96,29.5,45.5,23,Meter
+102060,D48_Slovenia_TM,500000,-5000000,15,0.9999, ,0,Meter
+102063,Kandawala_Ceylon_Belt_Meters,160933.5605,160933.5605,80.77171111,1, ,7.000480278,Meter
+102064,Kandawala_Ceylon_Belt_Indian_Yards_1937,176000,176000,80.77171111,1, ,7.000480278,Yard_Indian_1937
+102068,EMEP_50_Kilometer_Grid,8,110,-32,60,,,50_Kilometers
+102069,EMEP_150_Kilometer_Grid,3,37,-32,60,,,150_Kilometers
+102070,Guernsey_Grid,47000,50000,-2.416666667,0.999997, ,49.5,Meter
+102071,AGD_1966_ACT_Grid_AGC_Zone,200000,4510193.494,149.0092948,1.000086, ,0,Meter
+102072,AGD_1966_ISG_54_2,300000,5000000,141,0.99994, ,0,Meter
+102073,AGD_1966_ISG_54_3,300000,5000000,143,0.99994, ,0,Meter
+102074,AGD_1966_ISG_55_1,300000,5000000,145,0.99994, ,0,Meter
+102075,AGD_1966_ISG_55_2,300000,5000000,147,0.99994, ,0,Meter
+102076,AGD_1966_ISG_55_3,300000,5000000,149,0.99994, ,0,Meter
+102077,AGD_1966_ISG_56_1,300000,5000000,151,0.99994, ,0,Meter
+102078,AGD_1966_ISG_56_2,300000,5000000,153,0.99994, ,0,Meter
+102079,AGD_1966_ISG_56_3,300000,5000000,155,0.99994, ,0,Meter
+102090,Bermuda_2000_National_Grid,550000,100000,-64.75,1, ,32,Meter
+102091,Monte_Mario_Italy_1,1500000,0,9,0.9996, ,0,Meter
+102092,Monte_Mario_Italy_2,2520000,0,15,0.9996, ,0,Meter
+102093,Roma_1940_Gauss_Boaga_Est,2520000,0,15,0.9996, ,0,Meter
+102094,Roma_1940_Gauss_Boaga_Ovest,1500000,0,9,0.9996, ,0,Meter
+102095,JAD_2001_Jamaica_Grid,750000,650000,-77,18,1,18,Meter
+102096,Bab_South_Palau_Azimuthal_Equidistant,50000,150000,134.4504449,,,7.351222111,Meter
+102097,ETRS_1989_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
+102098,ETRS_1989_UTM_Zone_27N,500000,0,-21,0.9996, ,0,Meter
+102099,ETRS_1989_UTM_Zone_39N,500000,0,51,0.9996, ,0,Meter
+102101,NGO_1948_Norway_Zone_1,0,0,6.05625,1, ,58,Meter
+102102,NGO_1948_Norway_Zone_2,0,0,8.389583333,1, ,58,Meter
+102103,NGO_1948_Norway_Zone_3,0,0,10.72291667,1, ,58,Meter
+102104,NGO_1948_Norway_Zone_4,0,0,13.22291667,1, ,58,Meter
+102105,NGO_1948_Norway_Zone_5,0,0,16.88958333,1, ,58,Meter
+102106,NGO_1948_Norway_Zone_6,0,0,20.88958333,1, ,58,Meter
+102107,NGO_1948_Norway_Zone_7,0,0,24.88958333,1, ,58,Meter
+102108,NGO_1948_Norway_Zone_8,0,0,29.05625,1, ,58,Meter
+102110,RGF_1993_Lambert_93,700000,6600000,3,44,49,46.5,Meter
+102111,Chatham_Islands_1979_Map_Grid,350000,650000,-176.5,1, ,-44,Meter
+102112,NZGD_2000_Chatham_Island_Circuit,400000,800000,-176.5,1, ,-44,Meter
+102114,Old_Hawaiian_UTM_Zone_4N,500000,0,-159,0.9996, ,0,Meter
+102115,Old_Hawaiian_UTM_Zone_5N,500000,0,-153,0.9996, ,0,Meter
+102116,American_Samoa_1962_UTM_Zone_2S,500000,10000000,-171,0.9996, ,0,Meter
+102117,NAD_1927_Alaska_Albers_Meters,0,0,-154,55,65,50,Meter
+102118,NAD_1927_Georgia_Statewide_Albers,0,0,-83.5,29.5,45.5,23,Foot_US
+102119,NAD_1927_Texas_Statewide_Mapping_System,3000000,3000000,-100,27.41666667,34.91666667,31.16666667,Foot
+102120,NAD_1927_Michigan_GeoRef_Feet_US,8355401.583,-14284780.54,0.9996,337.25556,-86,45.30916667,Foot_US
+102121,NAD_1983_Michigan_GeoRef_Feet_US,8355401.583,-14284780.54,0.9996,337.25556,-86,45.30916667,Foot_US
+102122,NAD_1927_Michigan_GeoRef_Meters,2546731.496,-4354009.816,0.9996,337.25556,-86,45.30916667,Meter
+102123,NAD_1983_Michigan_GeoRef_Meters,2546731.496,-4354009.816,0.9996,337.25556,-86,45.30916667,Meter
+102124,NAD_1927_UTM_Zone_1N,500000,0,-177,0.9996, ,0,Meter
+102125,NAD_1927_UTM_Zone_2N,500000,0,-171,0.9996, ,0,Meter
+102126,NAD_1927_UTM_Zone_59N,500000,0,171,0.9996, ,0,Meter
+102127,NAD_1927_UTM_Zone_60N,500000,0,177,0.9996, ,0,Meter
+102128,NAD_1983_UTM_Zone_1N,500000,0,-177,0.9996, ,0,Meter
+102129,NAD_1983_UTM_Zone_2N,500000,0,-171,0.9996, ,0,Meter
+102130,NAD_1983_UTM_Zone_59N,500000,0,171,0.9996, ,0,Meter
+102131,NAD_1983_UTM_Zone_60N,500000,0,177,0.9996, ,0,Meter
+102132,NGO_1948_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
+102133,NGO_1948_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
+102134,NGO_1948_UTM_Zone_34N,500000,0,21,0.9996, ,0,Meter
+102135,NGO_1948_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
+102136,NGO_1948_Baerum_Kommune,19999.32,-202977.79,10.72291667,1, ,58,Meter
+102137,NGO_1948_Bergenhalvoen,100000,-200000,6.05625,1, ,58,Meter
+102138,NGO_1948_Oslo_Kommune,0,-212979.18,10.72291667,1, ,58,Meter
+102139,EUREF_FIN_TM35FIN,500000,0,27,0.9996, ,0,Meter
+102140,Hong_Kong_1980_Grid,836694.05,819069.8,114.1785556,1, ,22.31213333,Meter
+102141,Hong_Kong_1980_UTM_Zone_49N,500000,0,111,0.9996, ,0,Meter
+102142,Hong_Kong_1980_UTM_Zone_50N,500000,0,117,0.9996, ,0,Meter
+102143,QND_1995_UTM_39N,500000,0,51,0.9996, ,0,Meter
+102144,Merchich_Degree_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+102145,JGD_2000_UTM_Zone_51N,500000,0,123,0.9996, ,0,Meter
+102146,JGD_2000_UTM_Zone_52N,500000,0,129,0.9996, ,0,Meter
+102147,JGD_2000_UTM_Zone_53N,500000,0,135,0.9996, ,0,Meter
+102148,JGD_2000_UTM_Zone_54N,500000,0,141,0.9996, ,0,Meter
+102149,JGD_2000_UTM_Zone_55N,500000,0,147,0.9996, ,0,Meter
+102150,JGD_2000_UTM_Zone_56N,500000,0,153,0.9996, ,0,Meter
+102151,Tokyo_UTM_Zone_51N,500000,0,123,0.9996, ,0,Meter
+102152,Tokyo_UTM_Zone_52N,500000,0,129,0.9996, ,0,Meter
+102153,Tokyo_UTM_Zone_53N,500000,0,135,0.9996, ,0,Meter
+102154,Tokyo_UTM_Zone_54N,500000,0,141,0.9996, ,0,Meter
+102155,Tokyo_UTM_Zone_55N,500000,0,147,0.9996, ,0,Meter
+102156,Tokyo_UTM_Zone_56N,500000,0,153,0.9996, ,0,Meter
+102157,ETRS_1989_Kosovo_Grid,7500000,0,21,0.9999, ,0,Meter
+102158,Jordan_JTM,500000,-3000000,37,0.9998, ,0,Meter
+102159,Observatorio_Meteorologico_1965_Macau_Grid,20000,20000,113.5364694,1, ,22.21239722,Meter
+102160,Datum_73_Hayford_Gauss_IGeoE,200180.598,299913.01,-8.131906111,1, ,39.66666667,Meter
+102161,Datum_73_Hayford_Gauss_IPCC,180.598,-86.99,-8.131906111,1, ,39.66666667,Meter
+102162,Graciosa_Base_SW_1948_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
+102163,Lisboa_Bessel_Bonne,0,0,-8.131906111,39.66666667,,,Meter
+102164,Lisboa_Hayford_Gauss_IGeoE,200000,300000,-8.131906111,1, ,39.66666667,Meter
+102165,Lisboa_Hayford_Gauss_IPCC,0,0,-8.131906111,1, ,39.66666667,Meter
+102166,Observ_Meteorologico_1939_UTM_Zone_25N,500000,0,-33,0.9996, ,0,Meter
+102167,Porto_Santo_1936_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+102168,Sao_Braz_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
+102169,Selvagem_Grande_1938_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+102170,AGD_1966_VICGRID,2500000,4500000,145,-36,-38,-37,Meter
+102171,GDA_1994_VICGRID94,2500000,2500000,145,-36,-38,-37,Meter
+102172,GDA_1994_South_Australia_Lambert,1000000,2000000,135,-28,-36,-32,Meter
+102173,ETRS_1989_UWPP_1992,500000,-5300000,19,0.9993, ,0,Meter
+102174,ETRS_1989_UWPP_2000_PAS_5,5500000,0,15,0.999923, ,0,Meter
+102175,ETRS_1989_UWPP_2000_PAS_6,6500000,0,18,0.999923, ,0,Meter
+102176,ETRS_1989_UWPP_2000_PAS_7,7500000,0,21,0.999923, ,0,Meter
+102177,ETRS_1989_UWPP_2000_PAS_8,8500000,0,24,0.999923, ,0,Meter
+102178,NAD_1927_10TM_AEP_Forest,500000,0,-115,0.9992, ,0,Meter
+102179,NAD_1927_10TM_AEP_Resource,0,0,-115,0.9992, ,0,Meter
+102180,NAD_1927_3TM_111,0,0,-111,0.9999, ,0,Meter
+102181,NAD_1927_3TM_114,0,0,-114,0.9999, ,0,Meter
+102182,NAD_1927_3TM_117,0,0,-117,0.9999, ,0,Meter
+102183,NAD_1927_3TM_120,0,0,-120,0.9999, ,0,Meter
+102184,NAD_1983_10TM_AEP_Forest,500000,0,-115,0.9992, ,0,Meter
+102185,NAD_1983_10TM_AEP_Resource,0,0,-115,0.9992, ,0,Meter
+102186,NAD_1983_3TM_111,0,0,-111,0.9999, ,0,Meter
+102187,NAD_1983_3TM_114,0,0,-114,0.9999, ,0,Meter
+102188,NAD_1983_3TM_117,0,0,-117,0.9999, ,0,Meter
+102189,NAD_1983_3TM_120,0,0,-120,0.9999, ,0,Meter
+102190,NAD_1983_BC_Environment_Albers,1000000,0,-126,50,58.5,45,Meter
+102191,Nord_Maroc_Degree,500000,300000,-5.4,33.3,0.999625769,33.3,Meter
+102192,Sud_Maroc_Degree,500000,300000,-5.4,29.7,0.999615596,29.7,Meter
+102193,Sahara_Degree,1200000,400000,-5.4,26.1,0.9996,26.1,Meter
+102194,UWPP_1992,500000,-5300000,19,0.9993, ,0,Meter
+102195,UWPP_2000_PAS_5,5500000,0,15,0.999923, ,0,Meter
+102196,UWPP_2000_PAS_6,6500000,0,18,0.999923, ,0,Meter
+102197,UWPP_2000_PAS_7,7500000,0,21,0.999923, ,0,Meter
+102198,UWPP_2000_PAS_8,8500000,0,24,0.999923, ,0,Meter
+102200,NAD_1983_HARN_UTM_Zone_2S,500000,10000000,-171,0.9996, ,0,Meter
+102201,NAD_1983_HARN_Guam_Map_Grid,100000,200000,144.75,1, ,13.5,Meter
+102202,NAD_1983_HARN_UTM_Zone_4N,500000,0,-159,0.9996, ,0,Meter
+102203,NAD_1983_HARN_UTM_Zone_5N,500000,0,-153,0.9996, ,0,Meter
+102205,NAD_1983_HARN_UTM_Zone_11N,500000,0,-117,0.9996, ,0,Meter
+102206,NAD_1983_HARN_UTM_Zone_12N,500000,0,-111,0.9996, ,0,Meter
+102207,NAD_1983_HARN_UTM_Zone_13N,500000,0,-105,0.9996, ,0,Meter
+102208,NAD_1983_HARN_Maine_2000_East_Zone,700000,0,-67.875,0.99998, ,43.83333333,Meter
+102209,NAD_1983_HARN_Maine_2000_Central_Zone,500000,0,-69.125,0.99998, ,43.5,Meter
+102210,NAD_1983_HARN_Maine_2000_West_Zone,300000,0,-70.375,0.99998, ,42.83333333,Meter
+102211,NAD_1983_HARN_UTM_Zone_18N,500000,0,-75,0.9996, ,0,Meter
+102219,NAD_1983_Wisconsin_TM_US_Ft,1706033.333,-14698133.33,-90,0.9996, ,0,Foot_US
+102220,NAD_1983_HARN_Wisconsin_TM_US_Ft,1706033.333,-14698133.33,-90,0.9996, ,0,Foot_US
+102221,Ocotepeque_1935_Costa_Rica_Lambert_Norte,500000,271820.522,-84.33333333,11,9.933333333,10.46666667,Meter
+102222,Ocotepeque_1935_Costa_Rica_Lambert_Sur,500000,327987.436,-83.66666667,9.533333333,8.466666667,9,Meter
+102223,WGS_1984_Costa_Rica_TM_90,500000,0,-84,0.9996, ,0,Meter
+102224,MONREF_1997_UTM_Zone_46N,500000,0,93,0.9996, ,0,Meter
+102225,MONREF_1997_UTM_Zone_47N,500000,0,99,0.9996, ,0,Meter
+102226,MONREF_1997_UTM_Zone_48N,500000,0,105,0.9996, ,0,Meter
+102227,MONREF_1997_UTM_Zone_49N,500000,0,111,0.9996, ,0,Meter
+102228,MONREF_1997_UTM_Zone_50N,500000,0,117,0.9996, ,0,Meter
+102229,NAD_1983_HARN_StatePlane_Alabama_East_FIPS_0101,200000,0,-85.83333333,0.99996, ,30.5,Meter
+102230,NAD_1983_HARN_StatePlane_Alabama_West_FIPS_0102,600000,0,-87.5,0.999933333, ,30,Meter
+102231,Colombia_West_West_Zone,1000000,1000000,-80.08091667,1, ,4.599047222,Meter
+102232,Bogota_Ciudad_Bogota,92334.879,109320.965,-74.15,1.000399788, ,4.683333333,Meter
+102233,MAGNA_Ciudad_Bogota,92334.879,109320.965,-74.14659167,1.000399803, ,4.680486111,Meter
+102239,Guam_Geodetic_Triangulation_Network_1963,50000,50000,144.7487507,,,13.47246635,Meter
+102240,Guam_Geodetic_Network_1993,100000,200000,144.75,1, ,13.5,Meter
+102241,Pohnpei_Az_Eq_1971,80122.82,80747.24,158.2092992,,,6.965075694,Meter
+102242,Saipan_Az_Eq_1969,50000,50000,145.7112869,,,15.16755722,Meter
+102243,NAD_1983_HARN_StatePlane_California_III_FIPS_0403,2000000,500000,-120.5,37.06666667,38.43333333,36.5,Meter
+102244,NAD_1983_HARN_StatePlane_California_IV_FIPS_0404,2000000,500000,-119,36,37.25,35.33333333,Meter
+102245,NAD_1983_HARN_StatePlane_California_V_FIPS_0405,2000000,500000,-118,34.03333333,35.46666667,33.5,Meter
+102246,NAD_1983_HARN_StatePlane_California_VI_FIPS_0406,2000000,500000,-116.25,32.78333333,33.88333333,32.16666667,Meter
+102248,NAD_1983_HARN_StatePlane_Arizona_East_FIPS_0201,213360,0,-110.1666667,0.9999, ,31,Meter
+102249,NAD_1983_HARN_StatePlane_Arizona_Central_FIPS_0202,213360,0,-111.9166667,0.9999, ,31,Meter
+102250,NAD_1983_HARN_StatePlane_Arizona_West_FIPS_0203,213360,0,-113.75,0.999933333, ,31,Meter
+102251,NAD_1983_HARN_StatePlane_Arkansas_North_FIPS_0301,400000,0,-92,34.93333333,36.23333333,34.33333333,Meter
+102252,NAD_1983_HARN_StatePlane_Arkansas_South_FIPS_0302,400000,400000,-92,33.3,34.76666667,32.66666667,Meter
+102253,NAD_1983_HARN_StatePlane_Colorado_North_FIPS_0501,914401.8289,304800.6096,-105.5,39.71666667,40.78333333,39.33333333,Meter
+102254,NAD_1983_HARN_StatePlane_Colorado_Central_FIPS_0502,914401.8289,304800.6096,-105.5,38.45,39.75,37.83333333,Meter
+102255,NAD_1983_HARN_StatePlane_Colorado_South_FIPS_0503,914401.8289,304800.6096,-105.5,37.23333333,38.43333333,36.66666667,Meter
+102256,NAD_1983_HARN_StatePlane_Connecticut_FIPS_0600,304800.6096,152400.3048,-72.75,41.2,41.86666667,40.83333333,Meter
+102257,NAD_1983_HARN_StatePlane_Delaware_FIPS_0700,200000,0,-75.41666667,0.999995, ,38,Meter
+102258,NAD_1983_HARN_StatePlane_Florida_East_FIPS_0901,200000,0,-81,0.999941176, ,24.33333333,Meter
+102259,NAD_1983_HARN_StatePlane_Florida_West_FIPS_0902,200000,0,-82,0.999941176, ,24.33333333,Meter
+102260,NAD_1983_HARN_StatePlane_Florida_North_FIPS_0903,600000,0,-84.5,29.58333333,30.75,29,Meter
+102261,NAD_1983_HARN_StatePlane_Hawaii_1_FIPS_5101,500000,0,-155.5,0.999966667, ,18.83333333,Meter
+102262,NAD_1983_HARN_StatePlane_Hawaii_2_FIPS_5102,500000,0,-156.6666667,0.999966667, ,20.33333333,Meter
+102263,NAD_1983_HARN_StatePlane_Hawaii_3_FIPS_5103,500000,0,-158,0.99999, ,21.16666667,Meter
+102264,NAD_1983_HARN_StatePlane_Hawaii_4_FIPS_5104,500000,0,-159.5,0.99999, ,21.83333333,Meter
+102265,NAD_1983_HARN_StatePlane_Hawaii_5_FIPS_5105,500000,0,-160.1666667,1, ,21.66666667,Meter
+102266,NAD_1983_HARN_StatePlane_Georgia_East_FIPS_1001,200000,0,-82.16666667,0.9999, ,30,Meter
+102267,NAD_1983_HARN_StatePlane_Georgia_West_FIPS_1002,700000,0,-84.16666667,0.9999, ,30,Meter
+102268,NAD_1983_HARN_StatePlane_Idaho_East_FIPS_1101,200000,0,-112.1666667,0.999947368, ,41.66666667,Meter
+102269,NAD_1983_HARN_StatePlane_Idaho_Central_FIPS_1102,500000,0,-114,0.999947368, ,41.66666667,Meter
+102270,NAD_1983_HARN_StatePlane_Idaho_West_FIPS_1103,800000,0,-115.75,0.999933333, ,41.66666667,Meter
+102271,NAD_1983_HARN_StatePlane_Illinois_East_FIPS_1201,300000,0,-88.33333333,0.999975, ,36.66666667,Meter
+102272,NAD_1983_HARN_StatePlane_Illinois_West_FIPS_1202,700000,0,-90.16666667,0.999941176, ,36.66666667,Meter
+102273,NAD_1983_HARN_StatePlane_Indiana_East_FIPS_1301,100000,250000,-85.66666667,0.999966667, ,37.5,Meter
+102274,NAD_1983_HARN_StatePlane_Indiana_West_FIPS_1302,900000,250000,-87.08333333,0.999966667, ,37.5,Meter
+102275,NAD_1983_HARN_StatePlane_Iowa_North_FIPS_1401,1500000,1000000,-93.5,42.06666667,43.26666667,41.5,Meter
+102276,NAD_1983_HARN_StatePlane_Iowa_South_FIPS_1402,500000,0,-93.5,40.61666667,41.78333333,40,Meter
+102277,NAD_1983_HARN_StatePlane_Kansas_North_FIPS_1501,400000,0,-98,38.71666667,39.78333333,38.33333333,Meter
+102278,NAD_1983_HARN_StatePlane_Kansas_South_FIPS_1502,400000,400000,-98.5,37.26666667,38.56666667,36.66666667,Meter
+102279,NAD_1983_HARN_StatePlane_Kentucky_North_FIPS_1601,500000,0,-84.25,37.96666667,38.96666667,37.5,Meter
+102280,NAD_1983_HARN_StatePlane_Kentucky_South_FIPS_1602,500000,500000,-85.75,36.73333333,37.93333333,36.33333333,Meter
+102281,NAD_1983_HARN_StatePlane_Louisiana_North_FIPS_1701,1000000,0,-92.5,31.16666667,32.66666667,30.5,Meter
+102282,NAD_1983_HARN_StatePlane_Louisiana_South_FIPS_1702,1000000,0,-91.33333333,29.3,30.7,28.5,Meter
+102283,NAD_1983_HARN_StatePlane_Maine_East_FIPS_1801,300000,0,-68.5,0.9999, ,43.66666667,Meter
+102284,NAD_1983_HARN_StatePlane_Maine_West_FIPS_1802,900000,0,-70.16666667,0.999966667, ,42.83333333,Meter
+102285,NAD_1983_HARN_StatePlane_Maryland_FIPS_1900,400000,0,-77,38.3,39.45,37.66666667,Meter
+102286,NAD_1983_HARN_StatePlane_Massachusetts_Mainland_FIPS_2001,200000,750000,-71.5,41.71666667,42.68333333,41,Meter
+102287,NAD_1983_HARN_StatePlane_Massachusetts_Island_FIPS_2002,500000,0,-70.5,41.28333333,41.48333333,41,Meter
+102288,NAD_1983_HARN_StatePlane_Michigan_North_FIPS_2111,8000000,0,-87,45.48333333,47.08333333,44.78333333,Meter
+102289,NAD_1983_HARN_StatePlane_Michigan_Central_FIPS_2112,6000000,0,-84.36666667,44.18333333,45.7,43.31666667,Meter
+102290,NAD_1983_HARN_StatePlane_Michigan_South_FIPS_2113,4000000,0,-84.36666667,42.1,43.66666667,41.5,Meter
+102291,NAD_1983_HARN_StatePlane_Minnesota_North_FIPS_2201,800000,100000,-93.1,47.03333333,48.63333333,46.5,Meter
+102292,NAD_1983_HARN_StatePlane_Minnesota_Central_FIPS_2202,800000,100000,-94.25,45.61666667,47.05,45,Meter
+102293,NAD_1983_HARN_StatePlane_Minnesota_South_FIPS_2203,800000,100000,-94,43.78333333,45.21666667,43,Meter
+102294,NAD_1983_HARN_StatePlane_Mississippi_East_FIPS_2301,300000,0,-88.83333333,0.99995, ,29.5,Meter
+102295,NAD_1983_HARN_StatePlane_Mississippi_West_FIPS_2302,700000,0,-90.33333333,0.99995, ,29.5,Meter
+102296,NAD_1983_HARN_StatePlane_Missouri_East_FIPS_2401,250000,0,-90.5,0.999933333, ,35.83333333,Meter
+102297,NAD_1983_HARN_StatePlane_Missouri_Central_FIPS_2402,500000,0,-92.5,0.999933333, ,35.83333333,Meter
+102298,NAD_1983_HARN_StatePlane_Missouri_West_FIPS_2403,850000,0,-94.5,0.999941176, ,36.16666667,Meter
+102300,NAD_1983_HARN_StatePlane_Montana_FIPS_2500,600000,0,-109.5,45,49,44.25,Meter
+102304,NAD_1983_HARN_StatePlane_Nebraska_FIPS_2600,500000,0,-100,40,43,39.83333333,Meter
+102307,NAD_1983_HARN_StatePlane_Nevada_East_FIPS_2701,200000,8000000,-115.5833333,0.9999, ,34.75,Meter
+102308,NAD_1983_HARN_StatePlane_Nevada_Central_FIPS_2702,500000,6000000,-116.6666667,0.9999, ,34.75,Meter
+102309,NAD_1983_HARN_StatePlane_Nevada_West_FIPS_2703,800000,4000000,-118.5833333,0.9999, ,34.75,Meter
+102310,NAD_1983_HARN_StatePlane_New_Hampshire_FIPS_2800,300000,0,-71.66666667,0.999966667, ,42.5,Meter
+102311,NAD_1983_HARN_StatePlane_New_Jersey_FIPS_2900,150000,0,-74.5,0.9999, ,38.83333333,Meter
+102312,NAD_1983_HARN_StatePlane_New_Mexico_East_FIPS_3001,165000,0,-104.3333333,0.999909091, ,31,Meter
+102313,NAD_1983_HARN_StatePlane_New_Mexico_Central_FIPS_3002,500000,0,-106.25,0.9999, ,31,Meter
+102314,NAD_1983_HARN_StatePlane_New_Mexico_West_FIPS_3003,830000,0,-107.8333333,0.999916667, ,31,Meter
+102315,NAD_1983_HARN_StatePlane_New_York_East_FIPS_3101,150000,0,-74.5,0.9999, ,38.83333333,Meter
+102316,NAD_1983_HARN_StatePlane_New_York_Central_FIPS_3102,250000,0,-76.58333333,0.9999375, ,40,Meter
+102317,NAD_1983_HARN_StatePlane_New_York_West_FIPS_3103,350000,0,-78.58333333,0.9999375, ,40,Meter
+102318,NAD_1983_HARN_StatePlane_New_York_Long_Island_FIPS_3104,300000,0,-74,40.66666667,41.03333333,40.16666667,Meter
+102320,NAD_1983_HARN_StatePlane_North_Dakota_North_FIPS_3301,600000,0,-100.5,47.43333333,48.73333333,47,Meter
+102321,NAD_1983_HARN_StatePlane_North_Dakota_South_FIPS_3302,600000,0,-100.5,46.18333333,47.48333333,45.66666667,Meter
+102322,NAD_1983_HARN_StatePlane_Ohio_North_FIPS_3401,600000,0,-82.5,40.43333333,41.7,39.66666667,Meter
+102323,NAD_1983_HARN_StatePlane_Ohio_South_FIPS_3402,600000,0,-82.5,38.73333333,40.03333333,38,Meter
+102324,NAD_1983_HARN_StatePlane_Oklahoma_North_FIPS_3501,600000,0,-98,35.56666667,36.76666667,35,Meter
+102325,NAD_1983_HARN_StatePlane_Oklahoma_South_FIPS_3502,600000,0,-98,33.93333333,35.23333333,33.33333333,Meter
+102326,NAD_1983_HARN_StatePlane_Oregon_North_FIPS_3601,2500000,0,-120.5,44.33333333,46,43.66666667,Meter
+102327,NAD_1983_HARN_StatePlane_Oregon_South_FIPS_3602,1500000,0,-120.5,42.33333333,44,41.66666667,Meter
+102330,NAD_1983_HARN_StatePlane_Rhode_Island_FIPS_3800,100000,0,-71.5,0.99999375, ,41.08333333,Meter
+102334,NAD_1983_HARN_StatePlane_South_Dakota_North_FIPS_4001,600000,0,-100,44.41666667,45.68333333,43.83333333,Meter
+102335,NAD_1983_HARN_StatePlane_South_Dakota_South_FIPS_4002,600000,0,-100.3333333,42.83333333,44.4,42.33333333,Meter
+102336,NAD_1983_HARN_StatePlane_Tennessee_FIPS_4100,600000,0,-86,35.25,36.41666667,34.33333333,Meter
+102337,NAD_1983_HARN_StatePlane_Texas_North_FIPS_4201,200000,1000000,-101.5,34.65,36.18333333,34,Meter
+102338,NAD_1983_HARN_StatePlane_Texas_North_Central_FIPS_4202,600000,2000000,-98.5,32.13333333,33.96666667,31.66666667,Meter
+102339,NAD_1983_HARN_StatePlane_Texas_Central_FIPS_4203,700000,3000000,-100.3333333,30.11666667,31.88333333,29.66666667,Meter
+102340,NAD_1983_HARN_StatePlane_Texas_South_Central_FIPS_4204,600000,4000000,-99,28.38333333,30.28333333,27.83333333,Meter
+102341,NAD_1983_HARN_StatePlane_Texas_South_FIPS_4205,300000,5000000,-98.5,26.16666667,27.83333333,25.66666667,Meter
+102342,NAD_1983_HARN_StatePlane_Utah_North_FIPS_4301,500000,1000000,-111.5,40.71666667,41.78333333,40.33333333,Meter
+102343,NAD_1983_HARN_StatePlane_Utah_Central_FIPS_4302,500000,2000000,-111.5,39.01666667,40.65,38.33333333,Meter
+102344,NAD_1983_HARN_StatePlane_Utah_South_FIPS_4303,500000,3000000,-111.5,37.21666667,38.35,36.66666667,Meter
+102345,NAD_1983_HARN_StatePlane_Vermont_FIPS_4400,500000,0,-72.5,0.999964286, ,42.5,Meter
+102346,NAD_1983_HARN_StatePlane_Virginia_North_FIPS_4501,3500000,2000000,-78.5,38.03333333,39.2,37.66666667,Meter
+102347,NAD_1983_HARN_StatePlane_Virginia_South_FIPS_4502,3500000,1000000,-78.5,36.76666667,37.96666667,36.33333333,Meter
+102348,NAD_1983_HARN_StatePlane_Washington_North_FIPS_4601,500000,0,-120.8333333,47.5,48.73333333,47,Meter
+102349,NAD_1983_HARN_StatePlane_Washington_South_FIPS_4602,500000,0,-120.5,45.83333333,47.33333333,45.33333333,Meter
+102350,NAD_1983_HARN_StatePlane_West_Virginia_North_FIPS_4701,600000,0,-79.5,39,40.25,38.5,Meter
+102351,NAD_1983_HARN_StatePlane_West_Virginia_South_FIPS_4702,600000,0,-81,37.48333333,38.88333333,37,Meter
+102352,NAD_1983_HARN_StatePlane_Wisconsin_North_FIPS_4801,600000,0,-90,45.56666667,46.76666667,45.16666667,Meter
+102353,NAD_1983_HARN_StatePlane_Wisconsin_Central_FIPS_4802,600000,0,-90,44.25,45.5,43.83333333,Meter
+102354,NAD_1983_HARN_StatePlane_Wisconsin_South_FIPS_4803,600000,0,-90,42.73333333,44.06666667,42,Meter
+102355,NAD_1983_HARN_StatePlane_Wyoming_East_FIPS_4901,200000,0,-105.1666667,0.9999375, ,40.5,Meter
+102356,NAD_1983_HARN_StatePlane_Wyoming_East_Central_FIPS_4902,400000,100000,-107.3333333,0.9999375, ,40.5,Meter
+102357,NAD_1983_HARN_StatePlane_Wyoming_West_Central_FIPS_4903,600000,0,-108.75,0.9999375, ,40.5,Meter
+102358,NAD_1983_HARN_StatePlane_Wyoming_West_FIPS_4904,800000,100000,-110.0833333,0.9999375, ,40.5,Meter
+102361,NAD_1983_HARN_StatePlane_Puerto_Rico_Virgin_Islands_FIPS_5200,200000,200000,-66.43333333,18.03333333,18.43333333,17.83333333,Meter
+102363,NAD_1983_HARN_StatePlane_Kentucky_FIPS_1600,1500000,1000000,-85.75,37.08333333,38.66666667,36.33333333,Meter
+102421,WGS_1984_ARC_System_Zone_01,0,0,0,22.94791772,,,Meter
+102422,WGS_1984_ARC_System_Zone_02,0,0,0,41.12682127,,,Meter
+102423,WGS_1984_ARC_System_Zone_03,0,0,0,52.28859923,,,Meter
+102424,WGS_1984_ARC_System_Zone_04,0,0,0,60.32378942,,,Meter
+102425,WGS_1984_ARC_System_Zone_05,0,0,0,66.09421768,,,Meter
+102426,WGS_1984_ARC_System_Zone_06,0,0,0,70.10896259,,,Meter
+102427,WGS_1984_ARC_System_Zone_07,0,0,0,74.13230145,,,Meter
+102428,WGS_1984_ARC_System_Zone_08,0,0,0,78.1728375,,,Meter
+102429,WGS_1984_ARC_System_Zone_09,0,0,0,,,90,Meter
+102430,WGS_1984_ARC_System_Zone_10,0,0,0,-22.94791772,,,Meter
+102431,WGS_1984_ARC_System_Zone_11,0,0,0,-41.12682127,,,Meter
+102432,WGS_1984_ARC_System_Zone_12,0,0,0,-52.28859923,,,Meter
+102433,WGS_1984_ARC_System_Zone_13,0,0,0,-60.32378942,,,Meter
+102434,WGS_1984_ARC_System_Zone_14,0,0,0,-66.09421768,,,Meter
+102435,WGS_1984_ARC_System_Zone_15,0,0,0,-70.10896259,,,Meter
+102436,WGS_1984_ARC_System_Zone_16,0,0,0,-74.13230145,,,Meter
+102437,WGS_1984_ARC_System_Zone_17,0,0,0,-78.1728375,,,Meter
+102438,WGS_1984_ARC_System_Zone_18,0,0,0,,,-90,Meter
+102440,LKS_1992_Latvia_TM_0,500000,0,24,0.9996, ,0,Meter
+102441,TWD_1967_TM_Taiwan,250000,0,121,0.9999, ,0,Meter
+102442,TWD_1967_TM_Penghu,250000,0,119,0.9999, ,0,Meter
+102443,TWD_1997_TM_Taiwan,250000,0,121,0.9999, ,0,Meter
+102444,TWD_1997_TM_Penghu,250000,0,119,0.9999, ,0,Meter
+102461,NAD_1983_HARN_StatePlane_Hawaii_1_FIPS_5101_Feet,1640416.667,0,-155.5,0.999966667, ,18.83333333,Foot_US
+102462,NAD_1983_HARN_StatePlane_Hawaii_2_FIPS_5102_Feet,1640416.667,0,-156.6666667,0.999966667, ,20.33333333,Foot_US
+102463,NAD_1983_HARN_StatePlane_Hawaii_3_FIPS_5103_Feet,1640416.667,0,-158,0.99999, ,21.16666667,Foot_US
+102464,NAD_1983_HARN_StatePlane_Hawaii_4_FIPS_5104_Feet,1640416.667,0,-159.5,0.99999, ,21.83333333,Foot_US
+102465,NAD_1983_HARN_StatePlane_Hawaii_5_FIPS_5105_Feet,1640416.667,0,-160.1666667,1, ,21.66666667,Foot_US
+102466,NAD_1983_HARN_StatePlane_Minnesota_North_FIPS_2201_Feet,2624666.667,328083.3333,-93.1,47.03333333,48.63333333,46.5,Foot_US
+102467,NAD_1983_HARN_StatePlane_Minnesota_Central_FIPS_2202_Feet,2624666.667,328083.3333,-94.25,45.61666667,47.05,45,Foot_US
+102468,NAD_1983_HARN_StatePlane_Minnesota_South_FIPS_2203_Feet,2624666.667,328083.3333,-94,43.78333333,45.21666667,43,Foot_US
+102491,Nord_Algerie_Ancienne_Degree,500000,300000,2.7,36,0.999625544,36,Meter
+102492,Sud_Algerie_Ancienne_Degree,500000,300000,2.7,33.3,0.999625769,33.3,Meter
+102570,WGS_1984_Complex_UTM_Zone_20N,500000,0,-63,0.9996, ,0,Meter
+102571,WGS_1984_Complex_UTM_Zone_21N,500000,0,-57,0.9996, ,0,Meter
+102572,WGS_1984_Complex_UTM_Zone_22N,500000,0,-51,0.9996, ,0,Meter
+102573,WGS_1984_Complex_UTM_Zone_23N,500000,0,-45,0.9996, ,0,Meter
+102574,WGS_1984_Complex_UTM_Zone_24N,500000,0,-39,0.9996, ,0,Meter
+102575,WGS_1984_Complex_UTM_Zone_25N,500000,0,-33,0.9996, ,0,Meter
+102576,WGS_1984_Complex_UTM_Zone_26N,500000,0,-27,0.9996, ,0,Meter
+102577,WGS_1984_Complex_UTM_Zone_27N,500000,0,-21,0.9996, ,0,Meter
+102578,WGS_1984_Complex_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+102579,WGS_1984_Complex_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
+102580,WGS_1984_Complex_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
+102581,NTF_France_I_degrees,600000,1200000,2.337229167,49.5,0.999877341,49.5,Meter
+102582,NTF_France_II_degrees,600000,2200000,2.337229167,46.8,0.99987742,46.8,Meter
+102583,NTF_France_III_degrees,600000,3200000,2.337229167,44.1,0.999877499,44.1,Meter
+102584,NTF_France_IV_degrees,234.358,185861.369,2.337229167,42.165,0.99994471,42.165,Meter
+102591,Nord_Algerie_Degree,500135,300090,2.7,36,0.999625544,36,Meter
+102592,Sud_Algerie_Degree,500135,300090,2.7,33.3,0.999625769,33.3,Meter
+102601,NAD_1983_Texas_Centric_Mapping_System_Albers,1500000,6000000,-100,27.5,35,18,Meter
+102602,NAD_1983_Texas_Centric_Mapping_System_Lambert,1500000,5000000,-100,27.5,35,18,Meter
+102603,NAD_1983_Texas_Statewide_Mapping_System,1000000,1000000,-100,27.41666667,34.91666667,31.16666667,Meter
+102604,NAD_1983_Georgia_Statewide_Lambert,0,0,-83.5,31.41666667,34.28333333,0,Foot_US
+102605,NAD_1983_Idaho_TM,2500000,1200000,-114,0.9996, ,42,Meter
+102606,NAD_1983_Maine_2000_East_Zone,700000,0,-67.875,0.99998, ,43.83333333,Meter
+102607,NAD_1983_Maine_2000_Central_Zone,500000,0,-69.125,0.99998, ,43.5,Meter
+102608,NAD_1983_Maine_2000_West_Zone,300000,0,-70.375,0.99998, ,42.83333333,Meter
+102609,NAD_1983_Mississippi_TM,500000,1300000,-89.75,0.9998335, ,32.5,Meter
+102629,NAD_1983_StatePlane_Alabama_East_FIPS_0101_Feet,656166.6667,0,-85.83333333,0.99996, ,30.5,Foot_US
+102630,NAD_1983_StatePlane_Alabama_West_FIPS_0102_Feet,1968500,0,-87.5,0.999933333, ,30,Foot_US
+102631,NAD_1983_StatePlane_Alaska_1_FIPS_5001_Feet,16404166.67,-16404166.67,0.9999,-36.86989765,-133.6666667,57,Foot_US
+102632,NAD_1983_StatePlane_Alaska_2_FIPS_5002_Feet,1640416.667,0,-142,0.9999, ,54,Foot_US
+102633,NAD_1983_StatePlane_Alaska_3_FIPS_5003_Feet,1640416.667,0,-146,0.9999, ,54,Foot_US
+102634,NAD_1983_StatePlane_Alaska_4_FIPS_5004_Feet,1640416.667,0,-150,0.9999, ,54,Foot_US
+102635,NAD_1983_StatePlane_Alaska_5_FIPS_5005_Feet,1640416.667,0,-154,0.9999, ,54,Foot_US
+102636,NAD_1983_StatePlane_Alaska_6_FIPS_5006_Feet,1640416.667,0,-158,0.9999, ,54,Foot_US
+102637,NAD_1983_StatePlane_Alaska_7_FIPS_5007_Feet,1640416.667,0,-162,0.9999, ,54,Foot_US
+102638,NAD_1983_StatePlane_Alaska_8_FIPS_5008_Feet,1640416.667,0,-166,0.9999, ,54,Foot_US
+102639,NAD_1983_StatePlane_Alaska_9_FIPS_5009_Feet,1640416.667,0,-170,0.9999, ,54,Foot_US
+102640,NAD_1983_StatePlane_Alaska_10_FIPS_5010_Feet,3280833.333,0,-176,51.83333333,53.83333333,51,Foot_US
+102641,NAD_1983_StatePlane_California_I_FIPS_0401_Feet,6561666.667,1640416.667,-122,40,41.66666667,39.33333333,Foot_US
+102642,NAD_1983_StatePlane_California_II_FIPS_0402_Feet,6561666.667,1640416.667,-122,38.33333333,39.83333333,37.66666667,Foot_US
+102643,NAD_1983_StatePlane_California_III_FIPS_0403_Feet,6561666.667,1640416.667,-120.5,37.06666667,38.43333333,36.5,Foot_US
+102644,NAD_1983_StatePlane_California_IV_FIPS_0404_Feet,6561666.667,1640416.667,-119,36,37.25,35.33333333,Foot_US
+102645,NAD_1983_StatePlane_California_V_FIPS_0405_Feet,6561666.667,1640416.667,-118,34.03333333,35.46666667,33.5,Foot_US
+102646,NAD_1983_StatePlane_California_VI_FIPS_0406_Feet,6561666.667,1640416.667,-116.25,32.78333333,33.88333333,32.16666667,Foot_US
+102648,NAD_1983_StatePlane_Arizona_East_FIPS_0201_Feet,699998.6,0,-110.1666667,0.9999, ,31,Foot_US
+102649,NAD_1983_StatePlane_Arizona_Central_FIPS_0202_Feet,699998.6,0,-111.9166667,0.9999, ,31,Foot_US
+102650,NAD_1983_StatePlane_Arizona_West_FIPS_0203_Feet,699998.6,0,-113.75,0.999933333, ,31,Foot_US
+102651,NAD_1983_StatePlane_Arkansas_North_FIPS_0301_Feet,1312333.333,0,-92,34.93333333,36.23333333,34.33333333,Foot_US
+102652,NAD_1983_StatePlane_Arkansas_South_FIPS_0302_Feet,1312333.333,1312333.333,-92,33.3,34.76666667,32.66666667,Foot_US
+102653,NAD_1983_StatePlane_Colorado_North_FIPS_0501_Feet,3000000,1000000,-105.5,39.71666667,40.78333333,39.33333333,Foot_US
+102654,NAD_1983_StatePlane_Colorado_Central_FIPS_0502_Feet,3000000,1000000,-105.5,38.45,39.75,37.83333333,Foot_US
+102655,NAD_1983_StatePlane_Colorado_South_FIPS_0503_Feet,3000000,1000000,-105.5,37.23333333,38.43333333,36.66666667,Foot_US
+102656,NAD_1983_StatePlane_Connecticut_FIPS_0600_Feet,1000000,500000,-72.75,41.2,41.86666667,40.83333333,Foot_US
+102657,NAD_1983_StatePlane_Delaware_FIPS_0700_Feet,656166.6667,0,-75.41666667,0.999995, ,38,Foot_US
+102658,NAD_1983_StatePlane_Florida_East_FIPS_0901_Feet,656166.6667,0,-81,0.999941176, ,24.33333333,Foot_US
+102659,NAD_1983_StatePlane_Florida_West_FIPS_0902_Feet,656166.6667,0,-82,0.999941176, ,24.33333333,Foot_US
+102660,NAD_1983_StatePlane_Florida_North_FIPS_0903_Feet,1968500,0,-84.5,29.58333333,30.75,29,Foot_US
+102661,NAD_1983_StatePlane_Hawaii_1_FIPS_5101_Feet,1640416.667,0,-155.5,0.999966667, ,18.83333333,Foot_US
+102662,NAD_1983_StatePlane_Hawaii_2_FIPS_5102_Feet,1640416.667,0,-156.6666667,0.999966667, ,20.33333333,Foot_US
+102663,NAD_1983_StatePlane_Hawaii_3_FIPS_5103_Feet,1640416.667,0,-158,0.99999, ,21.16666667,Foot_US
+102664,NAD_1983_StatePlane_Hawaii_4_FIPS_5104_Feet,1640416.667,0,-159.5,0.99999, ,21.83333333,Foot_US
+102665,NAD_1983_StatePlane_Hawaii_5_FIPS_5105_Feet,1640416.667,0,-160.1666667,1, ,21.66666667,Foot_US
+102666,NAD_1983_StatePlane_Georgia_East_FIPS_1001_Feet,656166.6667,0,-82.16666667,0.9999, ,30,Foot_US
+102667,NAD_1983_StatePlane_Georgia_West_FIPS_1002_Feet,2296583.333,0,-84.16666667,0.9999, ,30,Foot_US
+102668,NAD_1983_StatePlane_Idaho_East_FIPS_1101_Feet,656166.6667,0,-112.1666667,0.999947368, ,41.66666667,Foot_US
+102669,NAD_1983_StatePlane_Idaho_Central_FIPS_1102_Feet,1640416.667,0,-114,0.999947368, ,41.66666667,Foot_US
+102670,NAD_1983_StatePlane_Idaho_West_FIPS_1103_Feet,2624666.667,0,-115.75,0.999933333, ,41.66666667,Foot_US
+102671,NAD_1983_StatePlane_Illinois_East_FIPS_1201_Feet,984250,0,-88.33333333,0.999975, ,36.66666667,Foot_US
+102672,NAD_1983_StatePlane_Illinois_West_FIPS_1202_Feet,2296583.333,0,-90.16666667,0.999941176, ,36.66666667,Foot_US
+102673,NAD_1983_StatePlane_Indiana_East_FIPS_1301_Feet,328083.3333,820208.3333,-85.66666667,0.999966667, ,37.5,Foot_US
+102674,NAD_1983_StatePlane_Indiana_West_FIPS_1302_Feet,2952750,820208.3333,-87.08333333,0.999966667, ,37.5,Foot_US
+102675,NAD_1983_StatePlane_Iowa_North_FIPS_1401_Feet,4921250,3280833.333,-93.5,42.06666667,43.26666667,41.5,Foot_US
+102676,NAD_1983_StatePlane_Iowa_South_FIPS_1402_Feet,1640416.667,0,-93.5,40.61666667,41.78333333,40,Foot_US
+102677,NAD_1983_StatePlane_Kansas_North_FIPS_1501_Feet,1312333.333,0,-98,38.71666667,39.78333333,38.33333333,Foot_US
+102678,NAD_1983_StatePlane_Kansas_South_FIPS_1502_Feet,1312333.333,1312333.333,-98.5,37.26666667,38.56666667,36.66666667,Foot_US
+102679,NAD_1983_StatePlane_Kentucky_North_FIPS_1601_Feet,1640416.667,0,-84.25,37.96666667,38.96666667,37.5,Foot_US
+102680,NAD_1983_StatePlane_Kentucky_South_FIPS_1602_Feet,1640416.667,1640416.667,-85.75,36.73333333,37.93333333,36.33333333,Foot_US
+102681,NAD_1983_StatePlane_Louisiana_North_FIPS_1701_Feet,3280833.333,0,-92.5,31.16666667,32.66666667,30.5,Foot_US
+102682,NAD_1983_StatePlane_Louisiana_South_FIPS_1702_Feet,3280833.333,0,-91.33333333,29.3,30.7,28.5,Foot_US
+102683,NAD_1983_StatePlane_Maine_East_FIPS_1801_Feet,984250,0,-68.5,0.9999, ,43.66666667,Foot_US
+102684,NAD_1983_StatePlane_Maine_West_FIPS_1802_Feet,2952750,0,-70.16666667,0.999966667, ,42.83333333,Foot_US
+102685,NAD_1983_StatePlane_Maryland_FIPS_1900_Feet,1312333.333,0,-77,38.3,39.45,37.66666667,Foot_US
+102686,NAD_1983_StatePlane_Massachusetts_Mainland_FIPS_2001_Feet,656166.6667,2460625,-71.5,41.71666667,42.68333333,41,Foot_US
+102687,NAD_1983_StatePlane_Massachusetts_Island_FIPS_2002_Feet,1640416.667,0,-70.5,41.28333333,41.48333333,41,Foot_US
+102688,NAD_1983_StatePlane_Michigan_North_FIPS_2111_Feet,26246666.67,0,-87,45.48333333,47.08333333,44.78333333,Foot_US
+102689,NAD_1983_StatePlane_Michigan_Central_FIPS_2112_Feet,19685000,0,-84.36666667,44.18333333,45.7,43.31666667,Foot_US
+102690,NAD_1983_StatePlane_Michigan_South_FIPS_2113_Feet,13123333.33,0,-84.36666667,42.1,43.66666667,41.5,Foot_US
+102691,NAD_1983_StatePlane_Minnesota_North_FIPS_2201_Feet,2624666.667,328083.3333,-93.1,47.03333333,48.63333333,46.5,Foot_US
+102692,NAD_1983_StatePlane_Minnesota_Central_FIPS_2202_Feet,2624666.667,328083.3333,-94.25,45.61666667,47.05,45,Foot_US
+102693,NAD_1983_StatePlane_Minnesota_South_FIPS_2203_Feet,2624666.667,328083.3333,-94,43.78333333,45.21666667,43,Foot_US
+102694,NAD_1983_StatePlane_Mississippi_East_FIPS_2301_Feet,984250,0,-88.83333333,0.99995, ,29.5,Foot_US
+102695,NAD_1983_StatePlane_Mississippi_West_FIPS_2302_Feet,2296583.333,0,-90.33333333,0.99995, ,29.5,Foot_US
+102696,NAD_1983_StatePlane_Missouri_East_FIPS_2401_Feet,820208.3333,0,-90.5,0.999933333, ,35.83333333,Foot_US
+102697,NAD_1983_StatePlane_Missouri_Central_FIPS_2402_Feet,1640416.667,0,-92.5,0.999933333, ,35.83333333,Foot_US
+102698,NAD_1983_StatePlane_Missouri_West_FIPS_2403_Feet,2788708.333,0,-94.5,0.999941176, ,36.16666667,Foot_US
+102700,NAD_1983_StatePlane_Montana_FIPS_2500_Feet,1968500,0,-109.5,45,49,44.25,Foot_US
+102704,NAD_1983_StatePlane_Nebraska_FIPS_2600_Feet,1640416.667,0,-100,40,43,39.83333333,Foot_US
+102707,NAD_1983_StatePlane_Nevada_East_FIPS_2701_Feet,656166.6667,26246666.67,-115.5833333,0.9999, ,34.75,Foot_US
+102708,NAD_1983_StatePlane_Nevada_Central_FIPS_2702_Feet,1640416.667,19685000,-116.6666667,0.9999, ,34.75,Foot_US
+102709,NAD_1983_StatePlane_Nevada_West_FIPS_2703_Feet,2624666.667,13123333.33,-118.5833333,0.9999, ,34.75,Foot_US
+102710,NAD_1983_StatePlane_New_Hampshire_FIPS_2800_Feet,984250,0,-71.66666667,0.999966667, ,42.5,Foot_US
+102711,NAD_1983_StatePlane_New_Jersey_FIPS_2900_Feet,492125,0,-74.5,0.9999, ,38.83333333,Foot_US
+102712,NAD_1983_StatePlane_New_Mexico_East_FIPS_3001_Feet,541337.5,0,-104.3333333,0.999909091, ,31,Foot_US
+102713,NAD_1983_StatePlane_New_Mexico_Central_FIPS_3002_Feet,1640416.667,0,-106.25,0.9999, ,31,Foot_US
+102714,NAD_1983_StatePlane_New_Mexico_West_FIPS_3003_Feet,2723091.667,0,-107.8333333,0.999916667, ,31,Foot_US
+102715,NAD_1983_StatePlane_New_York_East_FIPS_3101_Feet,492125,0,-74.5,0.9999, ,38.83333333,Foot_US
+102716,NAD_1983_StatePlane_New_York_Central_FIPS_3102_Feet,820208.3333,0,-76.58333333,0.9999375, ,40,Foot_US
+102717,NAD_1983_StatePlane_New_York_West_FIPS_3103_Feet,1148291.667,0,-78.58333333,0.9999375, ,40,Foot_US
+102718,NAD_1983_StatePlane_New_York_Long_Island_FIPS_3104_Feet,984250,0,-74,40.66666667,41.03333333,40.16666667,Foot_US
+102719,NAD_1983_StatePlane_North_Carolina_FIPS_3200_Feet,2000000.003,0,-79,34.33333333,36.16666667,33.75,Foot_US
+102720,NAD_1983_StatePlane_North_Dakota_North_FIPS_3301_Feet,1968500,0,-100.5,47.43333333,48.73333333,47,Foot_US
+102721,NAD_1983_StatePlane_North_Dakota_South_FIPS_3302_Feet,1968500,0,-100.5,46.18333333,47.48333333,45.66666667,Foot_US
+102722,NAD_1983_StatePlane_Ohio_North_FIPS_3401_Feet,1968500,0,-82.5,40.43333333,41.7,39.66666667,Foot_US
+102723,NAD_1983_StatePlane_Ohio_South_FIPS_3402_Feet,1968500,0,-82.5,38.73333333,40.03333333,38,Foot_US
+102724,NAD_1983_StatePlane_Oklahoma_North_FIPS_3501_Feet,1968500,0,-98,35.56666667,36.76666667,35,Foot_US
+102725,NAD_1983_StatePlane_Oklahoma_South_FIPS_3502_Feet,1968500,0,-98,33.93333333,35.23333333,33.33333333,Foot_US
+102726,NAD_1983_StatePlane_Oregon_North_FIPS_3601_Feet,8202083.333,0,-120.5,44.33333333,46,43.66666667,Foot_US
+102727,NAD_1983_StatePlane_Oregon_South_FIPS_3602_Feet,4921250,0,-120.5,42.33333333,44,41.66666667,Foot_US
+102728,NAD_1983_StatePlane_Pennsylvania_North_FIPS_3701_Feet,1968500,0,-77.75,40.88333333,41.95,40.16666667,Foot_US
+102729,NAD_1983_StatePlane_Pennsylvania_South_FIPS_3702_Feet,1968500,0,-77.75,39.93333333,40.96666667,39.33333333,Foot_US
+102730,NAD_1983_StatePlane_Rhode_Island_FIPS_3800_Feet,328083.3333,0,-71.5,0.99999375, ,41.08333333,Foot_US
+102733,NAD_1983_StatePlane_South_Carolina_FIPS_3900_Feet,1999996,0,-81,32.5,34.83333333,31.83333333,Foot_US
+102734,NAD_1983_StatePlane_South_Dakota_North_FIPS_4001_Feet,1968500,0,-100,44.41666667,45.68333333,43.83333333,Foot_US
+102735,NAD_1983_StatePlane_South_Dakota_South_FIPS_4002_Feet,1968500,0,-100.3333333,42.83333333,44.4,42.33333333,Foot_US
+102736,NAD_1983_StatePlane_Tennessee_FIPS_4100_Feet,1968500,0,-86,35.25,36.41666667,34.33333333,Foot_US
+102737,NAD_1983_StatePlane_Texas_North_FIPS_4201_Feet,656166.6667,3280833.333,-101.5,34.65,36.18333333,34,Foot_US
+102738,NAD_1983_StatePlane_Texas_North_Central_FIPS_4202_Feet,1968500,6561666.667,-98.5,32.13333333,33.96666667,31.66666667,Foot_US
+102739,NAD_1983_StatePlane_Texas_Central_FIPS_4203_Feet,2296583.333,9842500,-100.3333333,30.11666667,31.88333333,29.66666667,Foot_US
+102740,NAD_1983_StatePlane_Texas_South_Central_FIPS_4204_Feet,1968500,13123333.33,-99,28.38333333,30.28333333,27.83333333,Foot_US
+102741,NAD_1983_StatePlane_Texas_South_FIPS_4205_Feet,984250,16404166.67,-98.5,26.16666667,27.83333333,25.66666667,Foot_US
+102742,NAD_1983_StatePlane_Utah_North_FIPS_4301_Feet,1640416.667,3280833.333,-111.5,40.71666667,41.78333333,40.33333333,Foot_US
+102743,NAD_1983_StatePlane_Utah_Central_FIPS_4302_Feet,1640416.667,6561666.667,-111.5,39.01666667,40.65,38.33333333,Foot_US
+102744,NAD_1983_StatePlane_Utah_South_FIPS_4303_Feet,1640416.667,9842500,-111.5,37.21666667,38.35,36.66666667,Foot_US
+102745,NAD_1983_StatePlane_Vermont_FIPS_4400_Feet,1640416.667,0,-72.5,0.999964286, ,42.5,Foot_US
+102746,NAD_1983_StatePlane_Virginia_North_FIPS_4501_Feet,11482916.67,6561666.667,-78.5,38.03333333,39.2,37.66666667,Foot_US
+102747,NAD_1983_StatePlane_Virginia_South_FIPS_4502_Feet,11482916.67,3280833.333,-78.5,36.76666667,37.96666667,36.33333333,Foot_US
+102748,NAD_1983_StatePlane_Washington_North_FIPS_4601_Feet,1640416.667,0,-120.8333333,47.5,48.73333333,47,Foot_US
+102749,NAD_1983_StatePlane_Washington_South_FIPS_4602_Feet,1640416.667,0,-120.5,45.83333333,47.33333333,45.33333333,Foot_US
+102750,NAD_1983_StatePlane_West_Virginia_North_FIPS_4701_Feet,1968500,0,-79.5,39,40.25,38.5,Foot_US
+102751,NAD_1983_StatePlane_West_Virginia_South_FIPS_4702_Feet,1968500,0,-81,37.48333333,38.88333333,37,Foot_US
+102752,NAD_1983_StatePlane_Wisconsin_North_FIPS_4801_Feet,1968500,0,-90,45.56666667,46.76666667,45.16666667,Foot_US
+102753,NAD_1983_StatePlane_Wisconsin_Central_FIPS_4802_Feet,1968500,0,-90,44.25,45.5,43.83333333,Foot_US
+102754,NAD_1983_StatePlane_Wisconsin_South_FIPS_4803_Feet,1968500,0,-90,42.73333333,44.06666667,42,Foot_US
+102755,NAD_1983_StatePlane_Wyoming_East_FIPS_4901_Feet,656166.6667,0,-105.1666667,0.9999375, ,40.5,Foot_US
+102756,NAD_1983_StatePlane_Wyoming_East_Central_FIPS_4902_Feet,1312333.333,328083.3333,-107.3333333,0.9999375, ,40.5,Foot_US
+102757,NAD_1983_StatePlane_Wyoming_West_Central_FIPS_4903_Feet,1968500,0,-108.75,0.9999375, ,40.5,Foot_US
+102758,NAD_1983_StatePlane_Wyoming_West_FIPS_4904_Feet,2624666.667,328083.3333,-110.0833333,0.9999375, ,40.5,Foot_US
+102761,NAD_1983_StatePlane_Puerto_Rico_Virgin_Islands_FIPS_5200_Feet,656166.6667,656166.6667,-66.43333333,18.03333333,18.43333333,17.83333333,Foot_US
+102763,NAD_1983_StatePlane_Kentucky_FIPS_1600_Feet,4921250,3280833.333,-85.75,37.08333333,38.66666667,36.33333333,Foot_US
+102766,NAD_1983_StatePlane_Guam_FIPS_5400_Feet,164041.6667,164041.6667,144.7487507,,,13.47246635,Foot_US
+103528,ETRF_1989_UTM_Zone_28N,500000,0,-15,0.9996, ,0,Meter
+103529,ETRF_1989_UTM_Zone_29N,500000,0,-9,0.9996, ,0,Meter
+103530,ETRF_1989_UTM_Zone_30N,500000,0,-3,0.9996, ,0,Meter
+103531,ETRF_1989_UTM_Zone_31N,500000,0,3,0.9996, ,0,Meter
+103532,ETRF_1989_UTM_Zone_32N,500000,0,9,0.9996, ,0,Meter
+103533,ETRF_1989_UTM_Zone_33N,500000,0,15,0.9996, ,0,Meter
+103534,ETRF_1989_UTM_Zone_34N,500000,0,21,0.9996, ,0,Meter
+103535,ETRF_1989_UTM_Zone_35N,500000,0,27,0.9996, ,0,Meter
+103536,ETRF_1989_UTM_Zone_36N,500000,0,33,0.9996, ,0,Meter
+103537,ETRF_1989_UTM_Zone_37N,500000,0,39,0.9996, ,0,Meter
+103538,ETRF_1989_UTM_Zone_38N,500000,0,45,0.9996, ,0,Meter
+103584,ETRF_1989_TM_Baltic_1993,500000,0,24,0.9996, ,0,Meter
+103600,NAD_1983_HARN_Adj_MN_Aitkin_Meters,152409.3197,30481.86394,-93.41666667,1.000059153, ,46.15416667,Meter
+103601,NAD_1983_HARN_Adj_MN_Clay_Meters,152407.2113,30481.44225,-96.7,1.000045318, ,46.63,Meter
+103602,NAD_1983_HARN_Adj_MN_Clearwater_Meters,152411.3547,30482.27094,-95.36666667,1.000072506, ,47.15166667,Meter
+103603,NAD_1983_HARN_Adj_MN_Hubbard_Meters,152411.2096,30482.24192,-94.91666667,1.000071554, ,46.80361111,Meter
+103604,NAD_1983_HARN_Adj_MN_Lake_Meters,152411.8635,30482.37271,-91.4,1.000075845, ,47.06666667,Meter
+103605,NAD_1983_HARN_Adj_MN_Mille_Lacs_Meters,152408.5567,30481.71134,-93.61666667,1.000054146, ,45.55888889,Meter
+103606,NAD_1983_HARN_Adj_MN_Washington_Meters,152406.3759,30481.27519,-92.83333333,1.000039837, ,44.74583333,Meter
+103607,NAD_1983_HARN_Adj_MN_Wilkin_Meters,152407.7573,30481.55147,-96.51666667,1.000048901, ,46.02166667,Meter
+103608,NAD_1983_HARN_Adj_MN_Anoka_Meters,152400.3048,30480.06096,-93.26666667,45.06666667,45.36666667,45.03527778,Meter
+103609,NAD_1983_HARN_Adj_MN_Becker_Meters,152400.3048,30480.06096,-95.68333333,46.78333333,47.08333333,46.71777778,Meter
+103610,NAD_1983_HARN_Adj_MN_Beltrami_North_Meters,152400.3048,30480.06096,-95.01666667,48.11666667,48.46666667,48.02,Meter
+103611,NAD_1983_HARN_Adj_MN_Beltrami_South_Meters,152400.3048,30480.06096,-94.85,47.5,47.91666667,47.4125,Meter
+103612,NAD_1983_HARN_Adj_MN_Benton_Meters,152400.3048,30480.06096,-94.05,45.58333333,45.78333333,45.55916667,Meter
+103613,NAD_1983_HARN_Adj_MN_Big_Stone_Meters,152400.3048,30480.06096,-96.05,45.21666667,45.53333333,45.15222222,Meter
+103614,NAD_1983_HARN_Adj_MN_Blue_Earth_Meters,152400.3048,30480.06096,-94.26666667,43.93333333,44.36666667,43.84805556,Meter
+103615,NAD_1983_HARN_Adj_MN_Brown_Meters,152400.3048,30480.06096,-94.73333333,44.16666667,44.46666667,44.10805556,Meter
+103616,NAD_1983_HARN_Adj_MN_Carlton_Meters,152400.3048,30480.06096,-92.68333333,46.46666667,46.73333333,46.41722222,Meter
+103617,NAD_1983_HARN_Adj_MN_Carver_Meters,152400.3048,30480.06096,-93.76666667,44.68333333,44.9,44.63972222,Meter
+103618,NAD_1983_HARN_Adj_MN_Cass_North_Meters,152400.3048,30480.06096,-94.21666667,46.91666667,47.31666667,46.80361111,Meter
+103619,NAD_1983_HARN_Adj_MN_Cass_South_Meters,152400.3048,30480.06096,-94.46666667,46.26666667,46.73333333,46.15638889,Meter
+103620,NAD_1983_HARN_Adj_MN_Chippewa_Meters,152400.3048,30480.06096,-95.85,44.83333333,45.2,44.75277778,Meter
+103621,NAD_1983_HARN_Adj_MN_Chisago_Meters,152400.3048,30480.06096,-93.08333333,45.33333333,45.66666667,45.29638889,Meter
+103622,NAD_1983_HARN_Adj_MN_Cook_North_Meters,152400.3048,30480.06096,-90.25,47.93333333,48.16666667,47.88333333,Meter
+103623,NAD_1983_HARN_Adj_MN_Cook_South_Meters,152400.3048,30480.06096,-90.25,47.55,47.81666667,47.43888889,Meter
+103624,NAD_1983_HARN_Adj_MN_Cottonwood_Meters,152400.3048,30480.06096,-94.91666667,43.9,44.16666667,43.84805556,Meter
+103625,NAD_1983_HARN_Adj_MN_Crow_Wing_Meters,152400.3048,30480.06096,-94.46666667,46.26666667,46.73333333,46.15638889,Meter
+103626,NAD_1983_HARN_Adj_MN_Dakota_Meters,152400.3048,30480.06096,-93.31666667,44.51666667,44.91666667,44.47194444,Meter
+103627,NAD_1983_HARN_Adj_MN_Dodge_Meters,152400.3048,30480.06096,-92.91666667,43.88333333,44.13333333,43.83388889,Meter
+103628,NAD_1983_HARN_Adj_MN_Douglas_Meters,152400.3048,30480.06096,-96.05,45.8,46.05,45.75888889,Meter
+103629,NAD_1983_HARN_Adj_MN_Faribault_Meters,152400.3048,30480.06096,-93.95,43.56666667,43.8,43.5,Meter
+103630,NAD_1983_HARN_Adj_MN_Fillmore_Meters,152400.3048,30480.06096,-92.08333333,43.55,43.8,43.5,Meter
+103631,NAD_1983_HARN_Adj_MN_Freeborn_Meters,152400.3048,30480.06096,-93.95,43.56666667,43.8,43.5,Meter
+103632,NAD_1983_HARN_Adj_MN_Goodhue_Meters,152400.3048,30480.06096,-93.13333333,44.3,44.66666667,44.19472222,Meter
+103633,NAD_1983_HARN_Adj_MN_Grant_Meters,152400.3048,30480.06096,-96.05,45.8,46.05,45.75888889,Meter
+103634,NAD_1983_HARN_Adj_MN_Hennepin_Meters,152400.3048,30480.06096,-93.38333333,44.88333333,45.13333333,44.79111111,Meter
+103635,NAD_1983_HARN_Adj_MN_Houston_Meters,152400.3048,30480.06096,-91.46666667,43.56666667,43.8,43.5,Meter
+103636,NAD_1983_HARN_Adj_MN_Isanti_Meters,152400.3048,30480.06096,-93.08333333,45.33333333,45.66666667,45.29638889,Meter
+103637,NAD_1983_HARN_Adj_MN_Itasca_North_Meters,152400.3048,30480.06096,-93.73333333,47.56666667,47.81666667,47.5,Meter
+103638,NAD_1983_HARN_Adj_MN_Itasca_South_Meters,152400.3048,30480.06096,-93.73333333,47.08333333,47.41666667,47.02638889,Meter
+103639,NAD_1983_HARN_Adj_MN_Jackson_Meters,152400.3048,30480.06096,-93.95,43.56666667,43.8,43.5,Meter
+103640,NAD_1983_HARN_Adj_MN_Kanabec_Meters,152400.3048,30480.06096,-92.9,45.81666667,46.33333333,45.73,Meter
+103641,NAD_1983_HARN_Adj_MN_Kandiyohi_Meters,152400.3048,30480.06096,-94.75,44.96666667,45.33333333,44.89138889,Meter
+103642,NAD_1983_HARN_Adj_MN_Kittson_Meters,152400.3048,30480.06096,-96.15,48.6,48.93333333,48.54388889,Meter
+103643,NAD_1983_HARN_Adj_MN_Koochiching_Meters,152400.3048,30480.06096,-93.75,48,48.61666667,47.84583333,Meter
+103644,NAD_1983_HARN_Adj_MN_Lac_Qui_Parle_Meters,152400.3048,30480.06096,-95.85,44.83333333,45.2,44.75277778,Meter
+103647,NAD_1983_HARN_Adj_MN_Le_Sueur_Meters,152400.3048,30480.06096,-93.13333333,44.3,44.66666667,44.19472222,Meter
+103648,NAD_1983_HARN_Adj_MN_Lincoln_Meters,152400.3048,30480.06096,-96.26666667,44.28333333,44.61666667,44.19666667,Meter
+103649,NAD_1983_HARN_Adj_MN_Lyon_Meters,152400.3048,30480.06096,-95.85,44.25,44.58333333,44.19555556,Meter
+103650,NAD_1983_HARN_Adj_MN_McLeod_Meters,152400.3048,30480.06096,-94.63333333,44.53333333,44.91666667,44.45611111,Meter
+103651,NAD_1983_HARN_Adj_MN_Mahnomen_Meters,152400.3048,30480.06096,-95.81666667,47.2,47.45,47.15166667,Meter
+103652,NAD_1983_HARN_Adj_MN_Marshall_Meters,152400.3048,30480.06096,-96.38333333,48.23333333,48.48333333,48.17305556,Meter
+103653,NAD_1983_HARN_Adj_MN_Martin_Meters,152400.3048,30480.06096,-93.95,43.56666667,43.8,43.5,Meter
+103654,NAD_1983_HARN_Adj_MN_Meeker_Meters,152400.3048,30480.06096,-94.75,44.96666667,45.33333333,44.89138889,Meter
+103655,NAD_1983_HARN_Adj_MN_Morrison_Meters,152400.3048,30480.06096,-94.2,45.85,46.26666667,45.77388889,Meter
+103656,NAD_1983_HARN_Adj_MN_Mower_Meters,152400.3048,30480.06096,-93.95,43.56666667,43.8,43.5,Meter
+103657,NAD_1983_HARN_Adj_MN_Murray_Meters,152400.3048,30480.06096,-95.76666667,43.91666667,44.16666667,43.84805556,Meter
+103658,NAD_1983_HARN_Adj_MN_Nicollet_Meters,152400.3048,30480.06096,-94.26666667,43.93333333,44.36666667,43.84805556,Meter
+103659,NAD_1983_HARN_Adj_MN_Nobles_Meters,152400.3048,30480.06096,-95.95,43.56666667,43.8,43.5,Meter
+103660,NAD_1983_HARN_Adj_MN_Norman_Meters,152400.3048,30480.06096,-96.45,47.2,47.45,47.15055556,Meter
+103661,NAD_1983_HARN_Adj_MN_Olmsted_Meters,152400.3048,30480.06096,-92.91666667,43.88333333,44.13333333,43.83388889,Meter
+103662,NAD_1983_HARN_Adj_MN_Ottertail_Meters,152400.3048,30480.06096,-95.71666667,46.18333333,46.65,46.10638889,Meter
+103663,NAD_1983_HARN_Adj_MN_Pennington_Meters,152400.3048,30480.06096,-96.36666667,47.6,48.08333333,47.49888889,Meter
+103664,NAD_1983_HARN_Adj_MN_Pine_Meters,152400.3048,30480.06096,-92.9,45.81666667,46.33333333,45.73,Meter
+103665,NAD_1983_HARN_Adj_MN_Pipestone_Meters,152400.3048,30480.06096,-96.25,43.88333333,44.15,43.84916667,Meter
+103666,NAD_1983_HARN_Adj_MN_Polk_Meters,152400.3048,30480.06096,-96.36666667,47.6,48.08333333,47.49888889,Meter
+103667,NAD_1983_HARN_Adj_MN_Pope_Meters,152400.3048,30480.06096,-95.15,45.35,45.7,45.28277778,Meter
+103668,NAD_1983_HARN_Adj_MN_Ramsey_Meters,152400.3048,30480.06096,-93.38333333,44.88333333,45.13333333,44.79111111,Meter
+103669,NAD_1983_HARN_Adj_MN_Red_Lake_Meters,152400.3048,30480.06096,-96.36666667,47.6,48.08333333,47.49888889,Meter
+103670,NAD_1983_HARN_Adj_MN_Redwood_Meters,152400.3048,30480.06096,-95.23333333,44.26666667,44.56666667,44.19472222,Meter
+103671,NAD_1983_HARN_Adj_MN_Renville_Meters,152400.3048,30480.06096,-94.63333333,44.53333333,44.91666667,44.45611111,Meter
+103672,NAD_1983_HARN_Adj_MN_Rice_Meters,152400.3048,30480.06096,-93.13333333,44.3,44.66666667,44.19472222,Meter
+103673,NAD_1983_HARN_Adj_MN_Rock_Meters,152400.3048,30480.06096,-95.95,43.56666667,43.8,43.5,Meter
+103674,NAD_1983_HARN_Adj_MN_Roseau_Meters,152400.3048,30480.06096,-96.15,48.6,48.93333333,48.54388889,Meter
+103675,NAD_1983_HARN_Adj_MN_St_Louis_North_Meters,152400.3048,30480.06096,-92.45,47.98333333,48.53333333,47.83333333,Meter
+103676,NAD_1983_HARN_Adj_MN_St_Louis_Central_Meters,152400.3048,30480.06096,-92.45,47.33333333,47.75,47.25,Meter
+103677,NAD_1983_HARN_Adj_MN_St_Louis_South_Meters,152400.3048,30480.06096,-92.45,46.78333333,47.13333333,46.65,Meter
+103678,NAD_1983_HARN_Adj_MN_Scott_Meters,152400.3048,30480.06096,-93.31666667,44.51666667,44.91666667,44.47194444,Meter
+103679,NAD_1983_HARN_Adj_MN_Sherburne_Meters,152400.3048,30480.06096,-93.88333333,45.03333333,45.46666667,44.9775,Meter
+103680,NAD_1983_HARN_Adj_MN_Sibley_Meters,152400.3048,30480.06096,-94.63333333,44.53333333,44.91666667,44.45611111,Meter
+103681,NAD_1983_HARN_Adj_MN_Stearns_Meters,152400.3048,30480.06096,-95.15,45.35,45.7,45.28277778,Meter
+103682,NAD_1983_HARN_Adj_MN_Steele_Meters,152400.3048,30480.06096,-92.91666667,43.88333333,44.13333333,43.83388889,Meter
+103683,NAD_1983_HARN_Adj_MN_Stevens_Meters,152400.3048,30480.06096,-95.15,45.35,45.7,45.28277778,Meter
+103684,NAD_1983_HARN_Adj_MN_Swift_Meters,152400.3048,30480.06096,-96.05,45.21666667,45.53333333,45.15222222,Meter
+103685,NAD_1983_HARN_Adj_MN_Todd_Meters,152400.3048,30480.06096,-94.9,45.86666667,46.28333333,45.77333333,Meter
+103686,NAD_1983_HARN_Adj_MN_Traverse_Meters,152400.3048,30480.06096,-96.55,45.63333333,45.96666667,45.58555556,Meter
+103687,NAD_1983_HARN_Adj_MN_Wabasha_Meters,152400.3048,30480.06096,-92.26666667,44.15,44.41666667,44.10694444,Meter
+103688,NAD_1983_HARN_Adj_MN_Wadena_Meters,152400.3048,30480.06096,-94.46666667,46.26666667,46.73333333,46.15638889,Meter
+103689,NAD_1983_HARN_Adj_MN_Waseca_Meters,152400.3048,30480.06096,-92.91666667,43.88333333,44.13333333,43.83388889,Meter
+103690,NAD_1983_HARN_Adj_MN_Watonwan_Meters,152400.3048,30480.06096,-94.91666667,43.9,44.16666667,43.84805556,Meter
+103691,NAD_1983_HARN_Adj_MN_Winona_Meters,152400.3048,30480.06096,-91.61666667,43.9,44.13333333,43.84722222,Meter
+103692,NAD_1983_HARN_Adj_MN_Wright_Meters,152400.3048,30480.06096,-93.88333333,45.03333333,45.46666667,44.9775,Meter
+103693,NAD_1983_HARN_Adj_MN_Yellow_Medicine_Meters,152400.3048,30480.06096,-95.9,44.66666667,44.95,44.54166667,Meter
+103700,NAD_1983_HARN_Adj_MN_Aitkin_Feet,500029.5763,100005.9153,-93.41666667,1.000059153, ,46.15416667,Foot_US
+103701,NAD_1983_HARN_Adj_MN_Clay_Feet,500022.6589,100004.5318,-96.7,1.000045318, ,46.63,Foot_US
+103702,NAD_1983_HARN_Adj_MN_Clearwater_Feet,500036.2528,100007.2506,-95.36666667,1.000072506, ,47.15166667,Foot_US
+103703,NAD_1983_HARN_Adj_MN_Hubbard_Feet,500035.7768,100007.1554,-94.91666667,1.000071554, ,46.80361111,Foot_US
+103704,NAD_1983_HARN_Adj_MN_Lake_Feet,500037.9223,100007.5845,-91.4,1.000075845, ,47.06666667,Foot_US
+103705,NAD_1983_HARN_Adj_MN_Mille_Lacs_Feet,500027.0731,100005.4146,-93.61666667,1.000054146, ,45.55888889,Foot_US
+103706,NAD_1983_HARN_Adj_MN_Washington_Feet,500019.9184,100003.9837,-92.83333333,1.000039837, ,44.74583333,Foot_US
+103707,NAD_1983_HARN_Adj_MN_Wilkin_Feet,500024.4505,100004.8901,-96.51666667,1.000048901, ,46.02166667,Foot_US
+103708,NAD_1983_HARN_Adj_MN_Anoka_Feet,500000,100000,-93.26666667,45.06666667,45.36666667,45.03527778,Foot_US
+103709,NAD_1983_HARN_Adj_MN_Becker_Feet,500000,100000,-95.68333333,46.78333333,47.08333333,46.71777778,Foot_US
+103710,NAD_1983_HARN_Adj_MN_Beltrami_North_Feet,500000,100000,-95.01666667,48.11666667,48.46666667,48.02,Foot_US
+103711,NAD_1983_HARN_Adj_MN_Beltrami_South_Feet,500000,100000,-94.85,47.5,47.91666667,47.4125,Foot_US
+103712,NAD_1983_HARN_Adj_MN_Benton_Feet,500000,100000,-94.05,45.58333333,45.78333333,45.55916667,Foot_US
+103713,NAD_1983_HARN_Adj_MN_Big_Stone_Feet,500000,100000,-96.05,45.21666667,45.53333333,45.15222222,Foot_US
+103714,NAD_1983_HARN_Adj_MN_Blue_Earth_Feet,500000,100000,-94.26666667,43.93333333,44.36666667,43.84805556,Foot_US
+103715,NAD_1983_HARN_Adj_MN_Brown_Feet,500000,100000,-94.73333333,44.16666667,44.46666667,44.10805556,Foot_US
+103716,NAD_1983_HARN_Adj_MN_Carlton_Feet,500000,100000,-92.68333333,46.46666667,46.73333333,46.41722222,Foot_US
+103717,NAD_1983_HARN_Adj_MN_Carver_Feet,500000,100000,-93.76666667,44.68333333,44.9,44.63972222,Foot_US
+103718,NAD_1983_HARN_Adj_MN_Cass_North_Feet,500000,100000,-94.21666667,46.91666667,47.31666667,46.80361111,Foot_US
+103719,NAD_1983_HARN_Adj_MN_Cass_South_Feet,500000,100000,-94.46666667,46.26666667,46.73333333,46.15638889,Foot_US
+103720,NAD_1983_HARN_Adj_MN_Chippewa_Feet,500000,100000,-95.85,44.83333333,45.2,44.75277778,Foot_US
+103721,NAD_1983_HARN_Adj_MN_Chisago_Feet,500000,100000,-93.08333333,45.33333333,45.66666667,45.29638889,Foot_US
+103722,NAD_1983_HARN_Adj_MN_Cook_North_Feet,500000,100000,-90.25,47.93333333,48.16666667,47.88333333,Foot_US
+103723,NAD_1983_HARN_Adj_MN_Cook_South_Feet,500000,100000,-90.25,47.55,47.81666667,47.43888889,Foot_US
+103724,NAD_1983_HARN_Adj_MN_Cottonwood_Feet,500000,100000,-94.91666667,43.9,44.16666667,43.84805556,Foot_US
+103725,NAD_1983_HARN_Adj_MN_Crow_Wing_Feet,500000,100000,-94.46666667,46.26666667,46.73333333,46.15638889,Foot_US
+103726,NAD_1983_HARN_Adj_MN_Dakota_Feet,500000,100000,-93.31666667,44.51666667,44.91666667,44.47194444,Foot_US
+103727,NAD_1983_HARN_Adj_MN_Dodge_Feet,500000,100000,-92.91666667,43.88333333,44.13333333,43.83388889,Foot_US
+103728,NAD_1983_HARN_Adj_MN_Douglas_Feet,500000,100000,-96.05,45.8,46.05,45.75888889,Foot_US
+103729,NAD_1983_HARN_Adj_MN_Faribault_Feet,500000,100000,-93.95,43.56666667,43.8,43.5,Foot_US
+103730,NAD_1983_HARN_Adj_MN_Fillmore_Feet,500000,100000,-92.08333333,43.55,43.8,43.5,Foot_US
+103731,NAD_1983_HARN_Adj_MN_Freeborn_Feet,500000,100000,-93.95,43.56666667,43.8,43.5,Foot_US
+103732,NAD_1983_HARN_Adj_MN_Goodhue_Feet,500000,100000,-93.13333333,44.3,44.66666667,44.19472222,Foot_US
+103733,NAD_1983_HARN_Adj_MN_Grant_Feet,500000,100000,-96.05,45.8,46.05,45.75888889,Foot_US
+103734,NAD_1983_HARN_Adj_MN_Hennepin_Feet,500000,100000,-93.38333333,44.88333333,45.13333333,44.79111111,Foot_US
+103735,NAD_1983_HARN_Adj_MN_Houston_Feet,500000,100000,-91.46666667,43.56666667,43.8,43.5,Foot_US
+103736,NAD_1983_HARN_Adj_MN_Isanti_Feet,500000,100000,-93.08333333,45.33333333,45.66666667,45.29638889,Foot_US
+103737,NAD_1983_HARN_Adj_MN_Itasca_North_Feet,500000,100000,-93.73333333,47.56666667,47.81666667,47.5,Foot_US
+103738,NAD_1983_HARN_Adj_MN_Itasca_South_Feet,500000,100000,-93.73333333,47.08333333,47.41666667,47.02638889,Foot_US
+103739,NAD_1983_HARN_Adj_MN_Jackson_Feet,500000,100000,-93.95,43.56666667,43.8,43.5,Foot_US
+103740,NAD_1983_HARN_Adj_MN_Kanabec_Feet,500000,100000,-92.9,45.81666667,46.33333333,45.73,Foot_US
+103741,NAD_1983_HARN_Adj_MN_Kandiyohi_Feet,500000,100000,-94.75,44.96666667,45.33333333,44.89138889,Foot_US
+103742,NAD_1983_HARN_Adj_MN_Kittson_Feet,500000,100000,-96.15,48.6,48.93333333,48.54388889,Foot_US
+103743,NAD_1983_HARN_Adj_MN_Koochiching_Feet,500000,100000,-93.75,48,48.61666667,47.84583333,Foot_US
+103744,NAD_1983_HARN_Adj_MN_Lac_Qui_Parle_Feet,500000,100000,-95.85,44.83333333,45.2,44.75277778,Foot_US
+103747,NAD_1983_HARN_Adj_MN_Le_Sueur_Feet,500000,100000,-93.13333333,44.3,44.66666667,44.19472222,Foot_US
+103748,NAD_1983_HARN_Adj_MN_Lincoln_Feet,500000,100000,-96.26666667,44.28333333,44.61666667,44.19666667,Foot_US
+103749,NAD_1983_HARN_Adj_MN_Lyon_Feet,500000,100000,-95.85,44.25,44.58333333,44.19555556,Foot_US
+103750,NAD_1983_HARN_Adj_MN_McLeod_Feet,500000,100000,-94.63333333,44.53333333,44.91666667,44.45611111,Foot_US
+103751,NAD_1983_HARN_Adj_MN_Mahnomen_Feet,500000,100000,-95.81666667,47.2,47.45,47.15166667,Foot_US
+103752,NAD_1983_HARN_Adj_MN_Marshall_Feet,500000,100000,-96.38333333,48.23333333,48.48333333,48.17305556,Foot_US
+103753,NAD_1983_HARN_Adj_MN_Martin_Feet,500000,100000,-93.95,43.56666667,43.8,43.5,Foot_US
+103754,NAD_1983_HARN_Adj_MN_Meeker_Feet,500000,100000,-94.75,44.96666667,45.33333333,44.89138889,Foot_US
+103755,NAD_1983_HARN_Adj_MN_Morrison_Feet,500000,100000,-94.2,45.85,46.26666667,45.77388889,Foot_US
+103756,NAD_1983_HARN_Adj_MN_Mower_Feet,500000,100000,-93.95,43.56666667,43.8,43.5,Foot_US
+103757,NAD_1983_HARN_Adj_MN_Murray_Feet,500000,100000,-95.76666667,43.91666667,44.16666667,43.84805556,Foot_US
+103758,NAD_1983_HARN_Adj_MN_Nicollet_Feet,500000,100000,-94.26666667,43.93333333,44.36666667,43.84805556,Foot_US
+103759,NAD_1983_HARN_Adj_MN_Nobles_Feet,500000,100000,-95.95,43.56666667,43.8,43.5,Foot_US
+103760,NAD_1983_HARN_Adj_MN_Norman_Feet,500000,100000,-96.45,47.2,47.45,47.15055556,Foot_US
+103761,NAD_1983_HARN_Adj_MN_Olmsted_Feet,500000,100000,-92.91666667,43.88333333,44.13333333,43.83388889,Foot_US
+103762,NAD_1983_HARN_Adj_MN_Ottertail_Feet,500000,100000,-95.71666667,46.18333333,46.65,46.10638889,Foot_US
+103763,NAD_1983_HARN_Adj_MN_Pennington_Feet,500000,100000,-96.36666667,47.6,48.08333333,47.49888889,Foot_US
+103764,NAD_1983_HARN_Adj_MN_Pine_Feet,500000,100000,-92.9,45.81666667,46.33333333,45.73,Foot_US
+103765,NAD_1983_HARN_Adj_MN_Pipestone_Feet,500000,100000,-96.25,43.88333333,44.15,43.84916667,Foot_US
+103766,NAD_1983_HARN_Adj_MN_Polk_Feet,500000,100000,-96.36666667,47.6,48.08333333,47.49888889,Foot_US
+103767,NAD_1983_HARN_Adj_MN_Pope_Feet,500000,100000,-95.15,45.35,45.7,45.28277778,Foot_US
+103768,NAD_1983_HARN_Adj_MN_Ramsey_Feet,500000,100000,-93.38333333,44.88333333,45.13333333,44.79111111,Foot_US
+103769,NAD_1983_HARN_Adj_MN_Red_Lake_Feet,500000,100000,-96.36666667,47.6,48.08333333,47.49888889,Foot_US
+103770,NAD_1983_HARN_Adj_MN_Redwood_Feet,500000,100000,-95.23333333,44.26666667,44.56666667,44.19472222,Foot_US
+103771,NAD_1983_HARN_Adj_MN_Renville_Feet,500000,100000,-94.63333333,44.53333333,44.91666667,44.45611111,Foot_US
+103772,NAD_1983_HARN_Adj_MN_Rice_Feet,500000,100000,-93.13333333,44.3,44.66666667,44.19472222,Foot_US
+103773,NAD_1983_HARN_Adj_MN_Rock_Feet,500000,100000,-95.95,43.56666667,43.8,43.5,Foot_US
+103774,NAD_1983_HARN_Adj_MN_Roseau_Feet,500000,100000,-96.15,48.6,48.93333333,48.54388889,Foot_US
+103775,NAD_1983_HARN_Adj_MN_St_Louis_North_Feet,500000,100000,-92.45,47.98333333,48.53333333,47.83333333,Foot_US
+103776,NAD_1983_HARN_Adj_MN_St_Louis_Central_Feet,500000,100000,-92.45,47.33333333,47.75,47.25,Foot_US
+103777,NAD_1983_HARN_Adj_MN_St_Louis_South_Feet,500000,100000,-92.45,46.78333333,47.13333333,46.65,Foot_US
+103778,NAD_1983_HARN_Adj_MN_Scott_Feet,500000,100000,-93.31666667,44.51666667,44.91666667,44.47194444,Foot_US
+103779,NAD_1983_HARN_Adj_MN_Sherburne_Feet,500000,100000,-93.88333333,45.03333333,45.46666667,44.9775,Foot_US
+103780,NAD_1983_HARN_Adj_MN_Sibley_Feet,500000,100000,-94.63333333,44.53333333,44.91666667,44.45611111,Foot_US
+103781,NAD_1983_HARN_Adj_MN_Stearns_Feet,500000,100000,-95.15,45.35,45.7,45.28277778,Foot_US
+103782,NAD_1983_HARN_Adj_MN_Steele_Feet,500000,100000,-92.91666667,43.88333333,44.13333333,43.83388889,Foot_US
+103783,NAD_1983_HARN_Adj_MN_Stevens_Feet,500000,100000,-95.15,45.35,45.7,45.28277778,Foot_US
+103784,NAD_1983_HARN_Adj_MN_Swift_Feet,500000,100000,-96.05,45.21666667,45.53333333,45.15222222,Foot_US
+103785,NAD_1983_HARN_Adj_MN_Todd_Feet,500000,100000,-94.9,45.86666667,46.28333333,45.77333333,Foot_US
+103786,NAD_1983_HARN_Adj_MN_Traverse_Feet,500000,100000,-96.55,45.63333333,45.96666667,45.58555556,Foot_US
+103787,NAD_1983_HARN_Adj_MN_Wabasha_Feet,500000,100000,-92.26666667,44.15,44.41666667,44.10694444,Foot_US
+103788,NAD_1983_HARN_Adj_MN_Wadena_Feet,500000,100000,-94.46666667,46.26666667,46.73333333,46.15638889,Foot_US
+103789,NAD_1983_HARN_Adj_MN_Waseca_Feet,500000,100000,-92.91666667,43.88333333,44.13333333,43.83388889,Foot_US
+103790,NAD_1983_HARN_Adj_MN_Watonwan_Feet,500000,100000,-94.91666667,43.9,44.16666667,43.84805556,Foot_US
+103791,NAD_1983_HARN_Adj_MN_Winona_Feet,500000,100000,-91.61666667,43.9,44.13333333,43.84722222,Foot_US
+103792,NAD_1983_HARN_Adj_MN_Wright_Feet,500000,100000,-93.88333333,45.03333333,45.46666667,44.9775,Foot_US
+103793,NAD_1983_HARN_Adj_MN_Yellow_Medicine_Feet,500000,100000,-95.9,44.66666667,44.95,44.54166667,Foot_US
+103800,NAD_1983_HARN_Adj_WI_Adams_Meters,147218.6944,0,-90,0.999999, ,43.36666667,Meter
+103801,NAD_1983_HARN_Adj_WI_Ashland_Meters,172821.9456,0,-90.62222222,0.999997, ,45.70611111,Meter
+103802,NAD_1983_HARN_Adj_WI_Barron_Meters,93150,0,-91.85,0.999996, ,45.13333333,Meter
+103803,NAD_1983_HARN_Adj_WI_Brown_Meters,31599.99999,4599.98984,-88,1.00002, ,43,Meter
+103804,NAD_1983_HARN_Adj_WI_Buffalo_Meters,175260.3505,0,-91.79722222,1, ,43.48138889,Meter
+103805,NAD_1983_HARN_Adj_WI_Calumet_Meters,244754.8895,0,-88.5,0.999996, ,42.71944444,Meter
+103806,NAD_1983_HARN_Adj_WI_Clark_Meters,199949.1999,0,-90.70833333,0.999994, ,43.6,Meter
+103807,NAD_1983_HARN_Adj_WI_Dodge_Meters,263347.7267,0,-88.775,0.999997, ,41.47222222,Meter
+103808,NAD_1983_HARN_Adj_WI_Door_Meters,158801.1176,0,-87.27222222,0.999991, ,44.4,Meter
+103809,NAD_1983_HARN_Adj_WI_Douglas_Meters,59131.31826,0,-91.91666667,0.999995, ,45.88333333,Meter
+103810,NAD_1983_HARN_Adj_WI_Dunn_Meters,51816.10363,0,-91.89444444,0.999998, ,44.40833333,Meter
+103811,NAD_1983_HARN_Adj_WI_Florence_Meters,133502.667,0,-88.14166667,0.999993, ,45.43888889,Meter
+103812,NAD_1983_HARN_Adj_WI_Fond_du_Lac_Meters,244754.8895,0,-88.5,0.999996, ,42.71944444,Meter
+103813,NAD_1983_HARN_Adj_WI_Forest_Meters,275844.5517,0,-88.63333333,0.999996, ,44.00555556,Meter
+103814,NAD_1983_HARN_Adj_WI_Grant_Meters,242316.4846,0,-90.8,0.999997, ,41.41111111,Meter
+103815,NAD_1983_HARN_Adj_WI_Iowa_Meters,113081.0262,0,-90.16111111,0.999997, ,42.53888889,Meter
+103816,NAD_1983_HARN_Adj_WI_Iron_Meters,220980.442,0,-90.25555556,0.999996, ,45.43333333,Meter
+103817,NAD_1983_HARN_Adj_WI_Jefferson_Meters,263347.7267,0,-88.775,0.999997, ,41.47222222,Meter
+103818,NAD_1983_HARN_Adj_WI_Juneau_Meters,147218.6944,0,-90,0.999999, ,43.36666667,Meter
+103819,NAD_1983_HARN_Adj_WI_Kenosha_Meters,185928.3719,0,-87.89444444,0.999998, ,42.21666667,Meter
+103820,NAD_1983_HARN_Adj_WI_Kewaunee_Meters,79857.75972,0,-87.55,1, ,43.26666667,Meter
+103821,NAD_1983_HARN_Adj_WI_LaCrosse_Meters,130454.6609,0,-91.31666667,0.999994, ,43.45111111,Meter
+103822,NAD_1983_HARN_Adj_WI_Lincoln_Meters,116129.0323,0,-89.73333333,0.999998, ,44.84444444,Meter
+103823,NAD_1983_HARN_Adj_WI_Manitowoc_Meters,79857.75972,0,-87.55,1, ,43.26666667,Meter
+103824,NAD_1983_HARN_Adj_WI_Marinette_Meters,238658.8773,0,-87.71111111,0.999986, ,44.69166667,Meter
+103825,NAD_1983_HARN_Adj_WI_Menominee_Meters,105461.0109,0,-88.41666667,0.999994, ,44.71666667,Meter
+103826,NAD_1983_HARN_Adj_WI_Milwaukee_Meters,185928.3719,0,-87.89444444,0.999998, ,42.21666667,Meter
+103827,NAD_1983_HARN_Adj_WI_Oconto_Meters,182880.3658,0,-87.90833333,0.999991, ,44.39722222,Meter
+103828,NAD_1983_HARN_Adj_WI_Outagamie_Meters,244754.8895,0,-88.5,0.999996, ,42.71944444,Meter
+103829,NAD_1983_HARN_Adj_WI_Ozaukee_Meters,185928.3719,0,-87.89444444,0.999998, ,42.21666667,Meter
+103830,NAD_1983_HARN_Adj_WI_Polk_Meters,141732.2835,0,-92.63333333,1, ,44.66111111,Meter
+103831,NAD_1983_HARN_Adj_WI_Price_Meters,227990.856,0,-90.48888889,0.999998, ,44.55555556,Meter
+103832,NAD_1983_HARN_Adj_WI_Racine_Meters,185928.3719,0,-87.89444444,0.999998, ,42.21666667,Meter
+103833,NAD_1983_HARN_Adj_WI_Rock_Meters,146304.2926,0,-89.07222222,0.999996, ,41.94444444,Meter
+103834,NAD_1983_HARN_Adj_WI_Rusk_Meters,250546.1011,0,-91.06666667,0.999997, ,43.91944444,Meter
+103835,NAD_1983_HARN_Adj_WI_St_Croix_Meters,165506.731,0,-92.63333333,0.999995, ,44.03611111,Meter
+103836,NAD_1983_HARN_Adj_WI_Sauk_Meters,185623.5712,0,-89.9,0.999995, ,42.81944444,Meter
+103837,NAD_1983_HARN_Adj_WI_Shawano_Meters,262433.3249,0,-88.60555556,0.99999, ,44.03611111,Meter
+103838,NAD_1983_HARN_Adj_WI_Sheboygan_Meters,79857.75972,0,-87.55,1, ,43.26666667,Meter
+103839,NAD_1983_HARN_Adj_WI_Trempealeau_Meters,256946.9139,0,-91.36666667,0.999998, ,43.16111111,Meter
+103840,NAD_1983_HARN_Adj_WI_Washington_Meters,120091.4402,0,-88.06388889,0.999995, ,42.91805556,Meter
+103841,NAD_1983_HARN_Adj_WI_Waukesha_Meters,208788.4176,0,-88.225,0.999997, ,42.56944444,Meter
+103842,NAD_1983_HARN_Adj_WI_Waupaca_Meters,185013.97,0,-88.81666667,0.999996, ,43.42027778,Meter
+103843,NAD_1983_HARN_Adj_WI_Winnebago_Meters,244754.8895,0,-88.5,0.999996, ,42.71944444,Meter
+103844,NAD_1983_HARN_Adj_WI_Bayfield_Meters,228600.4572,0,-91.15277778,46.41388889,46.925,45.33333333,Meter
+103845,NAD_1983_HARN_Adj_WI_Burnett_Meters,64008.12802,0,-92.45777778,45.71388889,46.08333333,45.36388889,Meter
+103846,NAD_1983_HARN_Adj_WI_Chippewa_Meters,60045.72009,0,-91.29444444,44.81388889,45.14166667,44.58111111,Meter
+103847,NAD_1983_HARN_Adj_WI_Columbia_Meters,169164.3383,0,-89.39444444,43.33333333,43.59166667,42.45833333,Meter
+103848,NAD_1983_HARN_Adj_WI_Crawford_Meters,113690.6274,0,-90.93888889,43.05833333,43.34166667,42.71666667,Meter
+103849,NAD_1983_HARN_Adj_WI_Dane_Meters,247193.2944,0,-89.42222222,42.90833333,43.23055556,41.75,Meter
+103850,NAD_1983_HARN_Adj_WI_EauClaire_Meters,120091.4402,0,-91.28888889,44.73055556,45.01388889,44.04722222,Meter
+103851,NAD_1983_HARN_Adj_WI_Green_Meters,170078.7402,0,-89.83888889,42.48611111,42.78888889,42.225,Meter
+103852,NAD_1983_HARN_Adj_WI_GreenLake_Meters,150876.3018,0,-89.24166667,43.66666667,43.94722222,43.09444444,Meter
+103853,NAD_1983_HARN_Adj_WI_Jackson_Meters,125882.6518,0,-90.73888889,44.16388889,44.41944444,43.79444444,Meter
+103854,NAD_1983_HARN_Adj_WI_Lafayette_Meters,170078.7402,0,-89.83888889,42.48611111,42.78888889,42.225,Meter
+103855,NAD_1983_HARN_Adj_WI_Langlade_Meters,198425.1969,0,-89.03333333,45,45.30833333,44.20694444,Meter
+103856,NAD_1983_HARN_Adj_WI_Marathon_Meters,74676.14935,0,-89.77,44.74527778,45.05638889,44.40555556,Meter
+103857,NAD_1983_HARN_Adj_WI_Marquette_Meters,150876.3018,0,-89.24166667,43.66666667,43.94722222,43.09444444,Meter
+103858,NAD_1983_HARN_Adj_WI_Monroe_Meters,204521.209,0,-90.64166667,43.83888889,44.16111111,42.90277778,Meter
+103859,NAD_1983_HARN_Adj_WI_Oneida_Meters,70104.14021,0,-89.54444444,45.56666667,45.84166667,45.18611111,Meter
+103860,NAD_1983_HARN_Adj_WI_Pepin_Meters,167640.3353,0,-92.22777778,44.52222222,44.75,43.86194444,Meter
+103861,NAD_1983_HARN_Adj_WI_Pierce_Meters,167640.3353,0,-92.22777778,44.52222222,44.75,43.86194444,Meter
+103862,NAD_1983_HARN_Adj_WI_Portage_Meters,56388.11278,0,-89.5,44.18333333,44.65,43.96666667,Meter
+103863,NAD_1983_HARN_Adj_WI_Richland_Meters,202387.6048,0,-90.43055556,43.14166667,43.50277778,42.11388889,Meter
+103864,NAD_1983_HARN_Adj_WI_Sawyer_Meters,216713.2334,0,-91.11666667,45.71944444,46.08055556,44.81388889,Meter
+103865,NAD_1983_HARN_Adj_WI_Taylor_Meters,187147.5743,0,-90.48333333,45.05555556,45.3,44.20833333,Meter
+103866,NAD_1983_HARN_Adj_WI_Vernon_Meters,222504.445,0,-90.78333333,43.46666667,43.68333333,43.14722222,Meter
+103867,NAD_1983_HARN_Adj_WI_Vilas_Meters,134417.0688,0,-89.48888889,45.93055556,46.225,45.625,Meter
+103868,NAD_1983_HARN_Adj_WI_Walworth_Meters,232562.8651,0,-88.54166667,42.58888889,42.75,41.66944444,Meter
+103869,NAD_1983_HARN_Adj_WI_Washburn_Meters,234086.8682,0,-91.78333333,45.77222222,46.15,44.26666667,Meter
+103870,NAD_1983_HARN_Adj_WI_Waushara_Meters,120091.4402,0,-89.24166667,43.975,44.25277778,43.70833333,Meter
+103871,NAD_1983_HARN_Adj_WI_Wood_Meters,208483.617,0,-90,44.18055556,44.54444444,43.15138889,Meter
+103900,NAD_1983_HARN_Adj_WI_Adams_Feet,483000,0,-90,0.999999, ,43.36666667,Foot_US
+103901,NAD_1983_HARN_Adj_WI_Ashland_Feet,567000,0,-90.62222222,0.999997, ,45.70611111,Foot_US
+103902,NAD_1983_HARN_Adj_WI_Barron_Feet,305609.625,0,-91.85,0.999996, ,45.13333333,Foot_US
+103903,NAD_1983_HARN_Adj_WI_Brown_Feet,103674.3333,15091.8,-88,1.00002, ,43,Foot_US
+103904,NAD_1983_HARN_Adj_WI_Buffalo_Feet,575000,0,-91.79722222,1, ,43.48138889,Foot_US
+103905,NAD_1983_HARN_Adj_WI_Calumet_Feet,803000,0,-88.5,0.999996, ,42.71944444,Foot_US
+103906,NAD_1983_HARN_Adj_WI_Clark_Feet,656000,0,-90.70833333,0.999994, ,43.6,Foot_US
+103907,NAD_1983_HARN_Adj_WI_Dodge_Feet,864000,0,-88.775,0.999997, ,41.47222222,Foot_US
+103908,NAD_1983_HARN_Adj_WI_Door_Feet,521000,0,-87.27222222,0.999991, ,44.4,Foot_US
+103909,NAD_1983_HARN_Adj_WI_Douglas_Feet,194000,0,-91.91666667,0.999995, ,45.88333333,Foot_US
+103910,NAD_1983_HARN_Adj_WI_Dunn_Feet,170000,0,-91.89444444,0.999998, ,44.40833333,Foot_US
+103911,NAD_1983_HARN_Adj_WI_Florence_Feet,438000,0,-88.14166667,0.999993, ,45.43888889,Foot_US
+103912,NAD_1983_HARN_Adj_WI_Fond_du_Lac_Feet,803000,0,-88.5,0.999996, ,42.71944444,Foot_US
+103913,NAD_1983_HARN_Adj_WI_Forest_Feet,905000,0,-88.63333333,0.999996, ,44.00555556,Foot_US
+103914,NAD_1983_HARN_Adj_WI_Grant_Feet,795000,0,-90.8,0.999997, ,41.41111111,Foot_US
+103915,NAD_1983_HARN_Adj_WI_Iowa_Feet,371000,0,-90.16111111,0.999997, ,42.53888889,Foot_US
+103916,NAD_1983_HARN_Adj_WI_Iron_Feet,725000,0,-90.25555556,0.999996, ,45.43333333,Foot_US
+103917,NAD_1983_HARN_Adj_WI_Jefferson_Feet,864000,0,-88.775,0.999997, ,41.47222222,Foot_US
+103918,NAD_1983_HARN_Adj_WI_Juneau_Feet,483000,0,-90,0.999999, ,43.36666667,Foot_US
+103919,NAD_1983_HARN_Adj_WI_Kenosha_Feet,610000,0,-87.89444444,0.999998, ,42.21666667,Foot_US
+103920,NAD_1983_HARN_Adj_WI_Kewaunee_Feet,262000,0,-87.55,1, ,43.26666667,Foot_US
+103921,NAD_1983_HARN_Adj_WI_LaCrosse_Feet,428000,0,-91.31666667,0.999994, ,43.45111111,Foot_US
+103922,NAD_1983_HARN_Adj_WI_Lincoln_Feet,381000,0,-89.73333333,0.999998, ,44.84444444,Foot_US
+103923,NAD_1983_HARN_Adj_WI_Manitowoc_Feet,262000,0,-87.55,1, ,43.26666667,Foot_US
+103924,NAD_1983_HARN_Adj_WI_Marinette_Feet,783000,0,-87.71111111,0.999986, ,44.69166667,Foot_US
+103925,NAD_1983_HARN_Adj_WI_Menominee_Feet,346000,0,-88.41666667,0.999994, ,44.71666667,Foot_US
+103926,NAD_1983_HARN_Adj_WI_Milwaukee_Feet,610000,0,-87.89444444,0.999998, ,42.21666667,Foot_US
+103927,NAD_1983_HARN_Adj_WI_Oconto_Feet,600000,0,-87.90833333,0.999991, ,44.39722222,Foot_US
+103928,NAD_1983_HARN_Adj_WI_Outagamie_Feet,803000,0,-88.5,0.999996, ,42.71944444,Foot_US
+103929,NAD_1983_HARN_Adj_WI_Ozaukee_Feet,610000,0,-87.89444444,0.999998, ,42.21666667,Foot_US
+103930,NAD_1983_HARN_Adj_WI_Polk_Feet,465000,0,-92.63333333,1, ,44.66111111,Foot_US
+103931,NAD_1983_HARN_Adj_WI_Price_Feet,748000,0,-90.48888889,0.999998, ,44.55555556,Foot_US
+103932,NAD_1983_HARN_Adj_WI_Racine_Feet,610000,0,-87.89444444,0.999998, ,42.21666667,Foot_US
+103933,NAD_1983_HARN_Adj_WI_Rock_Feet,480000,0,-89.07222222,0.999996, ,41.94444444,Foot_US
+103934,NAD_1983_HARN_Adj_WI_Rusk_Feet,822000,0,-91.06666667,0.999997, ,43.91944444,Foot_US
+103935,NAD_1983_HARN_Adj_WI_St_Croix_Feet,543000,0,-92.63333333,0.999995, ,44.03611111,Foot_US
+103936,NAD_1983_HARN_Adj_WI_Sauk_Feet,609000,0,-89.9,0.999995, ,42.81944444,Foot_US
+103937,NAD_1983_HARN_Adj_WI_Shawano_Feet,861000,0,-88.60555556,0.99999, ,44.03611111,Foot_US
+103938,NAD_1983_HARN_Adj_WI_Sheboygan_Feet,262000,0,-87.55,1, ,43.26666667,Foot_US
+103939,NAD_1983_HARN_Adj_WI_Trempealeau_Feet,843000,0,-91.36666667,0.999998, ,43.16111111,Foot_US
+103940,NAD_1983_HARN_Adj_WI_Washington_Feet,394000,0,-88.06388889,0.999995, ,42.91805556,Foot_US
+103941,NAD_1983_HARN_Adj_WI_Waukesha_Feet,685000,0,-88.225,0.999997, ,42.56944444,Foot_US
+103942,NAD_1983_HARN_Adj_WI_Waupaca_Feet,607000,0,-88.81666667,0.999996, ,43.42027778,Foot_US
+103943,NAD_1983_HARN_Adj_WI_Winnebago_Feet,803000,0,-88.5,0.999996, ,42.71944444,Foot_US
+103944,NAD_1983_HARN_Adj_WI_Bayfield_Feet,750000,0,-91.15277778,46.41388889,46.925,45.33333333,Foot_US
+103945,NAD_1983_HARN_Adj_WI_Burnett_Feet,210000,0,-92.45777778,45.71388889,46.08333333,45.36388889,Foot_US
+103946,NAD_1983_HARN_Adj_WI_Chippewa_Feet,197000,0,-91.29444444,44.81388889,45.14166667,44.58111111,Foot_US
+103947,NAD_1983_HARN_Adj_WI_Columbia_Feet,555000,0,-89.39444444,43.33333333,43.59166667,42.45833333,Foot_US
+103948,NAD_1983_HARN_Adj_WI_Crawford_Feet,373000,0,-90.93888889,43.05833333,43.34166667,42.71666667,Foot_US
+103949,NAD_1983_HARN_Adj_WI_Dane_Feet,811000,0,-89.42222222,42.90833333,43.23055556,41.75,Foot_US
+103950,NAD_1983_HARN_Adj_WI_EauClaire_Feet,394000,0,-91.28888889,44.73055556,45.01388889,44.04722222,Foot_US
+103951,NAD_1983_HARN_Adj_WI_Green_Feet,558000,0,-89.83888889,42.48611111,42.78888889,42.225,Foot_US
+103952,NAD_1983_HARN_Adj_WI_GreenLake_Feet,495000,0,-89.24166667,43.66666667,43.94722222,43.09444444,Foot_US
+103953,NAD_1983_HARN_Adj_WI_Jackson_Feet,413000,0,-90.73888889,44.16388889,44.41944444,43.79444444,Foot_US
+103954,NAD_1983_HARN_Adj_WI_Lafayette_Feet,558000,0,-89.83888889,42.48611111,42.78888889,42.225,Foot_US
+103955,NAD_1983_HARN_Adj_WI_Langlade_Feet,651000,0,-89.03333333,45,45.30833333,44.20694444,Foot_US
+103956,NAD_1983_HARN_Adj_WI_Marathon_Feet,245000,0,-89.77,44.74527778,45.05638889,44.40555556,Foot_US
+103957,NAD_1983_HARN_Adj_WI_Marquette_Feet,495000,0,-89.24166667,43.66666667,43.94722222,43.09444444,Foot_US
+103958,NAD_1983_HARN_Adj_WI_Monroe_Feet,671000,0,-90.64166667,43.83888889,44.16111111,42.90277778,Foot_US
+103959,NAD_1983_HARN_Adj_WI_Oneida_Feet,230000,0,-89.54444444,45.56666667,45.84166667,45.18611111,Foot_US
+103960,NAD_1983_HARN_Adj_WI_Pepin_Feet,550000,0,-92.22777778,44.52222222,44.75,43.86194444,Foot_US
+103961,NAD_1983_HARN_Adj_WI_Pierce_Feet,550000,0,-92.22777778,44.52222222,44.75,43.86194444,Foot_US
+103962,NAD_1983_HARN_Adj_WI_Portage_Feet,185000,0,-89.5,44.18333333,44.65,43.96666667,Foot_US
+103963,NAD_1983_HARN_Adj_WI_Richland_Feet,664000,0,-90.43055556,43.14166667,43.50277778,42.11388889,Foot_US
+103964,NAD_1983_HARN_Adj_WI_Sawyer_Feet,711000,0,-91.11666667,45.71944444,46.08055556,44.81388889,Foot_US
+103965,NAD_1983_HARN_Adj_WI_Taylor_Feet,614000,0,-90.48333333,45.05555556,45.3,44.20833333,Foot_US
+103966,NAD_1983_HARN_Adj_WI_Vernon_Feet,730000,0,-90.78333333,43.46666667,43.68333333,43.14722222,Foot_US
+103967,NAD_1983_HARN_Adj_WI_Vilas_Feet,441000,0,-89.48888889,45.93055556,46.225,45.625,Foot_US
+103968,NAD_1983_HARN_Adj_WI_Walworth_Feet,763000,0,-88.54166667,42.58888889,42.75,41.66944444,Foot_US
+103969,NAD_1983_HARN_Adj_WI_Washburn_Feet,768000,0,-91.78333333,45.77222222,46.15,44.26666667,Foot_US
+103970,NAD_1983_HARN_Adj_WI_Waushara_Feet,394000,0,-89.24166667,43.975,44.25277778,43.70833333,Foot_US
+103971,NAD_1983_HARN_Adj_WI_Wood_Feet,684000,0,-90,44.18055556,44.54444444,43.15138889,Foot_US
diff --git a/src/apps/ossim-applanix2ogeom/ossim-applanix2ogeom.cpp b/src/apps/ossim-applanix2ogeom/ossim-applanix2ogeom.cpp
index 187caef..76bb856 100644
--- a/src/apps/ossim-applanix2ogeom/ossim-applanix2ogeom.cpp
+++ b/src/apps/ossim-applanix2ogeom/ossim-applanix2ogeom.cpp
@@ -100,7 +100,7 @@ int main(int argc, char* argv[])
       exit(1);
    }
 
-   cout << "argc:  " << argumentParser.argc() << endl;
+   // cout << "argc:  " << argumentParser.argc() << endl;
    
    if(argumentParser.argc() < 4)
    {
@@ -135,9 +135,9 @@ int main(int argc, char* argv[])
                << "\nCould not create directory:  " << outputDir
                << endl;
             exit(1);
-            outputDirOverrideFlag = true;
          }
       }
+      outputDirOverrideFlag = outputDir.exists();
    }
 
    
diff --git a/src/apps/ossim-band-merge/ossim-band-merge.cpp b/src/apps/ossim-band-merge/ossim-band-merge.cpp
index 9cf07cf..9a3533c 100644
--- a/src/apps/ossim-band-merge/ossim-band-merge.cpp
+++ b/src/apps/ossim-band-merge/ossim-band-merge.cpp
@@ -13,8 +13,7 @@
 //
 //*******************************************************************
 //  $Id: band_merge.cpp 10695 2007-04-12 13:56:50Z gpotts $
-#include <iostream>
-#include <exception>
+
 #include <ossim/imaging/ossimJpegWriter.h>
 #include <ossim/base/ossimConstants.h>
 #include <ossim/base/ossimKeywordNames.h>
@@ -23,6 +22,7 @@
 #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>
@@ -34,7 +34,8 @@
 #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();
diff --git a/src/apps/ossim-batch-test/CMakeLists.txt b/src/apps/ossim-batch-test/CMakeLists.txt
new file mode 100644
index 0000000..db78d05
--- /dev/null
+++ b/src/apps/ossim-batch-test/CMakeLists.txt
@@ -0,0 +1,2 @@
+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/src/apps/ossim-batch-test/ossim-batch-test.cpp b/src/apps/ossim-batch-test/ossim-batch-test.cpp
new file mode 100644
index 0000000..81e2be6
--- /dev/null
+++ b/src/apps/ossim-batch-test/ossim-batch-test.cpp
@@ -0,0 +1,55 @@
+//----------------------------------------------------------------------------
+//
+// 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/src/apps/ossim-btoa/ossim-btoa.cpp b/src/apps/ossim-btoa/ossim-btoa.cpp
index ab13cba..a14433b 100644
--- a/src/apps/ossim-btoa/ossim-btoa.cpp
+++ b/src/apps/ossim-btoa/ossim-btoa.cpp
@@ -11,46 +11,19 @@
 //               binary headers.
 //
 //********************************************************************
-// $Id: ossim-btoa.cpp 15118 2009-08-22 15:20:13Z dburken $
+// $Id: ossim-btoa.cpp 22209 2013-03-29 13:38:38Z dburken $
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimEbcdicToAscii.h>
 
 #include <cstdio>
 #include <cstdlib>
 #include <iostream>
 using namespace std;
 
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimEbcdicToAscii.h>
-
-
-int main(int argc, char** argv)
+// Regular print with offset, hex, and ascii section.
+static void print( FILE* fptr, bool isEbcdic )
 {
-   ossimArgumentParser argumentParser(&argc, argv);
-   
-   bool isEbcdic = false;
-   if ( argumentParser.read("-e") )
-   {
-      isEbcdic = true;
-   }
-
-   if ( argumentParser.read("-h") || argumentParser.read("--help") ||
-        (argumentParser.argc() != 2) )
-   {
-      std::cout << "\nBinary to ascii usage: btoa [-e] <binary_file>\n"
-                << "Options:\n" 
-                << "-e Indicates text characters are ebcdic and should be"
-                << "converted to ascii.\n" 
-                << "-h or --help usage\n" << std::endl;
-      exit(0);
-   }
-   
-   FILE* fptr = fopen(argv[argumentParser.argc()-1], "rb");
-   if (fptr == 0)
-   {
-      std::cout << "\nError opening file " << argv[argumentParser.argc()-1] 
-                << std::endl << std::endl;
-      return -1;
-   }
-
    int           offset = 0;
    unsigned char bin_data[16];
    char          asc_data[17];
@@ -58,16 +31,17 @@ int main(int argc, char** argv)
    int           nbytes;
    int           i;
 
-   ossimEbcdicToAscii* e2a = NULL;
+   asc_data[16] = '\0';
+   
+   ossimEbcdicToAscii* e2a = 0;
    if ( isEbcdic )
    {
       e2a = new ossimEbcdicToAscii;
    }
 
-   asc_data[16] = 0;
    while (!feof(fptr))
    {
-      nbytes = fread(bin_data, 16, 1, fptr);
+      nbytes = (int)fread(bin_data, 16, 1, fptr);
       for(i=0; i<16; i++)
       {
          hex_data[i] = (int) bin_data[i];
@@ -77,7 +51,7 @@ int main(int argc, char** argv)
             bin_data[i] = e2a->ebcdicToAscii(bin_data[i]);
          }
          
-         if ((bin_data[i] >= 0x20) && (bin_data[i] <= 0x7F))
+         if ((bin_data[i] >= 0x20) && (bin_data[i] < 0x7F)) // 0x7F is a DEL
          {
             asc_data[i] = bin_data[i];
          }
@@ -98,13 +72,192 @@ int main(int argc, char** argv)
       offset += 16;
    }
 
-   fclose (fptr);
+   if (e2a)
+   {
+      delete e2a;
+      e2a = 0;
+   }
+   
+} // End: print(...)
+
+// Wide print offset and ascii section only.
+static void printWide( FILE* fptr, bool isEbcdic )
+{
+   const int WIDTH = 64;
+   
+   int           offset = 0;
+   unsigned char bin_data[WIDTH];
+   char          asc_data[WIDTH+1];
+   int           nbytes;
+   int           i = 0;
+
+   asc_data[WIDTH] = '\0';
+   
+   ossimEbcdicToAscii* e2a = 0;
+   if ( isEbcdic )
+   {
+      e2a = new ossimEbcdicToAscii;
+   }
+   
+   while (!feof(fptr))
+   {
+      nbytes = (int)fread(bin_data, WIDTH, 1, fptr);
+      for( i = 0; i < WIDTH; ++i )
+      {
+         if (e2a) 
+         {
+            bin_data[i] = e2a->ebcdicToAscii(bin_data[i]);
+         }
+         
+         if ((bin_data[i] >= 0x20) && (bin_data[i] < 0x7F)) // 0x7F is a DEL
+         {
+            asc_data[i] = bin_data[i];
+         }
+         else
+         {
+            asc_data[i] = '.';
+         }
+      }
+
+      printf("%06d  %64s\n", offset, asc_data);
+
+      offset += WIDTH;
+   }
 
    if (e2a)
    {
       delete e2a;
-      e2a = NULL;
+      e2a = 0;
    }
+   
+} // End printWide( ... )
+
+// Wide print ascii section only.
+static void printAscii( FILE* fptr, bool isEbcdic )
+{
+   const int WIDTH = 80;
+   
+   int           offset = 0;
+   unsigned char bin_data[WIDTH];
+   char          asc_data[WIDTH+1];
+   int           nbytes;
+   int           i = 0;
+
+   asc_data[WIDTH] = '\0';
+   
+   ossimEbcdicToAscii* e2a = 0;
+   if ( isEbcdic )
+   {
+      e2a = new ossimEbcdicToAscii;
+   }
+   
+   while (!feof(fptr))
+   {
+      nbytes = (int)fread(bin_data, WIDTH, 1, fptr);
+      for( i = 0; i < WIDTH; ++i )
+      {
+         if (e2a) 
+         {
+            bin_data[i] = e2a->ebcdicToAscii(bin_data[i]);
+         }
+         
+         if ((bin_data[i] >= 0x20) && (bin_data[i] < 0x7F)) // 0x7F is a DEL
+         {
+            asc_data[i] = bin_data[i];
+         }
+         else
+         {
+            asc_data[i] = '.';
+         }
+      }
+
+      printf( "%80s\n", asc_data );
+
+      offset += WIDTH;
+   }
+
+   if (e2a)
+   {
+      delete e2a;
+      e2a = 0;
+   }
+   
+} // printAscii
+
+int main(int argc, char** argv)
+{
+   // Parse the args:
+   ossimArgumentParser argumentParser(&argc, argv);
+
+   enum PrintMode
+   {
+      ALL   = 0, // offsets hex ascii - default
+      WIDE  = 1, // offsets ascii     - "-w" option
+      ASCII = 2  // ascii             - "-a" option 
+   };
+
+   // Check for options:
+   bool isEbcdic = false;
+   PrintMode mode = ALL;
+
+   if ( argumentParser.read("-e") )
+   {
+      isEbcdic = true;
+   }
+   if ( argumentParser.read("-w") )
+   {
+      mode = WIDE;
+   }
+   if ( argumentParser.read("-a") )
+   {
+      if ( mode != ALL )
+      {
+         std::cerr << "Cannot use -a and -w options." << std::endl;
+         return -1;
+      }
+      mode = ASCII;
+   }
+
+   if ( argumentParser.read("-h") || argumentParser.read("--help") ||
+        (argumentParser.argc() != 2) )
+   {
+      std::cout << "\nBinary to ascii usage: btoa [options] <binary_file>\n"
+                << "Options:\n"
+                << "-e Indicates text characters are ebcdic and should be"
+                << " converted to ascii.\n"
+                << "-h or --help usage\n"
+                << "-a Ascii mode, prints 64 characters wide with no offset or hex data.\n"
+                << "-w Wide mode, prints offset and 64 characters wide with no hex data.\n"
+                << "Notes:\n"
+                << "  1) Non-ascii characters are printed as dot in ascii output.\n"
+                << "  2) Default mode prints offsets, hex and ascii data."
+                << std::endl;
+      return 0;
+   }
+   
+   FILE* fptr = fopen(argv[argumentParser.argc()-1], "rb");
+   if (fptr == 0)
+   {
+      std::cout << "\nError opening file " << argv[argumentParser.argc()-1] 
+                << std::endl << std::endl;
+      return -1;
+   }
+
+   if ( mode == WIDE )
+   {
+      printWide( fptr, isEbcdic );
+   }
+   else if ( mode == ASCII )
+   {
+      printAscii( fptr, isEbcdic );
+   }
+   else // default
+   {
+      print( fptr, isEbcdic );
+   }
+
+   fclose (fptr);
              
    return 0;
-}
+   
+} // End: main( ... )
diff --git a/src/apps/ossim-chipper/CMakeLists.txt b/src/apps/ossim-chipper/CMakeLists.txt
new file mode 100644
index 0000000..a0fde63
--- /dev/null
+++ b/src/apps/ossim-chipper/CMakeLists.txt
@@ -0,0 +1,2 @@
+FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
+OSSIM_SETUP_APPLICATION(ossim-chipper INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})
diff --git a/src/apps/ossim-dem/ossim-dem.cpp b/src/apps/ossim-chipper/ossim-chipper.cpp
similarity index 74%
copy from src/apps/ossim-dem/ossim-dem.cpp
copy to src/apps/ossim-chipper/ossim-chipper.cpp
index 4d2394d..ff6a413 100644
--- a/src/apps/ossim-dem/ossim-dem.cpp
+++ b/src/apps/ossim-chipper/ossim-chipper.cpp
@@ -1,5 +1,7 @@
 //----------------------------------------------------------------------------
 //
+// File: ossim-dem.cpp
+// 
 // License:  LGPL
 // 
 // See LICENSE.txt file in the top level directory for more details.
@@ -11,12 +13,6 @@
 //----------------------------------------------------------------------------
 // $Id$
 
-#include <cstdlib> /* for exit */
-#include <iomanip>
-#include <iostream>
-
-using namespace std;
-
 #include <ossim/base/ossimConstants.h>
 #include <ossim/base/ossimArgumentParser.h>
 #include <ossim/base/ossimApplicationUsage.h>
@@ -26,7 +22,13 @@ using namespace std;
 #include <ossim/base/ossimTimer.h>
 #include <ossim/base/ossimTrace.h>
 #include <ossim/init/ossimInit.h>
-#include <ossim/util/ossimElevUtil.h>
+#include <ossim/util/ossimChipperUtil.h>
+
+#include <cstdlib> /* for exit */
+#include <iomanip>
+#include <iostream>
+
+using namespace std;
 
 static ossimTrace traceDebug = ossimTrace("ossim-dem:debug");
 
@@ -43,9 +45,6 @@ int main(int argc, char* argv[])
    
    ossimArgumentParser ap(&argc, argv);
 
-   // Add global usage options.
-   ossimInit::instance()->addOptions(ap);
-
    // Initialize ossim stuff, factories, plugin, etc.
    ossimInit::instance()->initialize(ap);
 
@@ -55,36 +54,27 @@ int main(int argc, char* argv[])
    //---
    if ( ( ap.argc() > 1 ) || ( ap.argc() == originalArgCount ) )
    {
-      //---
-      // Set the application name here.  The ossimElevUtil class will do the rest
-      // of the usage.
-      //---
-      ap.getApplicationUsage()->setApplicationName(ap.getApplicationName());
-
       // Make the generator.
-      ossimRefPtr<ossimElevUtil> eu = new ossimElevUtil;
-
-      // Add options.
-      eu->addArguments(ap);
+      ossimRefPtr<ossimChipperUtil> chipper = new ossimChipperUtil;
 
       try
       {      
          //---
-         // NOTE: ossimElevUtil::initialize handles the application usage which will
+         // NOTE: ossimChipperUtil::initialize handles the application usage which will
          // false, to end things if certain options (e.g. "--help") are provided.
          //
-         // ossimElevUtil::initialize can throw an exception.
+         // ossimChipperUtil::initialize can throw an exception.
          //---
-         bool continue_after_init = eu->initialize(ap);
+         bool continue_after_init = chipper->initialize(ap);
          if (continue_after_init)
          {      
-            // ossimElevUtil::execute can throw an excepion.
-            eu->execute();
+            // ossimChipperUtil::execute can throw an excepion.
+            chipper->execute();
             
             ossimNotify(ossimNotifyLevel_NOTICE)
                << "elapsed time in seconds: "
                << std::setiosflags(ios::fixed)
-               << std::setprecision(2)
+               << std::setprecision(3)
                << ossimTimer::instance()->time_s() << endl;
          }
       }
diff --git a/src/apps/ossim-create-bitmask/CMakeLists.txt b/src/apps/ossim-create-bitmask/CMakeLists.txt
new file mode 100644
index 0000000..7839187
--- /dev/null
+++ b/src/apps/ossim-create-bitmask/CMakeLists.txt
@@ -0,0 +1,2 @@
+FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
+OSSIM_SETUP_APPLICATION(ossim-create-bitmask INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})
diff --git a/src/apps/ossim-create-bitmask/ossim-create-bitmask.cpp b/src/apps/ossim-create-bitmask/ossim-create-bitmask.cpp
new file mode 100644
index 0000000..f006114
--- /dev/null
+++ b/src/apps/ossim-create-bitmask/ossim-create-bitmask.cpp
@@ -0,0 +1,308 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Oscar Kramer
+//
+// Description:
+//
+// Command line application "ossim-create-bitmask" to build overviews.
+//
+//----------------------------------------------------------------------------
+// $Id: ossim-create-bitmask.cpp 3081 2011-12-22 16:34:12Z oscar.kramer $
+
+#include <ossim/ossimConfig.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/imaging/ossimBitMaskWriter.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageSourceSequencer.h>
+#include <ossim/imaging/ossimPixelFlipper.h> // for its keywords
+#include <cstdio>
+#include <cstdlib> /* for exit */
+
+//*************************************************************************************************
+// FINALIZE -- Convenient location for placing debug breakpoint for catching program exit.
+//*************************************************************************************************
+void finalize(int code)
+{
+   exit (code);
+}
+
+//*************************************************************************************************
+// MAIN
+//*************************************************************************************************
+int main(int argc, char* argv[])
+{
+   ossimString tempString;
+   double tempDouble, tempDouble2;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+   ossimArgumentParser::ossimParameter doubleParam(tempDouble);
+   ossimArgumentParser::ossimParameter doubleParam2(tempDouble2);
+
+   ossimArgumentParser argumentParser(&argc, argv);
+   ossimInit::instance()->addOptions(argumentParser);
+   ossimInit::instance()->initialize(argumentParser);
+
+   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
+   argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName()+
+      " Generates a bit-mask given source image and target pixel range to mask out. If the input"
+      " image has overviews, then masks will be generated for all R-levels.");
+   argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName()+
+      " [options] <input file>");
+
+   argumentParser.getApplicationUsage()->addCommandLineOption("-d", 
+      "Write mask to directory specified.");
+
+   argumentParser.getApplicationUsage()->addCommandLineOption("-e or --entry",
+      "Give the entry(zero based) for which to build a mask. Only one entry can be processed. "
+      "If the input is multi-entry and no entry was specified, entry 0 is assumed.");
+
+   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help", 
+      "Shows help");
+
+   argumentParser.getApplicationUsage()->addCommandLineOption("--mask-mode <mode>",
+      "Specifies how to treat multi-band imagery when determining whether pixel will be masked "
+      "according to the defined target value or range. Possible modes are: "
+      "\"mask_full_and_partial_targets\" (default) | \"mask_only_full_targets\".");
+
+   argumentParser.getApplicationUsage()->addCommandLineOption("--mask-range <min> <max>", 
+      "Specifies the range of pixels to target for masking out.");
+
+   argumentParser.getApplicationUsage()->addCommandLineOption("--mask-value <target>", 
+      "Specifies the unique pixel value to target for masking out.");
+
+   argumentParser.getApplicationUsage()->addCommandLineOption("-o", 
+      "Write mask to file specified.  If used on a multi-entry file, given \"foo.mask\" you will "
+      "get: \"foo_e0.mask\". If none specified, the input filename is used with \".mask\" "
+      "extension.");
+
+   argumentParser.getApplicationUsage()->addCommandLineOption("--ovr-from-image", 
+      "Uses exclusively the image overview data when computing subsequent overviews. "
+      "Normally the mask overview from the prior level is referenced for establishing the masks at "
+      "the next level.");
+
+   argumentParser.getApplicationUsage()->addCommandLineOption("--spec-kwl <filename>", 
+      "In lieu of providing mask parameters on the command line, this option specifies a keyword "
+      "list filename that contains all settings. Typically used when spawning from other process.");
+
+   argumentParser.getApplicationUsage()->addCommandLineOption("-x or --exclude-fullres", 
+      "Excludes R0 mask computation. The mask file will start at R1.");
+
+   if(argumentParser.read("-h") || argumentParser.read("--help"))
+   {
+      argumentParser.getApplicationUsage()->write(std::cout);
+      finalize(0);
+   }
+
+   if ( argumentParser.read("--version") || argumentParser.read("-v"))
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)<< argumentParser.getApplicationName().c_str() << " " 
+         << ossimInit::instance()->instance()->version().c_str()<< std::endl;
+      finalize(0);
+   }
+
+   // Fetch command line options:
+   ossimFilename outputFile;
+   if (argumentParser.read("-o", stringParam))
+      outputFile = tempString.trim();
+
+   ossimFilename outputDir;
+   if (argumentParser.read("-d", stringParam))
+      outputDir = tempString.trim();
+
+   bool exclude_r0 = false;
+   if (argumentParser.read("-x") || argumentParser.read("--exclude-fullres"))
+      exclude_r0 = true;
+
+   bool entry_specified = false;
+   ossim_int32 entry = 0;
+   if (argumentParser.read("-e", stringParam) || argumentParser.read("--entry", stringParam))
+   {
+      entry = ossimString(tempString).toUInt32();
+      entry_specified = true;
+   }
+
+   double target_min = 0;
+   double target_max = 0;
+   if (argumentParser.read("--mask-range", doubleParam, doubleParam2))
+   {
+      target_min = tempDouble;
+      target_max = tempDouble2;
+   }
+
+   if (argumentParser.read("--mask-value", doubleParam))
+   {
+      target_min = tempDouble;
+      target_max = target_min;
+   }
+
+   ossimString mask_mode = "REPLACE_ALL_BANDS_IF_ANY_TARGET";
+   ossimString mask_mode_arg;
+   if (argumentParser.read("--mask-mode", stringParam))
+   {
+      mask_mode_arg = tempString;
+      if (mask_mode_arg == "mask_full_and_partial_targets")
+         mask_mode = "REPLACE_ALL_BANDS_IF_ANY_TARGET";
+      else if (mask_mode_arg == "mask_only_full_targets")
+         mask_mode = "REPLACE_ONLY_FULL_TARGETS";
+      else
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE)<< argumentParser.getApplicationName().c_str() << " " 
+            << " Unknown mask-mode <"<<mask_mode_arg<<"> specified. See usage below." << std::endl;
+         argumentParser.getApplicationUsage()->write(std::cout);
+         finalize(1);
+      }
+   }
+
+   bool ovr_from_image = false;
+   if (argumentParser.read("--ovr-from-image"))
+      ovr_from_image = true;
+
+   ossimFilename spec_kwl_file;
+   if (argumentParser.read("--spec_kwl", stringParam))
+      spec_kwl_file = tempString.trim();
+
+   // Handle bad command line:
+   argumentParser.reportRemainingOptionsAsUnrecognized();
+   if (argumentParser.errors())
+   {
+      argumentParser.writeErrorMessages(std::cout);
+      finalize(1);
+   }
+   if ((argumentParser.argc()<2) && spec_kwl_file.empty())
+   {
+      argumentParser.getApplicationUsage()->write(std::cout);
+      finalize(1);
+   }
+
+   // Establish input filename:
+   ossimFilename inputFile;
+   ossimKeywordlist kwl;
+   if (spec_kwl_file.isReadable())
+   {
+      kwl.addFile(spec_kwl_file);
+      inputFile = kwl.find(ossimKeywordNames::IMAGE_FILE_KW);
+      outputFile = kwl.find(ossimKeywordNames::OUTPUT_FILE_KW);
+   }
+   else
+   {
+      inputFile = argv[1];
+   }
+
+   // Establish the input image handler:
+   ossimRefPtr<ossimImageHandler> handler = ossimImageHandlerRegistry::instance()->open(inputFile);
+   if (!handler.valid())
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)<<argumentParser.getApplicationName().c_str()
+         <<" Error encountered opening input file <"<<inputFile<<">."<<endl;
+      finalize(1);
+   }
+
+   // Establish output filename:
+   if (outputFile.empty())
+      outputFile = handler->getFilenameWithThisExtension("mask", entry_specified);
+   if (!outputDir.empty())
+      outputFile.setPath(outputDir);
+   else
+   {
+      ossimFilename path (outputFile.path());
+      if (path.empty())
+         outputFile.setPath(inputFile.path());
+   }
+
+   // Consider input file with multiple entries:
+   std::vector<ossim_uint32> entryList;
+   handler->getEntryList(entryList); 
+   if (entryList.size() <= entry)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)<<argumentParser.getApplicationName().c_str()
+         <<" Entry specified <"<<entry<<"> exceeds total number of entries available <"
+         <<entryList.size()<<">. Aborting..."<<endl;
+      finalize(1);
+   }
+   handler->setCurrentEntry(entry); 
+
+
+   // Establish a keywordlist to pass to the mask builder. This KWL may have already been specified
+   // on the command line with --spec_kwl option:
+   kwl.add(ossimKeywordNames::OUTPUT_FILE_KW, outputFile.chars()); // may overwrite same value
+   if (kwl.getSize() == 0)
+   {
+      kwl.add(ossimKeywordNames::IMAGE_FILE_KW, inputFile.chars());
+      ossimString target_str (ossimString::toString(target_min)+" "+ossimString::toString(target_max));
+      kwl.add(ossimPixelFlipper::PF_TARGET_RANGE_KW, target_str.chars());
+      kwl.add(ossimPixelFlipper::PF_REPLACEMENT_MODE_KW, mask_mode.chars());
+      kwl.add(ossimPixelFlipper::PF_REPLACEMENT_VALUE_KW, (int) 0);
+      if (exclude_r0)
+         kwl.add(ossimBitMaskWriter::BM_STARTING_RLEVEL_KW, (int) 1);
+      else
+         kwl.add(ossimBitMaskWriter::BM_STARTING_RLEVEL_KW, (int) 0);
+   }
+
+   // Instantiate the bit mask processor and write out the mask file:
+   ossimRefPtr<ossimBitMaskWriter> mask_writer = new ossimBitMaskWriter;
+   mask_writer->loadState(kwl);
+   mask_writer->connectMyInputTo(handler.get());
+
+   // Need to loop over all R-levels. Use a sequencer:
+   ossimRefPtr<ossimImageSourceSequencer> sequencer =  new ossimImageSourceSequencer(handler.get());
+   sequencer->initialize();
+   int num_rlevels = handler->getNumberOfDecimationLevels();
+   int num_tiles = sequencer->getNumberOfTiles();
+   int tile_idx = 0;
+   int percent_complete = 0;
+   ossimRefPtr<ossimImageData> tile = 0;
+
+   int start_res = 0;
+   if (exclude_r0)
+   {
+      start_res = 1;
+      num_tiles = (num_tiles+3)/4;
+   }
+
+   for (int r=start_res; r<num_rlevels; r++)
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)<<"\nProcessing R-level "<<r<<"... "<<endl;
+
+      // Set the area of interest to the full image rectangle at this R-level:
+      ossimIrect rect (handler->getBoundingRect(r));
+      sequencer->setAreaOfInterest(rect);
+      sequencer->setToStartOfSequence();
+      do
+      {
+         tile = sequencer->getNextTile(r);
+         mask_writer->generateMask(tile, r);
+
+         percent_complete = 100 * tile_idx++/num_tiles;
+         ossimNotify(ossimNotifyLevel_NOTICE)<<percent_complete<< "%\r";
+      } 
+      while(tile.valid());
+      tile_idx = 0;
+      num_tiles = (num_tiles+3)/4;
+      if (num_tiles == 0)
+         num_tiles = 1;
+
+      // Check if additional overviews are to be generated directly from the mask at first R-level:
+      if ((r == start_res) && !ovr_from_image)
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE)<<"\nBuilding remaining overviews from initial mask..."
+            <<endl;
+         mask_writer->buildOverviews(num_rlevels);
+         break;
+      }
+   }
+
+   // Finished sequencing all levels, ready to write out the mask buffers:
+   mask_writer->close();
+   ossimNotify(ossimNotifyLevel_NOTICE)<<"\nSuccessfully wrote mask file to <"<<outputFile
+      <<">. Finished."<<endl;
+   
+   finalize(0);
+}
diff --git a/src/apps/ossim-create-cg/ossim-create-cg.cpp b/src/apps/ossim-create-cg/ossim-create-cg.cpp
index 0b7e219..b778a2b 100644
--- a/src/apps/ossim-create-cg/ossim-create-cg.cpp
+++ b/src/apps/ossim-create-cg/ossim-create-cg.cpp
@@ -16,12 +16,12 @@
 //*******************************************************************
 //  $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>
@@ -100,10 +100,10 @@ int main(int argc, char *argv[])
    }
    
    ossimFilename outputBaseName;
-   argumentParser.read("-o", outputBaseName);
+   argumentParser.read("-o", outputBaseName.string());
 
    ossimFilename outputPath;
-   argumentParser.read("-d", outputPath);
+   argumentParser.read("-d", outputPath.string());
    if (outputPath.empty())
    {
       argumentParser.read("--support", outputPath);
diff --git a/src/apps/ossim-create-histo/ossim-create-histo.cpp b/src/apps/ossim-create-histo/ossim-create-histo.cpp
index 84fd595..a96c8d5 100644
--- a/src/apps/ossim-create-histo/ossim-create-histo.cpp
+++ b/src/apps/ossim-create-histo/ossim-create-histo.cpp
@@ -101,6 +101,13 @@ void computeHistogram(const ossimString& imageOption,
       {
          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())
diff --git a/src/apps/ossim-dem/ossim-dem.cpp b/src/apps/ossim-dem/ossim-dem.cpp
index 4d2394d..ff6a413 100644
--- a/src/apps/ossim-dem/ossim-dem.cpp
+++ b/src/apps/ossim-dem/ossim-dem.cpp
@@ -1,5 +1,7 @@
 //----------------------------------------------------------------------------
 //
+// File: ossim-dem.cpp
+// 
 // License:  LGPL
 // 
 // See LICENSE.txt file in the top level directory for more details.
@@ -11,12 +13,6 @@
 //----------------------------------------------------------------------------
 // $Id$
 
-#include <cstdlib> /* for exit */
-#include <iomanip>
-#include <iostream>
-
-using namespace std;
-
 #include <ossim/base/ossimConstants.h>
 #include <ossim/base/ossimArgumentParser.h>
 #include <ossim/base/ossimApplicationUsage.h>
@@ -26,7 +22,13 @@ using namespace std;
 #include <ossim/base/ossimTimer.h>
 #include <ossim/base/ossimTrace.h>
 #include <ossim/init/ossimInit.h>
-#include <ossim/util/ossimElevUtil.h>
+#include <ossim/util/ossimChipperUtil.h>
+
+#include <cstdlib> /* for exit */
+#include <iomanip>
+#include <iostream>
+
+using namespace std;
 
 static ossimTrace traceDebug = ossimTrace("ossim-dem:debug");
 
@@ -43,9 +45,6 @@ int main(int argc, char* argv[])
    
    ossimArgumentParser ap(&argc, argv);
 
-   // Add global usage options.
-   ossimInit::instance()->addOptions(ap);
-
    // Initialize ossim stuff, factories, plugin, etc.
    ossimInit::instance()->initialize(ap);
 
@@ -55,36 +54,27 @@ int main(int argc, char* argv[])
    //---
    if ( ( ap.argc() > 1 ) || ( ap.argc() == originalArgCount ) )
    {
-      //---
-      // Set the application name here.  The ossimElevUtil class will do the rest
-      // of the usage.
-      //---
-      ap.getApplicationUsage()->setApplicationName(ap.getApplicationName());
-
       // Make the generator.
-      ossimRefPtr<ossimElevUtil> eu = new ossimElevUtil;
-
-      // Add options.
-      eu->addArguments(ap);
+      ossimRefPtr<ossimChipperUtil> chipper = new ossimChipperUtil;
 
       try
       {      
          //---
-         // NOTE: ossimElevUtil::initialize handles the application usage which will
+         // NOTE: ossimChipperUtil::initialize handles the application usage which will
          // false, to end things if certain options (e.g. "--help") are provided.
          //
-         // ossimElevUtil::initialize can throw an exception.
+         // ossimChipperUtil::initialize can throw an exception.
          //---
-         bool continue_after_init = eu->initialize(ap);
+         bool continue_after_init = chipper->initialize(ap);
          if (continue_after_init)
          {      
-            // ossimElevUtil::execute can throw an excepion.
-            eu->execute();
+            // ossimChipperUtil::execute can throw an excepion.
+            chipper->execute();
             
             ossimNotify(ossimNotifyLevel_NOTICE)
                << "elapsed time in seconds: "
                << std::setiosflags(ios::fixed)
-               << std::setprecision(2)
+               << std::setprecision(3)
                << ossimTimer::instance()->time_s() << endl;
          }
       }
diff --git a/src/apps/ossim-icp/ossim-icp.cpp b/src/apps/ossim-icp/ossim-icp.cpp
index ac95d26..0a03d00 100644
--- a/src/apps/ossim-icp/ossim-icp.cpp
+++ b/src/apps/ossim-icp/ossim-icp.cpp
@@ -9,11 +9,7 @@
 // (no resampler).
 //
 //*******************************************************************
-//  $Id: icp.cpp 13641 2008-10-01 13:02:40Z gpotts $
-#include <iostream>
-#include <algorithm>
-#include <iterator>
-#include <exception>
+//  $Id: ossim-icp.cpp 3023 2011-11-02 15:02:27Z david.burken $
 
 #include <ossim/base/ossimConstants.h>
 #include <ossim/base/ossimKeywordNames.h>
@@ -35,10 +31,16 @@
 #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");
 
@@ -75,38 +77,77 @@ ossimString massageQuotedValue(const ossimString& value)
    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 argumentParser(&argc, argv);
-   ossimInit::instance()->addOptions(argumentParser);
-   ossimInit::instance()->initialize(argumentParser);
-   
-   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
-   argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName()+" copys any supported input image format to any supported output image format format");
-   argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName()+" [options] <output_type> <input_file> <output_file>");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-a or --use-scalar-remapper", "Uses scalar remapper, transforms to 8-bit");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-o or --create-overview", "Creates and overview for the output image");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-b or --bands", "uses the specified bands: ex. \"1, 2, 4\" will select bands 1 2 and 4 of the input image.  Note: it is 1 based");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-c or --compression-type", "Uses compression.  Currently valid for only tiff output -c jpeg will use jpeg compression");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-e or --entry", "For multi image handlers which entry do you wish to extract");
-   
-   argumentParser.getApplicationUsage()->addCommandLineOption("-q or --compression-quality", "Uses compression.  Valid for jpeg type. default is 75 where 100 is the best and 1 is the worst");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("--pixel-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.");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("-r or --res-level", "Which res level to extract from the input: ex -r 1 will get res level 1");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-l or --start-line", "Which start line do you wish to copy from the input. If none is given then 0 is used");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-L or --end-line", "Which end line do you wish to copy from the input.  If none is given then max line is used");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-s or --start-sample", "Which start sample do you wish to copy from the input.  If none is given then 0 is used");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-p or --end-sample", "Which end sample do you wish to copy from the input.  If none is given then max sample is used");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-t or --create-thumbnail", "Takes an argument which is the maximum pixel dimension desired.\nCreate thumbnail flag is enabled");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-w or --tile-width", "Defines the tile width for the handlers that support tiled output");
-   argumentParser.getApplicationUsage()->addCommandLineOption("--writer-prop", "adds a property to send to the writer. format is name=value");
-   argumentParser.getApplicationUsage()->addCommandLineOption("--filter-spec", "This is an external file spec that describes a chain and can be used as for filtering the input image");
+   
+   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;
@@ -119,10 +160,12 @@ int main(int argc, char* argv[])
    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;
@@ -132,66 +175,88 @@ int main(int argc, char* argv[])
    ossim_int32 sample_stop              = 0;
    ossim_int32 cibcadrg_entry           = 0;
    vector<ossimString> band_list(0);
-   ossimFilename filterSpec;
-   std::map<ossimString, ossimString> theWriterPropertyMap;
+   ossimFilename filterSpec, maskFile;
+   std::map<ossimString, ossimString, ossimStringLtstr> readerPropertyMap;
+   std::map<ossimString, ossimString, ossimStringLtstr> writerPropertyMap;
 
-   if (argumentParser.read("-h") ||
-       argumentParser.read("--help")||(argumentParser.argc() < 2))
+   if (ap.read("-h") ||
+       ap.read("--help")||(ap.argc() < 2))
    {
-      argumentParser.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_NOTICE));
+      au->write(ossimNotify(ossimNotifyLevel_NOTICE));
       usage(); // for writer output types
-      exit(0);
+      finalize(0);
    }
-   
-   while(argumentParser.read("--writer-prop", stringParam))
+
+   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)
       {
-         theWriterPropertyMap.insert(std::make_pair(nameValue[0], massageQuotedValue(nameValue[1])));
+         writerPropertyMap.insert(std::make_pair(nameValue[0], massageQuotedValue(nameValue[1])));
       }
    }
-   while(argumentParser.read("-a") ||
-         argumentParser.read("--use-scalar-remapper"))
+   while(ap.read("-a") ||
+         ap.read("--use-scalar-remapper"))
    {
       use_scalar_remapper = true;        
    }
-   while(argumentParser.read("--filter-spec",stringParam))
+   while(ap.read("--filter-spec",stringParam))
    {
       filterSpec = ossimFilename(tempString);        
    }
    
-   while(argumentParser.read("-o") ||
-         argumentParser.read("--create-overview"))
+   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(argumentParser.read("-b", stringParam) ||
-         argumentParser.read("--bands", stringParam))
+   while(ap.read("-b", stringParam) ||
+         ap.read("--bands", stringParam))
    {
       use_band_selector = true;
       ossimString s = tempString;
       band_list = s.split(",");
    }
    
-   while(argumentParser.read("-c", stringParam) ||
-         argumentParser.read("--compression-type", stringParam))
+   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(argumentParser.read("-e", stringParam) ||
-         argumentParser.read("--entry", stringParam))
+   while(ap.read("-e", stringParam) ||
+         ap.read("--entry", stringParam))
    {
       cibcadrg_entry = ossimString(tempString).toInt();
    }
+
+   if ( ap.read("-g") )
+   {
+      convert_to_greyscale = true;
+   }   
    
-   while(argumentParser.read("-q", stringParam) ||
-         argumentParser.read("--compression-quality", stringParam))
+   while(ap.read("-q", stringParam) ||
+         ap.read("--compression-quality", stringParam))
    {
       // Set the jpeg compression quality level.
       kwl.add(PREFIX,
@@ -199,48 +264,48 @@ int main(int argc, char* argv[])
               tempString.c_str(),
               true);
    }
-   while(argumentParser.read("-r", stringParam) ||
-         argumentParser.read("--res-level", stringParam))
+   while(ap.read("-r", stringParam) ||
+         ap.read("--res-level", stringParam))
    {
       rr_level = ossimString(tempString).toInt();
    }
    
-   while(argumentParser.read("-l", stringParam) ||
-         argumentParser.read("--start-line", stringParam))
+   while(ap.read("-l", stringParam) ||
+         ap.read("--start-line", stringParam))
    {
       lineStartIsSpecified = true;
       line_start = ossimString(tempString).toInt();
    }
    
-   while(argumentParser.read("-L", stringParam) ||
-         argumentParser.read("--end-line", stringParam))
+   while(ap.read("-L", stringParam) ||
+         ap.read("--end-line", stringParam))
    {
       lineEndIsSpecified = true;
       line_stop = ossimString(tempString).toInt();
    }
-   while(argumentParser.read("-s", stringParam) ||
-         argumentParser.read("--start-sample", stringParam))
+   while(ap.read("-s", stringParam) ||
+         ap.read("--start-sample", stringParam))
    {
       sampStartIsSpecified = true;
       sample_start = ossimString(tempString).toInt();
    }
    
-   while(argumentParser.read("-p", stringParam) ||
-         argumentParser.read("--end-sample", stringParam))
+   while(ap.read("-p", stringParam) ||
+         ap.read("--end-sample", stringParam))
    {
       sampEndIsSpecified = true;
       sample_stop = ossimString(tempString).toInt();
    }
    
-   while(argumentParser.read("-t", stringParam) ||
-         argumentParser.read("--create-thumbnail", stringParam))
+   while(ap.read("-t", stringParam) ||
+         ap.read("--create-thumbnail", stringParam))
    {
       create_thumbnail = true;
       max_thumbnail_dimension=ossimString(tempString).toInt();
    }
    
-   while(argumentParser.read("-w", stringParam) ||
-         argumentParser.read("-tile-width", stringParam))
+   while(ap.read("-w", stringParam) ||
+         ap.read("-tile-width", stringParam))
    {
       tile_width = ossimString(tempString).toInt();
       if ((tile_width % 16) != 0)
@@ -253,7 +318,7 @@ int main(int argc, char* argv[])
          tile_width = 0;
       }
    }
-   if (argumentParser.read("--pixel-type", stringParam))
+   if (ap.read("--pixel-type", stringParam))
    {
       ossimString os = tempString;
       os.downcase();
@@ -268,47 +333,47 @@ int main(int argc, char* argv[])
       }
    }
    
-   argumentParser.reportRemainingOptionsAsUnrecognized();
+   ap.reportRemainingOptionsAsUnrecognized();
    
    // Three required args:  output_type, input file, and output file.
-   if (argumentParser.errors())
+   if (ap.errors())
    {
-      argumentParser.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
-      exit(0);
+      ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
+      finalize(0);
    }
-   if (argumentParser.argc() < 4)
+   if (ap.argc() < 4)
    {
-      argumentParser.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_NOTICE));
+      au->write(ossimNotify(ossimNotifyLevel_NOTICE));
       usage(); // for writer output types
-      exit(0);
+      finalize(0);
    }
    
-   //---
    // Set the writer type and the image type.
-   //---
-   ossimString output_type = argumentParser.argv()[argumentParser.argc()-3];
-//   output_type.downcase();
-   
+   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[argumentParser.argc()-2];
+   const char* input_file = argv[ap.argc()-2];
    
    // Get the output file.
-   ossimFilename    output_file = argv[argumentParser.argc()-1];
+   ossimFilename output_file = argv[ap.argc()-1];
    
    if (traceDebug())
    {
       CLOG << "DEBUG:"
            << "\noutput type:  "
-           << argumentParser.argv()[argumentParser.argc()-3]
+           << ap.argv()[ap.argc()-3]
            << "\ninput file:   "
-           << argumentParser.argv()[argumentParser.argc()-2]
+           << ap.argv()[ap.argc()-2]
            << "\noutput file:  "
-           << argumentParser.argv()[argumentParser.argc()-1]
+           << ap.argv()[ap.argc()-1]
            << std::endl;
       
-      if (tile_width) ossimNotify(ossimNotifyLevel_NOTICE) << "tile_width:  " << tile_width << std::endl;
+      if (tile_width)
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE) << "tile_width:  " << tile_width << std::endl;
+      }
    }
    
    // Get an image handler for the input file.
@@ -329,19 +394,30 @@ int main(int argc, char* argv[])
    {
       ossimNotify(ossimNotifyLevel_NOTICE) << "Unsupported image file:  " << input_file
            << "\nExiting application..." << std::endl;
-      exit(0);
+      finalize(0);
    }
-   
-   // Initialize the 
    if (ih->getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
    {
       ossimNotify(ossimNotifyLevel_FATAL)
          << "Error reading image:  " << input_file
          << "Exiting application..." << std::endl; 
-      exit(1);
+      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())
    {
@@ -349,27 +425,17 @@ int main(int argc, char* argv[])
            << "\nImage Handler:  " << ih->getLongName()
            << std::endl;
    }
-   
-   ossimRefPtr<ossimImageSource> source = ih.get();
-   ossimRefPtr<ossimBandSelector> bs = 0;
-   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 (use_band_selector && (source->getNumberOfOutputBands() > 1))
+
+   // 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();
@@ -390,11 +456,11 @@ int main(int argc, char* argv[])
                << "\nBand list range error!"
                << "\nHighest available band:  " << bands
                << std::endl;
-            exit(1);
+            finalize(1);
          }
       }
       
-      bs = new ossimBandSelector();
+      ossimRefPtr<ossimBandSelector> bs = new ossimBandSelector();
       bs->connectMyInputTo(source.get());
       bs->setOutputBandList(bl);
       bs->enableSource();
@@ -412,21 +478,59 @@ int main(int argc, char* argv[])
          }
          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();
    }
    
-   //---
-   // Get the image rectangle for the rrLevel selected.
-   //---
-   ossimIrect output_rect;
-   ossimRefPtr<ossimRLevelFilter> rlevelFilter = 0;
+   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)
    {
-      rlevelFilter = new ossimRLevelFilter;
-      
-      rlevelFilter->connectMyInputTo(source.get());
-      
-      source = rlevelFilter.get();
       // Get the rlevel that <= max thumbnail dimension.
       int max   = 0;
       int level = 0;
@@ -440,119 +544,96 @@ int main(int argc, char* argv[])
          {
             break;
          }
-         level++;
+         ++level;
       }
       
       if (max > max_thumbnail_dimension)
       {
          ossimNotify(ossimNotifyLevel_NOTICE) << " NOTICE:"
-              << "\nLowest rlevel not small enough to fullfill "
+              << "\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;
-      rlevelFilter->setCurrentRLevel(rr_level);
-      if (rr_level)
-      {
-         rlevelFilter->setOverrideGeometryFlag(true);
-      }
-
-
-      // Set the rectangle to that of the res level.
-      output_rect = rlevelFilter->getBoundingRect();
 
    } // end of "if  (create_thumbnail == true)
-   else
-   {
-      // modified to only do an rlevel if one is requested
-      if(rr_level != 0)
+
+   // 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()))
       {
-         //***
-         // 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:"
+         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;
-         }
-         
-         rlevelFilter = new ossimRLevelFilter;
-         
-         rlevelFilter->connectMyInputTo(source.get());
-         
-         source = rlevelFilter.get();
+         rr_level = 0;
+      }
          
-         rlevelFilter->setCurrentRLevel(rr_level);
-         if (rr_level)
-         {
-            rlevelFilter->setOverrideGeometryFlag(true);
-         }
+      ossimRefPtr<ossimRLevelFilter> rlevelFilter = new ossimRLevelFilter;
+      
+      rlevelFilter->connectMyInputTo(source.get());
+      
+      source = rlevelFilter.get();
+      
+      rlevelFilter->setCurrentRLevel(rr_level);
+      if ( rr_level )
+      {
+         rlevelFilter->setOverrideGeometryFlag(true);
       }
-      output_rect = source->getBoundingRect(rr_level);
       
-      //***
-      // If any of these are true the user wants to cut the rectangle.
-      //***
-      if ( lineStartIsSpecified || lineEndIsSpecified ||
-           sampStartIsSpecified || sampEndIsSpecified)
+   } // 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)
       {
-         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;
-         }
+         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;
+      }
 
-//          if (sample_start > output_rect.ul().x &&
-//              sample_start < output_rect.lr().x)
-//          {
-             output_rect.set_ulx(sample_start);
-//          }
-//          if (sample_stop > output_rect.ul().x &&
-//              sample_start < output_rect.lr().x)
-//          {
-             output_rect.set_lrx(sample_stop);
-//          }
-//          if (line_start > output_rect.ul().y &&
-//              line_start < output_rect.lr().y)
-//          {
-             output_rect.set_uly(line_start);
-//          }
-//          if (line_stop > output_rect.ul().y &&
-//              line_start < output_rect.lr().y)
-//          {
-             output_rect.set_lry(line_stop);
-//          }
+      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) ||..."
-   }
+   } // End of "if ((lineEndIsSpecified) ||..."
 
    if (traceDebug())
    {
@@ -562,7 +643,6 @@ int main(int argc, char* argv[])
            << "\nkeyword list:  " << kwl << std::endl;
    }
    
-   
    ossimRefPtr<ossimImageFileWriter> writer =
       ossimImageWriterFactoryRegistry::instance()->createWriter(kwl, PREFIX);
 
@@ -573,7 +653,7 @@ int main(int argc, char* argv[])
          << output_type
          << std::endl;
       usage();
-      exit(1);
+      finalize(1);
    }
 
    writer->connectMyInputTo(0, source.get());
@@ -619,12 +699,15 @@ int main(int argc, char* argv[])
 
       try
       {
-         ossimPropertyInterface* propInterface = (ossimPropertyInterface*)writer.get();
-         std::map<ossimString, ossimString>::iterator iter = theWriterPropertyMap.begin();
-         while(iter!=theWriterPropertyMap.end())
+         if ( writerPropertyMap.size() )
          {
-            propInterface->setProperty(iter->first, iter->second);
-            ++iter;
+            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();
       }
@@ -652,7 +735,7 @@ int main(int argc, char* argv[])
          << "Error detected in the image writer..."
          << "\nExiting application..." << std::endl;
 
-      exit(1);
+      finalize(1);
    }
    
    if (create_overview == true)
@@ -660,5 +743,5 @@ int main(int argc, char* argv[])
       writer->writeOverviewFile();
    }
    
-   exit(0);
+   finalize(0);
 }
diff --git a/src/apps/ossim-igen/ossim-igen.cpp b/src/apps/ossim-igen/ossim-igen.cpp
index 72ae48c..7e29b0a 100644
--- a/src/apps/ossim-igen/ossim-igen.cpp
+++ b/src/apps/ossim-igen/ossim-igen.cpp
@@ -8,21 +8,22 @@
 //*******************************************************************
 //  $Id: igen.cpp 13025 2008-06-13 17:06:30Z sbortman $
 
-#include <ctime>
-#include <cstdlib>
-#include <iostream>
-#include <list>
-#include <fstream>
 
-using namespace std;
-#include <ossim/parallel/ossimIgen.h>
-#include <ossim/parallel/ossimMpi.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimNotifyContext.h>
+
 #include <ossim/base/ossimArgumentParser.h>
 #include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
 #include <ossim/base/ossimRefPtr.h>
 #include <ossim/base/ossimTrace.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/parallel/ossimIgen.h>
+#include <ossim/parallel/ossimMpi.h>
+#include <iostream>
+#include <string>
+using namespace std;
+
 static ossimTrace traceDebug("igen:debug");
 
 int main(int argc, char* argv[])
@@ -60,6 +61,8 @@ int main(int argc, char* argv[])
    start = ossimMpi::instance()->getTime();
 
    ossimKeywordlist kwl;
+   kwl.setExpandEnvVarsFlag(true);
+   
    while(argumentParser.read("-t", stringParam)   ||
          argumentParser.read("--thumbnail", stringParam));
    
@@ -93,11 +96,22 @@ int main(int argc, char* argv[])
          kwl.add("igen.thumbnail_res",
                  tempString.c_str(),
                  true);
-         
+
          igen->initialize(kwl);
       }
    }
-   igen->outputProduct();
+
+   try // Can throw exception:
+   {
+      igen->outputProduct();
+   }
+   catch(const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)
+         << "ossim-igen caught exception:\n"
+         << e.what()
+         << std::endl; 
+   }
    
    if(ossimMpi::instance()->getRank() == 0)
    {
diff --git a/src/apps/ossim-image-compare/CMakeLists.txt b/src/apps/ossim-image-compare/CMakeLists.txt
new file mode 100644
index 0000000..6bd64d0
--- /dev/null
+++ b/src/apps/ossim-image-compare/CMakeLists.txt
@@ -0,0 +1,2 @@
+FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
+OSSIM_SETUP_APPLICATION(ossim-image-compare INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})
diff --git a/src/apps/ossim-image-compare/ossim-image-compare.cpp b/src/apps/ossim-image-compare/ossim-image-compare.cpp
new file mode 100644
index 0000000..0b6f2bd
--- /dev/null
+++ b/src/apps/ossim-image-compare/ossim-image-compare.cpp
@@ -0,0 +1,154 @@
+//----------------------------------------------------------------------------
+//
+// 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/src/apps/ossim-img2rr/ossim-img2rr.cpp b/src/apps/ossim-img2rr/ossim-img2rr.cpp
index b734009..eed99ad 100644
--- a/src/apps/ossim-img2rr/ossim-img2rr.cpp
+++ b/src/apps/ossim-img2rr/ossim-img2rr.cpp
@@ -1,678 +1,823 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Command line application "img2rr" to build overviews.
-//
-//----------------------------------------------------------------------------
-// $Id: img2rr.cpp 14814 2009-07-01 13:54:56Z dburken $
-
-#include <ctime> /* for clock function */
-#include <iomanip>
-#include <iostream>
-#include <iterator>
-#include <vector>
-#include <map>
-
-#include <tiff.h> /* for compression defines */
-
-#include <ossim/ossimConfig.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimProperty.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimHistogramWriter.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageHistogramSource.h>
-#include <ossim/imaging/ossimOverviewBuilderBase.h>
-#include <ossim/imaging/ossimOverviewBuilderFactoryRegistry.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/parallel/ossimMpi.h>
-
-static ossimTrace traceDebug = ossimTrace("img2rr:debug");
-static ossimTrace traceTime("time");
-
-static void outputWriterTypes()
-{
-   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"));
-}
-
-void computeHistogram(ossimImageHandler* ih,
-                      const ossimFilename& histogramFile,
-                      ossimHistogramMode histoMode,
-                      ossim_float64 histoMin,
-                      ossim_float64 histoMax,
-                      ossim_uint32 histoBins)
-{
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "computeHistogram entered..."
-         << "\nhistogramFile: " << histogramFile
-         << std::endl;
-   }
-   
-   if(ih)
-   {
-      ossimRefPtr<ossimImageHistogramSource> histoSource = new ossimImageHistogramSource;
-      ossimRefPtr<ossimHistogramWriter> writer = new ossimHistogramWriter;
-
-      histoSource->setMaxNumberOfRLevels(1); // Currently hard coded...
-
-      if( !ossim::isnan(histoMin) )
-      {
-         histoSource->setMinValueOverride(histoMin);
-      }
-
-      if( !ossim::isnan(histoMax) )
-      {
-         histoSource->setMaxValueOverride(histoMax);
-      }
-
-      if(histoBins > 0)
-      {
-         histoSource->setNumberOfBinsOverride(histoBins);
-      }
-      histoSource->setComputationMode(histoMode);
-
-      histoSource->connectMyInputTo(0, ih);
-      histoSource->enableSource();
-      writer->connectMyInputTo(0, histoSource.get());
-      writer->setFilename(histogramFile);
-      theStdOutProgress.setFlushStreamFlag(true);
-      writer->addListener(&theStdOutProgress);
-      writer->execute();
-      writer=0;
-   }
-}
-
-int main(int argc, char* argv[])
-{
-#if OSSIM_HAS_MPI
-   ossimMpi::instance()->initialize(&argc, &argv);
-#endif
-
-   //---
-   // Get the arg count so we can tell if an arg was consumed by
-   // ossimInit::instance()->initialize
-   //---
-   int originalArgCount = argc;
-
-   double start_time = 0.0;
-   if (ossimMpi::instance()->getRank() == 0)
-   {
-      ossimNotify(ossimNotifyLevel_INFO)
-         << "MPI running with "
-         << ossimMpi::instance()->getNumberOfProcessors()
-         << " processors..." << std::endl;
-      start_time = ossimMpi::instance()->getTime();
-   }
- 
-   ossimString tempString;
-   ossimArgumentParser::ossimParameter stringParam(tempString);
-   ossimArgumentParser argumentParser(&argc, argv);
-   ossimInit::instance()->addOptions(argumentParser);
-   ossimInit::instance()->initialize(argumentParser);
-
-   if ( (argumentParser.argc() == 1) && (originalArgCount > 1) )
-   {
-      exit(0); // ossimInit consumed all options.
-   }
-   
-   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
-
-   argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName()+" Creates overviews and optionally a histogram for the passed in image. ");
-
-   argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName()+" [options] <input file>");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("-a or --include-fullres", "Wants to include full res dataset as well as reduced res sets.");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help", "Shows help");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("-e or --entry","Give the entry(zero based) to build an overview for.");
-   
-   argumentParser.getApplicationUsage()->addCommandLineOption("--list-entries","Lists the entries within the image");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("--compression-quality","Compression quality varies from 0 to 100, where 100 is best.  Currently only for JPEG compression");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("--compression-type","Compression type can be: NONE, JPEG, PACKBITS, or DEFLATE");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("--tile-size", "Defines the tile size for the supported overview handler.");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("-o", "Write overview to file specified.  If used on a multi-entry file, given \"foo.ovr\" you will get: \"foo_e0.ovr\"");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("-d", "Write overview to directory specified.");
-
-   argumentParser.getApplicationUsage()->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, setting the keyword \"overview_stop_dimension\".");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "-t or --type",
-      "see list at bottom for valid types. (default = ossim_tiff_box)");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "-r or --rebuild",
-      "Rebuild overviews even if they are already present.");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("--set-property","key:value NOTE: separate key value by a colon.  Deprecated, use --writer-prop instead.");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("--writer-prop", "Adds a property to send to the writer. format is name=value");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("--create-histogram", "Computes a histogram.");
-   
-   argumentParser.getApplicationUsage()->addCommandLineOption("--create-histogram-fast", "Computes a histogram in fast mode which samples partial tiles.");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("--histogram-r0", "Forces create-histogram code to compute a histogram using r0.  If source image has reduced resolution sets built in a separate pass will be made at r0.");
-
-   
-   argumentParser.getApplicationUsage()->addCommandLineOption("--histogram-min", "Minimum histogram value to use.  This will override the default for scalar type.  Also this will force a separate pass.");
-   
-   argumentParser.getApplicationUsage()->addCommandLineOption("--histogram-max", "Maximum histogram value to use.  This will override the default for scalar type.  Also this will force a separate pass.");
-   
-   argumentParser.getApplicationUsage()->addCommandLineOption("--histogram-bins", "Number of histogram bins.   This will override the default for scalar type.  Also this will force a separate pass.");
-   
-   // Optional arguments.
-   bool copyAllFlag      = false;
-   bool entryListSetFlag = false;
-   bool listEntriesFlag  = false;
-   bool tileSizeFlag     = false;
-   bool rebuildFlag      = false;
-
-   // Optional histogram creation arguments:
-   ossimHistogramMode histoMode = OSSIM_HISTO_MODE_UNKNOWN;
-   bool histoR0Flag = false;
-   bool histoFastFlag = false;
-   ossim_float64 histoMin = ossim::nan();
-   ossim_float64 histoMax = ossim::nan();
-   ossim_uint32 histoBins = 0;
-
-   //---
-   // Note: singlePassHistoFlag
-   // There are two paths histogram creation can take.
-   // If true use overview sequencer.
-   //---
-   bool singlePassHistoFlag = true; 
-
-   ossimFilename inputFile  = ossimFilename::NIL;
-   ossimFilename outputFile = ossimFilename::NIL;
-   ossimFilename outputDir  = ossimFilename::NIL;
-   
-   std::vector<ossim_uint32> entryList;
-
-   ossimIpt tileSize(64, 64);
-   ossim_uint32 overviewStopDimension(0);
-
-   bool listFramesFlag = false;
-
-   //---
-   // Temporary way to pass generic things to builder.
-   //---
-   std::vector< ossimRefPtr<ossimProperty> > propertyList(0);
-
-   ossimString overviewType = "ossim_tiff_box";
-   
-   // Compression typedefs in tiff.h
-   ossimString compressionType = "";
-   ossimString compressionQuality = "75";
-
-   if(argumentParser.read("-h") || argumentParser.read("--help"))
-   {
-      argumentParser.getApplicationUsage()->write(std::cout);
-      outputWriterTypes();
-      ossimMpi::instance()->finalize();
-      exit(0);
-   }
-
-   if(argumentParser.read("--compression-quality", stringParam))
-   {
-      compressionQuality = tempString;
-   }
-   if(argumentParser.read("--compression-type", stringParam))
-   {
-      compressionType = tempString;
-   }
-   if( argumentParser.read("--create-histogram"))
-   {
-      histoMode = OSSIM_HISTO_MODE_NORMAL;
-   }
-   if( argumentParser.read("--create-histogram-fast"))
-   {
-      histoMode = OSSIM_HISTO_MODE_FAST;
-   }
-   if( argumentParser.read("--histogram-r0"))
-   {
-      histoR0Flag = true;
-   }
-   if(argumentParser.read("--histogram-min", stringParam))
-   {
-      histoMin = tempString.toFloat64();
-   }
-   if(argumentParser.read("--histogram-max", stringParam))
-   {
-      histoMax = tempString.toFloat64();
-   }
-   if(argumentParser.read("--histogram-bins", stringParam))
-   {
-      histoBins = tempString.toUInt32();
-   }
-
-   if(argumentParser.read("--tile-size", stringParam))
-   {
-      tileSize.x = tempString.toInt32();
-      tileSize.y = tileSize.x;
-      tileSizeFlag = true;
-   }
-   if( argumentParser.read("--list-entries"))
-   {
-      listEntriesFlag = true;
-   }
-
-   if( argumentParser.read("-o", stringParam) )
-   {
-      outputFile = tempString.trim();
-   }
-   
-   if( argumentParser.read("-d", stringParam) )
-   {
-      outputDir = tempString.trim();
-   }
-
-   if( argumentParser.read("-t", stringParam) ||
-       argumentParser.read("--type", stringParam))
-   {
-      overviewType = tempString.trim();
-   }
-
-   if( argumentParser.read("-s", stringParam) )
-   {
-      overviewStopDimension = tempString.toUInt32();
-   }
-    
-   if(argumentParser.read("-a") || argumentParser.read("--include-fullres"))
-   {
-      copyAllFlag = true;
-   }
-
-   if(argumentParser.read("-r") || argumentParser.read("--rebuild"))
-   {
-      rebuildFlag = true;
-   }
-
-   while(argumentParser.read("-e", stringParam) ||
-         argumentParser.read("--entry", stringParam))
-   {
-      entryList.push_back(ossimString(tempString).toUInt32());
-      entryListSetFlag = true;
-   }
-
-   while( argumentParser.read( "--set-property", stringParam) )
-   {
-      if (tempString.size())
-      {
-         ossimString propertyName;
-         ossimString propertyValue;
-         std::vector<ossimString> v = tempString.split(":");
-         if (v.size() == 2)
-         {
-            propertyName = v[0];
-            propertyValue = v[1];
-         }
-         else
-         {
-            propertyName = tempString;
-         }
-         ossimRefPtr<ossimProperty> p =
-            new ossimStringProperty(propertyName, propertyValue);
-         propertyList.push_back(p);
-      }
-   }
-
-   while(argumentParser.read("--writer-prop", stringParam))
-   {
-      if (tempString.size())
-      {
-         ossimString propertyName;
-         ossimString propertyValue;
-         std::vector<ossimString> v = tempString.split("=");
-         if (v.size() == 2)
-         {
-            propertyName = v[0];
-            propertyValue = v[1];
-         }
-         else
-         {
-            propertyName = tempString;
-         }
-         ossimRefPtr<ossimProperty> p =
-            new ossimStringProperty(propertyName, propertyValue);
-         propertyList.push_back(p);
-      }
-   }
-
-   argumentParser.reportRemainingOptionsAsUnrecognized();
-   if (argumentParser.errors())
-   {
-      argumentParser.writeErrorMessages(std::cout);
-      ossimMpi::instance()->finalize();
-      exit(1);
-   }
-
-   if(argumentParser.argc() < 2)
-   {
-      argumentParser.getApplicationUsage()->write(std::cout);
-      outputWriterTypes();
-      ossimMpi::instance()->finalize();
-      exit(1);
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "\nhistoMode:     " << histoMode
-         << "\nhistoMin:      " << histoMin
-         << "\nhistoMax:      " << histoMax
-         << "\nhistoBins:     " << histoBins
-         << "\nhistoR0Flag:   " << histoR0Flag
-         << std::endl;
-   }
-
-   // Keep a list of files for time command.
-   std::vector<ossimFilename> overviewFiles;
-
-   for (int i=1 ; i < argumentParser.argc(); i++)
-   {
-      inputFile = argumentParser.argv()[i];
-
-      ossimRefPtr<ossimImageHandler> ih =
-         ossimImageHandlerRegistry::instance()->open(inputFile);
-      
-      if(ih.valid())
-      {
-         // Get the list of entries 
-         if (entryList.size() == 0) 
-         { 
-            ih->getEntryList(entryList); 
-         }
-         
-         // User wants to see entries.
-         if(listEntriesFlag)
-         {
-            std::cout << "Entries: ";
-            std::copy(entryList.begin(),
-                      entryList.end(),
-                      std::ostream_iterator<ossim_uint32>(std::cout, " "));
-            std::cout << std::endl;
-            exit(0);
-         }
-         
-         // Force a rebuild. 
-         if (rebuildFlag) 
-         { 
-            for(ossim_uint32 idx = 0; idx < entryList.size(); ++idx) 
-            { 
-               ih->setCurrentEntry(entryList[idx]); 
-               ossimFilename f = ih->getOverviewFile(); 
-               ih->closeOverview(); 
-               if (f.exists())
-               {
-                  f.remove();
-               }
-            }
-         }
-         
-         ossimRefPtr<ossimOverviewBuilderBase> ob =
-            ossimOverviewBuilderFactoryRegistry::instance()->
-            createBuilder(overviewType);
-         if ( ob.valid() == false )
-         {
-            std::cout << "img2rr ERROR:"
-                      << "\nCould not create builder for:  "
-                      << overviewType
-                      << endl;
-            argumentParser.getApplicationUsage()->write(std::cout);
-            outputWriterTypes();
-            ossimMpi::instance()->finalize();
-            exit(1);
-         }
-         propertyList.push_back(
-            new ossimStringProperty("copy_all_flag",
-                                    ossimString::toString(copyAllFlag)));
-         propertyList.push_back(
-            new ossimStringProperty(ossimKeywordNames::COMPRESSION_TYPE_KW,
-                                    compressionType));
-         propertyList.push_back(
-            new ossimStringProperty(ossimKeywordNames::COMPRESSION_QUALITY_KW,
-                                    compressionQuality));
-         
-         if(tileSizeFlag)
-         {
-            propertyList.push_back(
-               new ossimStringProperty(ossimKeywordNames::OUTPUT_TILE_SIZE_KW,
-                                       tileSize.toString()));
-         }
-         
-         // Generic property setting.
-         if (propertyList.size())
-         {
-            ob->setProperties(propertyList);
-         }
-         
-         if (overviewStopDimension)
-         {
-            ob->setOverviewStopDimension(overviewStopDimension);
-         }
-         
-         //---
-         // Histogram creation:
-         // Two paths:
-         // 
-         // 1) In conjunction with overview sequencer which is most efficient.
-         // 2) Separate function call in which case the image will be scanned when
-         //    building overviews and to create histo.
-         //
-         // Notes:
-         //
-         // Path # 1 is most efficient; however limitted to single process.
-         //
-         // If the source image has overviews and the user wants histogram from r0 we use
-         // path #2.
-         //
-         // If options for min, max or bin count we use path 2.
-         //---
-         if ( histoMode != OSSIM_HISTO_MODE_UNKNOWN )
-         {
-            if ( ( ossimMpi::instance()->getNumberOfProcessors() > 1) ||
-                 ( ih->hasOverviews() && histoR0Flag ) ||
-                 ( !ossim::isnan(histoMin) ) ||
-                 ( !ossim::isnan(histoMax) ) ||
-                 ( histoBins ) ||
-                 ( overviewType.contains("gdal") )
-                 )
-            {
-               singlePassHistoFlag = false;
-            }
-
-            if ( traceDebug() )
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "singlePassHistoFlag: " << singlePassHistoFlag << std::endl;
-            }
-
-            if ( singlePassHistoFlag )
-            {
-               // This will tell the overview builder to make a histogram.
-               ob->setHistogramMode(histoMode);
-            }
-         }
-         
-         //---
-         // This code block will put an entry string in the resulting
-         // overview filename.  We only use this if the user used the -e or
-         // --entry option, or we have multiple (more than one) entries.
-         //---
-         if(entryListSetFlag || entryList.size() > 1)
-         {
-            for(ossim_uint32 idx = 0; idx < entryList.size(); ++idx)
-            {
-               ih->setCurrentEntry(entryList[idx]);
-               ossimFilename f = ih->createDefaultOverviewFilename();
-               /*
-               if (outputFile.size())
-               {
-                  f = outputFile.noExtension();
-                  f += "_e";
-                  f += ossimString::toString(entryList[idx]);
-                  f.setExtension(".ovr");
-               }
-               else
-               {
-                  f = ih->getFilenameWithThisExtension(
-                     ossimString(".ovr"), true);
-               }
-                */
-               // -d "output directory option.
-               if ( (outputDir != ossimFilename::NIL) && (outputDir.isDir()) )
-               {
-                  f = outputDir.dirCat(f.file());
-               }
-
-               std::cout << "Creating overviews for entry number: "
-                         << entryList[idx]
-                         << std::endl;
-                  
-               ob->setOutputFile(f);
-               ob->setInputSource(ih.get());
-               if ( traceTime() )
-               {
-                  overviewFiles.push_back(ob->getOutputFile());
-               }
-               ob->execute();
-
-               // See if we need to run create histo the old way.
-               if ( (histoMode != OSSIM_HISTO_MODE_UNKNOWN) && !singlePassHistoFlag )
-               {
-                  f.setExtension(".his");
-                  computeHistogram(ih.get(),
-                                   f,
-                                   histoMode,
-                                   histoMin,
-                                   histoMax,
-                                   histoBins);
-               }
-               
-            } // for(ossim_uint32 idx = 0; idx < entryList.size(); ++idx)
-            
-         } // if(entryListSetFlag || entryList.size() > 1)
-         else
-         {
-            std::cout << "Creating overviews for file: "
-                      << inputFile << std::endl;
-
-            ossimFilename f;
-            if (outputFile.size())
-            {
-               f = outputFile;
-            }
-            else
-            {
-               f = ih->getFilenameWithThisExtension(ossimString(".ovr"),
-                                                    false); // no _e0...
-            }
-
-            // -d "output directory option.
-            if ( (outputDir != ossimFilename::NIL) && (outputDir.isDir()) )
-            {
-               f = outputDir.dirCat(f.file());
-            }
-
-            ob->setOutputFile(f);
-
-            ob->setInputSource(ih.get());
-
-            if ( traceTime() )
-            {
-               overviewFiles.push_back(ob->getOutputFile());
-            }
-
-            ob->execute();
-
-            // See if we need to run create histo the old way.
-            if ( (histoMode != OSSIM_HISTO_MODE_UNKNOWN) && !singlePassHistoFlag )
-            {
-               f.setExtension(".his");
-               computeHistogram(ih.get(),
-                                f,
-                                histoMode,
-                                histoMin,
-                                histoMax,
-                                histoBins);
-            }
-         }
-         
-      } // end of "if(ih.valid())"
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "WARNING: Unable to open image file " << inputFile
-            << std::endl;
-      }
-
-   } // end of "for (int i=1 ; i < argumentParser.argc(); i++)"
-
-   if(ossimMpi::instance()->getRank() == 0)
-   {
-      double stop_time = ossimMpi::instance()->getTime();
-      std::cout << "Elapsed time: " << (stop_time-start_time)
-                << std::endl;
-   }
-   ossimMpi::instance()->finalize();
-
-   if ( traceTime() )
-   {
-      cout << "size: " << overviewFiles.size() << endl;
-      
-      if ( overviewFiles.size() )
-      {
-         const ossim_float64 MB = 1048576.0; // 1024*1024
-         ossim_float64 size = 0;
-         std::vector<ossimFilename>::const_iterator i = overviewFiles.begin();
-         while ( i < overviewFiles.end() )
-         {
-            size += (*i).fileSize();
-            ++i;
-         }
-         ossim_float64 seconds = clock()/CLOCKS_PER_SEC;
-         ossim_float64 megaBytes = size/MB;
-         ossim_float64 megaBytesPerSecond = megaBytes/seconds;
-         ossimNotify(ossimNotifyLevel_INFO)
-            << std::setiosflags(ios::fixed)
-            << std::setprecision(2)
-            << "Wrote " << megaBytes
-            << " mega bytes in " << seconds
-            << " seconds.  MB/sec="
-            << megaBytesPerSecond
-            << std::endl;
-      }
-   }
-
-   exit(0);
-}
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Command line application "img2rr" to build overviews.
+//
+//----------------------------------------------------------------------------
+// $Id: ossim-img2rr.cpp 2684 2011-06-07 15:32:23Z oscar.kramer $
+
+#include <ctime> /* for clock function */
+#include <iomanip>
+#include <iostream>
+#include <iterator>
+#include <vector>
+#include <map>
+
+#include <tiff.h> /* for compression defines */
+
+#include <ossim/ossimConfig.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimHistogramWriter.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/imaging/ossimOverviewBuilderBase.h>
+#include <ossim/imaging/ossimOverviewBuilderFactoryRegistry.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/parallel/ossimMpi.h>
+#include <ossim/imaging/ossimPixelFlipper.h> // for its keywords
+#include <ossim/imaging/ossimBitMaskWriter.h> // for its keywords
+
+static ossimTrace traceDebug = ossimTrace("img2rr:debug");
+static ossimTrace traceTime("time");
+
+//*************************************************************************************************
+// FINALIZE -- Convenient location for placing debug breakpoint for catching program exit.
+//*************************************************************************************************
+static void finalize(int code)
+{
+   exit (code);
+}
+
+static void outputWriterTypes()
+{
+   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"));
+}
+
+static void usage(ossimApplicationUsage* au, int code)
+{
+   au->write(std::cout);
+
+   outputWriterTypes();
+   
+   ossimNotify(ossimNotifyLevel_NOTICE)
+      << "\nExample command building j2k overviews with a histogram removing/overwriting\n"
+      << "any existing overviews:\n"
+      << "\nossim-img2rr -r -t ossim_kakadu_nitf_j2k --create-histogram image.tif\n"
+      << std::endl;
+
+   ossimMpi::instance()->finalize();
+   
+   finalize( code );
+}
+
+//*************************************************************************************************
+// Compute histogram after RRDSs have been established (2-pass solution)
+//*************************************************************************************************
+static void computeHistogram(ossimImageHandler* ih,
+   const ossimFilename& histogramFile,
+   ossimHistogramMode histoMode,
+   ossim_float64 histoMin,
+   ossim_float64 histoMax,
+   ossim_uint32 histoBins)
+{
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "computeHistogram entered..."
+         << "\nhistogramFile: " << histogramFile
+         << std::endl;
+   }
+
+   if(ih)
+   {
+      ossimRefPtr<ossimImageHistogramSource> histoSource = new ossimImageHistogramSource;
+      ossimRefPtr<ossimHistogramWriter> writer = new ossimHistogramWriter;
+
+      histoSource->setMaxNumberOfRLevels(1); // Currently hard coded...
+
+      if( !ossim::isnan(histoMin) )
+      {
+         histoSource->setMinValueOverride(histoMin);
+      }
+
+      if( !ossim::isnan(histoMax) )
+      {
+         histoSource->setMaxValueOverride(histoMax);
+      }
+
+      if(histoBins > 0)
+      {
+         histoSource->setNumberOfBinsOverride(histoBins);
+      }
+      histoSource->setComputationMode(histoMode);
+
+      histoSource->connectMyInputTo(0, ih);
+      histoSource->enableSource();
+      writer->connectMyInputTo(0, histoSource.get());
+      writer->setFilename(histogramFile);
+      theStdOutProgress.setFlushStreamFlag(true);
+      writer->addListener(&theStdOutProgress);
+      writer->execute();
+      writer=0;
+   }
+}
+
+//*************************************************************************************************
+// Compute bit-mask after RRDSs have been established (2-pass solution). Returns TRUE if successful
+//*************************************************************************************************
+static bool computeBitMask(const ossimFilename& f, const ossimKeywordlist& bitMaskKwl)
+{
+   bool rtn_status = true;
+   ossimFilename tempKwlFile = f;
+   tempKwlFile.setExtension("maskspec.kwl");
+   if (bitMaskKwl.write(tempKwlFile))
+   {
+      ossimString command ("ossim-create-bitmask --spec_kwl ");
+      command += tempKwlFile;
+      ossimNotify(ossimNotifyLevel_INFO)<< " NOTICE:"
+         <<"  Launching ossim-create-bitmask process.\n"<< std::endl;
+      if (system(command.chars()))
+      {
+         ossimNotify(ossimNotifyLevel_WARN)<<" Error code returned from "
+            <<"ossim-create-bitmask utility. Mask will not be generated."<< std::endl;
+         rtn_status = false;
+      }
+      tempKwlFile.remove();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<" Unable to write temporary bit-mask"
+         <<"spec KWL to <"<<tempKwlFile<<">. Mask will not be generated."<< std::endl;
+      rtn_status = false;
+   }
+
+   return rtn_status;
+}
+
+
+//*************************************************************************************************
+// MAIN
+//*************************************************************************************************
+int main(int argc, char* argv[])
+{
+#if OSSIM_HAS_MPI
+   ossimMpi::instance()->initialize(&argc, &argv);
+#endif
+
+   double start_time = 0.0;
+   if (ossimMpi::instance()->getRank() == 0)
+   {
+      ossimNotify(ossimNotifyLevel_INFO)
+         << "MPI running with "
+         << ossimMpi::instance()->getNumberOfProcessors()
+         << " processors..." << std::endl;
+      start_time = ossimMpi::instance()->getTime();
+   }
+
+   ossimString tempString;
+   double tempDouble, tempDouble2;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+   ossimArgumentParser::ossimParameter doubleParam(tempDouble);
+   ossimArgumentParser::ossimParameter doubleParam2(tempDouble2);
+
+   ossimArgumentParser ap(&argc, argv);
+   ossimInit::instance()->addOptions(ap);
+   ossimInit::instance()->initialize(ap);
+
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+
+   au->setApplicationName(ap.getApplicationName());
+
+   au->setDescription(ap.getApplicationName()+
+      " Creates overviews and optionally a histogram for the passed in image. ");
+
+   au->setCommandLineUsage(ap.getApplicationName()+
+      " [options] <input file>");
+
+   au->addCommandLineOption("-a or --include-fullres", 
+      "Wants to include full res dataset as well as reduced res sets.");
+
+   au->addCommandLineOption("--compression-quality",
+      "Compression quality varies from 0 to 100, where 100 is best.  Currently only for JPEG "
+      "compression");
+
+   au->addCommandLineOption("--compression-type",
+      "Compression type can be: NONE, JPEG, PACKBITS, or DEFLATE");
+
+   au->addCommandLineOption("--create-histogram", 
+      "Computes full histogram alongside overview.");
+
+   au->addCommandLineOption("--create-histogram-fast", 
+      "Computes a histogram in fast mode which samples partial tiles.");
+
+   au->addCommandLineOption("--create-mask", 
+      "Computes and writes out an alpha mask to a separate .mask file.");
+
+   au->addCommandLineOption("-d", 
+      "Write overview to directory specified.");
+
+   au->addCommandLineOption("-e or --entry",
+      "Give the entry(zero based) to build an overview for.");
+
+   au->addCommandLineOption("-h or --help", 
+      "Shows help");
+
+   au->addCommandLineOption("--histogram-bins", 
+      "Number of histogram bins.   This will override the default for scalar type.  Also this will "
+      "force a separate pass.");
+
+   au->addCommandLineOption("--histogram-min", 
+      "Minimum histogram value to use.  This will override the default for scalar type.  Also this "
+      "will force a separate pass.");
+
+   au->addCommandLineOption("--histogram-max", 
+      "Maximum histogram value to use.  This will override the default for scalar type.  Also this "
+      "will force a separate pass.");
+
+   au->addCommandLineOption("--histogram-r0", 
+      "Forces create-histogram code to compute a histogram using r0 instead of the starting "
+      "resolution for the overview. Requires a separate pass of R0 layer.");
+
+   au->addCommandLineOption("--list-entries",
+      "Lists the entries within the image");
+
+   au->addCommandLineOption("--mask-mode <mode>",
+      "Specifies how to treat multi-band imagery when determining whether pixel will be masked "
+      "according to the defined target value or range. Possible modes are: "
+      "\"mask_full_and_partial_targets\" (default) | \"mask_only_full_targets\".");
+
+   au->addCommandLineOption("--mask-range <min> <max>", 
+      "Specifies the range of pixels to target for masking out.");
+
+   au->addCommandLineOption("--mask-value <target>", 
+      "Specifies the unique pixel value to target for masking out.");
+
+   au->addCommandLineOption("-o", 
+      "Write overview to file specified.  If used on a multi-entry file, given \"foo.ovr\" you will"
+      "get: \"foo_e0.ovr\"");
+
+   au->addCommandLineOption(
+      "-r or --rebuild",
+      "Rebuild overviews even if they are already present.");
+
+   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, setting the keyword "
+      "\"overview_stop_dimension\".");
+
+   au->addCommandLineOption("--scanForMinMax",
+      "Turns on min, max scanning when reading tiles.  This option assumes the null is known.");
+
+   au->addCommandLineOption("--scanForMinMaxNull",
+      "Turns on min, max, null scanning when reading tiles.  This option tries to find a null value which is useful for float data.");
+
+   au->addCommandLineOption("--set-property",
+      "key:value NOTE: separate key value by a colon.  Deprecated, use --writer-prop instead.");
+
+   au->addCommandLineOption(
+      "-t or --type",
+      "see list at bottom for valid types. (default = ossim_tiff_box)");
+
+   au->addCommandLineOption("--tile-size", 
+      "Defines the tile size for the supported overview handler.");
+
+   au->addCommandLineOption("--version", 
+      "Outputs version information.");
+
+   au->addCommandLineOption("--writer-prop", 
+      "Adds a property to send to the writer. format is name=value");
+
+   // Optional arguments.
+   bool copyAllFlag       = false;
+   bool useEntryIndex     = false;
+   bool listEntriesFlag   = false;
+   bool tileSizeFlag      = false;
+   bool rebuildFlag       = false;
+   bool scanForMinMax     = false;
+   bool scanForMinMaxNull = false;
+
+   // Optional histogram creation arguments:
+   ossimHistogramMode histoMode = OSSIM_HISTO_MODE_UNKNOWN;
+   bool histoR0Flag = false;
+   bool histoFastFlag = false;
+   ossim_float64 histoMin = ossim::nan();
+   ossim_float64 histoMax = ossim::nan();
+   ossim_uint32 histoBins = 0;
+
+
+   ossimFilename inputFile  = ossimFilename::NIL;
+   ossimFilename outputFile = ossimFilename::NIL;
+   ossimFilename outputDir  = ossimFilename::NIL;
+
+   std::vector<ossim_uint32> entryList;
+
+   ossimIpt tileSize(64, 64);
+   ossim_uint32 overviewStopDimension(0);
+
+   bool listFramesFlag = false;
+
+   //---
+   // Temporary way to pass generic things to builder.
+   //---
+   std::vector< ossimRefPtr<ossimProperty> > propertyList(0);
+
+   ossimString overviewType = "ossim_tiff_box";
+
+   // Compression typedefs in tiff.h
+   ossimString compressionType = "";
+   ossimString compressionQuality = "75";
+
+   if(ap.read("-h") || ap.read("--help"))
+   {
+      usage( au, 0 );
+   }
+
+   if ( ap.read("--version") )
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)
+         << ap.getApplicationName().c_str() << " " 
+         << ossimInit::instance()->instance()->version().c_str()
+         << std::endl;
+      finalize(0);
+   }
+
+   if(ap.read("--compression-quality", stringParam))
+   {
+      compressionQuality = tempString;
+   }
+   if(ap.read("--compression-type", stringParam))
+   {
+      compressionType = tempString;
+   }
+   if( ap.read("--create-histogram"))
+   {
+      histoMode = OSSIM_HISTO_MODE_NORMAL;
+   }
+   if( ap.read("--create-histogram-fast"))
+   {
+      histoMode = OSSIM_HISTO_MODE_FAST;
+   }
+
+   if( ap.read("--histogram-r0"))
+   {
+      histoR0Flag = true;
+   }
+   if(ap.read("--histogram-min", stringParam))
+   {
+      histoMin = tempString.toFloat64();
+   }
+   if(ap.read("--histogram-max", stringParam))
+   {
+      histoMax = tempString.toFloat64();
+   }
+   if(ap.read("--histogram-bins", stringParam))
+   {
+      histoBins = tempString.toUInt32();
+   }
+
+   if(ap.read("--tile-size", stringParam))
+   {
+      tileSize.x = tempString.toInt32();
+      tileSize.y = tileSize.x;
+      tileSizeFlag = true;
+   }
+   if( ap.read("--list-entries"))
+   {
+      listEntriesFlag = true;
+   }
+
+   if( ap.read("-o", stringParam) )
+   {
+      outputFile = tempString.trim();
+   }
+
+   if( ap.read("-d", stringParam) )
+   {
+      outputDir = tempString.trim();
+   }
+
+   if( ap.read("-t", stringParam) ||
+      ap.read("--type", stringParam))
+   {
+      overviewType = tempString.trim();
+   }
+
+   if( ap.read("-s", stringParam) )
+   {
+      overviewStopDimension = tempString.toUInt32();
+   }
+
+   if( ap.read("--scanForMinMax" ) )
+   {
+      scanForMinMax = true;
+   }
+   if( ap.read("--scanForMinMaxNull" ) )
+   {
+      scanForMinMaxNull = true;
+   }
+
+   if(ap.read("-a") || ap.read("--include-fullres"))
+   {
+      copyAllFlag = true;
+   }
+
+   if(ap.read("-r") || ap.read("--rebuild"))
+   {
+      rebuildFlag = true;
+   }
+
+   while(ap.read("-e", stringParam) ||
+      ap.read("--entry", stringParam))
+   {
+      entryList.push_back(ossimString(tempString).toUInt32());
+      useEntryIndex = true;
+   }
+
+   while( ap.read( "--set-property", stringParam) )
+   {
+      if (tempString.size())
+      {
+         ossimString propertyName;
+         ossimString propertyValue;
+         std::vector<ossimString> v = tempString.split(":");
+         if (v.size() == 2)
+         {
+            propertyName = v[0];
+            propertyValue = v[1];
+         }
+         else
+         {
+            propertyName = tempString;
+         }
+         ossimRefPtr<ossimProperty> p =
+            new ossimStringProperty(propertyName, propertyValue);
+         propertyList.push_back(p);
+      }
+   }
+
+   while(ap.read("--writer-prop", stringParam))
+   {
+      if (tempString.size())
+      {
+         ossimString propertyName;
+         ossimString propertyValue;
+         std::vector<ossimString> v = tempString.split("=");
+         if (v.size() == 2)
+         {
+            propertyName = v[0];
+            propertyValue = v[1];
+         }
+         else
+         {
+            propertyName = tempString;
+         }
+         ossimRefPtr<ossimProperty> p =
+            new ossimStringProperty(propertyName, propertyValue);
+         propertyList.push_back(p);
+      }
+   }
+
+   // Handle Mask options:
+   bool createMaskFlag   = false;
+   double target_min = 0; // default
+   double target_max = 0; // default
+   ossimString mask_mode = "REPLACE_ALL_BANDS_IF_ANY_TARGET"; // default
+   if( ap.read("--create-mask"))
+   {
+      createMaskFlag = true;
+   }
+   if (ap.read("--mask-range", doubleParam, doubleParam2))
+   {
+      target_min = tempDouble;
+      target_max = tempDouble2;
+      createMaskFlag = true;
+   }
+
+   if (ap.read("--mask-value", doubleParam))
+   {
+      target_min = tempDouble;
+      target_max = target_min;
+      createMaskFlag = true;
+   }
+
+   ossimString mask_mode_arg;
+   if (ap.read("--mask-mode", stringParam))
+   {
+      mask_mode_arg = tempString;
+      createMaskFlag = true;
+      if (mask_mode_arg == "mask_full_and_partial_targets")
+         mask_mode = "REPLACE_ALL_BANDS_IF_ANY_TARGET";
+      else if (mask_mode_arg == "mask_only_full_targets")
+         mask_mode = "REPLACE_ONLY_FULL_TARGETS";
+      else
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE)<< ap.getApplicationName().c_str() << " " 
+            << " Unknown mask-mode <"<<mask_mode_arg<<"> specified. See usage below." << std::endl;
+         usage( au, 1 );
+      }
+   }
+
+   ap.reportRemainingOptionsAsUnrecognized();
+   if (ap.errors())
+   {
+      ap.writeErrorMessages(std::cout);
+      ossimMpi::instance()->finalize();
+      finalize(1);
+   }
+
+   if(ap.argc() < 2)
+   {
+      usage( au, 1 );
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nhistoMode:        " << histoMode
+         << "\nhistoMin:         " << histoMin
+         << "\nhistoMax:         " << histoMax
+         << "\nhistoBins:        " << histoBins
+         << "\nhistoR0Flag:      " << histoR0Flag
+         << "\nscanForMinMax:    " << scanForMinMax
+         << "\nscanForMinMaxull: " << scanForMinMaxNull
+         << std::endl;
+   }
+
+   ossim_int32 returnStatus = ossimErrorCodes::OSSIM_OK;
+   
+   // Keep a list of files for time command.
+   std::vector<ossimFilename> overviewFiles;
+
+   // BIG LOOP over all input files specified on command line:
+   for (int i=1 ; i < ap.argc(); i++)
+   {
+      inputFile = ap.argv()[i];
+      ossimRefPtr<ossimImageHandler> ih = ossimImageHandlerRegistry::instance()->open(inputFile);
+      if (!ih.valid())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "WARNING: Unable to open image file " << inputFile
+            << std::endl;
+         continue;
+      }
+
+      // Get the list of entries
+      if (entryList.size() == 0) 
+         ih->getEntryList(entryList); 
+
+      // User wants to see entries.
+      if(listEntriesFlag)
+      {
+         std::cout << "Entries: ";
+         std::copy(entryList.begin(), entryList.end(),
+            std::ostream_iterator<ossim_uint32>(std::cout, " "));
+         std::cout << std::endl;
+         finalize( returnStatus );
+      }
+
+      ossimRefPtr<ossimOverviewBuilderBase> ob =
+         ossimOverviewBuilderFactoryRegistry::instance()->createBuilder(overviewType);
+      if ( ob.valid() == false )
+      {
+         std::cout << "img2rr ERROR:\nCould not create builder for:  "<< overviewType << endl;
+         usage( au, 1);
+      }
+      propertyList.push_back(new ossimStringProperty("copy_all_flag",
+         ossimString::toString(copyAllFlag)));
+      propertyList.push_back(new ossimStringProperty(ossimKeywordNames::COMPRESSION_TYPE_KW,
+         compressionType));
+      propertyList.push_back(new ossimStringProperty(ossimKeywordNames::COMPRESSION_QUALITY_KW,
+         compressionQuality));
+
+      if(tileSizeFlag)
+      {
+         propertyList.push_back(new ossimStringProperty(ossimKeywordNames::OUTPUT_TILE_SIZE_KW,
+            tileSize.toString()));
+      }
+
+      // Generic property setting.
+      if (propertyList.size())
+         ob->setProperties(propertyList);
+
+      if (overviewStopDimension)
+         ob->setOverviewStopDimension(overviewStopDimension);
+
+      // INNER LOOP over each entry in file. At least the default 0 entry is represented:
+      for(ossim_uint32 idx = 0; idx < entryList.size(); ++idx)
+      {
+         // If image is a single entry, avoid using entry index in filename:
+         if ((entryList.size() == 1) && (entryList[0] == 0))
+         {
+            useEntryIndex = false;
+         }
+         else
+         {
+            useEntryIndex = true;
+         }
+
+         // Explicitly set an entry number if specified:
+         if (useEntryIndex)
+         {
+            ih->setCurrentEntry(entryList[idx]);
+            std::cout << "Creating overviews for entry number: "<< entryList[idx]<< std::endl;
+         }
+         else
+            std::cout << "Creating overviews for file: " << inputFile << std::endl;
+
+         if (outputFile.empty())
+            outputFile = ih->getFilenameWithThisExtension(ossimString(".ovr"), useEntryIndex);
+
+         // -d "output directory option.
+         if ( (outputDir != ossimFilename::NIL) && (outputDir.isDir()) )
+         {
+            outputFile = outputDir.dirCat(outputFile.file());
+
+            //check if omd file exists
+            ossimFilename omdFileName = inputFile.file();
+            omdFileName.setExtension("omd");
+            ossimFilename omdFile = outputDir.dirCat(omdFileName);
+            if (omdFile.exists())
+               ih->setSupplementaryDirectory(omdFile.path());
+         }
+
+         // Force a rebuild of existing OVR file. NOTE: the input image file may still contain
+         // it's own internal RRDSs. 
+         if (rebuildFlag) 
+         { 
+            ih->closeOverview(); 
+            if (outputFile.exists())
+               outputFile.remove();
+         }
+
+         if ( scanForMinMax )
+            ob->setScanForMinMax(scanForMinMax);
+
+         if ( scanForMinMaxNull )
+            ob->setScanForMinMaxNull(scanForMinMaxNull);
+
+         //---
+         // Histogram creation:
+         // Two paths:
+         // 
+         // 1) In conjunction with overview sequencer which is most efficient.
+         // 2) Separate function call in which case the image will be scanned when
+         //    building overviews and to create histo.
+         //
+         // Notes:
+         //
+         // Path # 1 is most efficient; however limitted to single process.
+         //
+         // If the source image has overviews and the user wants histogram from r0 we use
+         // path #2.
+         //
+         // If options for min, max or bin count we use path 2.
+         //
+         // NOTE: Similar situation exists for mask creation. If partial or complete overviews 
+         // already exist, we'll need to create bitmask after OVRs are generated instead of during.
+         //---
+         bool singlePassHistoFlag = true; 
+         if ( histoMode != OSSIM_HISTO_MODE_UNKNOWN )
+         {
+            if ( ( ossimMpi::instance()->getNumberOfProcessors() > 1) ||
+               ( ih->hasOverviews() && histoR0Flag ) ||
+               ( !ossim::isnan(histoMin) ) ||
+               ( !ossim::isnan(histoMax) ) ||
+               ( histoBins ) ||
+               ( overviewType.contains("gdal") ) )
+            {
+               singlePassHistoFlag = false;
+            }
+            if ( traceDebug() )
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "singlePassHistoFlag: " << singlePassHistoFlag << std::endl;
+            }
+            if ( singlePassHistoFlag )
+            {
+               // This will tell the overview builder to make a histogram.
+               ob->setHistogramMode(histoMode);
+            }
+         }
+
+         ob->setOutputFile(outputFile);
+         ob->setInputSource(ih.get());
+
+         // Tell the overview to compute alpha mask according to KWL spec assembled here.
+         ossimKeywordlist bitMaskKwl;
+         bool singlePassMaskPerformed = false;
+         if (createMaskFlag)
+         {
+            bitMaskKwl.add(ossimKeywordNames::IMAGE_FILE_KW, inputFile.chars());
+            ossimFilename maskFileName = outputFile;
+            maskFileName.setExtension("mask");
+            bitMaskKwl.add(ossimKeywordNames::OUTPUT_FILE_KW, maskFileName.chars());
+            ossimString target_str (ossimString::toString(target_min)+" ");
+            target_str += ossimString::toString(target_max);
+            bitMaskKwl.add(ossimPixelFlipper::PF_TARGET_RANGE_KW, target_str.chars());
+            bitMaskKwl.add(ossimPixelFlipper::PF_REPLACEMENT_MODE_KW, mask_mode.chars());
+            bitMaskKwl.add(ossimPixelFlipper::PF_REPLACEMENT_VALUE_KW, (int) 0);
+            bitMaskKwl.add(ossimBitMaskWriter::BM_STARTING_RLEVEL_KW, (int) 0);
+
+            // If the image already has no overviews, we can generate them in a single pass along 
+            // with the RRDSs (similar situation to histogram path 1):
+            if (!ih->hasOverviews())
+            {
+               singlePassMaskPerformed = true;
+               ob->setBitMaskSpec(bitMaskKwl);
+            }
+         }
+
+         if ( traceTime() )
+            overviewFiles.push_back(ob->getOutputFile());
+
+         // Create the overview for this entry in this file:
+         bool buildOvrStatus = ob->execute();
+
+         if ( !buildOvrStatus )
+         {
+            returnStatus = ossimErrorCodes::OSSIM_ERROR;
+         }
+
+         //---
+         // See if we need to run create histo the old way.
+         // Note if the build status is false and a histogram mode was set run
+         // it the old way.  The execute may have returned false because there
+         // were already required overviews.
+         //---
+         if ( ( (histoMode != OSSIM_HISTO_MODE_UNKNOWN) && !singlePassHistoFlag ) ||
+            ( (histoMode != OSSIM_HISTO_MODE_UNKNOWN) && !buildOvrStatus ) )
+         {
+            ossimFilename histoFile (outputFile);
+            histoFile.setExtension(".his");
+            computeHistogram(ih.get(), histoFile, histoMode, histoMin, histoMax, histoBins);
+         }
+
+         // If bit-mask was requested but could not be generated in a single pass, then need to
+         // spawn the create-bit-mask app to do it:
+         if (createMaskFlag && !singlePassMaskPerformed)
+            computeBitMask(outputFile, bitMaskKwl);
+
+         // Specified output filename (if any) is good for only single image/single entry. After
+         // that, reset the filename to null so it assumes default name. The user should never 
+         // specify an output file name if multiple images are being processed.
+         outputFile.clear();
+
+      } // END of for-loop over image file's entries
+
+      // Finished with this file's image handler:
+      ih->close();
+
+   } // end of for-loop over all input files
+
+   if(ossimMpi::instance()->getRank() == 0)
+   {
+      double stop_time = ossimMpi::instance()->getTime();
+      std::cout << "Elapsed time: " << (stop_time-start_time)
+         << std::endl;
+   }
+   ossimMpi::instance()->finalize();
+
+   if ( traceTime() )
+   {
+      cout << "size: " << overviewFiles.size() << endl;
+
+      if ( overviewFiles.size() )
+      {
+         const ossim_float64 MB = 1048576.0; // 1024*1024
+         ossim_float64 size = 0;
+         std::vector<ossimFilename>::const_iterator i = overviewFiles.begin();
+         while ( i < overviewFiles.end() )
+         {
+            size += (*i).fileSize();
+            ++i;
+         }
+         ossim_float64 seconds = clock()/CLOCKS_PER_SEC;
+         ossim_float64 megaBytes = size/MB;
+         ossim_float64 megaBytesPerSecond = megaBytes/seconds;
+         ossimNotify(ossimNotifyLevel_INFO)
+            << std::setiosflags(ios::fixed)
+            << std::setprecision(2)
+            << "Wrote " << megaBytes
+            << " mega bytes in " << seconds
+            << " seconds.  MB/sec="
+            << megaBytesPerSecond
+            << std::endl;
+      }
+   }
+
+   finalize( returnStatus );
+}
diff --git a/src/apps/ossim-mosaic/ossim-mosaic.cpp b/src/apps/ossim-mosaic/ossim-mosaic.cpp
index b9215f3..d45c8e5 100644
--- a/src/apps/ossim-mosaic/ossim-mosaic.cpp
+++ b/src/apps/ossim-mosaic/ossim-mosaic.cpp
@@ -39,6 +39,9 @@ using namespace std;
 #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"));
 
@@ -238,11 +241,12 @@ bool buildChains(const ossimKeywordlist& kwl,
                       chains);
 }
 
-ossimImageCombiner* createMosaic(const ossimKeywordlist& kwl,
+ossimRefPtr<ossimImageCombiner> createMosaic(const ossimKeywordlist& kwl,
                                ossimConnectableObject::ConnectableObjectList& inputSources)
 {
    const char* mosaicType = kwl.find("mosaic.type");
-   ossimImageCombiner* mosaic = NULL;
+   //ossimImageCombiner* mosaic = NULL;
+   ossimRefPtr<ossimImageCombiner> mosaic = 0;
    if(mosaicType)
    {
       if(ossimString(mosaicType).upcase() == "FEATHER")
@@ -255,13 +259,15 @@ ossimImageCombiner* createMosaic(const ossimKeywordlist& kwl,
       }
       else
       {
-         mosaic  = new ossimImageMosaic;
+		 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());
@@ -271,130 +277,82 @@ ossimImageCombiner* createMosaic(const ossimKeywordlist& kwl,
 
    return mosaic;
 }
-
-bool writeMosaic(const ossimKeywordlist& kwl,
-                 const ossimFilename& outputFile)
+ossimString massageQuotedValue(const ossimString& value)
 {
-   ossimConnectableObject::ConnectableObjectList inputSources;
-   ossimFilename outfile = outputFile;
-
-   if(outfile == "")
+   char quote = '\0';
+   if(*value.begin() == '"')
    {
-      outfile = "./output.tif";
+      quote = '"';
    }
-   // 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))
+   else if(*value.begin() == '\'')
    {
-      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))
-      {
-
-         ossimRefPtr<ossimImageFileWriter> writer = ossimImageWriterFactoryRegistry::instance()->createWriter(kwl,
-                                                                                                  "writer.");
-         // now we need to add a mosaic
-         //
-         ossimRefPtr<ossimImageCombiner> mosaic = createMosaic(kwl,
-                                                   inputSources);
-
-         if(!writer)
-         {
-            writer = new ossimTiffWriter;
-            writer->open(outfile);
-         }
-         
-         if(writer.valid())
-         {
-            ossimStdOutProgress listener;
-            if(mosaic.valid())
-            {
-               writer->addListener(&listener);
-               writer->connectMyInputTo(0, mosaic.get());
-               writer->initialize();
-               ossimMapProjectionInfo mapInfo(productProjection,
-                                              mosaic->getBoundingRect());
-               
-               ossimTiffWriter* tempTiffPtr = PTR_CAST(ossimTiffWriter, writer.get());
-               
-               if(tempTiffPtr)
-               {
-                  tempTiffPtr->setProjectionInfo(mapInfo);
-                  tempTiffPtr->execute();
-               }
-               else
-               {
-                  writer->execute();
-               }
-               writer->removeListener(&listener);
-            }
-            writer->disconnect();
-            mosaic->disconnect();
-            mosaic = 0;
-            writer = 0;
-         }
-      }
-      else
-      {
-         return false;
-      }
+      quote = '\'';
    }
    
-   return true;
+   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>");
+	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])));
+      }
+   }
 
-   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
-   
-   argumentParser.getApplicationUsage()->addCommandLineOption("-k", "keyword list to load from");
+	// User input a writer type
+	while (argumentParser.read("-w", stringParam))
+   {
+      theWriterType = tempString;
+   }
 
-   argumentParser.getApplicationUsage()->addCommandLineOption("-m", "Mosiac type (SIMPLE, BLEND, or FEATHER) (default=SIMPLE");
-   
-   argumentParser.getApplicationUsage()->addCommandLineOption("-t", "ouput a keyword list template");
-   
-   
-   ossimKeywordlist kwl;
-   bool keywordlistSupplied = false;
-   bool optionGiven = false;
-   ossimFilename outfile = "";
-   std::string tempString;
-   ossimArgumentParser::ossimParameter stringParam(tempString);
-   
-   if (argumentParser.read("-k", stringParam))
+   // Keyword list to load from
+   while (argumentParser.read("-k", stringParam))
    {
       kwl.addFile(tempString.c_str());
       keywordlistSupplied = true;
       optionGiven         = true;
    }
 
-   if (argumentParser.read("-m", stringParam))
+   // Mosiac type
+   while (argumentParser.read("-m", stringParam))
    {
       ossimString opt = tempString;
       opt = opt.upcase();
@@ -403,23 +361,25 @@ int main(int argc, char *argv[])
           (opt != "BLEND")&&
           (opt != "FEATHER"))
       {
-         opt = "SIMPLE";
+         opt = tempString;
       }
       kwl.add("mosaic.type",
               opt.c_str(),
               true);
    }
    
-   if (argumentParser.read("-t", stringParam))
+   // Output KWL template
+   while (argumentParser.read("-t", stringParam))
    {
       ossimFilename templateFilename = tempString.c_str();
       outputTemplateKeywordlist(templateFilename);
       exit(0);
    }
    
-   if (argumentParser.read("-h") ||
+   // 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() < 3))
+       (argumentParser.argc() < 2 ))
    {
       argumentParser.getApplicationUsage()->write(
          ossimNotify(ossimNotifyLevel_INFO));
@@ -445,6 +405,7 @@ int main(int argc, char *argv[])
 
    // Get the output file.
    outfile = argv[argCount-1];
+
    if(outfile.exists())
    {
       ossimNotify(ossimNotifyLevel_WARN)
@@ -464,8 +425,110 @@ int main(int argc, char *argv[])
 
    if(keywordlistSupplied)
    {
-      writeMosaic(kwl, outfile);
+	   // 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(
diff --git a/src/apps/ossim-ogeom2ogeom/ossim-ogeom2ogeom.cpp b/src/apps/ossim-ogeom2ogeom/ossim-ogeom2ogeom.cpp
index eb84216..b501ac1 100644
--- a/src/apps/ossim-ogeom2ogeom/ossim-ogeom2ogeom.cpp
+++ b/src/apps/ossim-ogeom2ogeom/ossim-ogeom2ogeom.cpp
@@ -6,6 +6,7 @@
 #include <ossim/base/ossimTrace.h>
 #include <ossim/base/ossimKeywordNames.h>
 #include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimImageGeometry.h>
 #include <ossim/imaging/ossimImageHandler.h>
 #include <ossim/imaging/ossimImageHandlerRegistry.h>
 #include <ossim/projection/ossimProjectionFactoryRegistry.h>
@@ -36,7 +37,7 @@ int main(int argc, char* argv[])
    argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
    
    argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName() + " takes an input geometry (or image) and creates a converted output geometry");
-   argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName() + " [options] " + ossimString("<input file>"));
+   argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName() + " [options] <input file>");
    argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
    argumentParser.getApplicationUsage()->addCommandLineOption("--rpc","Create an RPC projection");
    argumentParser.getApplicationUsage()->addCommandLineOption("--rpc-gridsize","defines the grid size for the rpc estimate default is --rpc-gridsize=\"10 10\"");
diff --git a/src/apps/ossim-orthoigen/ossim-orthoigen.cpp b/src/apps/ossim-orthoigen/ossim-orthoigen.cpp
index dad7525..02c907b 100644
--- a/src/apps/ossim-orthoigen/ossim-orthoigen.cpp
+++ b/src/apps/ossim-orthoigen/ossim-orthoigen.cpp
@@ -1,5 +1,4 @@
 //*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
 //
 // License:  LGPL
 // 
@@ -8,7 +7,7 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: orthoigen.cpp 13025 2008-06-13 17:06:30Z sbortman $
+//  $Id: ossim-orthoigen.cpp 3023 2011-11-02 15:02:27Z david.burken $
 
 #include <iostream>
 #include <cstdlib>
@@ -33,6 +32,9 @@ using namespace std;
 
 static ossimTrace traceDebug("orthoigen:debug");
 
+//*************************************************************************************************
+// USAGE
+//*************************************************************************************************
 static void usage()
 {
    ossimNotify(ossimNotifyLevel_NOTICE) <<
@@ -41,11 +43,21 @@ static void usage()
       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)
@@ -55,12 +67,21 @@ int main(int argc, char* argv[])
    }
 #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);
@@ -100,7 +121,7 @@ int main(int argc, char* argv[])
       usage();
       ossimMpi::instance()->finalize();
       ossimInit::instance()->finalize();
-      exit(OK);
+      finalize(OK);
    }
    bool enableEntryDecoding = false;
    if(argumentParser.read("--enable-entry-decoding"))
@@ -114,9 +135,8 @@ int main(int argc, char* argv[])
    {
       argumentParser.writeErrorMessages(ossimNotify(ossimNotifyLevel_WARN));
       ossimMpi::instance()->finalize();
-      exit(OK);
+      finalize(OK);
    }
-   double start=ossimTimer::instance()->time_s(), stop=0;
    
    orthoIgen->clearFilenameList();
    orthoIgen->addFiles(argumentParser, enableEntryDecoding);
@@ -135,14 +155,13 @@ int main(int argc, char* argv[])
    
    if(ossimMpi::instance()->getRank() == 0)
    {
-      stop = ossimTimer::instance()->time_s();
       ossimNotify(ossimNotifyLevel_NOTICE)
          << std::setiosflags(ios::fixed)
-         << std::setprecision(15)
-         << "Time elapsed: " << (stop-start)
+         << std::setprecision(3)
+         << "Time elapsed : " << ossimTimer::instance()->time_s() 
          << std::endl;
    }
+   
    ossimMpi::instance()->finalize();
-
-   return status;
+   finalize(status); 
 }
diff --git a/src/apps/ossim-pixelflip/ossim-pixelflip.cpp b/src/apps/ossim-pixelflip/ossim-pixelflip.cpp
index 6736102..a338e69 100644
--- a/src/apps/ossim-pixelflip/ossim-pixelflip.cpp
+++ b/src/apps/ossim-pixelflip/ossim-pixelflip.cpp
@@ -7,7 +7,7 @@
 // Author:  David Burken
 //
 //*******************************************************************
-//  $Id: pixelflip.cpp 14645 2009-06-01 20:06:21Z dburken $
+//  $Id: ossim-pixelflip.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
 
 
 #include <iostream>
@@ -96,7 +96,7 @@ int main(int argc, char* argv[])
    double clamp_value = 0.0;
    bool do_clamp = false;
    ossimPixelFlipper::ReplacementMode replacement_mode =
-      ossimPixelFlipper::REPLACE_ALL_TARGETS;
+      ossimPixelFlipper::REPLACE_BAND_IF_TARGET;
 
 
    if(argumentParser.read("-h") || argumentParser.read("--help")||(argumentParser.argc() == 1))
@@ -118,25 +118,25 @@ int main(int argc, char* argv[])
    {
       ossimString mode = tempString;
       mode.downcase();
-      if (mode == "replace_partial_targets")
+      if (mode == "replace_band_if_target")
       {
-         replacement_mode = ossimPixelFlipper::REPLACE_PARTIAL_TARGETS;
+         replacement_mode = ossimPixelFlipper::REPLACE_BAND_IF_TARGET;
       }
-      else if (mode == "replace_partial_targets_all_bands")
+      else if (mode == "replace_band_if_partial_target")
       {
          replacement_mode =
-            ossimPixelFlipper::REPLACE_PARTIAL_TARGETS_ALL_BANDS;
+            ossimPixelFlipper::REPLACE_BAND_IF_PARTIAL_TARGET;
       }
-      else if (mode == "replace_full_targets")
+      else if (mode == "replace_all_bands_if_partial_target")
       {
-         replacement_mode = ossimPixelFlipper::REPLACE_FULL_TARGETS;
+         replacement_mode = ossimPixelFlipper::REPLACE_ALL_BANDS_IF_PARTIAL_TARGET;
       }
       else if (mode != "replace_all_targets")
       {
          ossimNotify(ossimNotifyLevel_WARN)
             << "Invalid mode:  "
             << mode
-            << "\nMode remains:  REPLACE_ALL_TARGETS"
+            << "\nMode remains:  replace_band_if_target"
             << std::endl;
       }
    }
diff --git a/src/apps/ossim-preproc/CMakeLists.txt b/src/apps/ossim-preproc/CMakeLists.txt
new file mode 100644
index 0000000..4c2a6d8
--- /dev/null
+++ b/src/apps/ossim-preproc/CMakeLists.txt
@@ -0,0 +1,2 @@
+FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
+OSSIM_SETUP_APPLICATION(ossim-preproc INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})
diff --git a/src/apps/ossim-preproc/ossim-preproc.cpp b/src/apps/ossim-preproc/ossim-preproc.cpp
new file mode 100644
index 0000000..b695124
--- /dev/null
+++ b/src/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/src/apps/ossim-rpf/ossim-rpf.cpp b/src/apps/ossim-rpf/ossim-rpf.cpp
index d462ae2..ab0e589 100644
--- a/src/apps/ossim-rpf/ossim-rpf.cpp
+++ b/src/apps/ossim-rpf/ossim-rpf.cpp
@@ -39,8 +39,10 @@ using namespace std;
 #include <ossim/support_data/ossimRpfAttributes.h>
 #include <ossim/support_data/ossimRpfFrame.h>
 #include <ossim/support_data/ossimRpfHeader.h>
+#include <ossim/support_data/ossimRpfReplaceUpdateTable.h>
 #include <ossim/support_data/ossimRpfToc.h>
 #include <ossim/support_data/ossimRpfTocEntry.h>
+
 #include <ossim/util/ossimRpfUtil.h>
 
 static ossimTrace traceDebug = ossimTrace("ossim-rpf:debug");
@@ -329,8 +331,16 @@ void printFrameList( const ossimFilename& imageFile,
                      ossimGpt llg;
                      ossimGpt lrg;
                      ossimGpt urg;
+                     ossimRefPtr<ossimRpfReplaceUpdateTable> replaceUpdateTable = 0;
+                     
                      if ( rpfFrame.parseFile(fullPath,true) == ossimErrorCodes::OSSIM_OK )
                      {
+                        replaceUpdateTable = rpfFrame.getRpfReplaceUpdateTable();
+                        if ( replaceUpdateTable.valid() )
+                        {
+                           replaceUpdateTable->print(out, framePrefix);
+                        }
+                        
                         pRpfAttr = rpfFrame.getAttributes();
                            
                         const ossimNitfFile* pNitfFile = rpfFrame.getNitfFile();
diff --git a/src/apps/ossim-src2src/CMakeLists.txt b/src/apps/ossim-src2src/CMakeLists.txt
new file mode 100644
index 0000000..1b16ef9
--- /dev/null
+++ b/src/apps/ossim-src2src/CMakeLists.txt
@@ -0,0 +1,2 @@
+FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
+OSSIM_SETUP_APPLICATION(ossim-src2src INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})
diff --git a/src/apps/ossim-src2src/ossim-src2src.cpp b/src/apps/ossim-src2src/ossim-src2src.cpp
new file mode 100644
index 0000000..1016312
--- /dev/null
+++ b/src/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/src/apps/ossim-ws-cmp/ossim-ws-cmp.cpp b/src/apps/ossim-ws-cmp/ossim-ws-cmp.cpp
index 53ed761..15950a5 100644
--- a/src/apps/ossim-ws-cmp/ossim-ws-cmp.cpp
+++ b/src/apps/ossim-ws-cmp/ossim-ws-cmp.cpp
@@ -132,9 +132,9 @@ void cmpFile(const ossimFilename& wsa,
    if ( file.exists() && bFile.exists() )
    {
       std::string command = "diff -w --ignore-matching-lines=\\$Id ";
-      command += file;
+      command += file.string();
       command += " ";
-      command += bFile;
+      command += bFile.string();
       
       int status = system( command.c_str() );
       
diff --git a/src/ossim/CMakeLists.txt b/src/ossim/CMakeLists.txt
index b6406ec..abc0a96 100644
--- a/src/ossim/CMakeLists.txt
+++ b/src/ossim/CMakeLists.txt
@@ -16,6 +16,7 @@ FILE(GLOB ossim_SRCS  RELATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}
         "${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"
         "${CMAKE_CURRENT_SOURCE_DIR}/kbool/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/kbool/*.c")
@@ -25,7 +26,6 @@ IF(WIN32)
 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")
@@ -41,17 +41,18 @@ FILE(GLOB ossim_projection_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_
 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_kbool_HDRS} 
-	${ossim_matrix_HDRS} ${ossim_parallel_HDRS} ${ossim_plugin_HDRS} ${ossim_projection_HDRS} ${ossim_support_data_HDRS} ${ossim_util_HDRS} ${ossim_vec_HDRS}  ${ossim_vpfutil_HDRS} )
+	${ossim_matrix_HDRS} ${ossim_parallel_HDRS} ${ossim_plugin_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)
@@ -94,6 +95,10 @@ IF(APPLE)
   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)
@@ -104,14 +109,14 @@ ENDIF(APPLE)
 OSSIM_LINK_LIBRARY(${LIB_NAME} 
                    COMPONENT_NAME ossim 
                    TYPE ${OSSIM_USER_DEFINED_DYNAMIC_OR_STATIC}
-                   LIBRARIES ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${GEOTIFF_LIBRARIES} ${OPENTHREADS_LIBRARIES} ${FREETYPE_LIBRARIES} ${MPI_LIBRARIES} ${ZLIB_LIBRARIES} ${DL_LIBRARY}
+                   LIBRARIES ${ossimDependentLibs}
                    HEADERS "${OSSIM_HEADER_FILES}" 
                    PUBLIC_HEADERS "${ossim_HDRS}"
                    SOURCE_FILES "${ossim_SRCS}"
                    INSTALL_LIB VERSION_SYMLINKS INSTALL_HEADERS)
 
 ########################################################## If DO special case for ossim core needs to have the files mapped properly ################################ 
-IF(NOT OSSIM_FRAMEWORK_GENERATION OR NOT APPLE)
+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)
@@ -126,5 +131,13 @@ IF(NOT OSSIM_FRAMEWORK_GENERATION OR NOT APPLE)
    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_FRAMEWORK_GENERATION OR NOT APPLE)
+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/src/ossim/base/ossimAdjSolutionAttributes.cpp b/src/ossim/base/ossimAdjSolutionAttributes.cpp
new file mode 100755
index 0000000..94cba02
--- /dev/null
+++ b/src/ossim/base/ossimAdjSolutionAttributes.cpp
@@ -0,0 +1,74 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Hicks
+//
+// Description: Helper interface class for ossimAdjustmentExecutive
+//              and ossimWLSBundleSolution.
+//----------------------------------------------------------------------------
+
+#include <ossim/base/ossimAdjSolutionAttributes.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNotify.h>
+
+static ossimTrace traceDebug(ossimString("ossimAdjSolutionAttributes:debug"));
+static ossimTrace traceExec(ossimString("ossimAdjSolutionAttributes:exec"));
+
+
+//*****************************************************************************
+// METHOD:      ossimAdjSolutionAttributes::ossimAdjSolutionAttributes
+//
+// DESCRIPTION: Default constructor
+//
+// PARAMETERS:  N/A
+//
+// RETURN:      N/A
+//*****************************************************************************
+ossimAdjSolutionAttributes::ossimAdjSolutionAttributes(
+	const int& numObjObs, const int& numImages, const int& numMeas, const int& rankN)
+	:
+	theNumObjObs(numObjObs),
+	theNumImages(numImages),
+	theFullRank(rankN),
+   theNumMeasurements(numMeas)
+{
+   theTotalCorrections.ReSize(rankN,1);
+   theLastCorrections.ReSize(rankN,1);
+   theTotalCorrections = 0.0;
+   theLastCorrections = 0.0;
+}
+
+
+//*****************************************************************************
+// METHOD:      ossimAdjSolutionAttributes::~ossimAdjSolutionAttributes
+//
+// DESCRIPTION: Destructor
+//
+// PARAMETERS:  N/A
+//
+// RETURN:      N/A
+//*****************************************************************************
+ossimAdjSolutionAttributes::~ossimAdjSolutionAttributes()
+{
+	if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+		<< "DEBUG: ~ossimAdjSolutionAttributes(): returning..." << std::endl;
+}
+
+
+//*****************************************************************************
+// METHOD:      operator <<
+//
+// DESCRIPTION: Output point parameters.
+//
+// PARAMETERS:  N/A
+//
+// RETURN:      N/A
+//*****************************************************************************
+std::ostream & operator << (std::ostream &output, ossimAdjSolutionAttributes& /* data */)
+{
+
+	 output << "ossimAdjSolutionAttributes..." << std::endl;
+
+	 return output;
+}
diff --git a/src/ossim/base/ossimAdjustableParameterInterface.cpp b/src/ossim/base/ossimAdjustableParameterInterface.cpp
index a07f941..2482c46 100644
--- a/src/ossim/base/ossimAdjustableParameterInterface.cpp
+++ b/src/ossim/base/ossimAdjustableParameterInterface.cpp
@@ -6,7 +6,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimAdjustableParameterInterface.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
+// $Id: ossimAdjustableParameterInterface.cpp 20610 2012-02-27 12:19:25Z gpotts $
 #include <algorithm>
 #include <ossim/base/ossimAdjustableParameterInterface.h>
 #include <ossim/base/ossimKeywordNames.h>
@@ -114,7 +114,7 @@ void ossimAdjustableParameterInterface::copyAdjustment(ossim_uint32 idx, bool no
     {
        return;
     }
-    if((idx >=0)&&(idx < theAdjustmentList.size()))
+    if(idx < theAdjustmentList.size())
     {
        theAdjustmentList.push_back(theAdjustmentList[idx]);
 
@@ -142,7 +142,7 @@ void ossimAdjustableParameterInterface::keepAdjustment(ossim_uint32 idx,
     {
        return;
     }
-    if((idx >=0)&&(idx < theAdjustmentList.size()))
+    if(idx < theAdjustmentList.size())
     {
        if(createCopy)
        {
diff --git a/src/ossim/base/ossimAdjustmentExecutive.cpp b/src/ossim/base/ossimAdjustmentExecutive.cpp
new file mode 100644
index 0000000..7cd7670
--- /dev/null
+++ b/src/ossim/base/ossimAdjustmentExecutive.cpp
@@ -0,0 +1,782 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Hicks
+//
+// Description: Executive class for adjustment operations..
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/base/ossimAdjustmentExecutive.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimWLSBundleSolution.h>
+#include <ossim/base/ossimAdjSolutionAttributes.h>
+#include <iostream>
+
+static ossimTrace traceExec  ("ossimAdjustmentExecutive:exec");
+static ossimTrace traceDebug ("ossimAdjustmentExecutive:debug");
+
+
+
+//*****************************************************************************
+//  METHOD: ossimAdjustmentExecutive::ossimAdjustmentExecutive()
+//  
+//  Constructor.
+//  
+//*****************************************************************************
+ossimAdjustmentExecutive::ossimAdjustmentExecutive(std::ostream& report)
+   :
+      theExecValid(false),
+      theSol(0),
+      theSolAttributes(0),
+      theConvCriteria(5.0),
+      theMaxIter(7),      
+      theMaxIterExceeded(false),
+      theSolDiverged(false),
+      theSolConverged(false),
+      theNumObsInSet(0),
+      theNumImages(0),
+      theNumParams(0),
+      theNumMeasurements(0),
+      theRankN(0),
+      theMeasResiduals(),
+      theObjPartials(),
+      theParPartials(),
+      theXrms(0.0),
+      theYrms(0.0),
+      theXmean(0.0),
+      theYmean(0.0),
+      theSEUW(0),
+      theParInitialValues(0),
+      theParInitialStdDev(0),
+      theParDesc(0),
+      theObsInitialValues(0),
+      theObsInitialStdDev(0),
+      theRep(report)      
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nossimAdjustmentExecutive::ossimAdjustmentExecutive 1 DEBUG:" << std::endl;
+   }
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimAdjustmentExecutive::ossimAdjustmentExecutive()
+//  
+//  ossimObservationSet-based constructor.
+//  
+//*****************************************************************************
+ossimAdjustmentExecutive::
+ossimAdjustmentExecutive(ossimObservationSet& obsSet, std::ostream& report)
+   :
+      theExecValid(false),
+      theSol(0),
+      theSolAttributes(0),
+      theConvCriteria(5.0),
+      theMaxIter(7),      
+      theMaxIterExceeded(false),
+      theSolDiverged(false),
+      theSolConverged(false),
+      theNumObsInSet(0),
+      theNumImages(0),
+      theNumParams(0),
+      theNumMeasurements(0),
+      theRankN(0),
+      theMeasResiduals(),
+      theObjPartials(),
+      theParPartials(),
+      theXrms(0.0),
+      theYrms(0.0),
+      theXmean(0.0),
+      theYmean(0.0),
+      theSEUW(0),
+      theParInitialValues(0),
+      theParInitialStdDev(0),
+      theParDesc(0),
+      theObsInitialValues(0),
+      theObsInitialStdDev(0),
+      theRep(report)      
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nossimAdjustmentExecutive::ossimAdjustmentExecutive 2 DEBUG:" << std::endl;
+   }
+
+   theExecValid = initializeSolution(obsSet);
+}
+
+
+//*****************************************************************************
+//  DESTRUCTOR: ~ossimAdjustmentExecutive()
+//  
+//*****************************************************************************
+ossimAdjustmentExecutive::~ossimAdjustmentExecutive()
+{
+   delete theSolAttributes;
+   delete theSol;
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG: ~ossimAdjustmentExecutive(): returning..." << std::endl;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimAdjustmentExecutive::initializeSolution()
+//  
+//  Execute solution.
+//  
+//*****************************************************************************
+bool ossimAdjustmentExecutive::initializeSolution(ossimObservationSet& obsSet)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nossimAdjustmentExecutive::initializeSolution DEBUG:" << std::endl; 
+   }
+   ossimString ts = timeStamp();
+
+   theObsSet = &obsSet;
+
+   // Initial report output
+   theRep << "\nossimAdjustmentExecutive Report     ";
+   theRep << ts;
+   theRep << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
+   theRep << endl;
+   theObsSet->print(theRep);
+   theRep << endl;
+
+   theExecValid = false;
+
+   // Adjustment traits
+   theNumObsInSet     = theObsSet->numObs();
+   if (theNumObsInSet == 0)
+      return theExecValid;
+
+   theNumImages       = theObsSet->numImages();
+   theNumParams       = theObsSet->numAdjPar();
+   theNumMeasurements = theObsSet->numMeas();
+
+   theRankN = theNumParams + theNumObsInSet*3;
+
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         <<"\n theNumObsInSet     = "<<theNumObsInSet
+         <<"\n theNumImages       = "<<theNumImages
+         <<"\n theNumParams       = "<<theNumParams
+         <<"\n theNumMeasurements = "<<theNumMeasurements
+         <<"\n theRankN           = "<<theRankN
+         <<std::endl;
+   }
+
+
+   // Instantiate solution attributes
+   theSolAttributes = new ossimAdjSolutionAttributes
+      (theNumObsInSet, theNumImages, theNumMeasurements, theRankN);
+
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         <<"\n\nInitial Parameter Setup....";
+
+      for (int i=0; i<theNumImages; i++)
+      {
+         ossimAdjustableParameterInterface* iface =
+            theObsSet->getImageGeom(i)->getAdjustableParameterInterface();
+         int np = iface->getNumberOfAdjustableParameters();
+         for (int cp=0; cp<np; ++cp)
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               <<"\n "<<cp<<"  "<<iface->getParameterDescription(cp)
+               // <<"=  "<<iface->getAdjustableParameter(cp)
+               <<"=  "<<iface->getParameterCenter(cp)
+               <<", units= "<<iface->getParameterUnit(cp)
+               <<", sigma= "<<iface->getParameterSigma(cp);
+         }
+      }
+      ossimNotify(ossimNotifyLevel_DEBUG)<<std::endl;
+   }
+
+   // Save parameter initial values and variances
+   int start = 1;
+   theSolAttributes->theAdjParCov.ReSize(theNumParams,theNumParams);
+   for (int i=0; i<theNumImages; i++)
+   {
+      ossimAdjustableParameterInterface* iface =
+         theObsSet->getImageGeom(i)->getAdjustableParameterInterface();
+      int np = iface->getNumberOfAdjustableParameters();
+      NEWMAT::Matrix parCov(np,np);
+      parCov = 0.0;
+      for (int cp=0; cp<np; ++cp)
+      {
+         // Get the a priori value
+         // theParInitialValues.push_back(iface->getAdjustableParameter(cp));
+         theParInitialValues.push_back(iface->getParameterCenter(cp));
+         theImgs.push_back(i);
+
+         theParDesc.push_back(iface->getParameterDescription(cp));
+         double sig = iface->getParameterSigma(cp);
+         
+         // If parameter is locked, tighten down the sigma
+         // TODO: Eventually need better handling of this
+         if (iface->isParameterLocked(cp))
+            sig /= 1000;
+
+         theParInitialStdDev.push_back(sig);
+         parCov(cp+1,cp+1) = sig*sig;
+      }
+      theSolAttributes->
+         theAdjParCov.SubMatrix(start,start+np-1,start,start+np-1) = parCov;
+      start += np;
+   }
+
+   // Ensure initial estimates for observations
+   //   TODO: Currently uses mean of single-ray point drops; should
+   //         eventually use multi-ray intersection, which is only
+   //         available via the ossimSensorModelTuple class.
+   for (int obs=0; obs<theNumObsInSet; obs++)
+   {
+      // If ground position not set, initialize it
+      if (theObsSet->observ(obs)->hasNans())
+      {
+         double latMean = 0.0;
+         double lonMean = 0.0;
+         double hgtMean = 0.0;
+         ossimGpt gpt;
+         ossimDpt ipt;
+         for (ossim_uint32 meas=0; meas<theObsSet->observ(obs)->numMeas(); ++meas)
+         {
+            ipt = theObsSet->observ(obs)->getMeasurement(meas);
+            theObsSet->observ(obs)->getImageGeom(meas)->localToWorld(ipt, gpt);
+            latMean += gpt.latr();
+            lonMean += gpt.lonr();
+            hgtMean += gpt.height();
+         }
+         latMean /= theObsSet->observ(obs)->numMeas();
+         lonMean /= theObsSet->observ(obs)->numMeas();
+         hgtMean /= theObsSet->observ(obs)->numMeas();
+         theObsSet->observ(obs)->Gpt().latr(latMean);
+         theObsSet->observ(obs)->Gpt().lonr(lonMean);
+         theObsSet->observ(obs)->Gpt().height(hgtMean);
+      }
+   }
+
+
+   // Save observation intial values
+   for (int obs=0; obs<theNumObsInSet; obs++)
+   {
+      theObsInitialValues.push_back(theObsSet->observ(obs)->Gpt().latr());
+      theObsInitialValues.push_back(theObsSet->observ(obs)->Gpt().lonr());
+      theObsInitialValues.push_back(theObsSet->observ(obs)->Gpt().height());
+   }
+
+
+   // Load obj/image covariance data
+   int cMeas = 1;
+   theSolAttributes->theImagePtCov.ReSize(theNumMeasurements*2,2);
+   theSolAttributes->theObjectPtCov.ReSize(theNumObsInSet*3,3);
+
+   for (int obs=0; obs<theNumObsInSet; ++obs)
+   {
+      NEWMAT::Matrix ocov;
+      theObsSet->observ(obs)->getObsCov(ocov);
+      int idx = obs*3+1;
+      theSolAttributes->theObjectPtCov.Rows(idx,idx+2) = ocov;
+      for (int i=1; i<=3; ++i)
+         theObsInitialStdDev.push_back(sqrt(ocov(i,i)));
+      for (ossim_uint32 meas=0; meas<theObsSet->observ(obs)->numMeas(); ++meas)
+      {
+         NEWMAT::Matrix mcov;
+         theObsSet->observ(obs)->getMeasCov((int)meas, mcov);
+         int start = (cMeas-1)*2 + 1;
+         theSolAttributes->theImagePtCov.Rows(start,start+1) = mcov;
+         cMeas++;   
+      }
+   }
+
+
+   // Load obj/image xref map
+   for (int obs=0; obs<theNumObsInSet; ++obs)
+   {
+      for (ossim_uint32 meas=0; meas<theObsSet->observ(obs)->numMeas(); ++meas)
+      {
+         int img = theObsSet->imIndex(meas);
+         theSolAttributes->theObjImgXref.insert(pair<int, int>(obs, img));
+      }
+   }
+
+   // Load image/numpar xref map
+   for (int img=0; img<theNumImages; ++img)
+   {
+      int numpar = theObsSet->adjParCount(img);
+      theSolAttributes->theImgNumparXref.insert(pair<int, int>(img, numpar));
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         <<"\ntheObjImgXref multimap  Obs/Img ....\n";
+      for (ObjImgMapIter_t it =theSolAttributes->theObjImgXref.begin();
+                           it!=theSolAttributes->theObjImgXref.end(); ++it)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            <<"  "<<it->first<<"    "<<it->second<<endl;
+      }
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         <<"\ntheImgNumparXref map  Img/Numpar ....\n";
+      for (ImgNumparMapIter_t it =theSolAttributes->theImgNumparXref.begin();
+                              it!=theSolAttributes->theImgNumparXref.end(); ++it)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            <<"  "<<it->first<<"    "<<it->second<<endl;
+      }
+   }
+
+ 
+   theRep << "\n Iteration 0...";
+
+   updateParameters();
+
+   // Perform initial (0th iteration) observation evaluation
+   theObsSet->evaluate(theMeasResiduals, theObjPartials, theParPartials);
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         <<"\n theObjPartials\n"
+         <<theObjPartials;
+   }
+
+   // Report residual summary
+   printResidualSummary(theRep);
+
+   // Residual statistics
+   computeResidualStatistics(theMeasResiduals);
+
+   // Load partials
+   theSolAttributes->theObjPartials = theObjPartials;
+   theSolAttributes->theParPartials = theParPartials;
+
+   // Load residuals
+   theSolAttributes->theMeasResiduals = theMeasResiduals;
+
+   // Initial standard error of unit weight
+   theSEUW.push_back(computeSEUW());
+
+   // Instantiate solution object
+   theSol = new ossimWLSBundleSolution();
+
+   theExecValid = true;
+
+   return theExecValid;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimAdjustmentExecutive::runSolution()
+//  
+//  Execute solution.
+//  
+//*****************************************************************************
+bool ossimAdjustmentExecutive::runSolution()
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nossimAdjustmentExecutive::runSolution DEBUG:" << std::endl;
+   }
+
+
+   // Iterative loop
+   int iter = 0;
+
+   while (iter < theMaxIter &&
+          !theSolConverged &&
+          !theSolDiverged &&
+          theExecValid)
+   {
+      iter++;
+
+      theRep << "\n Iteration "<<iter<<"...";
+
+      // Execute solution
+      theExecValid = theSol->run(theSolAttributes);
+
+
+      if (theExecValid)
+      {
+         // Report corrections
+         printParameterCorrectionSummary(theRep);
+         printObservationCorrectionSummary(theRep);
+
+         // Update adjustable parameters
+         updateParameters();
+
+         // Update ground points
+         updateObservations();
+
+         // Perform observation evaluation
+         theObsSet->evaluate(theMeasResiduals, theObjPartials, theParPartials);
+
+         // Load partials
+         theSolAttributes->theObjPartials = theObjPartials;
+         theSolAttributes->theParPartials = theParPartials;
+
+         // Load residuals
+         theSolAttributes->theMeasResiduals = theMeasResiduals;
+
+         // Report residual summary
+         printResidualSummary(theRep);
+
+         // Residual statistics
+         computeResidualStatistics(theMeasResiduals);
+
+         // Compute SEUW for current iteration
+         theSEUW.push_back(computeSEUW());
+
+         // Check convergence
+         double percChange = 
+         fabs((theSEUW[iter]-theSEUW[iter-1])/theSEUW[iter-1])*100.0;
+
+         if ((percChange <= theConvCriteria) && iter>1)
+            theSolConverged = true;
+         else if (iter == theMaxIter)
+            theMaxIterExceeded = true;
+         else if (iter >= 3)
+         {
+            if (theSEUW[iter]   > theSEUW[iter-1] &&
+                theSEUW[iter-1] > theSEUW[iter-2] &&
+                theSEUW[iter-2] > theSEUW[iter-3])
+               theSolDiverged = true;
+         }
+         else
+            theSolConverged = false;
+      }
+   }
+
+   return theExecValid;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimAdjustmentExecutive::updateParameters()
+//  
+//  Update adjustable parameters with current iteration corrections.
+//  
+//*****************************************************************************
+bool ossimAdjustmentExecutive::updateParameters()
+{
+   // Update local geometries
+   int currPar = 1;
+   for (int img=0; img<theNumImages; ++img)
+   {
+      ossimAdjustableParameterInterface* iface =
+         theObsSet->getImageGeom(img)->getAdjustableParameterInterface();
+
+      for (int par=0; par<theSolAttributes->theImgNumparXref[img]; ++par)
+      {
+         // double middle = iface->getAdjustableParameter(par);
+         // middle += theSolAttributes->theLastCorrections(currPar);
+         // iface->setAdjustableParameter(par, middle, true);
+
+         double middle = iface->getParameterCenter(par);
+         middle += theSolAttributes->theLastCorrections(currPar);
+         iface->setParameterCenter(par, middle, true);
+
+         currPar++;    
+      }
+   }
+
+   // Copy updated local geometries to observation geometries
+   for (int img=0; img<theNumImages; ++img)
+   {
+      for (int obs=0; obs<theNumObsInSet; ++obs)
+      {
+         for (ossim_uint32 imgInObs=0; imgInObs<theObsSet->observ(obs)->numImages(); ++imgInObs)
+         {
+            if (theObsSet->observ(obs)->imageFile(imgInObs) ==
+                theObsSet->imageFile(img))
+            {
+               theObsSet->observ(obs)->setImageGeom
+                  (imgInObs, theObsSet->getImageGeom(img));
+            }
+         }
+      }
+   }
+
+   return true;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimAdjustmentExecutive::updateObservations()
+//  
+//  Update adjustable ground points with current iteration corrections.
+//  
+//*****************************************************************************
+bool ossimAdjustmentExecutive::updateObservations()
+{
+   int currPar = theNumParams + 1;
+   for (int obs=0; obs<theNumObsInSet; ++obs)
+   {
+      double lat = theObsSet->observ(obs)->Gpt().latr();
+      lat += theSolAttributes->theLastCorrections(currPar);
+      currPar++;    
+      double lon = theObsSet->observ(obs)->Gpt().lonr();
+      lon += theSolAttributes->theLastCorrections(currPar);
+      currPar++;    
+      double hgt = theObsSet->observ(obs)->Gpt().height();
+      hgt += theSolAttributes->theLastCorrections(currPar);
+      currPar++;    
+      theObsSet->observ(obs)->Gpt().latr(lat);
+      theObsSet->observ(obs)->Gpt().lonr(lon);
+      theObsSet->observ(obs)->Gpt().height(hgt);
+   }
+
+   return true;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimAdjustmentExecutive::summarizeSolution()
+//  
+//  Execute solution.
+//  
+//*****************************************************************************
+void ossimAdjustmentExecutive::summarizeSolution() const
+{
+   theRep << "\nossimAdjustmentExecutive Summary..."<<std::endl;
+   theRep << " Valid Exec:         "<<(theExecValid?"true":"false")<<std::endl;
+   theRep << " Nbr Ground Pts:     "<<theNumObsInSet<<std::endl;
+   theRep << " Nbr Image Points:   "<<theNumMeasurements<<std::endl;
+   theRep << " Nbr Images:         "<<theNumImages<<std::endl;
+   theRep << " Nbr Parameters:     "<<theNumParams<<std::endl;
+   theRep << " -------------------------"<<std::endl;
+   theRep << " Solution Converged: "<<(theSolConverged?"true":"false")<<std::endl;
+   theRep << " Solution Diverged:  "<<(theSolDiverged?"true":"false")<<std::endl;
+   theRep << " Max Iter Exceeded:  "<<(theMaxIterExceeded?"true":"false")<<std::endl;
+   theRep << " Max Iterations:     "<<theMaxIter<<std::endl;
+   theRep << " Convergence Crit:   "<<theConvCriteria<<"%"<<std::endl;
+
+   // SEUW history
+   theRep << "\n SEUW Trace...";
+   theRep << "\n   Iter        SEUW";
+   for (ossim_uint32 iter=0; iter<theSEUW.size(); ++iter)
+      theRep << "\n"<<setw(7)<<iter<<setw(12)<<setprecision(3)<<theSEUW[iter];
+
+   ossimString ts = timeStamp();
+   theRep << "\n";
+   theRep << "\n" << ts;
+   theRep << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
+   theRep << endl;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimAdjustmentExecutive::computeResidualStatistics()
+//  
+//  Statistical evaluation.
+//  
+//*****************************************************************************
+bool ossimAdjustmentExecutive::computeResidualStatistics(NEWMAT::Matrix& res)
+{
+   theXmean = 0.0;
+   theYmean = 0.0;
+   theXrms  = 0.0;
+   theYrms  = 0.0;
+   for (int n=1; n<=res.Nrows();++n)
+   {
+      theXmean += res(n,1);
+      theYmean += res(n,2);
+      theXrms  += res(n,1)*res(n,1);
+      theYrms  += res(n,2)*res(n,2);
+   }
+
+   theXmean /= theNumMeasurements;
+   theYmean /= theNumMeasurements;
+   theXrms   = sqrt(theXrms/theNumMeasurements);
+   theYrms   = sqrt(theYrms/theNumMeasurements);
+
+   theRep<<"\n";
+   theRep<<" ______________Mean:";
+   theRep<<setprecision(1)<<setw(8)<<theXmean;
+   theRep<<setprecision(1)<<setw(8)<<theYmean;
+   theRep<<"    RMS:";
+   theRep<<setprecision(1)<<setw(8)<<theXrms;
+   theRep<<setprecision(1)<<setw(8)<<theYrms;
+   theRep<<endl;
+
+   return true;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimAdjustmentExecutive::computeSEUW()
+//  
+//  Standard error of unit weight evaluation.
+//  
+//*****************************************************************************
+double ossimAdjustmentExecutive::computeSEUW()
+{
+   double vuw = 0.0;
+
+   // Observation contributions
+   int cMeas = 1;
+   for (int obs=0; obs<theNumObsInSet; ++obs)
+   {
+      NEWMAT::ColumnVector tc(3);
+      NEWMAT::Matrix cov(3,3);
+      int idx = theNumParams + 3*obs + 1;
+      tc  = theSolAttributes->theTotalCorrections.Rows(idx, idx+2);
+      idx -= theNumParams;
+      cov = theSolAttributes->theObjectPtCov.SubMatrix(idx,idx+2,1,3);
+      for (int i=1; i<=3; ++i)
+      {
+         vuw += tc(i)*tc(i)/cov(i,i);
+      }
+      for (ossim_uint32 meas=0; meas<theObsSet->observ(obs)->numMeas(); ++meas)
+      {
+         NEWMAT::RowVector res(2);
+         NEWMAT::Matrix cov(2,2);
+         res = theSolAttributes->theMeasResiduals.Row(cMeas);
+         int start = (cMeas-1)*2 + 1;
+         cov = theSolAttributes->theImagePtCov.SubMatrix(start,start+1,1,2);
+         for (int i=1; i<=2; ++i)
+         {
+            vuw += res(i)*res(i)/cov(i,i);
+         }
+         cMeas++;
+      }
+   }
+
+   // Parameter contributions
+   NEWMAT::ColumnVector tc(theNumParams);
+   tc = theSolAttributes->theTotalCorrections.Rows(1, theNumParams);
+   for (int par=0; par<theNumParams; ++par)
+   {
+      vuw += tc(par+1)*tc(par+1)/(theParInitialStdDev[par]*theParInitialStdDev[par]);
+   }
+
+   // DF
+   double df = theNumMeasurements*2 - theRankN;
+   if (df<=0.0)
+      df = 1.0;
+
+   // SEUW
+   double seuw = sqrt(vuw/df);
+
+   return seuw;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimAdjustmentExecutive::printParameterCorrectionSummary()
+//  
+//  Print info.
+//  
+//*****************************************************************************
+std::ostream& ossimAdjustmentExecutive::
+printParameterCorrectionSummary(std::ostream& out) const
+{
+   out<<"\nParameter Corrections...";
+   out<<"\n  n im        parameter    a_priori  total_corr   last_corr initial_std    prop_std";
+   for (int pc=1; pc<=theNumParams; ++pc)
+   {
+      out<<"\n "<<setprecision(5)<<setw(2)<<pc;
+      out<<setw(3)<<theImgs[pc-1]+1;
+      out<<setw(17)<<theParDesc[pc-1];
+      out<<setw(12)<<theParInitialValues[pc-1];
+      out<<setw(12)<<theSolAttributes->theTotalCorrections(pc);
+      out<<setw(12)<<theSolAttributes->theLastCorrections(pc);
+      out<<setw(12)<<theParInitialStdDev[pc-1];
+      out<<setw(12)<<sqrt(theSolAttributes->theFullCovMatrix(pc,pc));
+   }
+   out<<endl;
+
+   return out;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimAdjustmentExecutive::printObservationCorrectionSummary()
+//  
+//*****************************************************************************
+std::ostream& ossimAdjustmentExecutive::
+printObservationCorrectionSummary(std::ostream& out) const
+{
+   out<<"\nObservation Corrections...";
+   out<<"\n  n         observation    a_priori  total_corr   last_corr initial_std    prop_std";
+   for (int obs=0; obs<theNumObsInSet; ++obs)
+   {
+      out<<"\n "<<setprecision(5)<<setw(2)<<obs+1;
+      out<<" "<<setw(19)<<theObsSet->observ(obs)->ID();
+      double mPerRadp = theObsSet->observ(obs)->Gpt().metersPerDegree().y*DEG_PER_RAD;
+      double mPerRadl = theObsSet->observ(obs)->Gpt().metersPerDegree().x*DEG_PER_RAD;
+      // ossim_uint32 iobs = obs*3+1;
+
+      for (int k=0; k<3; ++k)
+      {
+         int idx = theNumParams + obs*3 + k + 1;
+         if (k<2)
+            out<<setw(12)<<theObsInitialValues[obs*3+k]*DEG_PER_RAD;
+         else
+            out<<setw(12)<<theObsInitialValues[obs*3+k];
+         double factor;
+         if (k==0)
+            factor = mPerRadp;
+         else if (k==1)
+            factor = mPerRadl;
+         else
+            factor = 1.0;
+         out<<setw(12)<<theSolAttributes->theTotalCorrections(idx)*factor;
+         out<<setw(12)<<theSolAttributes->theLastCorrections(idx)*factor;
+         out<<setw(12)<<theObsInitialStdDev[obs*3+k]*factor;
+         out<<setw(12)<<sqrt(theSolAttributes->theFullCovMatrix(idx,idx))*factor;
+         out<<endl<<"                       ";
+      }
+   }
+   out<<endl;
+
+   return out;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimAdjustmentExecutive::printResidualSummary()
+//  
+//*****************************************************************************
+std::ostream& ossimAdjustmentExecutive::
+printResidualSummary(std::ostream& out) const
+{
+   out<<"\nMeasurement Residuals...";
+   out<<"\n observation   image    samp    line    initial_meas";
+   int j = 0;
+   for (int obs=0; obs<theNumObsInSet; obs++)
+   {
+      int numMeasPerObs = theObsSet->observ(obs)->numMeas();
+      for (int meas=0; meas<numMeasPerObs; ++meas)
+      {
+         int imIdx = theObsSet->imIndex(j);
+         ++j;
+         out<<"\n";
+         out<<setw(12)<<theObsSet->observ(obs)->ID();
+         out<<setw(8)<<imIdx+1;
+         out<<setprecision(1)<<setw(8)<<theMeasResiduals(j,1);
+         out<<setprecision(1)<<setw(8)<<theMeasResiduals(j,2);
+         out<<"    ";
+         theObsSet->observ(obs)->getMeasurement(meas).print(out,1);
+      }
+      out<<endl;
+   }
+
+   return out;
+}
diff --git a/src/ossim/base/ossimApplicationUsage.cpp b/src/ossim/base/ossimApplicationUsage.cpp
index 3033c9e..8f773df 100644
--- a/src/ossim/base/ossimApplicationUsage.cpp
+++ b/src/ossim/base/ossimApplicationUsage.cpp
@@ -4,7 +4,7 @@
 // OSSIM.
 //
 //-------------------------------------------------------------------------
-// $Id: ossimApplicationUsage.cpp 11955 2007-10-31 16:10:22Z gpotts $
+// $Id: ossimApplicationUsage.cpp 19682 2011-05-31 14:21:20Z dburken $
 
 #include <iostream>
 #include <ossim/base/ossimApplicationUsage.h>
@@ -107,8 +107,8 @@ void ossimApplicationUsage::getFormatedString(ossimString& str, const UsageMap&
         line.replace(optionPos,citr->first.length(),citr->first);
         
         const ossimString& explanation = citr->second;
-        ossimString::size_type pos = 0;
-        ossimString::size_type offset = 0;
+        std::string::size_type pos = 0;
+        std::string::size_type offset = 0;
         bool firstInLine = true;
         while (pos<explanation.length())
         {
@@ -123,13 +123,13 @@ void ossimApplicationUsage::getFormatedString(ossimString& str, const UsageMap&
             
             firstInLine = false;
         
-            ossimString::size_type width = ossim::min((ossim_int64)(explanation.length()-pos),
+            std::string::size_type width = ossim::min((ossim_int64)(explanation.length()-pos),
                                                       (ossim_int64)(explanationWidth-offset));
-            ossimString::size_type slashn_pos = explanation.find('\n',pos);
+            std::string::size_type slashn_pos = explanation.find('\n',pos);
             
             unsigned int extraSkip = 0;
             bool concatinated = false;
-            if (slashn_pos!=ossimString::npos)
+            if (slashn_pos!=std::string::npos)
             {
                 if (slashn_pos<pos+width)
                 {
diff --git a/src/ossim/base/ossimArgumentParser.cpp b/src/ossim/base/ossimArgumentParser.cpp
index 3d6bd0c..9d08c7c 100644
--- a/src/ossim/base/ossimArgumentParser.cpp
+++ b/src/ossim/base/ossimArgumentParser.cpp
@@ -4,7 +4,7 @@
 // OSSIM.
 //
 //-------------------------------------------------------------------------
-// $Id: ossimArgumentParser.cpp 17815 2010-08-03 13:23:14Z dburken $
+// $Id: ossimArgumentParser.cpp 19900 2011-08-04 14:19:57Z dburken $
 
 #include <cstring>
 #include <set>
@@ -171,6 +171,18 @@ 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]);
diff --git a/src/ossim/base/ossimBaseObjectFactory.cpp b/src/ossim/base/ossimBaseObjectFactory.cpp
index 6e21e98..3fb1c85 100644
--- a/src/ossim/base/ossimBaseObjectFactory.cpp
+++ b/src/ossim/base/ossimBaseObjectFactory.cpp
@@ -2,15 +2,16 @@
 //
 // License:  See top level LICENSE.txt file.
 // 
-// Author: Garrett Potts (gpotts at imagelinks)
-// Description:
+// Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimBaseObjectFactory.cpp 9966 2006-11-29 02:01:07Z gpotts $
+// $Id: ossimBaseObjectFactory.cpp 19900 2011-08-04 14:19:57Z dburken $
 #include <ossim/base/ossimBaseObjectFactory.h>
 #include <ossim/base/ossimConnectableContainer.h>
 #include <ossim/base/ossimKeywordNames.h>
 #include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimString.h>
+#include <vector>
 
 RTTI_DEF1(ossimBaseObjectFactory, "ossimBaseObjectFactory", ossimObjectFactory);
 
diff --git a/src/ossim/base/ossimBooleanProperty.cpp b/src/ossim/base/ossimBooleanProperty.cpp
index 7c5d1ea..ffe4307 100644
--- a/src/ossim/base/ossimBooleanProperty.cpp
+++ b/src/ossim/base/ossimBooleanProperty.cpp
@@ -5,7 +5,7 @@
 // Author: Garrett Potts (gpotts at imagelinks.com)
 //
 //*************************************************************************
-// $Id: ossimBooleanProperty.cpp 17195 2010-04-23 17:32:18Z dburken $
+// $Id: ossimBooleanProperty.cpp 19888 2011-08-03 11:30:22Z gpotts $
 #include <ossim/base/ossimBooleanProperty.h>
 
 RTTI_DEF1(ossimBooleanProperty, "ossimBooleanProperty", ossimProperty);
@@ -59,7 +59,7 @@ bool ossimBooleanProperty::setBooleanValue(bool value,
 
 void ossimBooleanProperty::valueToString(ossimString& valueResult)const
 {
-   valueResult = theValue?"1":"0";
+   valueResult = theValue?"true":"false";
 }
 
 bool ossimBooleanProperty::getBoolean()const
diff --git a/src/ossim/base/ossimByteStreamBuffer.cpp b/src/ossim/base/ossimByteStreamBuffer.cpp
new file mode 100644
index 0000000..033ab93
--- /dev/null
+++ b/src/ossim/base/ossimByteStreamBuffer.cpp
@@ -0,0 +1,355 @@
+#include <ossim/base/ossimByteStreamBuffer.h>
+#include <cstring> /* for memcpy */
+
+ossimByteStreamBuffer::ossimByteStreamBuffer()
+   :m_buffer(0),
+    m_bufferSize(0),
+    m_sharedBuffer(false)
+{
+   setBuf(m_buffer, m_bufferSize, m_sharedBuffer);
+}
+
+ossimByteStreamBuffer::ossimByteStreamBuffer(char_type* buf, 
+                                             ossim_int64 bufSize, 
+                                             bool shared)
+   :m_buffer(0),
+    m_bufferSize(0),
+    m_sharedBuffer(false)    
+{
+   setBuf(buf, bufSize, shared);
+}
+
+ossimByteStreamBuffer::ossimByteStreamBuffer(const ossimByteStreamBuffer& src)
+   :m_buffer(0),
+    m_bufferSize(0),
+    m_sharedBuffer(false)    
+{
+   setBuf(src.m_buffer, src.m_bufferSize, src.m_sharedBuffer);
+   
+   if(src.m_buffer&&src.m_bufferSize)
+   {
+      // now align pointers to the same offset locations
+      //
+      ossim_int64 goff = src.gptr()-src.eback();
+      ossim_int64 poff = src.pptr()-src.pbase();
+      setg(m_buffer, m_buffer+goff, m_buffer+m_bufferSize);
+      setp(m_buffer, m_buffer+m_bufferSize);
+      pbump(poff);
+   }
+}
+
+ossimByteStreamBuffer::~ossimByteStreamBuffer()
+{
+   deleteBuffer();
+}
+std::streambuf* ossimByteStreamBuffer::setbuf ( char_type * s, std::streamsize n )
+{
+   return setBuf(s, n, false);
+}
+
+void ossimByteStreamBuffer::clear()
+{
+   setbuf(0,0);
+}
+// added so we can set a buffer and make it shared
+std::streambuf* ossimByteStreamBuffer::setBuf(char* buf, std::streamsize bufSize, bool shared)
+{
+   
+   deleteBuffer();
+   setp(0,0);
+   setg(0,0,0);
+   char_type* tempBuf = buf;
+   if(!shared&&bufSize&&buf)
+   {
+      tempBuf = new char_type[bufSize];
+      memcpy(tempBuf, buf, bufSize);
+   }
+   m_buffer = tempBuf;
+   m_sharedBuffer = shared;
+   m_bufferSize = bufSize;
+   setp(m_buffer, m_buffer+bufSize);
+   if(m_buffer)
+   {
+      setg(m_buffer, m_buffer, m_buffer+bufSize);
+   }
+    
+   return this;
+}
+
+int ossimByteStreamBuffer::overflow( int c)
+{
+   if(m_sharedBuffer)
+   {
+      return EOF;
+   }
+   else
+   {            
+      ossim_uint32 oldSize = m_bufferSize;
+      extendBuffer(1);
+      pbump(1);
+      m_buffer[oldSize] = (char_type)c;
+   }
+    
+   return c;
+}
+
+ossimByteStreamBuffer::char_type* ossimByteStreamBuffer::buffer(){return m_buffer;}
+const ossimByteStreamBuffer::char_type* ossimByteStreamBuffer::buffer()const{return m_buffer;}
+
+/**
+ * The buffer is no longer managed by this stream buffer and is removed.
+ */
+ossimByteStreamBuffer::char_type* ossimByteStreamBuffer::takeBuffer()
+{
+   char_type* result = m_buffer;
+   setp(0,0);
+   setg(0,0,0);
+   m_bufferSize = 0;
+   m_buffer     = 0;
+    
+   return result;
+}
+
+ossim_uint64 ossimByteStreamBuffer::bufferSize()const{return m_bufferSize;}
+
+
+ossimByteStreamBuffer::int_type ossimByteStreamBuffer::pbackfail(int_type __c )
+{
+   int_type result = __c;
+   ossim_int64 delta = gptr()-eback();
+   if(delta!=0)
+   {
+      setg(m_buffer, m_buffer+(delta-1), m_buffer+m_bufferSize);
+      if(__c != traits_type::eof())
+      {
+         *gptr() = static_cast<char_type>(__c);
+      }
+   }
+   else
+   {
+      result = traits_type::eof();
+   }
+   return result;
+}
+ossimByteStreamBuffer::pos_type ossimByteStreamBuffer::seekoff(off_type offset, std::ios_base::seekdir dir,
+                                                               std::ios_base::openmode __mode)
+{ 
+   pos_type result = pos_type(off_type(-1));
+   if((__mode & std::ios_base::in)&&
+      (__mode & std::ios_base::out))
+   {
+      // we currently will not support both input and output stream at the same time
+      //
+      return result;
+   }
+   switch(dir)
+   {
+      case std::ios_base::beg:
+      {
+         // if we are determing an absolute position from the beginning then 
+         // just make sure the offset is within range of the current buffer size
+         //
+         if((offset < m_bufferSize)&&
+            (offset >=0))
+         {
+            result = pos_type(offset);
+         }
+         if(__mode  & std::ios_base::in)
+         {
+            gbump(offset - (gptr() - eback()));
+         }
+         else if(__mode & std::ios_base::out)
+         {
+            pbump(offset - (pptr() - pbase()));
+         }
+         break;
+      }
+      case std::ios_base::cur:
+      {
+         // if we are determing an absolute position from the current pointer then 
+         // add the offset as a relative displacment
+         //
+         pos_type newPosition = result;
+         ossim_int64 delta = 0;
+         if(__mode & std::ios_base::in)
+         {
+            delta = gptr()-eback();
+         }
+         else if(__mode & std::ios_base::out)
+         {
+            delta = pptr()-pbase();
+         }
+         newPosition = pos_type(delta + offset);
+         if((newPosition >= 0)&&(newPosition < m_bufferSize))
+         {
+            result = newPosition;
+            if(__mode  & std::ios_base::in)
+            {
+               gbump(offset);
+            }
+            else if(__mode & std::ios_base::out)
+            {
+               pbump(offset);
+            }
+         }
+         break;
+      }
+      case std::ios_base::end:
+      {
+         pos_type newPosition = result;
+         ossim_int64 delta = 0;
+         if(__mode & std::ios_base::in)
+         {
+            delta = egptr()-eback();
+         }
+         else if(__mode & std::ios_base::out)
+         {
+            delta = epptr()-pbase();
+         }
+         newPosition = pos_type(delta + offset);
+         if((newPosition >= 0)&&(newPosition < m_bufferSize))
+         {
+            result = newPosition;
+            if(__mode  & std::ios_base::in)
+            {
+               gbump(offset - (gptr() - eback()));
+            }
+            else if(__mode & std::ios_base::out)
+            {
+               pbump(offset - (epptr() - pptr()));
+            }
+         }
+         break;
+      }
+      default:
+      {
+         break;
+      }
+   }
+   return result; 
+} 
+
+ossimByteStreamBuffer::pos_type ossimByteStreamBuffer::seekpos(pos_type pos, std::ios_base::openmode __mode)
+{
+   pos_type result = pos_type(off_type(-1));
+    
+   if(__mode & std::ios_base::in)
+   {
+      if(pos >= 0)
+      {
+         if(pos < m_bufferSize)
+         {
+            setg(m_buffer, m_buffer + pos, m_buffer + m_bufferSize);
+            result = pos;
+         }
+      }
+   }
+   else if(__mode & std::ios_base::out)
+   {
+      if(pos >=0)
+      {
+         setp(m_buffer, m_buffer+m_bufferSize);
+         if(pos < m_bufferSize)
+         {
+            pbump(pos);
+            result = pos;
+         }
+         else if(!m_sharedBuffer)
+         {
+            ossim_int64 delta = ossim_int64(pos) - m_bufferSize;
+            if(delta > 0)
+            {
+               extendBuffer(delta+1);
+               pbump(pos);
+               result = pos;
+            }
+         }
+      }
+   }
+    
+   return result;
+}
+
+std::streamsize ossimByteStreamBuffer::xsgetn(char_type* __s, std::streamsize __n)
+{
+   ossim_uint64 bytesLeftToRead = egptr()-gptr();
+   ossim_uint64 bytesToRead = __n;
+    
+   if(bytesToRead > bytesLeftToRead)
+   {
+      bytesToRead = bytesLeftToRead;
+   }
+   if(bytesToRead)
+   {
+      std::memcpy(__s, gptr(), bytesToRead);
+      gbump(bytesToRead); // bump the current get pointer
+   }
+   return std::streamsize(bytesToRead);
+}
+
+std::streamsize ossimByteStreamBuffer::xsputn(const char_type* __s, std::streamsize __n)
+{
+   ossim_int64 bytesLeftToWrite = epptr()-pptr();
+   ossim_int64 bytesToWrite = __n;
+   if(__n > bytesLeftToWrite)
+   {
+      if(!m_sharedBuffer)
+      {
+         extendBuffer(__n-bytesLeftToWrite);
+      }
+      else
+      {
+         bytesToWrite = bytesLeftToWrite;
+      }
+   }
+   if(bytesToWrite)
+   {
+      std::memcpy(pptr(), __s, bytesToWrite);
+      pbump(bytesToWrite);
+   }
+    
+   return bytesToWrite;
+}
+
+void ossimByteStreamBuffer::deleteBuffer()
+{
+   if(!m_sharedBuffer&&m_buffer)
+   {
+      delete [] m_buffer;
+   }
+   m_buffer = 0;
+   m_bufferSize=0;
+}
+void ossimByteStreamBuffer::extendBuffer(ossim_uint64 bytes)
+{
+   // ossim_uint32 oldSize = m_bufferSize;
+   char* inBegin = eback();
+   char* inCur   = gptr();
+   ossim_uint64 pbumpOffset = pptr()-pbase();
+    
+   ossim_int64 relativeInCur = inCur-inBegin;
+    
+    
+   if(!m_buffer)
+   {
+      if(bytes>0)
+      {
+         m_buffer = new char[m_bufferSize + bytes];
+      }
+   }
+   else 
+   {
+      if(bytes>0)
+      {
+         char* newBuf = new char[m_bufferSize + bytes];
+         std::memcpy(newBuf, m_buffer, m_bufferSize);
+         delete [] m_buffer;
+         m_buffer = newBuf;
+      }
+   }
+   m_bufferSize += bytes;
+    
+   setp(m_buffer, m_buffer+m_bufferSize);
+   setg(m_buffer, m_buffer+relativeInCur, m_buffer + m_bufferSize);
+   pbump(pbumpOffset); // reallign to the current location
+}
diff --git a/src/ossim/base/ossimCommon.cpp b/src/ossim/base/ossimCommon.cpp
index 7a5cecc..8ac8e18 100644
--- a/src/ossim/base/ossimCommon.cpp
+++ b/src/ossim/base/ossimCommon.cpp
@@ -9,9 +9,7 @@
 // Description: Common file for global functions.
 //
 //*************************************************************************
-// $Id: ossimCommon.cpp 19008 2011-03-04 13:57:55Z gpotts $
-
-#include <sstream>
+// $Id: ossimCommon.cpp 20610 2012-02-27 12:19:25Z gpotts $
 
 #include <ossim/base/ossimCommon.h>
 #include <ossim/base/ossimConstants.h>
@@ -24,6 +22,9 @@
 #include <ossim/matrix/newmat.h>
 #include <ossim/base/ossimDpt.h>
 #include <ossim/base/ossimGpt.h>
+#include <OpenThreads/Thread>
+#include <sstream>
+
 static ossimTrace traceDebug("ossimCommon:debug");
 
 // stores a floating point nan value
@@ -356,17 +357,26 @@ ossim_uint32 ossim::getActualBitsPerPixel(ossimScalarType scalarType)
       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())
@@ -631,7 +641,7 @@ void ossim::lexQuotedTokens(const std::string& str,
    unbalancedQuotes = false;
    
    int end=0;
-   while (start < str.length() && start >= 0)
+   while (start < str.length())
    {
       if (str[start] == openQuote)
       {
@@ -854,15 +864,8 @@ void ossim::toVector(std::vector<ossimGpt>& result,
    }   
 }
 
-/**
- * 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
- */ 
-bool ossim::extractSimpleValues(std::vector<ossimString>& values, const ossimString& stringOfPoints)
+bool ossim::extractSimpleValues(std::vector<ossimString>& values,
+                                const ossimString& stringOfPoints)
 {
    std::istringstream in(stringOfPoints);
    ossim::skipws(in);
@@ -903,10 +906,7 @@ bool ossim::extractSimpleValues(std::vector<ossimString>& values, const ossimStr
    
    return result;
 }
-/**
- *  Takes input format of the form:
- *  (value1,value2,...,valueN)
- */
+
 bool ossim::toSimpleVector(std::vector<ossim_uint32>& result,
                            const ossimString& stringOfPoints)
 {
@@ -915,7 +915,7 @@ bool ossim::toSimpleVector(std::vector<ossim_uint32>& result,
    if(resultFlag)
    {
       ossim_uint32 idx = 0;
-      ossim_uint32 size = extractedValues.size();
+      ossim_uint32 size = (ossim_uint32) extractedValues.size();
       for(idx = 0; idx < size; ++idx)
       {
          result.push_back(extractedValues[idx].toUInt32());
@@ -923,18 +923,10 @@ bool ossim::toSimpleVector(std::vector<ossim_uint32>& result,
    }
    return resultFlag;
 }
-/**
- * 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 <>
 void ossim::toSimpleStringList(ossimString& result,
-                        const std::vector<ossim_uint8>& valuesList)
+                               const std::vector<ossim_uint8>& valuesList)
 
 {
    std::ostringstream out;
@@ -942,7 +934,7 @@ void ossim::toSimpleStringList(ossimString& result,
    if(!valuesList.empty())
    {
       ossim_uint32 idx = 0;
-      ossim_uint32 size = (valuesList.size()-1);
+      ossim_uint32 size = (ossim_uint32)(valuesList.size()-1);
       for(idx = 0; idx < size; ++idx)
       {
          out << ((ossim_uint32)valuesList[idx]) << ",";
@@ -953,10 +945,6 @@ void ossim::toSimpleStringList(ossimString& result,
    result = "("+out.str()+")";
 }
 
-/**
- *  Takes input format of the form:
- *  (value1,value2,...,valueN)
- */
 bool ossim::toSimpleVector(std::vector<ossim_int32>& result,
                            const ossimString& stringOfPoints)
 {
@@ -965,7 +953,7 @@ bool ossim::toSimpleVector(std::vector<ossim_int32>& result,
    if(resultFlag)
    {
       ossim_uint32 idx = 0;
-      ossim_uint32 size = extractedValues.size();
+      ossim_uint32 size = (ossim_int32) extractedValues.size();
       for(idx = 0; idx < size; ++idx)
       {
          result.push_back(extractedValues[idx].toInt32());
@@ -973,10 +961,7 @@ bool ossim::toSimpleVector(std::vector<ossim_int32>& result,
    }
    return resultFlag;
 }
-/**
- *  Takes input format of the form:
- *  (value1,value2,...,valueN)
- */
+
 bool ossim::toSimpleVector(std::vector<ossim_uint16>& result,
                            const ossimString& stringOfPoints)
 {
@@ -985,7 +970,7 @@ bool ossim::toSimpleVector(std::vector<ossim_uint16>& result,
    if(resultFlag)
    {
       ossim_uint32 idx = 0;
-      ossim_uint32 size = extractedValues.size();
+      ossim_uint32 size = (ossim_int32) extractedValues.size();
       for(idx = 0; idx < size; ++idx)
       {
          result.push_back(extractedValues[idx].toUInt32());
@@ -993,10 +978,7 @@ bool ossim::toSimpleVector(std::vector<ossim_uint16>& result,
    }
    return resultFlag;
 }
-/**
- *  Takes input format of the form:
- *  (value1,value2,...,valueN)
- */
+
 bool ossim::toSimpleVector(std::vector<ossim_int16>& result,
                            const ossimString& stringOfPoints)
 {
@@ -1005,7 +987,7 @@ bool ossim::toSimpleVector(std::vector<ossim_int16>& result,
    if(resultFlag)
    {
       ossim_uint32 idx = 0;
-      ossim_uint32 size = extractedValues.size();
+      ossim_uint32 size = (ossim_uint32) extractedValues.size();
       for(idx = 0; idx < size; ++idx)
       {
          result.push_back(extractedValues[idx].toInt32());
@@ -1013,10 +995,7 @@ bool ossim::toSimpleVector(std::vector<ossim_int16>& result,
    }
    return resultFlag;
 }
-/**
- *  Takes input format of the form:
- *  (value1,value2,...,valueN)
- */
+
 bool ossim::toSimpleVector(std::vector<ossim_uint8>& result,
                     const ossimString& stringOfPoints)
 {
@@ -1025,7 +1004,7 @@ bool ossim::toSimpleVector(std::vector<ossim_uint8>& result,
    if(resultFlag)
    {
       ossim_uint32 idx = 0;
-      ossim_uint32 size = extractedValues.size();
+      ossim_uint32 size = (ossim_uint32) extractedValues.size();
       for(idx = 0; idx < size; ++idx)
       {
          result.push_back(extractedValues[idx].toUInt8());
@@ -1033,10 +1012,7 @@ bool ossim::toSimpleVector(std::vector<ossim_uint8>& result,
    }
    return resultFlag;
 }
-/**
- *  Takes input format of the form:
- *  (value1,value2,...,valueN)
- */
+
 bool ossim::toSimpleVector(std::vector<ossim_int8>& result,
                     const ossimString& stringOfPoints)
 {
@@ -1045,7 +1021,7 @@ bool ossim::toSimpleVector(std::vector<ossim_int8>& result,
    if(resultFlag)
    {
       ossim_uint32 idx = 0;
-      ossim_uint32 size = extractedValues.size();
+      ossim_uint32 size = (ossim_uint32) extractedValues.size();
       for(idx = 0; idx < size; ++idx)
       {
          result.push_back(extractedValues[idx].toUInt8());
@@ -1054,3 +1030,21 @@ bool ossim::toSimpleVector(std::vector<ossim_int8>& result,
    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;
+}
diff --git a/src/ossim/base/ossimConnectableContainer.cpp b/src/ossim/base/ossimConnectableContainer.cpp
index 1ac8434..1b7f682 100644
--- a/src/ossim/base/ossimConnectableContainer.cpp
+++ b/src/ossim/base/ossimConnectableContainer.cpp
@@ -6,10 +6,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimConnectableContainer.cpp 19484 2011-05-03 16:28:27Z gpotts $
-
-#include <algorithm>
-#include <stack>
+// $Id: ossimConnectableContainer.cpp 21850 2012-10-21 20:09:55Z dburken $
 
 #include <ossim/base/ossimConnectableContainer.h>
 #include <ossim/base/ossimIdManager.h>
@@ -21,6 +18,9 @@
 #include <ossim/base/ossimTrace.h>
 #include <ossim/base/ossimNotifyContext.h>
 #include <ossim/base/ossimVisitor.h>
+#include <algorithm>
+#include <stack>
+
 static ossimTrace traceDebug("ossimConnectableContainer:debug");
 
 RTTI_DEF2(ossimConnectableContainer, "ossimConnectableContainer", ossimConnectableObject, ossimConnectableContainerInterface);
@@ -329,7 +329,7 @@ ossimConnectableObject* ossimConnectableContainer::findObject(const ossimConnect
 void ossimConnectableContainer::makeUniqueIds()
 {
    connectablObjectMapType::iterator current;
-   std::vector<ossimConnectableObject* > objectList;
+   std::vector<ossimRefPtr<ossimConnectableObject> > objectList;
 
 
    current = theObjectMap.begin();
@@ -345,18 +345,18 @@ void ossimConnectableContainer::makeUniqueIds()
    for(long index = 0; index < (long)objectList.size(); ++index)
    {
       ossimConnectableContainerInterface* container = PTR_CAST(ossimConnectableContainerInterface,
-                                                               objectList[index]);
+                                                               objectList[index].get());
       if(container)
       {
          container->makeUniqueIds();
          theObjectMap.insert(std::make_pair(objectList[index]->getId().getId(),
-                                            objectList[index]));
+                                            objectList[index].get()));
       }
       else
       {
          objectList[index]->setId(ossimIdManager::instance()->generateId());
          theObjectMap.insert(std::make_pair(objectList[index]->getId().getId(),
-                             objectList[index]));
+                             objectList[index].get()));
       }
    }
 }
@@ -392,16 +392,23 @@ bool ossimConnectableContainer::addChild(ossimConnectableObject* object)
    if(object)
    {
       // if it's not already a child
-      if(!findObject(object->getId()))
+      
+      ossimIdVisitor visitor(
+         object->getId(),
+         (ossimVisitor::VISIT_INPUTS|ossimVisitor::VISIT_CHILDREN) );
+      accept( visitor );
+      
+      // if(!findObject(object->getId()))
+      if ( !visitor.getObject() )      
       {
          object->changeOwner(this);
          theObjectMap.insert(std::make_pair(object->getId().getId(), object));
          object->addListener(theChildListener);
       }
-
+      
       return true;
    }
-
+   
    return false;
 }
 
@@ -674,27 +681,43 @@ bool ossimConnectableContainer::connectAllObjects(const std::map<ossimId, std::v
 {
    if(idMapping.size())
    {
+      
+      ossimIdVisitor visitor( (ossimVisitor::VISIT_INPUTS|ossimVisitor::VISIT_CHILDREN) );
+
       std::map<ossimId, std::vector<ossimId> >::const_iterator iter = idMapping.begin();
 
       while(iter != idMapping.end())
       {
-         ossimConnectableObject* currentObject = findObject((*iter).first);
+         visitor.setId( (*iter).first );
+         accept( visitor );
+         ossimConnectableObject* currentObject = visitor.getObject();
+         // ossimConnectableObject* currentObject = findObject((*iter).first);
 
          if(currentObject)
          {
             long upperBound = (long)(*iter).second.size();
             for(long index = 0; index < upperBound; ++index)
             {
-               ossimConnectableObject* inputObject = findObject((*iter).second[index]);
-
-               currentObject->connectMyInputTo(index, inputObject);
+               visitor.reset();
+               visitor.setId( (*iter).second[index] );
+               accept( visitor );
+               ossimConnectableObject* inputObject = visitor.getObject();
+               if ( inputObject )
+               {
+                  currentObject->connectMyInputTo(index, inputObject);
+               }
+               // ossimConnectableObject* inputObject = findObject((*iter).second[index]);
+               // currentObject->connectMyInputTo(index, inputObject);
             }
          }
          else
          {
-            ossimNotify(ossimNotifyLevel_FATAL) << "ossimConnectableContainer::connectAllObjects, Could not find " << (*iter).first << " for source: \n";
+            ossimNotify(ossimNotifyLevel_FATAL)
+               << "ossimConnectableContainer::connectAllObjects, Could not find "
+               << (*iter).first << " for source: \n";
             return false;
          }
+         visitor.reset();
          ++iter;
       }
    }
@@ -776,3 +799,24 @@ void ossimConnectableContainer::accept(ossimVisitor& visitor)
    
 }
 
+//**************************************************************************************************
+// Inserts all of this object's children and inputs into the container provided. Since this is
+// itself a container, this method will consolidate this with the argument container. Therefore 
+// this object will not be represented in the argument container (but its children will be).
+// Returns TRUE if successful.
+//**************************************************************************************************
+bool ossimConnectableContainer::fillContainer(ossimConnectableContainer& container)
+{
+   connectablObjectMapType::iterator current;
+   current = theObjectMap.begin();
+   // ossim_uint32 i = 0;
+   // bool fill_ok;
+   while(current != theObjectMap.end())
+   {
+      ossimRefPtr<ossimConnectableObject> currentObject = current->second;
+      if (currentObject.valid())
+         container.addChild(currentObject.get());
+      current++;
+   }
+   return true;
+}
diff --git a/src/ossim/base/ossimConnectableObject.cpp b/src/ossim/base/ossimConnectableObject.cpp
index e4cc7d5..d4d2195 100644
--- a/src/ossim/base/ossimConnectableObject.cpp
+++ b/src/ossim/base/ossimConnectableObject.cpp
@@ -5,17 +5,19 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimConnectableObject.cpp 19484 2011-05-03 16:28:27Z gpotts $
+// $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 <algorithm>
 #include <ossim/base/ossimVisitor.h>
+#include <algorithm>
 
 RTTI_DEF3(ossimConnectableObject,
           "ossimConnectableObject",
@@ -118,9 +120,13 @@ bool ossimConnectableObject::isConnected(ossimConnectableObjectDirectionType dir
    
    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))
@@ -169,6 +175,208 @@ ossimConnectableObject* ossimConnectableObject::findConnectableObject(const ossi
    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)
@@ -387,6 +595,8 @@ ossimConnectableObject* ossimConnectableObject::findInputObjectOfType(
    }
    return result;
 }
+#endif /* drb */
+// End: Old findObject findInputObject code kept here until debugged to satisfaction.
 
 ossim_int32 ossimConnectableObject::findInputIndex(const ossimConnectableObject* object)
 {
@@ -536,8 +746,12 @@ void ossimConnectableObject::disconnect(const ossimId& id)
    }
    else
    {
-      ossimConnectableObject* object = findConnectableObject(id);
-      disconnect(object);
+      ossimIdVisitor visitor( id,
+                              (ossimVisitor::VISIT_CHILDREN |
+                               ossimVisitor::VISIT_INPUTS   |
+                               ossimVisitor::VISIT_OUTPUTS) );
+      accept( visitor );
+      disconnect( visitor.getObject() );
    }
 }
 
@@ -559,11 +773,9 @@ ossimRefPtr<ossimConnectableObject> ossimConnectableObject::disconnectMyInput(os
       current = (theInputObjectList.begin()+inputIndex);
       result = (*current).get();
       
-      ossim_int32 index = inputIndex;
       if(!theInputListIsFixedFlag)
       {
          current = theInputObjectList.erase(current);
-         index = -1;
       }
       else
       {
@@ -644,11 +856,9 @@ ossimRefPtr<ossimConnectableObject> ossimConnectableObject::disconnectMyOutput(o
    {
       current = (theOutputObjectList.begin()+outputIndex);
       result = (*current).get();
-      ossim_int32 index = outputIndex;
       if(!theOutputListIsFixedFlag)
       {
          current = theOutputObjectList.erase(current);
-         index = -1;
       }
       else
       {
@@ -1137,31 +1347,31 @@ bool ossimConnectableObject::connectMyOutputTo(ConnectableObjectList& outputList
    return result;
 }
 
-ossimConnectableObject* ossimConnectableObject::getInput(ossim_uint32 index)
+ossimConnectableObject* ossimConnectableObject::getInput(ossim_uint32 idx)
 {
-   if( (index >= 0) && (index < theInputObjectList.size()))
+   if(idx < theInputObjectList.size())
    {
-      return theInputObjectList[index].get();
+      return theInputObjectList[idx].get();
    }
    
    return 0;
 }
 
-const ossimConnectableObject* ossimConnectableObject::getInput(ossim_uint32 index)const
+const ossimConnectableObject* ossimConnectableObject::getInput(ossim_uint32 idx)const
 {
-   if( (index >= 0) && (index < theInputObjectList.size()))
+   if( idx < theInputObjectList.size())
    {
-      return theInputObjectList[index].get();
+      return theInputObjectList[idx].get();
    }
    
    return 0;
 }
 
-ossimConnectableObject* ossimConnectableObject::getOutput(ossim_uint32 index)
+ossimConnectableObject* ossimConnectableObject::getOutput(ossim_uint32 idx)
 {
-   if( (index >= 0) && (index < theOutputObjectList.size()))
+   if(idx < theOutputObjectList.size())
    {
-      return theOutputObjectList[index].get();
+      return theOutputObjectList[idx].get();
    }
    
    return 0;
@@ -1209,28 +1419,20 @@ bool ossimConnectableObject::connectInputList(ConnectableObjectList& inputList)
       return (connectMyInputTo(inputList[0].get())>=0);
    }
    i = 0;
-   while(currentInput != inputList.end())
-   {
-      if(!canConnectMyInputTo(i, (*currentInput).get()))
-      {
-         result = false;
-      }
-      ++i;
-      ++currentInput;
-   }
-   
-   if(!result)
-   {
-      return false;
-   }
    // now connect the new outputs
    //
    currentInput = inputList.begin();
+   result = false;
+   
    while(currentInput != inputList.end())
    {
       if((*currentInput).valid())
       {
-         (*currentInput)->connectMyOutputTo(this, false);
+         if(connectMyInputTo((*currentInput).get(), false) >= 0)
+         {
+            newInputs.push_back((*currentInput).get());
+            result = true;
+         }
       }
       ++currentInput;
    }
@@ -1242,13 +1444,8 @@ bool ossimConnectableObject::connectInputList(ConnectableObjectList& inputList)
    
    if(theInputObjectList.size())
    {
-      theInputObjectList = inputList;
       fireEvent(event);
    }
-   else
-   {
-      theInputObjectList = inputList;
-   }
    
    newInputs          = theInputObjectList;
    
@@ -1381,11 +1578,11 @@ void ossimConnectableObject::setNumberOfOutputs(ossim_int32 numberOfOutputs)
 }
 
 
-const ossimConnectableObject* ossimConnectableObject::getOutput(ossim_uint32 index)const
+const ossimConnectableObject* ossimConnectableObject::getOutput(ossim_uint32 idx)const
 {
-   if( (index >= 0) && (index < theOutputObjectList.size()))
+   if(idx < theOutputObjectList.size())
    {
-      return theOutputObjectList[index].get();
+      return theOutputObjectList[idx].get();
    }
    
    return 0;
@@ -1442,7 +1639,7 @@ void ossimConnectableObject::findAllObjectsOfType(ConnectableObjectList& result,
    }
 }
 
-
+#if 0
 void ossimConnectableObject::findAllInputsOfType(ConnectableObjectList& result,
                                                  const RTTItypeid& typeInfo,
                                                  bool propagateToInputs,
@@ -1564,124 +1761,7 @@ void ossimConnectableObject::findAllInputsOfType(ConnectableObjectList& result,
       }
    }
 }
-
-void ossimConnectableObject::findAllOutputsOfType(ConnectableObjectList& result,
-                                                  const RTTItypeid& typeInfo,
-                                                  bool propagateToOutputs,
-                                                  bool recurseChildren)
-{
-   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]);
-         }
-      }
-   }
-   for(ossim_uint32 i = 0; i < getNumberOfOutputs(); ++i)
-   {
-      ossimConnectableObject* current = getOutput(i);
-      if(current&&(current->canCastTo(typeInfo)))
-      {
-         result.push_back(current);
-      }
-      ossimConnectableContainerInterface* 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(propagateToOutputs&&current)
-      {
-         current->findAllOutputsOfType(result,
-                                       typeInfo,
-                                       true,
-                                       recurseChildren);
-      }
-   }
-}
-
-void ossimConnectableObject::findAllOutputsOfType(ConnectableObjectList& result,
-                                                  const ossimString& className,
-                                                  bool propagateToOutputs,
-                                                  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 < getNumberOfOutputs(); ++i)
-   {
-      ossimConnectableObject* current = getOutput(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(propagateToOutputs&&current)
-      {
-         current->findAllOutputsOfType(result,
-                                       className,
-                                       true,
-                                       recurseChildren);
-      }
-   }
-}
-
+#endif
 
 void ossimConnectableObject::propagateEventToOutputs(ossimEvent& event)
 {
@@ -1723,6 +1803,11 @@ void ossimConnectableObject::setProperty(ossimRefPtr<ossimProperty> property)
    }
 }
 
+void ossimConnectableObject::setProperty(const ossimString& name, const ossimString& value)
+{
+   ossimPropertyInterface::setProperty(name, value);
+}
+
 ossimRefPtr<ossimProperty> ossimConnectableObject::getProperty(const ossimString& name)const
 {
    if(name == "Description")
@@ -1790,7 +1875,7 @@ bool ossimConnectableObject::loadState(const ossimKeywordlist& kwl,
    else
    {
       // if we are fixed then the list should already be set
-      numberInputs = theInputObjectList.size();
+      numberInputs = (ossim_int32) theInputObjectList.size();
    }
 
    
@@ -1807,7 +1892,7 @@ bool ossimConnectableObject::loadState(const ossimKeywordlist& kwl,
    else 
    {
       // if we are fixed then the list should already be set
-      numberOutputs = theOutputObjectList.size();
+      numberOutputs = (ossim_int32) theOutputObjectList.size();
    }
 
    lookup = kwl.find(prefix, ossimKeywordNames::DESCRIPTION_KW);
@@ -1901,14 +1986,13 @@ bool ossimConnectableObject::saveState(ossimKeywordlist& kwl,
    return true;
 }
 
-ossim_uint32 ossimConnectableObject::saveStateOfAllInputs(
-                                                          ossimKeywordlist& kwl,
+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)
    {
@@ -1917,35 +2001,45 @@ ossim_uint32 ossimConnectableObject::saveStateOfAllInputs(
       {
          const ossimConnectableObject* input = getInput(i);
          if(input)
-         {
-            index = input->saveStateOfAllInputs(kwl,
-                                                true,
-                                                index,
-                                                prefix);
-         }
+            index = input->saveStateOfAllInputs(kwl, true, index, prefix);
       }
    }
-   
+
    if (saveThisStateFlag)
    {
       ossimString myPrefix;
       if (prefix)
-      {
          myPrefix = prefix;
-      }
-      
-      myPrefix += "object";
-      myPrefix += ossimString::toString(index);
-      myPrefix += ".";
-      
+
+      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
 {
@@ -2167,7 +2261,87 @@ void ossimConnectableObject::accept(ossimVisitor& visitor)
                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/ossim/base/ossimConnectableObjectListener.cpp b/src/ossim/base/ossimConnectableObjectListener.cpp
index bf2ef76..4c213e9 100644
--- a/src/ossim/base/ossimConnectableObjectListener.cpp
+++ b/src/ossim/base/ossimConnectableObjectListener.cpp
@@ -7,7 +7,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimConnectableObjectListener.cpp 9094 2006-06-13 19:12:40Z dburken $
+// $Id: ossimConnectableObjectListener.cpp 19961 2011-08-16 18:10:36Z gpotts $
 
 #include <ossim/base/ossimConnectableObjectListener.h>
 #include <ossim/base/ossimConnectableObject.h>
@@ -24,73 +24,83 @@ void ossimConnectableObjectListener::processEvent(ossimEvent& event)
    {
       case OSSIM_EVENT_OBJECT_DESTRUCTING_ID:
       {
-         ossimObjectDestructingEvent* eventCast = static_cast<ossimObjectDestructingEvent*>(&event);
-         objectDestructingEvent(*eventCast);
+         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 = static_cast<ossimConnectionEvent*>(&event);
+         ossimConnectionEvent* eventCast = dynamic_cast<ossimConnectionEvent*>(&event);
          
-         connectionEvent(*eventCast);
-         if(event.getId() == OSSIM_EVENT_CONNECTION_DISCONNECT_ID)
+         if(eventCast)
          {
-            if(eventCast->isInputDirection())
-            {
-               disconnectInputEvent(*eventCast);
-            }
-            else if(eventCast->isOutputDirection())
-            {
-               disconnectOutputEvent(*eventCast);
-            }
-            else
-            {
-               ossimNotify(ossimNotifyLevel_WARN) << "ossimConnectableObjectListener::processEvent, Direction not set\n";
-            }
-         }
-         else
-         {
-            ossimConnectionEvent* eventCast = static_cast<ossimConnectionEvent*>(&event);
-            
-            if(eventCast->isInputDirection())
-            {
-               connectInputEvent(*eventCast);
-            }
-            else if(eventCast->isOutputDirection())
+            connectionEvent(*eventCast);
+         
+            if(event.getId() == OSSIM_EVENT_CONNECTION_DISCONNECT_ID)
             {
-               connectOutputEvent(*eventCast);
+               if(eventCast->isInputDirection())
+               {
+                  disconnectInputEvent(*eventCast);
+               }
+               else if(eventCast->isOutputDirection())
+               {
+                  disconnectOutputEvent(*eventCast);
+               }
+               else
+               {
+                  ossimNotify(ossimNotifyLevel_WARN) << "ossimConnectableObjectListener::processEvent, Direction not set\n";
+               }
             }
             else
             {
-               ossimNotify(ossimNotifyLevel_WARN) << "ossimConnectableObjectListener::processEvent, Direction not set\n";
+               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 = static_cast<ossimPropertyEvent*>(&event);
-         propertyEvent(*eventCast);
+         ossimPropertyEvent* eventCast = dynamic_cast<ossimPropertyEvent*>(&event);
+         if(eventCast) propertyEvent(*eventCast);
          break;
       }
       case OSSIM_EVENT_ADD_OBJECT_ID:
       {
-         ossimContainerEvent* eventCast = static_cast<ossimContainerEvent*>(&event);
-         addObjectEvent(*eventCast);
+         ossimContainerEvent* eventCast = dynamic_cast<ossimContainerEvent*>(&event);
+         if(eventCast)
+         {
+            containerEvent(*eventCast);
+            addObjectEvent(*eventCast);
+         }
          break;
       }
       case OSSIM_EVENT_REMOVE_OBJECT_ID:
       {
-         ossimContainerEvent* eventCast = static_cast<ossimContainerEvent*>(&event);
-         removeObjectEvent(*eventCast);
+         ossimContainerEvent* eventCast = dynamic_cast<ossimContainerEvent*>(&event);
+         if(eventCast)
+         {
+            containerEvent(*eventCast);
+            removeObjectEvent(*eventCast);
+         }
          break;
       }
       case OSSIM_EVENT_REFRESH_ID:
       {
-         ossimRefreshEvent* eventCast = static_cast<ossimRefreshEvent*>(&event);
-         refreshEvent(*eventCast);
+         ossimRefreshEvent* eventCast = dynamic_cast<ossimRefreshEvent*>(&event);
+         if(eventCast) refreshEvent(*eventCast);
          break;
       }
       default:
diff --git a/src/ossim/base/ossimContainerEvent.cpp b/src/ossim/base/ossimContainerEvent.cpp
index 27f4e56..9c440c7 100644
--- a/src/ossim/base/ossimContainerEvent.cpp
+++ b/src/ossim/base/ossimContainerEvent.cpp
@@ -7,32 +7,25 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimContainerEvent.cpp 9094 2006-06-13 19:12:40Z dburken $
+// $Id: ossimContainerEvent.cpp 19965 2011-08-16 18:12:15Z gpotts $
 
 #include <ossim/base/ossimContainerEvent.h>
 
 RTTI_DEF1(ossimContainerEvent, "ossimContainerEvent", ossimEvent);
 
-ossimContainerEvent::ossimContainerEvent(ossimObject* obj1,
-                                         ossimObject* obj2,
+ossimContainerEvent::ossimContainerEvent(ossimObject* obj,
                                          long id)
-   :
-   ossimEvent(obj1, id),
-   theAssociatedObject(obj2)
+   :ossimEvent(obj, id)
 {
 }
 
-ossimObject* ossimContainerEvent::getAssociatedObject()
+void ossimContainerEvent::setObjectList(ossimObject* obj)
 {
-   return theAssociatedObject;
+   m_objectList.clear();
+   m_objectList.push_back(obj);
 }
 
-const ossimObject* ossimContainerEvent::getAssociatedObject()const
+void ossimContainerEvent::setObjectList(ObjectList& objects)
 {
-   return theAssociatedObject;
-}
-
-void ossimContainerEvent::setAssociatedObject(ossimObject* obj)
-{
-   theAssociatedObject = obj;
+   m_objectList = objects;
 }
diff --git a/src/ossim/base/ossimContainerProperty.cpp b/src/ossim/base/ossimContainerProperty.cpp
index c76e225..5b3b655 100644
--- a/src/ossim/base/ossimContainerProperty.cpp
+++ b/src/ossim/base/ossimContainerProperty.cpp
@@ -5,9 +5,10 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimContainerProperty.cpp 18405 2010-11-10 20:44:58Z gpotts $
+// $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);
 
@@ -198,3 +199,30 @@ ossimRefPtr<ossimXmlNode> ossimContainerProperty::toXml()const
 
    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/src/ossim/base/ossimDataObject.cpp b/src/ossim/base/ossimDataObject.cpp
index 77ff3a7..b1b2e19 100644
--- a/src/ossim/base/ossimDataObject.cpp
+++ b/src/ossim/base/ossimDataObject.cpp
@@ -7,7 +7,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimDataObject.cpp 15766 2009-10-20 12:37:09Z gpotts $
+// $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>
@@ -155,3 +155,36 @@ std::ostream& ossimDataObject::print(ostream& out) const
 
    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/ossim/base/ossimDatum.cpp b/src/ossim/base/ossimDatum.cpp
index d9650da..1a92d29 100644
--- a/src/ossim/base/ossimDatum.cpp
+++ b/src/ossim/base/ossimDatum.cpp
@@ -7,12 +7,14 @@
 // Description:
 //
 //*******************************************************************
-//  $Id: ossimDatum.cpp 18693 2011-01-17 18:49:15Z dburken $
+//  $Id: ossimDatum.cpp 19795 2011-06-30 15:04:48Z gpotts $
 #include <ossim/base/ossimDatum.h>
 #include <ossim/base/ossimGpt.h>
 #include <ossim/base/ossimEllipsoid.h>
 #include <ossim/base/ossimEpsgDatumFactory.h> // For accessing the EPSG codes
 
+RTTI_DEF1(ossimDatum, "ossimDatum", ossimObject);
+
 ossimDatum::ossimDatum(const ossimString &alpha_code, const ossimString &name,
                        const ossimEllipsoid* anEllipsoid,
                        ossim_float64 sigmaX, ossim_float64 sigmaY, ossim_float64 sigmaZ,
@@ -129,3 +131,86 @@ void ossimDatum::molodenskyShift(double a,
      Lon_out += 2*M_PI;
 }
 
+bool ossimDatum::operator==(const ossimDatum& rhs) const
+{
+   // This method is complicated by the fact that some datums are represented by a precomputed
+   // grid version of the parametric datum.cpp Need to consider these cases. (OLK 02/11)
+   if (theCode == "NAR") // This is the code for gridded NADCON datum
+   {
+      if (!rhs.theCode.contains("NAR"))
+         return false;
+   }
+   else if (rhs.theCode == "NAR")
+   {
+      if (!theCode.contains("NAR"))
+         return false;
+   }
+   else if (theCode == "NAS")
+   {
+      if (!rhs.theCode.contains("NAS"))
+         return false;
+   }
+   else if (rhs.theCode == "NAS")
+   {
+      if (!theCode.contains("NAS"))
+         return false;
+   }
+
+   // Not a grid, so codes must match:
+   else if (theCode != rhs.theCode)
+      return false;
+
+   // Additional EPSG code check after HARN v. parametric caused false positives (OLK 05/11):
+   if ((theEpsgCode != 0) && (rhs.theEpsgCode !=0) && (theEpsgCode != rhs.theEpsgCode))
+      return false;
+
+   // Don't need to check the name since 1:1 relationship with code, code check is sufficient.
+   // This saves the tedium of filtering for NADCON datums as done above.
+   return ((*theEllipsoid == *rhs.theEllipsoid)&&
+      (theSigmaX == rhs.theSigmaX)&&
+      (theSigmaY == rhs.theSigmaY)&&
+      (theSigmaZ == rhs.theSigmaZ)&&
+      (theWestLongitude == rhs.theWestLongitude)&&
+      (theEastLongitude == rhs.theEastLongitude)&&
+      (theSouthLatitude == rhs.theSouthLatitude)&&
+      (theNorthLatitude == rhs.theNorthLatitude));
+}
+
+bool ossimDatum::isEqualTo(const ossimObject& obj, ossimCompareType compareType)const
+{
+   const ossimDatum* rhs = dynamic_cast<const ossimDatum*> (&obj);
+   bool result = rhs&&ossimObject::isEqualTo(obj, compareType);
+   if(result)
+   {
+      result = ((theCode == rhs->theCode)&&
+                (theEpsgCode == rhs->theEpsgCode)&&
+                (theName == rhs->theName)&&
+                (ossim::almostEqual(theSigmaX, rhs->theSigmaX))&&
+                (ossim::almostEqual(theSigmaY, rhs->theSigmaY))&&
+                (ossim::almostEqual(theSigmaZ, rhs->theSigmaZ))&&
+                (ossim::almostEqual(theWestLongitude, rhs->theWestLongitude))&&
+                (ossim::almostEqual(theEastLongitude, rhs->theEastLongitude))&&
+                (ossim::almostEqual(theSouthLatitude, rhs->theSouthLatitude))&&
+                (ossim::almostEqual(theNorthLatitude, rhs->theNorthLatitude)));
+      
+      if(result)
+      {
+         if(theEllipsoid&&rhs->theEllipsoid)
+         {
+            if(compareType == OSSIM_COMPARE_FULL)
+            {
+               result = theEllipsoid->isEqualTo(*rhs->theEllipsoid, compareType);
+            }
+            else 
+            {
+               result = theEllipsoid == rhs->theEllipsoid;
+            }
+         }
+         else if(reinterpret_cast<ossim_uint64>(theEllipsoid) | reinterpret_cast<ossim_uint64>(rhs->theEllipsoid)) // one is null
+         {
+            result = false;
+         }
+      }
+   }
+   return result;
+}
diff --git a/src/ossim/base/ossimDatumFactory.cpp b/src/ossim/base/ossimDatumFactory.cpp
index 1c26a45..43c85c0 100644
--- a/src/ossim/base/ossimDatumFactory.cpp
+++ b/src/ossim/base/ossimDatumFactory.cpp
@@ -1,5 +1,4 @@
 //*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
 //
 // License:  See top level LICENSE.txt file.
 //
@@ -9,11 +8,7 @@
 //
 // This holds the class definition of DatumFactory.
 //*******************************************************************
-//  $Id: ossimDatumFactory.cpp 17815 2010-08-03 13:23:14Z dburken $
-
-
-#include <cstring> /* for strlen */
-#include <utility> /* for std::make_pair */
+//  $Id: ossimDatumFactory.cpp 19682 2011-05-31 14:21:20Z dburken $
 
 #include <ossim/base/ossimDatumFactory.h>
 #include <ossim/base/ossimEllipsoidFactory.h>
@@ -30,6 +25,9 @@
 #include <ossim/base/ossimPreferences.h>
 #include "ossimDatumFactory.inc"
 
+#include <cstring> /* for strlen */
+#include <utility> /* for std::make_pair */
+
 ossimDatumFactory* ossimDatumFactory::theInstance = 0;
 
 static ossimString WGE = "WGE";
@@ -61,7 +59,7 @@ const ossimDatum* ossimDatumFactory::create(const ossimString &code)const
 {
    if ( code.size() )
    {
-      std::map<ossimString, const ossimDatum*>::const_iterator datum = theDatumTable.find(code);
+      std::map<std::string, const ossimDatum*>::const_iterator datum = theDatumTable.find(code);
       
       if(datum != theDatumTable.end())
       {
@@ -107,12 +105,12 @@ const ossimDatum* ossimDatumFactory::create(const ossimDatum* aDatum)const
 
 std::vector<ossimString> ossimDatumFactory::getList()const
 {
-   std::map<ossimString, const ossimDatum*>::const_iterator datum = theDatumTable.begin();
+   std::map<std::string, const ossimDatum*>::const_iterator datum = theDatumTable.begin();
    std::vector<ossimString> result;
 
    while(datum != theDatumTable.end())
    {
-      result.push_back((*datum).first);
+      result.push_back(ossimString((*datum).first) );
       ++datum;
    }
    return result;
@@ -120,25 +118,24 @@ std::vector<ossimString> ossimDatumFactory::getList()const
 
 void ossimDatumFactory::getList(std::vector<ossimString>& list) const
 {
-   std::map<ossimString, const ossimDatum*>::const_iterator datum =
+   std::map<std::string, const ossimDatum*>::const_iterator datum =
       theDatumTable.begin();
 
    while(datum != theDatumTable.end())
    {
-      list.push_back((*datum).first);
+      list.push_back( ossimString((*datum).first) );
       ++datum;
    }
 }
 
 void ossimDatumFactory::deleteAll()
 {   
-   std::map<ossimString, const ossimDatum*>::iterator datum;
+   std::map<std::string, const ossimDatum*>::iterator datum;
 
    datum = theDatumTable.begin();
    while(datum != theDatumTable.end())
    {
       delete ((*datum).second);
-
       ++datum;
    }
 
@@ -149,16 +146,16 @@ void ossimDatumFactory::deleteAll()
 void ossimDatumFactory::initializeDefaults()
 {
    //make the standards
-   theDatumTable.insert(make_pair(ossimString(WGE), new ossimWgs84Datum));
-   theDatumTable.insert(make_pair(ossimString(WGD), new ossimWgs72Datum));
+   theDatumTable.insert(std::make_pair(WGE.string(), new ossimWgs84Datum));
+   theDatumTable.insert(std::make_pair(WGD.string(), new ossimWgs72Datum));
 
    ossim_uint32 idx = 0;     
    while( std::strlen(threeParamDatum[idx].theCode) )
    {
-      if( (threeParamDatum[idx].theCode != ossimString(WGE)) &&
-         (threeParamDatum[idx].theCode != ossimString(WGD)) )
+      if( (threeParamDatum[idx].theCode != WGE) &&
+          (threeParamDatum[idx].theCode != WGD) )
       {
-         theDatumTable.insert(std::make_pair(threeParamDatum[idx].theCode, 
+         theDatumTable.insert(std::make_pair(std::string(threeParamDatum[idx].theCode), 
             new ossimThreeParamDatum(threeParamDatum[idx].theCode, 
             threeParamDatum[idx].theName,
             ossimEllipsoidFactory::instance()->create(ossimString(threeParamDatum[idx].theEllipsoidCode)),
@@ -179,7 +176,7 @@ void ossimDatumFactory::initializeDefaults()
    idx = 0;
    while( std::strlen(sevenParamDatum[idx].theCode) )
    {
-      theDatumTable.insert(std::make_pair(sevenParamDatum[idx].theCode, 
+      theDatumTable.insert(std::make_pair(std::string(sevenParamDatum[idx].theCode), 
          new ossimSevenParamDatum(sevenParamDatum[idx].theCode, 
          sevenParamDatum[idx].theName,
          ossimEllipsoidFactory::instance()->create(ossimString(sevenParamDatum[idx].theEllipsoidCode)),
@@ -215,8 +212,8 @@ void ossimDatumFactory::initializeDefaults()
 
       if (fileTest1.exists() && fileTest2.exists())
       {
-         theDatumTable.insert(std::make_pair(ossimString("NAS"), new ossimNadconNasDatum(file)));
-         theDatumTable.insert(std::make_pair(ossimString("NAR"), new ossimNadconNarDatum(file)));
+         theDatumTable.insert(std::make_pair(std::string("NAS"), new ossimNadconNasDatum(file)));
+         theDatumTable.insert(std::make_pair(std::string("NAR"), new ossimNadconNarDatum(file)));
       }
    }
 }
@@ -268,7 +265,7 @@ void ossimDatumFactory::writeCStructure(const ossimFilename& /*file*/)
    out << "#define NUMBER_OF_SEVEN_PARAM_DATUMS " << 2 << std::endl;
    if(out)
    {
-      std::map<ossimString, const ossimDatum*>::iterator datum;
+      std::map<std::string, const ossimDatum*>::iterator datum;
       out << "static ossimThreeParamDatumType threeParamDatum[] = {\n";
       datum = theDatumTable.begin();
       ossim_uint32 datumCount = 0;
diff --git a/src/ossim/base/ossimDblGrid.cpp b/src/ossim/base/ossimDblGrid.cpp
index d385c9f..99ddbe1 100644
--- a/src/ossim/base/ossimDblGrid.cpp
+++ b/src/ossim/base/ossimDblGrid.cpp
@@ -12,7 +12,7 @@
 //   system. 
 //
 //*****************************************************************************
-//  $Id: ossimDblGrid.cpp 18693 2011-01-17 18:49:15Z dburken $
+//  $Id: ossimDblGrid.cpp 20204 2011-11-04 15:12:28Z dburken $
 
 #include <cstring>
 #include <climits>
@@ -48,7 +48,7 @@ theMinValue       (OSSIM_DEFAULT_MIN_PIX_DOUBLE),
 theMaxValue       (OSSIM_DEFAULT_MAX_PIX_DOUBLE),
 theNullValue      (OSSIM_DEFAULT_NULL_PIX_DOUBLE),
 theMeanIsComputed (false),
-theExtrapIsEnabled (false),
+theExtrapIsEnabled (true),
 theDomainType     (CONTINUOUS)
 { }
 
@@ -62,7 +62,7 @@ ossimDblGrid::ossimDblGrid(const ossimDblGrid&  source)
 theGridData   (0),
 theMinValue   (OSSIM_DEFAULT_MIN_PIX_DOUBLE),
 theMaxValue   (OSSIM_DEFAULT_MAX_PIX_DOUBLE),
-theExtrapIsEnabled (false),
+theExtrapIsEnabled (true),
 theDomainType (CONTINUOUS)
 {
    static const char MODULE[] = "ossimDblGrid Constructor";
@@ -93,7 +93,7 @@ ossimDblGrid::ossimDblGrid(const ossimIpt&  size,
 theGridData   (0),
 theMinValue   (OSSIM_DEFAULT_MIN_PIX_DOUBLE),
 theMaxValue   (OSSIM_DEFAULT_MAX_PIX_DOUBLE),
-theExtrapIsEnabled (false),
+theExtrapIsEnabled (true),
 theDomainType (CONTINUOUS)
 {
    static const char MODULE[] = "ossimDblGrid Constructor";
@@ -115,7 +115,7 @@ ossimDblGrid::ossimDblGrid(const ossimDrect&  rect,
 theGridData   (0),
 theMinValue   (OSSIM_DEFAULT_MIN_PIX_DOUBLE),
 theMaxValue   (OSSIM_DEFAULT_MAX_PIX_DOUBLE),
-theExtrapIsEnabled (false),
+theExtrapIsEnabled (true),
 theDomainType (CONTINUOUS)
 {
    static const char MODULE[] = "ossimDblGrid Constructor";
@@ -215,21 +215,6 @@ void ossimDblGrid::initialize(const ossimDrect&  uv_rect,
 }
 
 //**************************************************************************************************
-//  Computes quantities referenced for extrapolation. This only needs to be called if extrapolation
-//  service is needed. The grid initialization must be completed before calling this method.
-//
-//  Note, the partials are computed using only adjacent grid points. In the future we may want to 
-//  use the filter() function to smooth out local noise.
-//**************************************************************************************************
-void ossimDblGrid::enableExtrapolation()
-{
-   // Clear out prior data:
-   theExtrapIsEnabled = false;
-   if ((theSize.x > 2) && (theSize.y > 2))
-      theExtrapIsEnabled = true;
-}
-
-//**************************************************************************************************
 void ossimDblGrid::deallocate()
 {
    if(theGridData)
@@ -355,6 +340,8 @@ double ossimDblGrid::operator() (const double& u, const double& v) const
 //*************************************************************************************************
 double ossimDblGrid::interpolate(double xi, double yi) const
 {
+   if(!theGridData) 
+      return theNullValue;
 
    // Establish the grid cell origin indices:
    int x0 = (int) xi;
@@ -430,9 +417,12 @@ double ossimDblGrid::interpolate(double xi, double yi) const
 //**************************************************************************************************
 double ossimDblGrid::extrapolate(double x, double y) const
 {
-   double dx=0, dy=0, dR_dx=0, dR_dy=0, R0;
+   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:
@@ -1095,7 +1085,7 @@ void ossimDblGrid::filter(int size_x, int size_y, double* kernel)
    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      node_idx, resample_node_idx;
+   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.
@@ -1111,7 +1101,6 @@ void ossimDblGrid::filter(int size_x, int size_y, double* kernel)
    {
       for (int x=start_x; x<end_x; x++)
       {
-         node_idx = index(x, y);
          resample_node_idx = resample_grid.index(x-start_x, y-start_y);
       
          // Fetch samples for each kernel element, apply gain, then accumulate
diff --git a/src/ossim/base/ossimDirectory.cpp b/src/ossim/base/ossimDirectory.cpp
index 18b98ba..cc7a61b 100644
--- a/src/ossim/base/ossimDirectory.cpp
+++ b/src/ossim/base/ossimDirectory.cpp
@@ -10,7 +10,7 @@
 // Description: A brief description of the contents of the file.
 //
 //*************************************************************************
-// $Id: ossimDirectory.cpp 14776 2009-06-25 14:34:06Z dburken $
+// $Id: ossimDirectory.cpp 20229 2011-11-08 17:01:17Z oscarkramer $
 
 #include <cstring> /* for strncasecmp */
 #include <iostream>
@@ -110,6 +110,7 @@ bool ossimDirectory::getFirst(ossimFilename &filename, int flags)
          else
          {
             // no more file in the directory
+            filename.clear();
             return false;
          }
       }
@@ -138,6 +139,7 @@ bool ossimDirectory::getNext(ossimFilename &filename) const
       else
       {
          // no more file in the directory
+         filename.clear();
          return false;
       }
    }
@@ -153,10 +155,10 @@ bool ossimDirectory::getNext(ossimFilename &filename) const
 
 bool ossimDirectory::fileMatched(ossimFilename &filename) const
 {
-   bool matches=false;
+   bool matches = false;
 
-   // don't return "." and ".." unless asked for
-   if ( (filename == "..") || (filename == ".")   )
+   // Don't return "." and ".." unless asked for.
+   if ( (filename.file() == "..") || (filename.file() == ".")   )
    {
       if (theFlags & ossimDirectory::OSSIM_DIR_DOTDOT)
       {
@@ -171,17 +173,13 @@ bool ossimDirectory::fileMatched(ossimFilename &filename) const
    {
       matches = true;
    }
-   else
-   {
-      matches = false;
-   }
 
    return matches;
 }
 
 bool ossimDirectory::isOpened() const
 {
-	return theDirectoryName.isDir();
+   return theDirectoryName.isDir();
     //return theData != 0;
 }
 
diff --git a/src/ossim/base/ossimDms.cpp b/src/ossim/base/ossimDms.cpp
index 72459ef..ba77c09 100644
--- a/src/ossim/base/ossimDms.cpp
+++ b/src/ossim/base/ossimDms.cpp
@@ -8,7 +8,7 @@
 //
 // Contains class definition for Degrees Minutes Seconds (ossimDms)
 //*******************************************************************
-//  $Id: ossimDms.cpp 17503 2010-06-02 11:18:49Z dburken $
+//  $Id: ossimDms.cpp 19682 2011-05-31 14:21:20Z dburken $
 
 #include <cctype> /* for isspace */
 #include <cmath>
@@ -294,7 +294,7 @@ bool ossimDms::setDegrees(const std::string& cdegrees)
 ossimString ossimDms::toString(const ossimString& formatString)const
 {
    ossimString result="";
-   ossimString::const_iterator stringIter;
+   std::string::const_iterator stringIter;
    ossimString tempFormatString = formatString;
    if(formatString == ossimString(""))
    {
@@ -613,8 +613,8 @@ ossimString ossimDms::degree_to_string(double degrees,
 
 
 void ossimDms::calc_mins_or_secs(double *dd,
-                            ossimString::const_iterator &formatIter,
-                            ossimString &result)const
+                                 std::string::const_iterator& formatIter,
+                                 std::string& result)const
 {
 	double du;
 	int ufactor, ires, numunits;
diff --git a/src/ossim/base/ossimDpt.cpp b/src/ossim/base/ossimDpt.cpp
index 1d8c071..4ca9b9b 100644
--- a/src/ossim/base/ossimDpt.cpp
+++ b/src/ossim/base/ossimDpt.cpp
@@ -8,7 +8,7 @@
 // Contains class definitions for ossimDpt.
 // 
 //*******************************************************************
-//  $Id: ossimDpt.cpp 15766 2009-10-20 12:37:09Z gpotts $
+//  $Id: ossimDpt.cpp 20204 2011-11-04 15:12:28Z dburken $
 
 #include <iostream>
 #include <iomanip>
@@ -150,6 +150,13 @@ std::ostream& operator<<(std::ostream& os, const ossimDpt& pt)
    return pt.print(os);
 }
 
+bool ossimDpt::isEqualTo(const ossimDpt& rhs, ossimCompareType /* compareType */)const
+{
+   if(rhs.isNan()&&isNan()) return true;
+   return (ossim::almostEqual(x, rhs.x)&&
+           ossim::almostEqual(y, rhs.y));
+}
+
 ossimString ossimDpt::toString(ossim_uint32 precision) const
 {
    std::ostringstream os;
diff --git a/src/ossim/base/ossimDrect.cpp b/src/ossim/base/ossimDrect.cpp
index 82e93de..7131f6a 100644
--- a/src/ossim/base/ossimDrect.cpp
+++ b/src/ossim/base/ossimDrect.cpp
@@ -1,5 +1,4 @@
 //*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
 //
 // License:  LGPL
 // 
@@ -11,7 +10,7 @@
 //
 // Contains class definition for ossimDrect.
 //*******************************************************************
-//  $Id: ossimDrect.cpp 19180 2011-03-22 17:36:33Z oscarkramer $
+//  $Id: ossimDrect.cpp 21560 2012-08-30 12:09:03Z gpotts $
 
 #include <iostream>
 #include <sstream>
@@ -19,6 +18,8 @@
 #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.
@@ -31,57 +32,57 @@ clip_1d (double *x0,
 	 double *y1, 
 	 double maxdim)
 {
-  double m;			/* gradient of line */
-  if (*x0 < 0)
-    {				/* start of line is left of window */
+   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;
+         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;
-	}
+      {
+         *y1 += m * (maxdim - *x1);
+         *x1 = maxdim;
+      }
       return 1;
-    }
-  if (*x0 > maxdim)
-    {				/* start of line is right of window -
+   }
+   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;
+         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;
-	}
+      {
+         *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 */
+   }
+   /* 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 */
+   }
+   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;
+   }
+   /* only get here if both points are inside the window */
+   return 1;
 }
 
 //*******************************************************************
@@ -522,7 +523,7 @@ ossimString ossimDrect::toString()const
    }
    else 
    {
-      ossimIpt origin = ll();
+      ossimDpt origin = ll();
       result += (ossimString::toString(origin.x) + ",");
       result += (ossimString::toString(origin.y) + ",");
       result += (ossimString::toString(width()) + ",");
@@ -540,7 +541,7 @@ bool ossimDrect::toRect(const ossimString& rectString)
    
    
    std::istringstream in(rectString);
-   in >> ossim::skipws;
+   ossim::skipws(in);
    char charString[2];
    charString[1] = '\0';
    ossimString interior;
@@ -596,6 +597,33 @@ bool ossimDrect::toRect(const ossimString& rectString)
    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
 //*******************************************************************
@@ -630,89 +658,22 @@ bool ossimDrect::clip(ossimDpt &p1, ossimDpt &p2)const
    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)
-    {
+   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)
-    {
+   }
+   if(clip_1d (&tempShiftP1.y, 
+               &tempShiftP1.x, 
+               &tempShiftP2.y, 
+               &tempShiftP2.x, maxH) == 0)
+   {
       return false;
-    }
-  p1 = tempShiftP1-shift;
-  p2 = tempShiftP2-shift;
-  return true;
-//   bool done    = false;
-   
-//    long p1Code = getCode(p1, (*this));
-//    long p2Code = getCode(p2, (*this));
-//    long codeOut;
-
-//    do{
-
-//       if((!p1Code) && (!p2Code))
-//       {
-//          visible = true;
-//          done    = true;
-//       }
-//       else if(p1Code&p2Code)
-//       {
-//          done    = true;
-//       }
-//       else
-//       {
-//          if(p1Code)
-//          {
-//             codeOut = p1Code;
-//          }
-//          else
-//          {
-//             codeOut = p2Code;
-//          }
-        
-//          if(codeOut&TOP) // divide rect at the top
-//          {
-//             tempPt.x = p1.x + (p2.x - p1.x)*
-//                        ((*this).ul().y - p1.y)/(p2.y - p1.y);
-//             tempPt.y = (*this).ul().y;
-//          }
-//          else if(codeOut&BOTTOM)
-//          {
-//             tempPt.x = p1.x + (p2.x - p1.x)*
-//                        ((*this).lr().y - p1.y)/(p2.y - p1.y);
-//             tempPt.y = (*this).lr().y;
-//          }
-//          else if(codeOut&RIGHT)
-//          {
-//             tempPt.y = p1.y + (p2.y - p1.y)*
-//                        ((*this).lr().x - p1.x)/(p2.x - p1.x);
-//             tempPt.x = (*this).lr().x;
-//          }
-//          else if(codeOut&LEFT)
-//          {
-//             tempPt.y = p1.y + (p2.y - p1.y)*
-//                        ((*this).ul().x - p1.x)/(p2.x - p1.x);
-//             tempPt.x = (*this).ul().x;
-//          }
-//          if(codeOut == p1Code)
-//          {
-//             p1.x = tempPt.x;
-//             p1.y = tempPt.y;
-//             p1Code = getCode(p1, (*this));
-//          }
-//          else
-//          {
-//             p2.x = tempPt.x;
-//             p2.y = tempPt.y;
-//             p2Code = getCode(p2, (*this));
-//          }
-//       }
-//    }while(!done);
-//    return visible;
+   }
+   p1 = tempShiftP1-shift;
+   p2 = tempShiftP2-shift;
+   return true;
 }
 
 //*******************************************************************
diff --git a/src/ossim/base/ossimEllipsoid.cpp b/src/ossim/base/ossimEllipsoid.cpp
index 4ca8cbc..20e8647 100644
--- a/src/ossim/base/ossimEllipsoid.cpp
+++ b/src/ossim/base/ossimEllipsoid.cpp
@@ -13,9 +13,10 @@
 //              Initial coding.
 //<
 //*****************************************************************************
-//  $Id: ossimEllipsoid.cpp 18693 2011-01-17 18:49:15Z dburken $
+//  $Id: ossimEllipsoid.cpp 21164 2012-06-24 20:17:58Z dhicks $
 
 #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>
@@ -61,15 +62,18 @@ ossimEllipsoid::ossimEllipsoid(const ossimEllipsoid &ellipsoid)
 ossimEllipsoid::ossimEllipsoid(const ossimString &name,
                                const ossimString &code,
                                const double &a,
-                               const double &b)
+                               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();   
@@ -235,14 +239,17 @@ bool ossimEllipsoid::nearestIntersection(const ossimEcefRay& ray,
    //***
    // 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 = false;
+//    if (t >= 0)
+//    {
+//       rtnval = true;
+//       rtnPt  = ray.extend(t); 
+// //       rtnPt  = ray.extend(t*theA); 
+//    }
       
+   bool rtnval = true;
+   rtnPt  = ray.extend(t); 
+
    return rtnval; 
 }
 
@@ -496,6 +503,24 @@ double ossimEllipsoid::geodeticRadius(const double& lat) const
    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
 {
diff --git a/src/ossim/base/ossimEllipsoidFactory.cpp b/src/ossim/base/ossimEllipsoidFactory.cpp
index ab77e5b..8db95b3 100644
--- a/src/ossim/base/ossimEllipsoidFactory.cpp
+++ b/src/ossim/base/ossimEllipsoidFactory.cpp
@@ -7,7 +7,7 @@
 // Author:  Garrett Potts
 // 
 //*******************************************************************
-//  $Id: ossimEllipsoidFactory.cpp 17815 2010-08-03 13:23:14Z dburken $
+//  $Id: ossimEllipsoidFactory.cpp 19682 2011-05-31 14:21:20Z dburken $
 
 #include <ossim/base/ossimEllipsoidFactory.h>
 #include <ossim/base/ossimEllipsoid.h>
@@ -40,134 +40,146 @@ ossimEllipsoidFactory::~ossimEllipsoidFactory()
 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.size() )
-   {
-      ossimString alphaCode;
+   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;
          }
-      }
-      else
-      {
-         // Alpha code was specified, try to establish an equivalent EPSG code:
-         alphaCode = code;
-         epsg_code = findEpsgCode(alphaCode);
-      }
 
       // Established two-letter code. Now fetch the ellipsoid instance:
-      ossimEllipsoid* ellipsoid = 0;
       TableType::const_iterator iter = theEllipsoidTable.find(alphaCode);
       if(iter != theEllipsoidTable.end())
-      {
          ellipsoid = iter->second;
-         if (ellipsoid)
-         {
-            ellipsoid->setEpsgCode(epsg_code);
-         }
-         return ellipsoid;
-      }
       else
       {
          ossimNotify(ossimNotifyLevel_WARN) << "ossimEllipsoidFactory::create WARNING:"
             << "\nDid not create ellipsoid for code: " << code << std::endl;
       }
-   }
    
-   return 0;
+   return ellipsoid;
 }
 
 void ossimEllipsoidFactory::initializeTable()
 {
-   if(theEllipsoidTable.size()<1)
-   {
-      theEllipsoidTable.insert(std::make_pair(ossimString("AA"),
-         new ossimEllipsoid(ossimString("Airy"), ossimString("AA"), 6377563.396, 6356256.9090)));   
-      theEllipsoidTable.insert(std::make_pair(ossimString("AM"),
-         new ossimEllipsoid(ossimString("Modified Airy"), ossimString("AM"), 6377340.189, 6356034.448)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("AN"),
-         new ossimEllipsoid(ossimString("Australian National"), ossimString("AN"), 6378160.000, 6356774.7190)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("BR"),
-         new ossimEllipsoid(ossimString("Bessel 1841"), ossimString("BR"), 6377397.155, 6356078.9630)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("BN"),
-         new ossimEllipsoid(ossimString("Bessel 1841(Namibia)"), ossimString("BN"), 6377483.865, 6356165.3830)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("CC"),
-         new ossimEllipsoid(ossimString("Clarke 1866"), ossimString("CC"), 6378206.400, 6356583.8000)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("CD"),
-         new ossimEllipsoid(ossimString("Clarke 1880"), ossimString("CD"), 6378249.145, 6356514.8700)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("CE"),
-         new ossimEllipsoid(ossimString("Clarke 1880 (IGN)EPSG 7011"), ossimString("CE"), 6378249.200, 6356515.0000)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("EA"),
-         new ossimEllipsoid(ossimString("Everest"), ossimString("EA"), 6377276.345, 6356075.4130)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("EB"),
-         new ossimEllipsoid(ossimString("Everest (E. Malasia, Brunei)"), ossimString("EB"), 6377298.556, 6356097.55)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("EC"),
-         new ossimEllipsoid(ossimString("Everest 1956 (India)"), ossimString("EC"), 6377301.243, 6356100.228)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("ED"),
-         new ossimEllipsoid(ossimString("Everest 1969 (West Malasia)"), ossimString("ED"), 6377295.664, 6356094.668)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("EE"),
-         new ossimEllipsoid(ossimString("Everest 1948(W.Mals. & Sing.)"), ossimString("EE"), 6377304.063, 6356103.039)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("EF"),
-         new ossimEllipsoid(ossimString("Everest (Pakistan)"), ossimString("EF"), 6377309.613, 6356109.571)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("FA"),
-         new ossimEllipsoid(ossimString("Mod. Fischer 1960(South Asia)"), ossimString("FA"), 6378155.0, 6356773.32)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("RF"),
-         new ossimEllipsoid(ossimString("GRS 80"), ossimString("RF"), 6378137.0, 6356752.3141)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("HE"),
-         new ossimEllipsoid(ossimString("Helmert 1906"), ossimString("HE"), 6378200.0, 6356818.17)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("HO"),
-         new ossimEllipsoid(ossimString("Hough"), ossimString("HO"), 6378270.0, 6356794.3430)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("ID"),
-         new ossimEllipsoid(ossimString("Indonesian 1974"), ossimString("ID"), 6378160.0, 6356774.504)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("IN"),
-         new ossimEllipsoid(ossimString("International 1924"), ossimString("IN"), 6378388.0, 6356911.946)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("KA"),
-         new ossimEllipsoid(ossimString("Krassovsky"), ossimString("KA"), 6378245.0, 6356863.0190)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("SA"),
-         new ossimEllipsoid(ossimString("South American 1969"),ossimString("SA"), 6378160.0, 6356774.719)));
-      theEllipsoidTable.insert(std::make_pair(ossimString("WD"),
-         new ossimEllipsoid(ossimString("WGS 72"), ossimString("WD"), 6378135.000, 6356750.5200)));
-
-      theEllipsoidTable.insert(std::make_pair(ossimString("WE"),
-         new ossimEllipsoid(ossimString("WGS 84"), ossimString("WE"), 6378137.000, 6356752.3142)));
-      
-      theEllipsoidTable.insert(std::make_pair(ossimString("PV"),
-         new ossimEllipsoid(ossimString("Popular Visualisation Sphere"), ossimString("7059"), 6378137.000, 6378137.000)));
-
-      theWgs84Ellipsoid = new ossimEllipsoid(ossimString("WGS 84"), ossimString("WE"), 6378137.000, 6356752.3142);
-      theWgs72Ellipsoid = new ossimEllipsoid(ossimString("WGS 72"), ossimString("WD"), 6378135.000, 6356750.5200);
-
-      // This table bridges between EPSG 7000-series codes to two-letter code:
-      theEpsgTable.insert(std::make_pair(7001, ossimString("AA")));   
-      theEpsgTable.insert(std::make_pair(7002, ossimString("AM")));
-      theEpsgTable.insert(std::make_pair(7003, ossimString("AN")));
-      theEpsgTable.insert(std::make_pair(7004, ossimString("BR")));
-      theEpsgTable.insert(std::make_pair(7006, ossimString("BN")));
-      theEpsgTable.insert(std::make_pair(7008, ossimString("CC")));
-      theEpsgTable.insert(std::make_pair(7012, ossimString("CD")));
-      theEpsgTable.insert(std::make_pair(7011, ossimString("CE")));
-      theEpsgTable.insert(std::make_pair(7015, ossimString("EA")));
-      theEpsgTable.insert(std::make_pair(7016, ossimString("EB")));
-      theEpsgTable.insert(std::make_pair(7044, ossimString("EC")));
-      theEpsgTable.insert(std::make_pair(7056, ossimString("ED")));
-      theEpsgTable.insert(std::make_pair(7018, ossimString("EE")));
-      theEpsgTable.insert(std::make_pair(7019, ossimString("RF")));
-      theEpsgTable.insert(std::make_pair(7020, ossimString("HE")));
-      theEpsgTable.insert(std::make_pair(7053, ossimString("HO")));
-      theEpsgTable.insert(std::make_pair(7021, ossimString("ID")));
-      theEpsgTable.insert(std::make_pair(7022, ossimString("IN")));
-      theEpsgTable.insert(std::make_pair(7024, ossimString("KA")));
-      theEpsgTable.insert(std::make_pair(7003, ossimString("SA"))); // Same as "AN"
-      theEpsgTable.insert(std::make_pair(7043, ossimString("WD")));
-      theEpsgTable.insert(std::make_pair(7030, ossimString("WE")));
-      theEpsgTable.insert(std::make_pair(7059, ossimString("PV")));
-   }
+   // 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)));
+      theEllipsoidTable.insert(std::make_pair(std::string("EF"),
+      new ossimEllipsoid(std::string("Everest (Pakistan)"), std::string("EF"), 
+      6377309.613, 6356109.571)));
+      theEllipsoidTable.insert(std::make_pair(std::string("FA"),
+      new ossimEllipsoid(std::string("Mod. Fischer 1960(South Asia)"), std::string("FA"), 
+      6378155.0, 6356773.32)));
+      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()
@@ -208,7 +220,7 @@ ossim_uint32 ossimEllipsoidFactory::findEpsgCode(const ossimString& alpha_code)
    EpsgTableType::const_iterator iter = theEpsgTable.begin();
    while ((iter != theEpsgTable.end()) && (epsg_code == 0))
    {
-      if (iter->second == alpha_code)
+      if (iter->second == alpha_code.string())
       {
          epsg_code = iter->first;
       }
diff --git a/src/ossim/base/ossimEndian.cpp b/src/ossim/base/ossimEndian.cpp
index 3d969bf..e4bdf88 100644
--- a/src/ossim/base/ossimEndian.cpp
+++ b/src/ossim/base/ossimEndian.cpp
@@ -8,7 +8,7 @@
 //              endian byte swap routines.
 //
 //***********************************
-// $Id: ossimEndian.cpp 11678 2007-09-07 12:06:19Z dburken $
+// $Id: ossimEndian.cpp 22197 2013-03-12 02:00:55Z dburken $
 
 #include <ossim/base/ossimEndian.h>
 
@@ -21,5 +21,3 @@ ossimEndian::ossimEndian()
    testPtr       = reinterpret_cast<unsigned char*>(&test);
    theSystemEndianType = testPtr[0] ? OSSIM_LITTLE_ENDIAN : OSSIM_BIG_ENDIAN;
 }
-
-
diff --git a/src/ossim/base/ossimEpsgDatumFactory.cpp b/src/ossim/base/ossimEpsgDatumFactory.cpp
index b939f83..60f0baf 100644
--- a/src/ossim/base/ossimEpsgDatumFactory.cpp
+++ b/src/ossim/base/ossimEpsgDatumFactory.cpp
@@ -11,9 +11,6 @@
 //*************************************************************************************************
 //  $Id$
 
-#include <cstring> /* for strlen */
-#include <utility> /* for std::make_pair */
-
 #include <ossim/base/ossimEpsgDatumFactory.h>
 #include <ossim/base/ossimEllipsoidFactory.h>
 #include <ossim/base/ossimDatum.h>
@@ -42,74 +39,74 @@ ossimEpsgDatumFactory* ossimEpsgDatumFactory::instance()
 //*************************************************************************************************
 ossimEpsgDatumFactory::ossimEpsgDatumFactory()
 {
-   m_epsgToAlphaMap.insert(std::make_pair(6135, ossimString("OHI-M"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6139, ossimString("PUR"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6152, ossimString("NAR"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6154, ossimString("EUR-M"))); // QUESTIONABLE  
-   m_epsgToAlphaMap.insert(std::make_pair(6155, ossimString("DAL"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6156, ossimString("CCD"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6158, ossimString("NAP"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6165, ossimString("BID"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6169, ossimString("AMA"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6175, ossimString("SRL")));   // QUESTIONABLE 
-   m_epsgToAlphaMap.insert(std::make_pair(6201, ossimString("ADI-M"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6202, ossimString("AUA"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6203, ossimString("AUG"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6204, ossimString("AIN-A"))); // QUESTIONABLE 
-   m_epsgToAlphaMap.insert(std::make_pair(6205, ossimString("AFG"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6209, ossimString("ARF-M"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6210, ossimString("ARS-M"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6216, ossimString("BER"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6218, ossimString("BOO")));   // QUESTIONABLE 
-   m_epsgToAlphaMap.insert(std::make_pair(6219, ossimString("BUR"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6221, ossimString("CAI"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6222, ossimString("CAP"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6223, ossimString("CGE"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6224, ossimString("CHU"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6236, ossimString("HTN"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6238, ossimString("IDN"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6239, ossimString("INF-A"))); // QUESTIONABLE 
-   m_epsgToAlphaMap.insert(std::make_pair(6240, ossimString("INH-A"))); // QUESTIONABLE 
-   m_epsgToAlphaMap.insert(std::make_pair(6244, ossimString("KAN"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6245, ossimString("KEA"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6248, ossimString("PRP-M"))); // QUESTIONABLE 
-   m_epsgToAlphaMap.insert(std::make_pair(6250, ossimString("LEH"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6251, ossimString("LIB"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6253, ossimString("LUZ-A"))); // QUESTIONABLE 
-   m_epsgToAlphaMap.insert(std::make_pair(6255, ossimString("HEN"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6256, ossimString("MIK"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6261, ossimString("MER"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6262, ossimString("MAS"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6263, ossimString("MIN-A"))); // QUESTIONABLE 
-   m_epsgToAlphaMap.insert(std::make_pair(6266, ossimString("MPO"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6267, ossimString("NAS-C"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6269, ossimString("NAR-C"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6270, ossimString("NAH-C"))); // QUESTIONABLE
-   m_epsgToAlphaMap.insert(std::make_pair(6282, ossimString("PTN"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6284, ossimString("PUK"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6285, ossimString("QAT")));   // QUESTIONABLE
-   m_epsgToAlphaMap.insert(std::make_pair(6287, ossimString("QUO"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6292, ossimString("SAP"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6293, ossimString("SCK"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6297, ossimString("TAN"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6298, ossimString("TIL"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6301, ossimString("TOY-M"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6304, ossimString("VOI")));   // QUESTIONABLE 
-   m_epsgToAlphaMap.insert(std::make_pair(6307, ossimString("NSD"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6309, ossimString("YAC"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6311, ossimString("ZAN"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6322, ossimString("WGD"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6326, ossimString("WGE"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6601, ossimString("AIA"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6604, ossimString("ASM"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6611, ossimString("HKD")));   // QUESTIONABLE
-   m_epsgToAlphaMap.insert(std::make_pair(6613, ossimString("GSE"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6615, ossimString("POS"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6616, ossimString("SGM"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6618, ossimString("SAN-M"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6658, ossimString("HJO"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6668, ossimString("EUS"))); 
-   m_epsgToAlphaMap.insert(std::make_pair(6807, ossimString("NTF"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6135, std::string("OHI-M"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6139, std::string("PUR"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6152, std::string("NAR"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6154, std::string("EUR-M"))); // QUESTIONABLE  
+   m_epsgToAlphaMap.insert(std::make_pair(6155, std::string("DAL"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6156, std::string("CCD"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6158, std::string("NAP"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6165, std::string("BID"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6169, std::string("AMA"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6175, std::string("SRL")));   // QUESTIONABLE 
+   m_epsgToAlphaMap.insert(std::make_pair(6201, std::string("ADI-M"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6202, std::string("AUA"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6203, std::string("AUG"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6204, std::string("AIN-A"))); // QUESTIONABLE 
+   m_epsgToAlphaMap.insert(std::make_pair(6205, std::string("AFG"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6209, std::string("ARF-M"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6210, std::string("ARS-M"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6216, std::string("BER"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6218, std::string("BOO")));   // QUESTIONABLE 
+   m_epsgToAlphaMap.insert(std::make_pair(6219, std::string("BUR"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6221, std::string("CAI"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6222, std::string("CAP"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6223, std::string("CGE"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6224, std::string("CHU"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6236, std::string("HTN"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6238, std::string("IDN"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6239, std::string("INF-A"))); // QUESTIONABLE 
+   m_epsgToAlphaMap.insert(std::make_pair(6240, std::string("INH-A"))); // QUESTIONABLE 
+   m_epsgToAlphaMap.insert(std::make_pair(6244, std::string("KAN"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6245, std::string("KEA"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6248, std::string("PRP-M"))); // QUESTIONABLE 
+   m_epsgToAlphaMap.insert(std::make_pair(6250, std::string("LEH"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6251, std::string("LIB"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6253, std::string("LUZ-A"))); // QUESTIONABLE 
+   m_epsgToAlphaMap.insert(std::make_pair(6255, std::string("HEN"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6256, std::string("MIK"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6261, std::string("MER"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6262, std::string("MAS"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6263, std::string("MIN-A"))); // QUESTIONABLE 
+   m_epsgToAlphaMap.insert(std::make_pair(6266, std::string("MPO"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6267, std::string("NAS-C"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6269, std::string("NAR-C"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6270, std::string("NAH-C"))); // QUESTIONABLE
+   m_epsgToAlphaMap.insert(std::make_pair(6282, std::string("PTN"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6284, std::string("PUK"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6285, std::string("QAT")));   // QUESTIONABLE
+   m_epsgToAlphaMap.insert(std::make_pair(6287, std::string("QUO"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6292, std::string("SAP"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6293, std::string("SCK"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6297, std::string("TAN"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6298, std::string("TIL"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6301, std::string("TOY-M"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6304, std::string("VOI")));   // QUESTIONABLE 
+   m_epsgToAlphaMap.insert(std::make_pair(6307, std::string("NSD"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6309, std::string("YAC"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6311, std::string("ZAN"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6322, std::string("WGD"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6326, std::string("WGE"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6601, std::string("AIA"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6604, std::string("ASM"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6611, std::string("HKD")));   // QUESTIONABLE
+   m_epsgToAlphaMap.insert(std::make_pair(6613, std::string("GSE"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6615, std::string("POS"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6616, std::string("SGM"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6618, std::string("SAN-M"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6658, std::string("HJO"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6668, std::string("EUS"))); 
+   m_epsgToAlphaMap.insert(std::make_pair(6807, std::string("NTF"))); 
 } 
 
 //*************************************************************************************************
@@ -127,22 +124,22 @@ const ossimDatum* ossimEpsgDatumFactory::create(const ossimString &epsg_spec) co
 {
    if ( epsg_spec.size() )
    {
-      ossim_uint32 gcs_code;
+      ossim_uint32 code;
       ossimString group; // assume we are working with EPSG codes
       if (epsg_spec.contains(":"))
       {
          group = epsg_spec.before(":");
-         gcs_code = epsg_spec.after(":").toUInt32();
+         code = epsg_spec.after(":").toUInt32();
       }
       else
       {
          group = "EPSG"; // No group spec provided, assuming EPSG:
-         gcs_code = epsg_spec.toUInt32();
+         code = epsg_spec.toUInt32();
       }
-      if ((group != "EPSG") || (gcs_code == 0))
+      if ((group != "EPSG") || (code == 0))
          return 0;
 
-      return create(gcs_code);
+      return create(code);
    }
    return 0;
 }
@@ -153,7 +150,7 @@ const ossimDatum* ossimEpsgDatumFactory::create(const ossimString &epsg_spec) co
 const ossimDatum* 
 ossimEpsgDatumFactory::create(const ossimKeywordlist& kwl, const char *prefix) const
 {
-   ossimString lookup = kwl.find(prefix, ossimKeywordNames::GCS_CODE_KW);
+   ossimString lookup = kwl.find(prefix, ossimKeywordNames::DATUM_KW);
    if(!lookup.empty())
       return create(lookup);
    return 0;
@@ -185,7 +182,7 @@ void ossimEpsgDatumFactory::getList(std::vector<ossimString>& list) const
 {
    ossimDatumFactory* df = ossimDatumFactory::instance();
    const ossimDatum* datum;
-   std::map<ossim_uint32, ossimString>::const_iterator iter = m_epsgToAlphaMap.begin();
+   std::map<ossim_uint32, std::string>::const_iterator iter = m_epsgToAlphaMap.begin();
 
    // Loop over all handled datum codes and instantiate the corresponding datum in order to
    // get the corresponding OSSIM/Geotrans name. Eventually the datum info (including its name as
@@ -212,10 +209,10 @@ void ossimEpsgDatumFactory::getList(std::vector<ossimString>& list) const
 //*************************************************************************************************
 ossim_uint32 ossimEpsgDatumFactory::findEpsgCode(const ossimString& alpha_code) const
 {
-   std::map<ossim_uint32, ossimString>::const_iterator iter = m_epsgToAlphaMap.begin();
+   std::map<ossim_uint32, std::string>::const_iterator iter = m_epsgToAlphaMap.begin();
    while (iter != m_epsgToAlphaMap.end())
    {
-      if (iter->second == alpha_code)
+      if (iter->second == alpha_code.string())
          return iter->first;
       ++iter;
    }
@@ -228,13 +225,11 @@ ossim_uint32 ossimEpsgDatumFactory::findEpsgCode(const ossimString& alpha_code)
 //*************************************************************************************************
 ossimString ossimEpsgDatumFactory::findAlphaCode(ossim_uint32 epsg_code) const
 {
-   std::map<ossim_uint32, ossimString>::const_iterator iter = m_epsgToAlphaMap.begin();
-   while (iter != m_epsgToAlphaMap.end())
+   ossimString result("");
+   std::map<ossim_uint32, std::string>::const_iterator iter = m_epsgToAlphaMap.find(epsg_code);
+   if (iter != m_epsgToAlphaMap.end())
    {
-      if (iter->first == epsg_code)
-         return iter->second;
-      ++iter;
+      result = iter->second;
    }
-   return ossimString("");
+   return result;
 }
-
diff --git a/src/ossim/base/ossimErrorStatusInterface.cpp b/src/ossim/base/ossimErrorStatusInterface.cpp
index d7a50f4..c9717ad 100644
--- a/src/ossim/base/ossimErrorStatusInterface.cpp
+++ b/src/ossim/base/ossimErrorStatusInterface.cpp
@@ -9,7 +9,7 @@
 // Contains class definition for common error interfaces.
 //
 //*************************************************************************
-// $Id: ossimErrorStatusInterface.cpp 9963 2006-11-28 21:11:01Z gpotts $
+// $Id: ossimErrorStatusInterface.cpp 22149 2013-02-11 21:36:10Z dburken $
 
 #include <iostream>
 #include <ossim/base/ossimErrorStatusInterface.h>
@@ -50,6 +50,11 @@ void  ossimErrorStatusInterface::clearErrorStatus() const
    theErrorStatus = ossimErrorCodes::OSSIM_OK;
 }
 
+bool ossimErrorStatusInterface::hasError() const
+{
+   return ( theErrorStatus != ossimErrorCodes::OSSIM_OK );
+}
+
 std::ostream& ossimErrorStatusInterface::print(std::ostream& out) const
 {
    out << "ossimErrorStatusInterface::print"
diff --git a/src/ossim/base/ossimFilename.cpp b/src/ossim/base/ossimFilename.cpp
index ba39ec3..bc2ec39 100644
--- a/src/ossim/base/ossimFilename.cpp
+++ b/src/ossim/base/ossimFilename.cpp
@@ -7,7 +7,7 @@
 // Description: This class provides manipulation of filenames.
 //
 //*************************************************************************
-// $Id: ossimFilename.cpp 16939 2010-03-29 12:41:35Z dburken $
+// $Id: ossimFilename.cpp 20192 2011-10-25 17:27:25Z dburken $
 
 #include <ossim/ossimConfig.h>  /* to pick up platform defines */
 
@@ -76,38 +76,37 @@ public:
    };
    
    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
-               );
+   {
+      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 )
-         {
+      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 ( m_hFile != INVALID_HANDLE_VALUE )
+         if ( !::CloseHandle(m_hFile) )
          {
-            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; }
@@ -216,19 +215,37 @@ ossimFilename::ossimFilename(const ossimFilename& src)
 ossimFilename::ossimFilename(const ossimString& src)
    : ossimString(src)
 {
-   convertToNative();
+   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)
 {
-   convertToNative();
+   if ( m_str.size() )
+   {
+      convertToNative();
+   }
 }
 
 template <class Iter> ossimFilename::ossimFilename(Iter s, Iter e)
    : ossimString(s, e)
 {
-   convertToNative();
+   if ( m_str.size() )
+   {
+      convertToNative();
+   }
 }
 
 bool ossimFilename::operator == (const ossimFilename& rhs)const
@@ -248,7 +265,7 @@ bool ossimFilename::operator == (const char* rhs)const
 
 void ossimFilename::convertBackToForwardSlashes()
 {
-   ossimFilename::iterator currentChar = this->begin();
+   std::string::iterator currentChar = this->begin();
 
    while(currentChar != this->end())
    {
@@ -262,7 +279,7 @@ void ossimFilename::convertBackToForwardSlashes()
 
 void ossimFilename::convertForwardToBackSlashes()
 {
-   ossimFilename::iterator currentChar = this->begin();
+   std::string::iterator currentChar = this->begin();
 
    while(currentChar != this->end())
    {
@@ -276,7 +293,11 @@ void ossimFilename::convertForwardToBackSlashes()
 
 bool ossimFilename::setTimes(ossimLocalTm* accessTime,
                              ossimLocalTm* modTime,
+#if defined(_WIN32)                             
                              ossimLocalTm* createTime)const
+#else
+                             ossimLocalTm* /* createTime */ )const
+#endif
 {
 #if defined(_WIN32)
    if(isDir())
@@ -669,13 +690,13 @@ bool ossimFilename::isExecutable() const
 ossimString ossimFilename::ext() const
 {
    ossimFilename file = *this;
-   size_type pos = file.rfind('.');
-   if (pos == npos)
+   std::string::size_type pos = file.m_str.rfind('.');
+   if (pos == std::string::npos)
    {
       return ossimFilename::NIL;
    }
 
-   return ossimFilename(file.substr(pos+1));
+   return ossimFilename(file.m_str.substr(pos+1));
 }
 
 ossimFilename ossimFilename::file() const
@@ -684,11 +705,11 @@ ossimFilename ossimFilename::file() const
 
    //file.convertBackToForwardSlashes();
 
-   size_type pos = file.rfind(thePathSeparator);
-   if (pos == npos)
+   std::string::size_type pos = file.m_str.rfind(thePathSeparator);
+   if (pos == std::string::npos)
       return *this;
    else
-      return ossimFilename(file.substr(pos+1));
+      return ossimFilename(file.m_str.substr(pos+1));
 }
 
 ossimFilename ossimFilename::path() const
@@ -697,17 +718,17 @@ ossimFilename ossimFilename::path() const
    //file.convertBackToForwardSlashes();
 
    // finds the last occurrence of the given string; in this case '/';
-   size_type pos = file.rfind(thePathSeparator);
+   std::string::size_type pos = file.m_str.rfind(thePathSeparator);
 
    if (pos == 0)
       return ossimFilename(ossimFilename(thePathSeparator));
-   if (pos == npos)
+   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.substr(0, pos));
+   return ossimFilename(file.m_str.substr(0, pos));
 }
 
 ossimFilename ossimFilename::drive()const
@@ -737,12 +758,12 @@ ossimFilename ossimFilename::fileNoExtension()const
    ossimFilename f = *this;
    //f.convertBackToForwardSlashes();
 
-   size_type dot_pos   = f.rfind('.');
-   size_type slash_pos = f.rfind(thePathSeparator);
+   std::string::size_type dot_pos   = f.m_str.rfind('.');
+   std::string::size_type slash_pos = f.m_str.rfind(thePathSeparator);
 
-   if(dot_pos == npos)
+   if(dot_pos == std::string::npos)
    {
-      if(slash_pos == npos)
+      if(slash_pos == std::string::npos)
       {
          return *this;
       }
@@ -752,7 +773,7 @@ ossimFilename ossimFilename::fileNoExtension()const
                               this->end());
       }
    }
-   else if(slash_pos == npos)
+   else if(slash_pos == std::string::npos)
    {
       return ossimFilename(this->begin(), this->begin()+dot_pos);
    }
@@ -1074,23 +1095,30 @@ bool ossimFilename::createDirectory( bool recurseFlag,
 bool ossimFilename::remove(const ossimFilename& pathname)
 {
    bool result = true;
+
 #if defined(__VISUALC__)  || defined(__BORLANDC__) || defined(__WATCOMC__) || \
    defined(__GNUWIN32__) || defined(_MSC_VER)
-   
-   if(::remove(pathname.c_str()) != 0)
+
+   // Note: not sure if these work on all of the above flavors. drb - 14 Sep. 2011.
+   if(pathname.isDir())
    {
-      result = false;
+      // Note this only removes empty directories.
+      result = ( RemoveDirectory( pathname.c_str() ) != 0 );
    }
-#else
+   else
+   {
+      result = ( DeleteFile( pathname.c_str() ) != 0 );
+   }
+#else /* Unix flavor from unistd.h. */
    if(pathname.isDir())
    {
-      result = (rmdir(pathname) >=0);
+      result = ( rmdir( pathname.c_str() ) == 0 );
    }
-   else if (unlink(pathname.c_str()) < 0)
+   else
    {
-      result = false;
+      result = ( unlink( pathname.c_str() ) == 0 );
    }
-#endif /* HAVE_UNISTD_H */
+#endif
 
    return result;
 }
@@ -1177,43 +1205,68 @@ bool ossimFilename::wildcardRemove()const
 
 bool ossimFilename::copyFileTo(const ossimFilename& outputFile) const
 {
+   bool result = false;
+   
    std::ifstream is(this->c_str(), std::ios::in|std::ios::binary);
-   if (is.fail())
+   if ( is.good() )
    {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "WARNING: "
-         << "ossimFilename::copyFileTo WARNING:"
-         << "\nCannot open: " << this->c_str() << std::endl;
-      return false;
-   }
-
-   std::ofstream os(outputFile.c_str(), std::ios::out|std::ios::binary);
-   if (os.fail())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "WARNING: "
-         << "ossimFilename::copyFileTo WARNING:"
-         << "\nCannot open: " << outputFile.c_str() << std::endl;
-      return false;
-   }
-
-   char c;
-   while(is.get(c))
-   {
-      os.put(c);
-   }
+      ossimFilename f = outputFile;
+      if ( f.isDir() )
+      {
+         f = f.dirCat( this->file() );
+      }
 
-   if (!is.eof() || os.fail())
+      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:"
-         << "\nError detected writing from file "
-         << this->c_str() << " to file " << outputFile.c_str() << std::endl;
-      return false;
+         << "\nCannot open: " << this->c_str() << std::endl;
    }
    
-   return true;
+   return result;
 }
 
 //---
@@ -1255,9 +1308,9 @@ bool ossimFilename::needsExpansion() const
       if (result == false)
       {
          // Check for '$'
-         size_type pos = find('$', 0);
+         std::string::size_type pos = m_str.find('$', 0);
          {
-            if (pos != npos)
+            if (pos != std::string::npos)
             {
                // found '$'
                result = true;
diff --git a/src/ossim/base/ossimGeodeticEvaluator.cpp b/src/ossim/base/ossimGeodeticEvaluator.cpp
new file mode 100644
index 0000000..e07b3f6
--- /dev/null
+++ b/src/ossim/base/ossimGeodeticEvaluator.cpp
@@ -0,0 +1,341 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Hicks
+//
+// Description: Evaluate geodetic functions.
+//
+//----------------------------------------------------------------------------
+
+#include <ossim/base/ossimGeodeticEvaluator.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNotify.h>
+
+#include <iostream>
+#include <iomanip>
+
+static ossimTrace traceDebug(ossimString("ossimGeodeticEvaluator:debug"));
+static ossimTrace traceExec(ossimString("ossimGeodeticEvaluator:exec"));
+
+
+//*****************************************************************************
+//  METHOD: ossimGeodeticEvaluator::ossimGeodeticEvaluator()
+//  
+//  Constructor.
+//  
+//*****************************************************************************
+ossimGeodeticEvaluator::ossimGeodeticEvaluator(const ossimEllipsoid& ell)
+   :
+      m_A(ell.getA()),
+      m_B(ell.getB()),
+      m_F(ell.getFlattening()),
+      m_Ecc2(ell.eccentricitySquared())
+{
+   m_A2 = m_A*m_A;
+   m_B2 = m_B*m_B;
+   m_2ndEcc2 = (m_A2 - m_B2) / m_B2;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimGeodeticEvaluator::ossimGeodeticEvaluator()
+//  
+//  Destructor.
+//  
+//*****************************************************************************
+ossimGeodeticEvaluator::~ossimGeodeticEvaluator()
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG: ~ossimGeodeticEvaluator(): returning..." << std::endl;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimGeodeticEvaluator::direct()
+//  
+//  Equation numbers reference Vincenty:
+//    http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf
+//
+//    p2   = unknown point
+//    az21 = azimuth 2->1  (back azimuth)
+//  
+//*****************************************************************************
+bool ossimGeodeticEvaluator::direct(const ossimGpt& p1,
+                                    const double& d,
+                                    const double& az12,
+                                    ossimGpt& p2,
+                                    double& az21)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nossimGeodeticEvaluator::direct DEBUG:" << std::endl;
+   }
+
+   bool computationOK = false;
+
+   double phi1 = p1.latr();
+   // double lam1 = p1.lonr();
+
+   double cosalpha1 = cos(az12);
+   double sinalpha1 = sin(az12);
+   double tanU1 = (1.0 - m_F) * tan(phi1);
+   double cosU1 = 1.0 / sqrt( 1.0 + tanU1 * tanU1 );
+   double sinU1 = tanU1 * cosU1;
+
+   // eq. 1
+   double sigma1 = atan2(tanU1, cosalpha1);
+
+   // eq. 2
+   double sinalpha = cosU1 * sinalpha1;
+
+   double sin2alpha = sinalpha * sinalpha;
+   double cos2alpha = 1.0 - sin2alpha;
+
+   double u2 = cos2alpha * m_2ndEcc2;
+
+   // Eq. 3
+   double A = 1 + u2 / 16384 * (4096 + u2 * (-768 + u2 * (320 - 175*u2)));
+
+   // Eq. 4
+   double B = u2 / 1024 * (256 + u2 * (-128 + u2 * (74 - 47*u2)));
+
+   // iterate until there is a negligible change in sigma
+   double dSig;
+   double d_bA = d / (m_B * A);
+   double sigma = d_bA;
+   double sinsig;
+   double cossig;
+   double prevSigma = M_PI;
+   double sigmaM2;
+   double cos2sigm;
+   double cos2sigm2;
+
+   while (abs(sigma - prevSigma) > 1.e-12)
+   {
+      // eq. 5
+      sigmaM2 = 2.0*sigma1 + sigma;
+      cos2sigm = cos(sigmaM2);
+      cos2sigm2 = cos2sigm * cos2sigm;
+      sinsig = sin(sigma);
+      cossig = cos(sigma);
+      double sin2sig = sinsig*sinsig;
+
+      // Eq. 6
+      dSig = B * sinsig * (cos2sigm + B / 4 * (cossig * (-1 + 2*cos2sigm2) - B / 6 * cos2sigm * (-3 + 4*sin2sig) * (-3 + 4*cos2sigm2)));
+
+      // eq. 7
+      prevSigma = sigma;
+      sigma = d_bA + dSig;
+   }
+
+   sigmaM2 = 2.0*sigma1 + sigma;
+   cos2sigm = cos(sigmaM2);
+   cos2sigm2 = cos2sigm * cos2sigm;
+   cossig = cos(sigma);
+   sinsig = sin(sigma);
+
+   // eq. 8
+   double tmp = sinU1*sinsig - cosU1*cossig*cosalpha1;
+   double phi2 = atan2( sinU1*cossig + cosU1*sinsig*cosalpha1, 
+                        (1.0-m_F) * sqrt( sin2alpha + tmp*tmp));
+
+   // eq. 9
+   double lam = atan2(sinsig*sinalpha1, cosU1*cossig - sinU1*sinsig*cosalpha1);
+
+   // eq. 10
+   double C = m_F/16 * cos2alpha * (4 + m_F * (4 - 3*cos2alpha));
+
+   // eq. 11
+   double L = lam - (1-C) * m_F * sinalpha * (sigma + C * sinsig * (cos2sigm + C * cossig * (-1 + 2*cos2sigm2)));
+
+   // eq. 12
+   double alpha2 = atan2(sinalpha, -tmp);
+
+
+   p2.latr(phi2);
+   p2.lonr(p1.lonr() + L);
+   az21 = alpha2 + M_PI;
+   if (az21 < 0.0)
+      az21 += 2.0*M_PI;
+   if (az21 > 2.0*M_PI)
+      az21 -= 2.0*M_PI;
+
+   return computationOK;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimGeodeticEvaluator::inverse()
+//  
+//  Equation numbers reference Vincenty:
+//    http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf
+//
+//    d    = distance (m)
+//    az12 = azimuth 1->2
+//    az21 = azimuth 2->1  (back azimuth)
+//  
+//*****************************************************************************
+bool ossimGeodeticEvaluator::inverse(const ossimGpt& p1,
+                                     const ossimGpt& p2,
+                                     double& d,
+                                     double& az12,
+                                     double& az21)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nossimGeodeticEvaluator::inverse DEBUG:" << std::endl;
+   }
+
+   bool computationOK = false;
+
+   double phi1 = p1.latr();
+   double lam1 = p1.lonr();
+   double phi2 = p2.latr();
+   double lam2 = p2.lonr();
+
+   double U1 = atan((1.0-m_F) * tan(phi1));
+   double sinU1 = sin(U1);
+   double cosU1 = cos(U1);
+
+   double U2 = atan((1.0-m_F) * tan(phi2));
+   double sinU2 = sin(U2);
+   double cosU2 = cos(U2);
+
+   double sinU1sinU2 = sinU1 * sinU2;
+   double cosU1sinU2 = cosU1 * sinU2;
+   double sinU1cosU2 = sinU1 * cosU2;
+   double cosU1cosU2 = cosU1 * cosU2;
+
+   // Eq. 13
+   // 1st approximation
+   double L = lam2 - lam1;
+   double lam = L;
+
+
+   // Auxiliaries
+   double sig = 0.0;
+   double dSig = 0.0;
+   double lam0;
+   double cos2alpha;
+   double cos2sigm;
+   double cos2sigm2;
+   double sinsig;
+   double sin2sig;
+   double cossig;
+   bool converged = false;
+
+
+   int iter = 0;
+   int iterMax = 100;
+   int iterMin = 4;
+
+   // Iterative loop
+   do 
+   {
+      iter++;
+
+      double sinlam = sin(lam);
+      double coslam = cos(lam);
+
+      // Eq. 14
+      double tmp = cosU1sinU2 - sinU1cosU2 * coslam;
+      sin2sig = cosU2*sinlam * cosU2*sinlam + tmp * tmp;
+      sinsig = sqrt(sin2sig);
+
+      // Eq. 15
+      cossig = sinU1sinU2 + (cosU1cosU2 * coslam);
+
+      // Eq. 16
+      sig = atan2(sinsig, cossig);
+
+      // Eq. 17
+      double sinalpha;
+      if (sin2sig == 0.0)
+         sinalpha = 0.0;
+      else
+         sinalpha = cosU1cosU2 * sinlam / sinsig;
+      cos2alpha = 1.0 - sinalpha*sinalpha;
+
+      // Eq. 18
+      if (cos2alpha == 0.0)
+         cos2sigm = 0.0;
+      else
+         cos2sigm = cossig - 2 * sinU1sinU2 / cos2alpha;
+      cos2sigm2 = cos2sigm * cos2sigm;
+
+      // Eq. 10
+      double C = m_F/16 * cos2alpha * (4 + m_F * (4 - 3*cos2alpha));
+
+      // Eq. 11
+      lam0 = lam;
+      lam = L + (1-C) * m_F * sinalpha * (sig + C * sinsig * (cos2sigm + C * cossig * (-1 + 2*cos2sigm2)));
+
+
+      // Check delta lambda for convergence
+      double delta = abs(lam - lam0);
+      if (delta < 1e-13 && iter>=iterMin)
+      {
+        converged = true;
+      }
+
+   } while (!converged && iter<=iterMax);
+
+
+   double u2 = cos2alpha * m_2ndEcc2;
+
+   // Eq. 3
+   double A = 1 + u2 / 16384 * (4096 + u2 * (-768 + u2 * (320 - 175*u2)));
+
+   // Eq. 4
+   double B = u2 / 1024 * (256 + u2 * (-128 + u2 * (74 - 47*u2)));
+
+   // Eq. 6
+   dSig = B * sinsig * (cos2sigm + B / 4 * (cossig * (-1 + 2*cos2sigm2) - B / 6 * cos2sigm * (-3 + 4*sin2sig) * (-3 + 4*cos2sigm2)));
+
+
+   // Compute distance
+   //  Eq. 19
+   d = m_B * A * (sig - dSig);
+
+
+   // Compute azimuths
+   //  Diverged, same meridian or antipodal
+   if (!converged)
+   {
+      if (phi1 > phi2)
+      {
+         az12 = M_PI;
+         az21 = 0.0;
+      }
+      else if (phi1 < phi2)
+      {
+         az12 = 0.0;
+         az21 = M_PI;
+      }
+      else
+      {
+         az12 = ossim::nan();
+         az21 = ossim::nan();
+      }
+   }
+
+   // Converged
+   else
+   {
+      // Eq. 20
+      az12 = atan2(cosU2 * sin(lam), (cosU1sinU2 - sinU1cosU2 * cos(lam)));
+      if (az12 < 0.0) az12 += 2.0*M_PI;
+
+      // Eq. 21
+      az21 = atan2(cosU1 * sin(lam), (-sinU1cosU2 + cosU1sinU2 * cos(lam))) + M_PI;
+      if (az21 < 0.0) az21 += 2.0*M_PI;
+
+      computationOK = true;
+   }
+
+   return computationOK;
+ }
diff --git a/src/ossim/base/ossimGeoidManager.cpp b/src/ossim/base/ossimGeoidManager.cpp
index d4f7cfd..0f12804 100644
--- a/src/ossim/base/ossimGeoidManager.cpp
+++ b/src/ossim/base/ossimGeoidManager.cpp
@@ -10,7 +10,7 @@
 // LIMITATIONS: None.
 //
 //*****************************************************************************
-//  $Id: ossimGeoidManager.cpp 16139 2009-12-18 18:37:07Z gpotts $
+//  $Id: ossimGeoidManager.cpp 20096 2011-09-14 16:44:20Z dburken $
 
 #include <ossim/base/ossimCommon.h>
 #include <ossim/base/ossimGeoidManager.h>
@@ -166,8 +166,7 @@ bool ossimGeoidManager::loadState(const ossimKeywordlist& kwl,
       geoidGrid1996 = geoidGrid1996.dirCat("egm96.grd");
    }
 
-   bool addedGeoid1996Grid = false;
-   if(geoidGrid1996.exists())
+   if( geoidGrid1996.exists() )
    {
       ossimRefPtr<ossimGeoid> geoid = new ossimGeoidEgm96(geoidGrid1996);
       if (geoid->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
@@ -179,7 +178,6 @@ bool ossimGeoidManager::loadState(const ossimKeywordlist& kwl,
                << "\nAdded geoid egm 96:  " << geoidGrid1996.c_str()
                << "\n";
          }
-         addedGeoid1996Grid = true;
          addGeoid(geoid.get());
       }
       else
diff --git a/src/ossim/base/ossimGpt.cpp b/src/ossim/base/ossimGpt.cpp
index cd56546..ae8d702 100644
--- a/src/ossim/base/ossimGpt.cpp
+++ b/src/ossim/base/ossimGpt.cpp
@@ -9,10 +9,7 @@
 // LATITUDE AND LONGITUDE VALUES ARE IN DEGREES.
 //
 //*******************************************************************
-//  $Id: ossimGpt.cpp 19071 2011-03-13 16:02:06Z dburken $
-
-#include <iostream>
-#include <sstream>
+//  $Id: ossimGpt.cpp 20615 2012-02-27 12:43:12Z gpotts $
 
 #include <ossim/base/ossimGpt.h>
 #include <ossim/base/ossimEcefPoint.h>
@@ -24,14 +21,19 @@
 #include <ossim/base/ossimGeoidManager.h>
 #include <ossim/base/ossimEllipsoid.h>
 #include <ossim/base/ossimGeocent.h>
+#include <iostream>
+#include <sstream>
 
 std::ostream& ossimGpt::print(std::ostream& os, ossim_uint32 precision) const
 {
    // Capture the original flags.
    std::ios_base::fmtflags f = os.flags();
-
-   os << setiosflags(ios::fixed) << setprecision(precision);
-   os << "( ";
+   
+   // Set the new precision capturing old.
+   std::streamsize oldPrecision = os.precision(precision);
+   
+   os << setiosflags(ios::fixed)
+      << "( "; 
 
    if(isLatNan())
    {
@@ -61,8 +63,9 @@ std::ostream& ossimGpt::print(std::ostream& os, ossim_uint32 precision) const
    
    os << (theDatum?theDatum->code().c_str():"") << " )";
 
-   // Reset flags.
+   // Reset flags and precision.
    os.setf(f);
+   os.precision(oldPrecision);
 
    return os;
 }
@@ -312,25 +315,25 @@ ossimGpt::ossimGpt(const ossimEcefPoint& ecef_point,
 //*****************************************************************************
 void ossimGpt::changeDatum(const ossimDatum *datum)
 {
-   if(datum == theDatum) return;
+   if (*datum == *theDatum) 
+      return;
 
    // only shift if all values lat and lon is good
    if(!isLatNan() && !isLonNan()) 
    {
       if(datum)
       {
-	double h = hgt;
-        *this = datum->shift(*this);
-        if(ossim::isnan(h))
-        {
-           hgt = h;
-        }
-        theDatum = datum;
+         double h = hgt;
+         *this = datum->shift(*this);
+         if(ossim::isnan(h))
+         {
+            hgt = h;
+         }
+         theDatum = datum;
       }
    }
 }
 
-
 //*****************************************************************************
 //  METHOD: ossimGpt::toDmsString()
 //*****************************************************************************
@@ -360,6 +363,65 @@ ossimString ossimGpt::toDmsString()const
    return result;
 }
 
+bool ossimGpt::isEqualTo(const ossimGpt& rhs, ossimCompareType compareType)const
+{
+   bool result = false;
+   if(!ossim::isnan(lat)&&!ossim::isnan(rhs.lat))
+   {
+      result = ossim::almostEqual(lat, rhs.lat);
+   }
+   else 
+   {
+      result = ossim::isnan(lat)&&ossim::isnan(rhs.lat);
+   }
+
+   if(result)
+   {
+      if(!ossim::isnan(lon)&&!ossim::isnan(rhs.lon))
+      {
+         result = ossim::almostEqual(lon, rhs.lon);
+      }
+      else 
+      {
+         result = ossim::isnan(lon)&&ossim::isnan(rhs.lon);
+      }
+   }
+   if(result)
+   {
+      if(!ossim::isnan(hgt)&&!ossim::isnan(rhs.hgt))
+      {
+         result = ossim::almostEqual(hgt, rhs.hgt);
+      }
+      else 
+      {
+         result = ossim::isnan(hgt)&&ossim::isnan(rhs.hgt);
+      }
+   }
+   
+   if(result)
+   {
+      if(theDatum&&rhs.theDatum)
+      {
+         if(compareType == OSSIM_COMPARE_FULL)
+         {
+            result = theDatum->isEqualTo(*rhs.theDatum);
+         }
+         else 
+         {
+            result = theDatum == rhs.theDatum;
+         }
+
+      }
+      else if(reinterpret_cast<ossim_uint64>(theDatum)|reinterpret_cast<ossim_uint64>(rhs.theDatum))
+      {
+         result = false;
+      }
+   }
+   
+   return result;
+}
+
+
 //*****************************************************************************
 //  METHOD: ossimGpt::distanceTo(ossimGpt)
 //
@@ -395,9 +457,9 @@ double ossimGpt::azimuthTo(const ossimGpt& gpt) const
 
    // Use alternate local method (not great circle):
    double mean_lat = 0.5*(lat + gpt.lat);
-   double dlon = cosd(mean_lat)*(gpt.lon - lon);
+   double dlon = ossim::cosd(mean_lat)*(gpt.lon - lon);
    double dlat = gpt.lat - lat;
-   double theta = atan2d(dlon,dlat);
+   double theta = ossim::atan2d(dlon,dlat);
    if (theta < 0)
       theta += 360.0;
    return theta;
@@ -435,6 +497,13 @@ void ossimGpt::heightMSL(double heightMSL)
 //*****************************************************************************
 ossimDpt ossimGpt::metersPerDegree() const
 {
+//#define USE_ELLIPTICAL_RADII
+#ifdef USE_ELLIPTICAL_RADII
+   ossimDpt radii;
+   theDatum->ellipsoid()->geodeticRadii(lat, radii);
+   return ossimDpt (RAD_PER_DEG * radii.x * ossim::cosd(lat), 
+                    RAD_PER_DEG * radii.y);
+#else 
    ossimDpt result;
 
    double radius = theDatum->ellipsoid()->geodeticRadius(lat);
@@ -442,4 +511,14 @@ ossimDpt ossimGpt::metersPerDegree() const
    result.x =  result.y * ossim::cosd(lat);
 
    return result;
+#endif
 }
+
+bool ossimGpt::operator==(const ossimGpt& gpt) const
+{
+   return ( ossim::almostEqual(lat, gpt.lat) &&
+            ossim::almostEqual(lon, gpt.lon) &&
+            ossim::almostEqual(hgt, gpt.hgt) &&
+            (*theDatum == *(gpt.theDatum)));
+}
+
diff --git a/src/ossim/base/ossimGzStream.cpp b/src/ossim/base/ossimGzStream.cpp
index 1142a44..9ba5693 100644
--- a/src/ossim/base/ossimGzStream.cpp
+++ b/src/ossim/base/ossimGzStream.cpp
@@ -19,7 +19,7 @@
 //
 // File          : gzstream.C
 // Revision      : $Revision: 17195 $
-// Revision_date : $Date: 2010-04-23 19:32:18 +0200(ven, 23 apr 2010) $
+// Revision_date : $Date: 2010-04-23 13:32:18 -0400 (Fri, 23 Apr 2010) $
 // Author(s)     : Deepak Bandyopadhyay, Lutz Kettner
 // 
 // Standard streambuf implementation following Nicolai Josuttis, "The 
diff --git a/src/ossim/base/ossimHistogram.cpp b/src/ossim/base/ossimHistogram.cpp
index 72cc573..d5dd07b 100644
--- a/src/ossim/base/ossimHistogram.cpp
+++ b/src/ossim/base/ossimHistogram.cpp
@@ -15,19 +15,21 @@
 // frequency counts for each of these buckets.
 //
 //********************************************************************
-// $Id: ossimHistogram.cpp 17765 2010-07-15 19:08:35Z gpotts $
-//
+// $Id: ossimHistogram.cpp 22124 2013-01-27 16:03:52Z dburken $
 
-#include <stdio.h>
+#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 <sstream>
 using namespace std;
 
-#include <math.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimHistogram.h>
-#include <ossim/base/ossimNotifyContext.h>
+
 
 // nonstandard versions that use operator>, so they behave differently
 // than std:::min/max and ossim::min/max.  kept here for now for that
@@ -41,33 +43,38 @@ using namespace std;
 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 = new float [1];
    vals[0] = 0.0;
-   counts = new float [1];
    counts[0] = 0.0;
-   num = 0;
-   vmin = 0;
-   vmax = 0;
-   delta = 0.0;
-   mean = 0.0;
-   standard_dev = 0.0;
-   stats_consistent = 0;
-   stats_consistent |= (MEAN_FLAG | SD_FLAG);
 }
 
 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)
 {
-   vals = new float [xres];
-   counts = new float [xres];
-   num = xres;
    vmax = MAX(val1, val2);
    vmin = MIN(val1, val2);
-   delta = (vmax - vmin) / xres;
+   delta = (vmax - vmin + 1) / 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)
@@ -91,19 +98,27 @@ ossimHistogram::ossimHistogram(int xres, float val1, float val2)
 }
 
 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)
 {
-   vals = uvals;
-   counts = ucounts;
-   num = xres;
-   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();
-   stats_consistent = 0;
-   stats_consistent |= (MEAN_FLAG | SD_FLAG);
+   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
@@ -343,6 +358,55 @@ void ossimHistogram::create(int xres, float val1, float val2)
       }
    }   
 }
+ossimHistogram* ossimHistogram::fillInteriorEmptyBins(int type)const
+{
+   ossimHistogram* result = new ossimHistogram(*this);
+   if(num < 1) return 0;
+   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.
@@ -1298,6 +1362,33 @@ bool ossimHistogram::saveState(ossimKeywordlist& kwl,
            "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)
    {
@@ -1313,7 +1404,7 @@ bool ossimHistogram::saveState(ossimKeywordlist& kwl,
                  true);
       }
    }
-   
+#endif   
    return true;
 }
 
@@ -1324,7 +1415,7 @@ bool ossimHistogram::loadState(const ossimKeywordlist& kwl,
 
    if(number_of_bins)
    {
-      long bins = ossimString(number_of_bins).toLong();
+      ossim_uint32 bins = ossimString(number_of_bins).toUInt32();
 
       if(bins > 0)
       {
@@ -1344,21 +1435,45 @@ bool ossimHistogram::loadState(const ossimKeywordlist& kwl,
          {
             maxValue = (ossim_float32)ossimString(max_value).toDouble();
          }
-         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();
-         create(bins, minValue, maxValue);
+
+         create((int)bins, minValue, maxValue);
          float* countsPtr = GetCounts();
          memset(countsPtr, '\0', bins*sizeof(float));
-         while(iter != kwlMap.end())
+         // this is new style histogram creation
+         //
+         ossimString binsString = kwl.find(prefix, "bins");
+         if(!binsString.empty())
          {
-            ossimString numberStr(iter->first.begin() + offset,
-                                  iter->first.end());
-            countsPtr[numberStr.toUInt32()] = ossimString(iter->second).toDouble();
-            ++iter;
+            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;
+            }
          }
          
          return true;
diff --git a/src/ossim/base/ossimHttpRequest.cpp b/src/ossim/base/ossimHttpRequest.cpp
new file mode 100644
index 0000000..938b772
--- /dev/null
+++ b/src/ossim/base/ossimHttpRequest.cpp
@@ -0,0 +1,30 @@
+#include <ossim/base/ossimHttpRequest.h>
+
+RTTI_DEF1(ossimHttpRequest, "ossimHttpRequest", ossimWebRequest);
+
+bool ossimHttpRequest::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   bool result = true;
+   ossimObject::loadState(kwl, prefix);
+   ossimString url = kwl.find(prefix, "url");
+   ossimString method = kwl.find(prefix, "method");
+   method = method.upcase();
+   
+   if(method == "GET")
+   {
+      m_methodType = HTTP_METHOD_GET;
+   }
+   else if(method == "POST")
+   {
+      m_methodType = HTTP_METHOD_POST;
+   }
+   else
+   {
+      m_methodType = HTTP_METHOD_UNKNOWN;
+   }
+   
+   
+   clearHeaderOptions();
+   
+   return result;
+}
diff --git a/src/ossim/base/ossimHttpResponse.cpp b/src/ossim/base/ossimHttpResponse.cpp
new file mode 100644
index 0000000..1c5e1bb
--- /dev/null
+++ b/src/ossim/base/ossimHttpResponse.cpp
@@ -0,0 +1,29 @@
+#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/src/ossim/base/ossimImageTypeLut.cpp b/src/ossim/base/ossimImageTypeLut.cpp
index 54b7ce3..5b769ee 100644
--- a/src/ossim/base/ossimImageTypeLut.cpp
+++ b/src/ossim/base/ossimImageTypeLut.cpp
@@ -2,7 +2,7 @@
 //
 // License:  See top level LICENSE.txt file.
 // 
-// Author:  David Burken (dburken at imagelinks.com)
+// Author:  David Burken
 //
 // Description:
 //
@@ -11,7 +11,7 @@
 // enumeration.
 //
 //*******************************************************************
-//  $Id: ossimImageTypeLut.cpp 9963 2006-11-28 21:11:01Z gpotts $
+//  $Id: ossimImageTypeLut.cpp 22221 2013-04-11 15:30:08Z dburken $
 
 #include <ossim/base/ossimImageTypeLut.h>
 
@@ -22,7 +22,7 @@ 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 = 8;
+static const int TABLE_SIZE = 9;
 
 //*******************************************************************
 // Public Constructor:
@@ -51,4 +51,6 @@ ossimImageTypeLut::ossimImageTypeLut()
    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/src/ossim/base/ossimIpt.cpp b/src/ossim/base/ossimIpt.cpp
index d922517..f1ca7d8 100644
--- a/src/ossim/base/ossimIpt.cpp
+++ b/src/ossim/base/ossimIpt.cpp
@@ -10,7 +10,7 @@
 // Contains class definitions for ipt.
 //
 //*******************************************************************
-//  $Id: ossimIpt.cpp 15766 2009-10-20 12:37:09Z gpotts $
+//  $Id: ossimIpt.cpp 20070 2011-09-07 18:48:35Z dburken $
 
 #include <iostream>
 #include <sstream>
@@ -166,6 +166,7 @@ ossimString ossimIpt::toString() const
    return ossimString(os.str());
 }
 
+
 void ossimIpt::toPoint(const std::string& s)
 {
    std::istringstream is(s);
@@ -256,3 +257,10 @@ std::istream& operator>>(std::istream& is, ossimIpt &pt)
    // Finished
    return is;
 }
+
+bool ossimIpt::isEqualTo(const ossimIpt& rhs, ossimCompareType /* compareType */)const
+{
+   return ((x==rhs.x)&&
+           (y==rhs.y));
+}
+
diff --git a/src/ossim/base/ossimIrect.cpp b/src/ossim/base/ossimIrect.cpp
index 209eacc..49a946d 100644
--- a/src/ossim/base/ossimIrect.cpp
+++ b/src/ossim/base/ossimIrect.cpp
@@ -10,7 +10,7 @@
 // Contains class definition for ossimIrect.
 // 
 //*******************************************************************
-//  $Id: ossimIrect.cpp 19180 2011-03-22 17:36:33Z oscarkramer $
+//  $Id: ossimIrect.cpp 21560 2012-08-30 12:09:03Z gpotts $
 
 #include <ostream>
 #include <sstream>
@@ -362,7 +362,7 @@ bool ossimIrect::toRect(const ossimString& rectString)
    makeNan();
    
    std::istringstream in(rectString);
-   in >> ossim::skipws;
+   ossim::skipws(in);
    char charString[2];
    charString[1] = '\0';
    ossimString interior;
@@ -589,7 +589,9 @@ bool ossimIrect::saveState(ossimKeywordlist& kwl,
            ossimKeywordNames::TYPE_KW,
            "ossimIrect",
            true);
-   
+
+   kwl.add(prefix, "rect", toString());
+ #if 0  
    if(hasNans())
    {
       kwl.add(prefix,
@@ -628,41 +630,37 @@ bool ossimIrect::saveState(ossimKeywordlist& kwl,
               theLrCorner.y,
               true);
    }
-
+#endif
    return true;
 }
 
 bool ossimIrect::loadState(const ossimKeywordlist& kwl,
                            const char* prefix)
 {
-   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");
-
-   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"))
-      {
-         makeNan();
-      }
-      else
-      {
-         *this = ossimIrect(ossimString(ulx).toInt32(),
-                            ossimString(uly).toInt32(),
-                            ossimString(lrx).toInt32(),
-                            ossimString(lry).toInt32());
-      }
-   }
-   else
-   {
-      makeNan();
-      
-      return false;
-   }
+  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;
 }
diff --git a/src/ossim/base/ossimKeywordlist.cpp b/src/ossim/base/ossimKeywordlist.cpp
index 96b05be..1515bc3 100644
--- a/src/ossim/base/ossimKeywordlist.cpp
+++ b/src/ossim/base/ossimKeywordlist.cpp
@@ -5,20 +5,20 @@
 // Description: This class provides capabilities for keywordlists.
 //
 //********************************************************************
-// $Id: ossimKeywordlist.cpp 19180 2011-03-22 17:36:33Z oscarkramer $
+// $Id: ossimKeywordlist.cpp 22366 2013-08-09 12:13:24Z gpotts $
 
 #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/ossimString.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;
@@ -28,9 +28,11 @@ static const char NULL_KEY_NOTICE[]
 
 #ifdef OSSIM_ID_ENABLED
 static const bool TRACE = false;
-static const char OSSIM_ID[] = "$Id: ossimKeywordlist.cpp 19180 2011-03-22 17:36:33Z oscarkramer $";
+static const char OSSIM_ID[] = "$Id: ossimKeywordlist.cpp 22366 2013-08-09 12:13:24Z gpotts $";
 #endif
 
+const std::string ossimKeywordlist::NULL_KW = "";
+
 ossimKeywordlist::ossimKeywordlist(const ossimKeywordlist& src)
 :m_map(src.m_map),
 m_delimiter(src.m_delimiter),
@@ -121,7 +123,7 @@ void ossimKeywordlist::addList(const ossimKeywordlist &src, bool overwrite)
    
    while (i != src.m_map.end())
    {
-      add( (*i).first, (*i).second, overwrite );
+      addPair( (*i).first, (*i).second, overwrite );
       i++;
    }
 }
@@ -130,12 +132,12 @@ void ossimKeywordlist::add(const ossimKeywordlist& kwl,
                            const char* prefix,
                            bool stripPrefix)
 {
-   std::map<ossimString, ossimString>::const_iterator iter = kwl.m_map.begin();
+   std::map<std::string, std::string>::const_iterator iter = kwl.m_map.begin();
    
    ossimRegExp regExp;
    
    // Check for null prefix.
-   ossimString tmpPrefix;
+   std::string tmpPrefix;
    if (prefix) tmpPrefix = prefix;
    
    regExp.compile(("^("+tmpPrefix+")").c_str());
@@ -149,14 +151,11 @@ void ossimKeywordlist::add(const ossimKeywordlist& kwl,
          newKey = (*iter).first;
          if(stripPrefix && prefix)
          {
-            newKey = newKey.substitute(prefix,
-                                       "");
+            newKey = newKey.substitute(prefix, "");
             
          }
          
-         add(newKey,
-             (*iter).second,
-             true);
+         addPair(newKey.string(), (*iter).second, true);
       }
       ++iter;
    }
@@ -166,77 +165,72 @@ void ossimKeywordlist::add(const char* prefix,
                            const ossimKeywordlist& kwl,
                            bool overwrite)
 {
-   std::map<ossimString, ossimString>::const_iterator iter = kwl.m_map.begin();
-   
+   std::string p = prefix ? prefix : "";
+   std::map<std::string, std::string>::const_iterator iter = kwl.m_map.begin();
    while(iter != kwl.m_map.end())
    {
-      ossimString valueToAdd = (*iter).second;
-      ossimString newKey     = (*iter).first;
-      
-      add(prefix,
-          newKey,
-          valueToAdd,
-          overwrite);
+      std::string k( p + (*iter).first );
+      addPair( k, (*iter).second, overwrite );
       ++iter;
    }
 }
 
-void ossimKeywordlist::add(const char* key,
-                           const char* value,
-                           bool        overwrite)
+void ossimKeywordlist::addPair(const std::string& key,
+                               const std::string& value,
+                               bool               overwrite)
 {
-   if (key)
+   if ( key.size() )
    {
-      ossimString k = key;
-      
-      ossimString v;
-      if (value) v = value;
+      ossimString v = value;
       if ( m_expandEnvVars == true )
       {
          v = v.expandEnvironmentVariable();
       }
       
-      KeywordMap::iterator i = getMapEntry(k);
+      KeywordMap::iterator i = getMapEntry(key);
       
       if (i == m_map.end())
       {
-         m_map.insert(std::make_pair(k, v));
+         m_map.insert(std::make_pair(key, v.string()));
       }
       else if (overwrite)
       {
-         (*i).second = v;
+         (*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)
+   if ( key )
    {
-      ossimString k;
-      if (prefix) k = prefix;
-      k += key;
-      
-      ossimString v;
-      if (value) v = value;
-      if ( m_expandEnvVars == true )
-      {
-         v = v.expandEnvironmentVariable();
-      }
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if(overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v(value ? value : "");
+      addPair(k, v, overwrite);
    }
 }
 
@@ -244,25 +238,11 @@ void ossimKeywordlist::add(const char* key,
                            char        value,
                            bool        overwrite)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k = key;
-      
-      char tmp[2];
-      tmp[0] = value;
-      tmp[1] = '\0';
-      ossimString v = tmp;
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if (i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(key);
+      std::string v(1, value);
+      addPair(k, v, overwrite);
    }
 }
 
@@ -271,27 +251,11 @@ void ossimKeywordlist::add(const char* prefix,
                            char        value,
                            bool        overwrite)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k;
-      if (prefix) k = prefix;
-      k += key;
-      
-      char tmp[2];
-      tmp[0] = value;
-      tmp[1] = '\0';
-      ossimString v = tmp;
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if(overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v(1, value);
+      addPair(k, v, overwrite);
    }
 }
 
@@ -299,22 +263,11 @@ void ossimKeywordlist::add(const char* key,
                            ossim_int16 value,
                            bool overwrite)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k = key;
-      
-      ossimString v = ossimString::toString(value);
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
    }
 }
 
@@ -323,24 +276,11 @@ void ossimKeywordlist::add(const char* prefix,
                            ossim_int16 value,
                            bool overwrite)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k;
-      if (prefix) k = prefix;
-      k += key;
-      
-      ossimString v = ossimString::toString(value);
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
    }
 }
 
@@ -348,22 +288,11 @@ void ossimKeywordlist::add(const char* key,
                            ossim_uint16 value,
                            bool overwrite)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k = key;
-      
-      ossimString v = ossimString::toString(value);
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
    }
 }
 
@@ -372,24 +301,11 @@ void ossimKeywordlist::add(const char* prefix,
                            ossim_uint16 value,
                            bool overwrite)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k;
-      if (prefix) k = prefix;
-      k += key;
-      
-      ossimString v = ossimString::toString(value);
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
    }
 }
 
@@ -397,22 +313,11 @@ void ossimKeywordlist::add(const char* key,
                            ossim_int32 value,
                            bool overwrite)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k = key;
-      
-      ossimString v = ossimString::toString(value);
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
    }
 }
 
@@ -421,24 +326,11 @@ void ossimKeywordlist::add(const char*  prefix,
                            ossim_int32 value,
                            bool overwrite)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k;
-      if (prefix) k = prefix;
-      k += key;
-      
-      ossimString v = ossimString::toString(value);
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
    }
 }
 
@@ -446,22 +338,11 @@ void ossimKeywordlist::add(const char* key,
                            ossim_uint32 value,
                            bool overwrite)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k = key;
-      
-      ossimString v = ossimString::toString(value);
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
    }
 }
 
@@ -470,24 +351,11 @@ void ossimKeywordlist::add(const char*  prefix,
                            ossim_uint32 value,
                            bool overwrite)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k;
-      if (prefix) k = prefix;
-      k += key;
-      
-      ossimString v = ossimString::toString(value);
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
    }
 }
 
@@ -495,22 +363,11 @@ void ossimKeywordlist::add(const char* key,
                            ossim_int64 value,
                            bool overwrite)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k = key;
-      
-      ossimString v = ossimString::toString(value);
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
    }
 }
 
@@ -519,24 +376,11 @@ void ossimKeywordlist::add(const char*  prefix,
                            ossim_int64 value,
                            bool overwrite)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k;
-      if (prefix) k = prefix;
-      k += key;
-      
-      ossimString v = ossimString::toString(value);
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
    }
 }
 
@@ -544,19 +388,11 @@ void ossimKeywordlist::add(const char* key,
                            ossim_uint64 value,
                            bool overwrite)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k = key;
-      ossimString v = ossimString::toString(value);
-      KeywordMap::iterator i = getMapEntry(k);
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
    }
 }
 
@@ -565,21 +401,11 @@ void ossimKeywordlist::add(const char*  prefix,
                            ossim_uint64 value,
                            bool overwrite)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k;
-      if (prefix) k = prefix;
-      k += key;
-      ossimString v = ossimString::toString(value);
-      KeywordMap::iterator i = getMapEntry(k);
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
    }
 }
 
@@ -588,23 +414,11 @@ void ossimKeywordlist::add(const char* key,
                            bool overwrite,
                            int precision)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k = key;
-      
-      ossimString v = ossimString::toString(value,
-                                            precision);
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(key);
+      std::string v = ossimString::toString(value, precision).string();
+      addPair(k, v, overwrite);
    }
 }
 
@@ -614,25 +428,11 @@ void ossimKeywordlist::add(const char* prefix,
                            bool overwrite,
                            int precision)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k;
-      if (prefix) k = prefix;
-      k += key;
-      
-      ossimString v = ossimString::toString(value,
-                                            precision);
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v = ossimString::toString(value, precision).string();
+      addPair(k, v, overwrite);
    }
 }
 
@@ -641,23 +441,11 @@ void ossimKeywordlist::add(const char* key,
                            bool overwrite,
                            int precision)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k = key;
-      
-      ossimString v = ossimString::toString(value,
-                                            precision);
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(key);
+      std::string v = ossimString::toString(value, precision).string();
+      addPair(k, v, overwrite);
    }
 }
 
@@ -667,25 +455,11 @@ void ossimKeywordlist::add(const char* prefix,
                            bool overwrite,
                            int precision)
 {
-   if (key)
+   if ( key )
    {
-      ossimString k;
-      if (prefix) k = prefix;
-      k += key;
-      
-      ossimString v = ossimString::toString(value,
-                                            precision);
-      
-      KeywordMap::iterator i = getMapEntry(k);
-      
-      if(i == m_map.end())
-      {
-         m_map.insert(std::make_pair(k, v));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v;
-      }
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v = ossimString::toString(value, precision).string();
+      addPair(k, v, overwrite);
    }
 }
 
@@ -700,16 +474,16 @@ bool ossimKeywordlist::write(const char* 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();
@@ -779,47 +553,69 @@ void ossimKeywordlist::writeToStream(std::ostream& out) const
    }
 }
 
+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 = NULL;
-   
+   const char* result = 0;
    if (key)
    {
-      ossimString k = key;
-      
-      KeywordMap::const_iterator i = m_map.find(k.c_str());
-      
+      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 = NULL;
-   
+   const char* result = 0;
    if (key)
    {
-      ossimString k;
+      std::string k;
       if (prefix) k = prefix;
       k += key;
-      KeywordMap::const_iterator i = m_map.find(k.c_str());
+      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:"";
@@ -859,7 +655,7 @@ ossim_uint32 ossimKeywordlist::numberOf(const char* str) const
       
       while (i != m_map.end())
       {
-         if ( (*i).first.contains(str) )
+         if ( ossimString((*i).first).contains(str) )
          {
             ++count;
          }
@@ -873,28 +669,12 @@ ossim_uint32 ossimKeywordlist::numberOf(const char* str) const
 ossim_uint32 ossimKeywordlist::numberOf(const char* prefix,
                                         const char* key) const
 {
-   if (!prefix && key)  // Must have key, sometimes no prefix.
+   if ( key ) // Must have key, sometimes no prefix.
    {
-      return numberOf(key);
-   }
-   
-   ossim_uint32 count = 0;
-   
-   if (prefix && key)
-   {
-      KeywordMap::const_iterator i = m_map.begin();
-      
-      while (i != m_map.end())
-      {
-         if ( (*i).first.contains(prefix) && (*i).first.contains(key))
-         {
-            ++count;
-         }
-         ++i;
-      }
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      return numberOf(k.c_str());
    }
-   
-   return count;
+   return 0;
 }
 
 void ossimKeywordlist::clear()
@@ -907,7 +687,7 @@ ossimKeywordlist::getMapEntry(const char* key)
 {
    if (key)
    {
-      ossimString k = key;
+      std::string k = key;
       return m_map.find(k);
    }
    else
@@ -917,11 +697,17 @@ ossimKeywordlist::getMapEntry(const char* key)
 }
 
 ossimKeywordlist::KeywordMap::iterator
-ossimKeywordlist::getMapEntry(const ossimString& key)
+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:
@@ -929,46 +715,18 @@ ossimKeywordlist::getMapEntry(const ossimString& key)
 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.is_open() )
+   
+   if(!is.fail())
    {
-      // 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.
-      ossimDirectory directory(file.path());
-      ossimFilename filename(file.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(), std::ios::in | std::ios::binary );
-         }
-      }
-
-      if ( !is.is_open() )
-      {
-         if ( traceDebug() ) 
-         {
-            // report all errors that aren't existence problems.
-            // we want to know about things like permissions, too many open files, etc.
-            ossimNotify(ossimNotifyLevel_DEBUG)
-            << "Error opening file: " << file.c_str() << std::endl;
-         }
-         return false;
-      }
+      result = parseStream(is, ignoreBinaryChars);
    }
-   bool result = parseStream(is, ignoreBinaryChars);
-
+   
    is.close();
-
+   
    return result;
 }
 
@@ -1021,11 +779,16 @@ ossimKeywordlist::KeywordlistParseState ossimKeywordlist::readComments(ossimStri
       c = in.peek();
       if(c == '/')
       {
-        result = KeywordlistParseState_OK;
+         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'))
             {
@@ -1126,7 +889,6 @@ ossimKeywordlist::KeywordlistParseState ossimKeywordlist::readValue(ossimString&
          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.
@@ -1177,6 +939,7 @@ ossimKeywordlist::KeywordlistParseState ossimKeywordlist::readValue(ossimString&
 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)) );
@@ -1197,11 +960,13 @@ bool ossimKeywordlist::parseStream(std::istream& is)
       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.
-         if(readKeyAndValuePair(key, value, is) == KeywordlistParseState_OK)
+         ossimKeywordlist::KeywordlistParseState testKeyValueState = readKeyAndValuePair(key, value, is);
+         if(testKeyValueState == KeywordlistParseState_OK)
          {
             key = key.trim();
             if(key.empty())
@@ -1211,19 +976,27 @@ bool ossimKeywordlist::parseStream(std::istream& is)
             if ( m_expandEnvVars == true )
             {
                ossimString result = value.expandEnvironmentVariable();
-               m_map.insert(std::make_pair(key, result));
+               m_map.insert(std::make_pair(key.string(), result.string()));
             }
             else
             {
-               m_map.insert(std::make_pair(key, value));
+               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)
+      else if(state & KeywordlistParseState_BAD_STREAM)
       {
          return false;
       }
@@ -1240,7 +1013,7 @@ std::vector<ossimString> ossimKeywordlist::findAllKeysThatContains(const ossimSt
    
    for(i = m_map.begin(); i != m_map.end(); ++i)
    {
-      if((*i).first.contains(searchString))
+      if( ossimString((*i).first).contains(searchString))
       {
          result.push_back((*i).first);
       }
@@ -1281,7 +1054,7 @@ void ossimKeywordlist::extractKeysThatMatch(ossimKeywordlist& kwl,
    {
       if(regExp.find( (*i).first.c_str()))
       {
-         kwl.add((*i).first, (*i).second);
+         kwl.addPair((*i).first, (*i).second);
       }
    }
 }
@@ -1378,10 +1151,8 @@ void ossimKeywordlist::addPrefixToAll(const ossimString& prefix)
    
    while(values != tempKwl.m_map.end())
    {
-      ossimString newKey = prefix + (*values).first;
-      add(newKey,
-          (*values).second,
-          true);
+      std::string newKey = prefix.string() + (*values).first;
+      addPair(newKey, (*values).second, true);
       ++values;
    }
 }
@@ -1400,19 +1171,15 @@ void ossimKeywordlist::addPrefixToKeysThatMatch(const ossimString& prefix,
    
    while(values != tempKwl.m_map.end())
    {
-      ossimString newKey = prefix+(*values).first;
+      std::string newKey = prefix.string()+(*values).first;
       if(regExp.find( (*values).first.c_str()))
       {
          
-         add(newKey,
-             (*values).second,
-             true);
+         addPair(newKey, (*values).second, true);
       }
       else
       {
-         add((*values).first,
-             (*values).second,
-             true);
+         addPair((*values).first, (*values).second, true);
       }
       ++values;
    }
@@ -1431,27 +1198,22 @@ void ossimKeywordlist::stripPrefixFromAll(const ossimString& regularExpression)
    
    while(values != tempKwl.m_map.end())
    {
-      ossimString newKey = (*values).first;
+      std::string newKey = (*values).first;
       if(regExp.find( (*values).first.c_str()))
       {
          newKey.erase(newKey.begin()+regExp.start(),
                       newKey.begin()+regExp.start()+regExp.end());
          
-         add(newKey.c_str(),
-             (*values).second,
-             true);
+         addPair(newKey, (*values).second, true);
       }
       else
       {
-         add(newKey.c_str(),
-             (*values).second,
-             true);
+         addPair(newKey, (*values).second, true);
       }
       ++values;
    }
 }
 
-
 ossim_uint32 ossimKeywordlist::getSize()const
 {
    return (ossim_uint32)m_map.size();
@@ -1513,11 +1275,11 @@ OSSIMDLLEXPORT std::ostream& operator<<(std::ostream& os,
 bool ossimKeywordlist::operator ==(ossimKeywordlist& kwl)const
 {
    if(this==&kwl) return true;
-   std::map<ossimString, ossimString>::const_iterator iter = m_map.begin();
+   std::map<std::string, std::string>::const_iterator iter = m_map.begin();
    
    while(iter != m_map.end())
    {
-      const char* value = kwl.find((*iter).first);
+      const char* value = kwl.find((*iter).first.c_str());
       
       if(ossimString(value) != (*iter).second)
       {
@@ -1536,9 +1298,8 @@ ossimKeywordlist&  ossimKeywordlist::downcaseKeywords()
    
    while(iter != m_map.end())
    {
-      tempMap.insert(make_pair(ossimString::downcase(iter->first),
-                               iter->second));
-      
+      ossimString k(iter->first);
+      tempMap.insert(std::make_pair(k.downcase().string(), iter->second));
       ++iter;
    }
    m_map = tempMap;
@@ -1553,9 +1314,8 @@ ossimKeywordlist& ossimKeywordlist::upcaseKeywords()
    
    while(iter != m_map.end())
    {
-      tempMap.insert(make_pair(ossimString::upcase(iter->first),
-                               iter->second));
-      
+      ossimString k(iter->first);
+      tempMap.insert(std::make_pair(k.upcase().string(), iter->second));
       ++iter;
    }
    m_map = tempMap;
@@ -1569,7 +1329,7 @@ ossimKeywordlist& ossimKeywordlist::trimAllValues(const ossimString& valueToTrim
    
    while(iter != m_map.end())
    {
-      iter->second.trim(valueToTrim);
+      iter->second = ossimString(iter->second).trim(valueToTrim).string();
       ++iter;
    }
    
@@ -1610,7 +1370,7 @@ bool ossimKeywordlist::getBoolKeywordValue(bool& rtn_val,
    }
    else
       found = false;
-
+   
    return found;
 }
 
diff --git a/src/ossim/base/ossimLagrangeInterpolator.cpp b/src/ossim/base/ossimLagrangeInterpolator.cpp
new file mode 100644
index 0000000..2c77356
--- /dev/null
+++ b/src/ossim/base/ossimLagrangeInterpolator.cpp
@@ -0,0 +1,191 @@
+//**************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer, GeoEye Inc.
+//
+// DESCRIPTION: Contains Lagrange Interpolator class
+// 
+//**************************************************************************************************
+//  $Id$
+#include <iomanip>
+#include <string>
+using namespace std;
+
+#include "ossim/base/ossimLagrangeInterpolator.h"
+
+// Define Trace flags for use within this file:
+#include "ossim/base/ossimTrace.h"
+static ossimTrace traceDebug ("ossimLagrangeInterpolator:debug");
+
+static const char HEADER_LABEL[] = "LAGRANGE_INTERP";
+
+
+//**************************************************************************************************
+//  CONSTRUCTOR: ossimLagrangeInterpolator()
+//**************************************************************************************************
+ossimLagrangeInterpolator::ossimLagrangeInterpolator(istream& stream)
+{
+   static const char MODULE[] = "ossimLagrangeInterpolator(istream&) CONSTRUCTOR";
+   if (traceDebug())  CLOG << "entering..." << endl;
+
+   stream >> *this;
+
+   if (traceDebug())  CLOG << "returning..." << endl;
+}
+
+
+//**************************************************************************************************
+//  CONSTRUCTOR: ossimLagrangeInterpolator()
+//**************************************************************************************************
+ossimLagrangeInterpolator::ossimLagrangeInterpolator(const std::vector<double>& t_array, 
+   const std::vector<NEWMAT::ColumnVector>&  data_array)
+:  theTeeArray (t_array),
+   theDataArray(data_array),
+   theNumElements(0)
+{
+   static const char MODULE[]="ossimLagrangeInterpolator(int, double, Vector) CONSTRUCTOR";
+   if (traceDebug())  CLOG << "entering..." << endl;
+
+   // Assign data members:
+   ossim_uint32 numPoints = (ossim_uint32) theTeeArray.size();
+   if (theDataArray.size() > 0)
+      theNumElements = theDataArray[0].Nrows();
+
+   ossim_uint32 i;
+   double n;
+   for (i=0; i<numPoints; i++)
+   {
+      // Compute the normalizer value at this data point:
+      n = 1.0;
+      for (ossim_uint32 j=0; j<numPoints; j++)
+      {
+         if (i != j) 
+            n *= (theTeeArray[i] - theTeeArray[j]);
+      }
+      theNormalizer.push_back(n);
+   }
+
+   if (traceDebug())  CLOG << "returning..." << endl;
+}
+
+
+//**************************************************************************************************
+//  DESTRUCTOR: ossimLagrangeInterpolator
+//**************************************************************************************************
+ossimLagrangeInterpolator::~ossimLagrangeInterpolator()
+{
+}
+
+//**************************************************************************************************
+// Adds one data sample to the collection.
+//**************************************************************************************************
+void ossimLagrangeInterpolator::addData(const double& t, const NEWMAT::ColumnVector& data)
+{
+   theTeeArray.push_back(t);
+   theDataArray.push_back(data);
+}
+
+//**************************************************************************************************
+// PUBLIC METHOD: ossimLagrangeInterpolator::interpolate(double t)
+//**************************************************************************************************
+bool ossimLagrangeInterpolator::interpolate(const double& t, NEWMAT::ColumnVector& result) const
+{
+   static const char MODULE[] = "ossimLagrangeInterpolator::interpolate()";
+   if (traceDebug())  CLOG << "entering..." << endl;
+
+   // Prepare to sum:
+   double weight;
+
+   // Perform interpolation:
+   ossim_uint32 numPoints = (ossim_uint32) theTeeArray.size();
+   for (ossim_uint32 i=0; i<numPoints; i++)
+   {
+      weight = 1.0/theNormalizer[i];
+      for (ossim_uint32 j=0; j<numPoints; j++)
+      {
+         if (i != j) 
+            weight *= (t - theTeeArray[j]);
+      }
+
+      result += theDataArray[i] * weight;
+   }
+
+   if (traceDebug())  CLOG << "leaving." << endl;
+   return true;
+}
+
+
+//*****************************************************************************
+//  Outputs contents to output stream. Compatible with input operator >> for
+//  restoring state of interpolator from file:
+//*****************************************************************************
+ostream& operator << (ostream& stream, const ossimLagrangeInterpolator& interpolator)
+{
+   stream << "\n" << HEADER_LABEL
+          << "  " << interpolator.theTeeArray.size()
+          << "  " << interpolator.theNumElements << endl;
+
+   for (ossim_uint32 i=0; i<interpolator.theTeeArray.size(); ++i)
+   {
+      stream << setprecision(20);
+      stream << interpolator.theTeeArray[i]   << " "
+             << interpolator.theNormalizer[i] << endl
+             << "( "<<interpolator.theDataArray[i](0)
+             << interpolator.theDataArray[i](1)
+             << interpolator.theDataArray[2](1) << " )" << endl;
+   }
+   
+   return stream;
+}
+
+
+//*****************************************************************************
+//  Inputs object from input stream. Compatible with output operator << for
+//  restoring state of interpolator from file. Assumes 3D data vector.
+//*****************************************************************************
+istream& operator >> (istream& stream, ossimLagrangeInterpolator& interpolator)
+{
+   // Start with ensuring we're at the right spot.  Let it go a max of ten
+   // reads.  If we go beyond that there's a problem...
+   string s;
+   int count = 0;
+   stream >> s;
+   while (s != "LAGRANGE_INTERP") 
+   {
+      stream >> s;
+      ++count;
+      if (count == 10) break; // Avoid infinite loop...
+   }
+
+   if (count == 10)
+   {
+      cerr << "ossimLagrangeInterpolator operator>> ERROR:"
+           << "\nStream seems to not contain LAGRANGE_INTERP header!"
+           << "\nReturning..." << endl;
+      return stream;
+   }
+
+   ossim_uint32 numPoints;
+   stream >> numPoints >> interpolator.theNumElements;
+
+   interpolator.theTeeArray.clear();
+   interpolator.theDataArray.clear();
+   interpolator.theNormalizer.clear();
+
+   double tee, normalizer;
+   NEWMAT::ColumnVector v(3);
+   for (ossim_uint32 i=0; i<numPoints; i++)
+   {
+      stream >> tee >> v(0) >> v(1) >> v(2) >> normalizer;
+      if (!stream.fail())
+      {
+         interpolator.theTeeArray.push_back(tee);
+         interpolator.theDataArray.push_back(v);
+         interpolator.theNormalizer.push_back(normalizer);
+      }
+   }
+
+   return stream;
+}
diff --git a/src/ossim/base/ossimLookUpTable.cpp b/src/ossim/base/ossimLookUpTable.cpp
index e58c009..87458d4 100644
--- a/src/ossim/base/ossimLookUpTable.cpp
+++ b/src/ossim/base/ossimLookUpTable.cpp
@@ -8,7 +8,7 @@
 //
 // Contains class declaration for 
 //*******************************************************************
-//  $Id: ossimLookUpTable.cpp 12966 2008-06-03 14:17:40Z gpotts $
+//  $Id: ossimLookUpTable.cpp 19448 2011-04-26 15:15:07Z dburken $
 
 #include <iostream>
 using namespace std;
@@ -78,21 +78,25 @@ ossimString ossimLookUpTable::getEntryString(const ossimKeywordlist& kwl,
 ossim_int32 ossimLookUpTable::getEntryNumber(const char*  entry_string,
                                              bool case_insensitive) const
 {
+   // Filter out trivial solution of NULL string:
    ossimString s1 = entry_string;
-   s1 = s1.trim();
-   for (ossim_uint32 i=0; i<theTable.size(); i++)
+   if (!s1.empty())
    {
-      ossimString s2 = theTable[i].theValue;
-
-      if (case_insensitive == true)
-      {
-         s1.downcase();
-         s2.downcase();
-      }
-      
-      if (s1 == s2)
+      s1 = s1.trim();
+      for (ossim_uint32 i=0; i<theTable.size(); i++)
       {
-         return theTable[i].theKey;
+         ossimString s2 = theTable[i].theValue;
+
+         if (case_insensitive == true)
+         {
+            s1.downcase();
+            s2.downcase();
+         }
+
+         if (s1 == s2)
+         {
+            return theTable[i].theKey;
+         }
       }
    }
 
diff --git a/src/ossim/base/ossimMultiBandHistogram.cpp b/src/ossim/base/ossimMultiBandHistogram.cpp
index 5db81da..e260621 100644
--- a/src/ossim/base/ossimMultiBandHistogram.cpp
+++ b/src/ossim/base/ossimMultiBandHistogram.cpp
@@ -7,13 +7,13 @@
 // Description: 
 //
 //*******************************************************************
-//  $Id: ossimMultiBandHistogram.cpp 17205 2010-04-24 18:10:01Z dburken $
-#include <fstream>
-using namespace std;
+//  $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()
 {  
@@ -316,7 +316,7 @@ bool ossimMultiBandHistogram::importHistogram(const ossimFilename& file)
 {
    if(file.exists())
    {
-      ifstream input(file.c_str());
+      std::ifstream input(file.c_str());
 
       return importHistogram(input);
    }
diff --git a/src/ossim/base/ossimMultiResLevelHistogram.cpp b/src/ossim/base/ossimMultiResLevelHistogram.cpp
index 8cc064d..2f5911d 100644
--- a/src/ossim/base/ossimMultiResLevelHistogram.cpp
+++ b/src/ossim/base/ossimMultiResLevelHistogram.cpp
@@ -7,7 +7,7 @@
 // Description: 
 //
 //*******************************************************************
-//  $Id: ossimMultiResLevelHistogram.cpp 13133 2008-07-04 02:09:36Z gpotts $
+//  $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>
@@ -149,9 +149,10 @@ ossimRefPtr<ossimMultiBandHistogram> ossimMultiResLevelHistogram::addHistogram()
    return result;
 }
 
-bool ossimMultiResLevelHistogram::setHistogram(ossimRefPtr<ossimMultiBandHistogram> histo, ossim_uint32 resLevel)
+bool ossimMultiResLevelHistogram::setHistogram(ossimRefPtr<ossimMultiBandHistogram> histo, 
+                                               ossim_uint32 resLevel)
 {
-   if( (resLevel >= 0) && (resLevel < getNumberOfResLevels()))
+   if(resLevel < getNumberOfResLevels())
    {
       theHistogramList[resLevel] = histo;
       return true;
@@ -215,7 +216,7 @@ ossim_uint32 ossimMultiResLevelHistogram::getNumberOfBands(ossim_uint32 resLevel
 
 ossimRefPtr<ossimMultiBandHistogram> ossimMultiResLevelHistogram::getMultiBandHistogram(ossim_uint32 resLevel) const
 {
-   if((resLevel >=0) &&(resLevel < (ossim_uint32)theHistogramList.size()))
+   if(resLevel < (ossim_uint32)theHistogramList.size())
    {
       return theHistogramList[resLevel];
    }
diff --git a/src/ossim/base/ossimNBandLutDataObject.cpp b/src/ossim/base/ossimNBandLutDataObject.cpp
index 5f8195a..8df3c7f 100644
--- a/src/ossim/base/ossimNBandLutDataObject.cpp
+++ b/src/ossim/base/ossimNBandLutDataObject.cpp
@@ -6,10 +6,8 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimNBandLutDataObject.cpp 17815 2010-08-03 13:23:14Z dburken $
+//  $Id: ossimNBandLutDataObject.cpp 19732 2011-06-06 22:24:54Z dburken $
 
-#include <iostream>
-#include <sstream>
 #include <ossim/base/ossimScalarTypeLut.h>
 #include <ossim/base/ossimNBandLutDataObject.h>
 #include <ossim/base/ossimKeywordlist.h>
@@ -17,6 +15,9 @@
 #include <ossim/base/ossimFilename.h>
 #include <ossim/base/ossimNotifyContext.h>
 
+#include <iostream>
+#include <sstream>
+
 RTTI_DEF1(ossimNBandLutDataObject, "ossimNBandLutDataObject", ossimObject);
 
 std::ostream& operator <<(std::ostream& out,
@@ -104,21 +105,29 @@ void ossimNBandLutDataObject::create(ossim_uint32 numberOfEntries,
    }
 }
 
-ossim_uint32 ossimNBandLutDataObject::findIndex(ossimNBandLutDataObject::LUT_ENTRY_TYPE* bandValues)const
+ossim_uint32 ossimNBandLutDataObject::findIndex(
+   ossimNBandLutDataObject::LUT_ENTRY_TYPE* bandValues)const
 {
-   ossim_float64 distance = 1.0/DBL_EPSILON; 
-   ossim_uint32  result   = 0;
+   return findIndex(bandValues, theNumberOfBands);
+}
 
-   if(theNumberOfEntries > 0)
+ossim_uint32 ossimNBandLutDataObject::findIndex(
+   ossimNBandLutDataObject::LUT_ENTRY_TYPE* bandValues, ossim_uint32 size)const
+{
+   ossim_uint32  result = 0;
+
+   if ( (theNumberOfEntries > 0) && (size <= theNumberOfBands) )
    {
+      ossim_float64 distance = 1.0/DBL_EPSILON; 
       ossim_uint32 idx = 0;
       ossim_uint32 bandIdx = 0;
       ossimNBandLutDataObject::LUT_ENTRY_TYPE* lutPtr = theLut;
+
       for(idx = 0; idx < theNumberOfEntries; ++idx,lutPtr+=theNumberOfBands)
       {
          ossim_float64 sumSquare = 0.0;
-
-         for(bandIdx = 0; bandIdx < theNumberOfBands; ++bandIdx)
+         
+         for(bandIdx = 0; bandIdx < size; ++bandIdx)
          {
             ossim_int64 delta = lutPtr[bandIdx] - bandValues[bandIdx];
             sumSquare += (delta*delta);
@@ -153,14 +162,14 @@ void ossimNBandLutDataObject::getMinMax(ossim_uint32 band,
    minValue = 0;
    maxValue = 0;
    ossim_uint32 idx = 0;
-   LUT_ENTRY_TYPE *bandPtr = theLut+theNumberOfBands;
+   LUT_ENTRY_TYPE *bandPtr = theLut+band;
    if((band < theNumberOfBands)&&
       (theNumberOfEntries > 0))
    {
       minValue = theLut[band];
       maxValue = theLut[band];
       
-      for(idx = 1; idx < theNumberOfEntries; ++idx,bandPtr+=theNumberOfBands)
+      for(idx = 0; idx < theNumberOfEntries; ++idx,bandPtr+=theNumberOfBands)
       {
          if((ossim_int32)idx != theNullPixelIndex)
          {
@@ -177,6 +186,25 @@ void ossimNBandLutDataObject::getMinMax(ossim_uint32 band,
    }
 }
 
+ossim_int32 ossimNBandLutDataObject::getFirstNullAlphaIndex() const
+{
+   ossim_int32 result = -1;
+   if ( (theNumberOfBands == 4) &&  (theNumberOfEntries > 0) )
+   {
+      ossim_uint32 idx = 0;
+      LUT_ENTRY_TYPE* bandPtr = theLut+3; // Index to the first alpha channel.
+      for ( idx = 0; idx < theNumberOfEntries; ++idx, bandPtr+=theNumberOfBands )
+      {
+         if ( *bandPtr == 0 )
+         {
+            result = *bandPtr;
+            break;
+         }
+      }
+   }
+   return result;
+}
+
 const ossimNBandLutDataObject& ossimNBandLutDataObject::operator =(const ossimNBandLutDataObject& lut)
 {
    if(theNumberOfEntries != lut.theNumberOfEntries)
diff --git a/src/ossim/base/ossimNadconGridDatum.cpp b/src/ossim/base/ossimNadconGridDatum.cpp
index 5d3844a..13420e8 100644
--- a/src/ossim/base/ossimNadconGridDatum.cpp
+++ b/src/ossim/base/ossimNadconGridDatum.cpp
@@ -1,5 +1,6 @@
 #include <ossim/base/ossimNadconGridDatum.h>
 
+RTTI_DEF1(ossimNadconGridDatum, "ossimNadconGridDatum", ossimThreeParamDatum);
 ossimNadconGridDatum::ossimNadconGridDatum(const ossimFilename& datumDirectory,
 					   const ossimString &code, const ossimString &name,
 					   const ossimEllipsoid* anEllipsoid,
diff --git a/src/ossim/base/ossimNadconGridFile.cpp b/src/ossim/base/ossimNadconGridFile.cpp
index 01daef0..5143d5e 100644
--- a/src/ossim/base/ossimNadconGridFile.cpp
+++ b/src/ossim/base/ossimNadconGridFile.cpp
@@ -14,7 +14,7 @@ bool ossimNadconGridFile::open(const ossimFilename& file)
    {
       theInputFile.close();
       theInputFile.clear();
-      theInputFile.open(file, ios::in|ios::binary);
+      theInputFile.open(file.c_str(), ios::in|ios::binary);
 
       theBoundingRect = theHeader.getBoundingRect();
       theLatLonOrigin.lat = theHeader.getMinY();
diff --git a/src/ossim/base/ossimNadconNarDatum.cpp b/src/ossim/base/ossimNadconNarDatum.cpp
index cff1f00..953977e 100644
--- a/src/ossim/base/ossimNadconNarDatum.cpp
+++ b/src/ossim/base/ossimNadconNarDatum.cpp
@@ -1,5 +1,6 @@
 #include <ossim/base/ossimNadconNarDatum.h>
 
+RTTI_DEF1(ossimNadconNarDatum, "ossimNadconNarDatum", ossimNadconGridDatum);
 ossimNadconNarDatum::ossimNadconNarDatum(const ossimFilename& nadconDirectory)
    :
       ossimNadconGridDatum(nadconDirectory,
diff --git a/src/ossim/base/ossimNadconNasDatum.cpp b/src/ossim/base/ossimNadconNasDatum.cpp
index 99141a1..74dc163 100644
--- a/src/ossim/base/ossimNadconNasDatum.cpp
+++ b/src/ossim/base/ossimNadconNasDatum.cpp
@@ -1,5 +1,6 @@
 #include <ossim/base/ossimNadconNasDatum.h>
 
+RTTI_DEF1(ossimNadconNasDatum, "ossimNadconNasDatum", ossimNadconGridDatum);
 ossimNadconNasDatum::ossimNadconNasDatum(const ossimFilename& nadconDirectory)
    :
       ossimNadconGridDatum(nadconDirectory,
diff --git a/src/ossim/base/ossimNotify.cpp b/src/ossim/base/ossimNotify.cpp
index b568786..9bcc2f5 100644
--- a/src/ossim/base/ossimNotify.cpp
+++ b/src/ossim/base/ossimNotify.cpp
@@ -7,7 +7,7 @@
 //
 // Contains class definition for ossimNotify.
 //*******************************************************************
-//  $Id: ossimNotify.cpp 18953 2011-02-23 20:18:39Z gpotts $
+//  $Id: ossimNotify.cpp 22149 2013-02-11 21:36:10Z dburken $
 
 #include <iostream>
 #include <cstdio>
@@ -398,6 +398,7 @@ void ossimSetError( const char* /* className */,
                     ossim_int32 /* error */,
                     const char *fmtString, ...)
 {
+   // NOTE: This code has an infinite loop in it!!! (drb)
    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
    va_list args;
    
diff --git a/src/ossim/base/ossimObject.cpp b/src/ossim/base/ossimObject.cpp
index 5d1f8db..60843e6 100644
--- a/src/ossim/base/ossimObject.cpp
+++ b/src/ossim/base/ossimObject.cpp
@@ -8,12 +8,14 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimObject.cpp 9094 2006-06-13 19:12:40Z dburken $
+// $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")
 
@@ -101,6 +103,19 @@ bool ossimObject::saveState(ossimKeywordlist& kwl,
    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;
diff --git a/src/ossim/base/ossimObservationSet.cpp b/src/ossim/base/ossimObservationSet.cpp
new file mode 100644
index 0000000..c83bba0
--- /dev/null
+++ b/src/ossim/base/ossimObservationSet.cpp
@@ -0,0 +1,228 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Hicks
+//
+// Description: Storage class for observations.
+//----------------------------------------------------------------------------
+#include <iostream>
+#include <iomanip>
+
+#include <ossim/base/ossimObservationSet.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+
+static ossimTrace traceExec  ("ossimObservationSet:exec");
+static ossimTrace traceDebug ("ossimObservationSet:debug");
+
+
+
+ossimObservationSet::ossimObservationSet() :
+theNumAdjPar(0),
+theNumMeas(0),
+theNumPartials(0)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG: ossimObservationSet(): returning..." << std::endl;
+}
+
+
+ossimObservationSet::~ossimObservationSet()
+{
+   for (ossim_uint32 i=0; i<theImageHandlers.size(); ++i)
+      theImageHandlers[i] = 0;
+   // for (int i=0; i<theObs.size(); ++i)
+   //    theObs[i] = 0;
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG: ~ossimObservationSet(): returning..." << std::endl;
+}
+
+
+bool 
+ossimObservationSet::addObservation(ossimRefPtr<ossimPointObservation> obs)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         <<"\n ossimObservationSet::addObservation: "<<obs->ID()<<endl;
+   }
+
+   theObs.push_back(obs);
+   theNumMeas += obs->numMeas();
+
+
+   // Update image list
+   for (ossim_uint32 i=0; i<obs->numImages(); ++i)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)<<"  i="<<i<<endl;
+      }
+
+      bool found = false;
+
+      // Check for image already in list
+      for (ossim_uint32 j=0; j<theImageFiles.size(); ++j)
+      {
+         if (theImageFiles[j] == obs->imageFile(i))
+         {
+            found = true;
+            theImageIndex.push_back(j);
+            int nAdjPar = obs->numPars(i);
+            theNumPartials += nAdjPar;
+         }
+      }
+
+      // If not found yet, add to image list
+      if (!found)
+      {
+         theImageFiles.push_back(obs->imageFile(i));
+
+         // Geometry
+         ossimRefPtr<ossimImageHandler> ih;
+         ih = ossimImageHandlerRegistry::instance()->open(obs->imageFile(i));        
+         theImageHandlers.push_back(ih);
+
+         theImageIndex.push_back(theImageHandlers.size()-1);
+
+         // Handle ossimAdjustableParameterInterface
+         ossimAdjustableParameterInterface* adjParIface = 
+            obs->getImageGeom(i)->getAdjustableParameterInterface();
+         if (!adjParIface)
+         {
+            return false;
+         }
+         else
+         {
+            if (traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)<<"  Found new image... "<<i<<endl;
+            }
+            int nAdjPar = adjParIface->getNumberOfAdjustableParameters();
+            theNumAdjPar   += nAdjPar;
+            theNumPartials += nAdjPar;
+            theNumAdjParams.push_back(nAdjPar);
+         }
+      }
+   }
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)<<"    theNumAdjPar   = "<<theNumAdjPar<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG)<<"    theNumPartials = "<<theNumPartials<<endl;
+   }
+
+   return true;
+}
+
+
+ossimImageGeometry* ossimObservationSet::getImageGeom(const int index)
+{
+   return theImageHandlers[index]->getImageGeometry().get();
+}
+
+
+void ossimObservationSet::setImageGeom(const int index, ossimImageGeometry* geom)
+{
+   theImageHandlers[index]->setImageGeometry(geom);
+}
+
+
+bool ossimObservationSet::evaluate(NEWMAT::Matrix& measResiduals,
+                                   NEWMAT::Matrix& objPartials,
+                                   NEWMAT::Matrix& parPartials)
+{
+
+   // Dimension output matrices
+   measResiduals = NEWMAT::Matrix(numMeas(), 2);
+   objPartials   = NEWMAT::Matrix(numMeas()*3, 2);
+   parPartials   = NEWMAT::Matrix(theNumPartials, 2);
+
+   int img = 1;
+   int cParIndex = 1;
+   int cObjIndex = 1;
+   for (ossim_uint32 cObs=0; cObs<numObs(); ++cObs)
+   {
+      int numMeasPerObs = theObs[cObs]->numMeas();
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)<<"\n cObs= "<<cObs;
+      }
+
+      for (int cImg=0; cImg<numMeasPerObs; ++cImg)
+      {
+         NEWMAT::Matrix cResid(1, 2);
+         theObs[cObs]->getResiduals(cImg, cResid);
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               <<"\n   cImg, img, cObjIndex, cParIndex, cResid: "
+               <<cImg<<" "<<img<<" "<<cObjIndex<<" "<<cParIndex<<" "<<cResid;
+         }
+         measResiduals.Row(img) = cResid;
+         img++;
+
+         NEWMAT::Matrix cObjPar(3, 2);
+         theObs[cObs]->getObjSpacePartials(cImg, cObjPar);
+         objPartials.SubMatrix(cObjIndex,cObjIndex+2,1,2) << cObjPar;
+         cObjIndex += 3;
+
+         int numPar = theObs[cObs]->numPars(cImg);
+         NEWMAT::Matrix cParamPar(numPar, 2);
+         theObs[cObs]->getParameterPartials(cImg, cParamPar);
+         parPartials.SubMatrix(cParIndex,cParIndex+numPar-1,1,2) << cParamPar;
+         cParIndex += numPar;
+      }
+   }
+
+   return true;
+}
+
+
+std::ostream& ossimObservationSet::print(std::ostream& os) const
+{
+   int idx = 0;
+
+   os<<"\nImages:\n";
+   ossim_uint32 spaces = 0;
+   for (ossim_uint32 i=0; i<numImages(); ++i)
+   {
+      if (theImageFiles[i].size() > spaces)
+         spaces = theImageFiles[i].size();
+   }
+   for (ossim_uint32 i=0; i<numImages(); ++i)
+   {
+      int nAdj = theNumAdjParams[i];
+      os << " "<<i+1<<": " << setw(spaces) << theImageFiles[i] << "   nPar: "<< setw(2) << nAdj <<endl;
+   }
+
+   os<<"\nObservations:";
+   for (ossim_uint32 cObs=0; cObs<numObs(); ++cObs)
+   {
+      os << "\n " << theObs[cObs]->ID();
+      if (ossim::isnan(theObs[cObs]->getScore()) == false)
+      {
+         os << std::setiosflags(std::ios::fixed) << std::setprecision(2);
+         os << "\t" << theObs[cObs]->getScore();
+      }
+      else
+      {
+         os << "\t" << "nan";
+      }
+      os << "\t";
+      theObs[cObs]->getGroundPoint().print(os);
+
+      int numMeasPerObs = theObs[cObs]->numMeas();
+      for (int cImg=0; cImg<numMeasPerObs; ++cImg)
+      {
+         os << "\n\t\t" << theImageIndex[idx]+1;
+         os << "\t";
+         theObs[cObs]->getMeasurement(cImg).print(os,1);
+         idx++;
+      }
+   }
+   return os;
+}
diff --git a/src/ossim/base/ossimPointObservation.cpp b/src/ossim/base/ossimPointObservation.cpp
new file mode 100644
index 0000000..ea93d65
--- /dev/null
+++ b/src/ossim/base/ossimPointObservation.cpp
@@ -0,0 +1,232 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Hicks
+//
+// Description: Class container for multi-ray point observation.
+//----------------------------------------------------------------------------
+
+#include <ossim/base/ossimPointObservation.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/base/ossimAdjustableParameterInterface.h>
+#include <iostream>
+#include <iomanip>
+
+
+static ossimTrace traceExec  ("ossimPointObservation:exec");
+static ossimTrace traceDebug ("ossimPointObservation:debug");
+
+
+ossimPointObservation::ossimPointObservation() :
+   theID(""),
+   theScore(0.0)
+{
+   thePt.makeNan();
+   for (int i=0; i<3; ++i) theObsSigmas[i] = 1000.0;
+}
+
+ossimPointObservation::ossimPointObservation(const ossimString& anID) : 
+   theID(anID),
+   theScore(0.0)
+{
+   thePt.makeNan();
+   for (int i=0; i<3; ++i) theObsSigmas[i] = 1000.0;
+}
+
+ossimPointObservation::ossimPointObservation(const ossimGpt& aPt,
+                                             const ossimString& anID,
+                                             const ossimColumnVector3d& latLonHgtSigmas) : 
+   thePt(aPt),
+   theID(anID),
+   theScore(0.0)
+{
+   for (int i=0; i<3; ++i) theObsSigmas[i] = latLonHgtSigmas[i];    
+}
+
+ossimPointObservation::ossimPointObservation(const ossimPointObservation& tpt) : 
+   thePt(tpt.thePt),
+   theID(tpt.theID),
+   theScore(tpt.theScore)
+{
+   for (int i=0; i<3; ++i) theObsSigmas[i] = tpt.theObsSigmas[i]; 
+   theImageHandlers = tpt.theImageHandlers;
+   theMeas = tpt.theMeas;  
+   theMeasSigmas = tpt.theMeasSigmas;
+   theImageFiles = tpt.theImageFiles;
+   theNumPars = tpt.theNumPars;
+}
+
+
+ossimPointObservation::~ossimPointObservation()
+{
+   reset();
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG: ~ossimPointObservation(): returning..." << std::endl;
+}
+
+
+void ossimPointObservation::reset()
+{
+   thePt.makeNan();
+   theID = "";
+   for (int i=0; i<3; ++i)
+      theObsSigmas[i] = 0.0;
+   theScore = 0.0;
+
+   for (ossim_uint32 i=0; i<theImageHandlers.size(); ++i)
+      theImageHandlers[i] = 0;
+   theMeas.clear();
+   theMeasSigmas.clear();
+   theImageFiles.clear();
+   theNumPars.clear();
+   theImageHandlers.clear();
+}
+
+
+void ossimPointObservation::addMeasurement(const double& x,
+                                           const double& y,
+                                           const std::string& imgFile,
+                                           const ossimDpt& measSigma)
+{
+   ossimDpt meas(x, y);
+   addMeasurement(meas, imgFile, measSigma);
+}
+
+
+void ossimPointObservation::addMeasurement(const ossimDpt& meas,
+                                           const ossimFilename& imgFile,
+                                           const ossimDpt& measSigma)
+{
+   // Image handler
+   ossimRefPtr<ossimImageHandler> ih =
+      ossimImageHandlerRegistry::instance()->open(imgFile);
+   if ( ih.valid() )
+   {
+      theImageFiles.push_back(imgFile);
+      theImageHandlers.push_back(ih);
+      
+      // Image measurements & sigmas
+      theMeas.push_back(meas);
+      theMeasSigmas.push_back(measSigma);
+      
+      // Number of parameters
+      ossimAdjustableParameterInterface* adjParInterface =
+         ih->getImageGeometry().get()->getAdjustableParameterInterface();
+      theNumPars.push_back(adjParInterface->getNumberOfAdjustableParameters());
+   }
+}
+
+
+ossimImageGeometry* ossimPointObservation::getImageGeom(const int index)
+{
+   return theImageHandlers[index]->getImageGeometry().get();
+}
+
+
+void ossimPointObservation::setImageGeom(const int index, ossimImageGeometry* imgGeom)
+{
+   theImageHandlers[index]->setImageGeometry(imgGeom);
+}
+
+
+void ossimPointObservation::getMeasurement(const int index, NEWMAT::Matrix& meas)const
+{
+   meas = NEWMAT::Matrix(1, 2);
+   meas[0][0] = theMeas[index].x;
+   meas[0][1] = theMeas[index].y;
+}
+
+
+void ossimPointObservation::getMeasCov(const int index, NEWMAT::Matrix& cov)const
+{
+   cov = NEWMAT::Matrix(2,2);
+   cov = 0.0;
+
+   cov(1,1) = theMeasSigmas[index].x*theMeasSigmas[index].x;
+   cov(2,2) = theMeasSigmas[index].y*theMeasSigmas[index].y;
+}
+
+
+void ossimPointObservation::getObsCov(NEWMAT::Matrix& cov)const
+{
+   cov = NEWMAT::Matrix(3,3);
+   cov = 0.0;
+
+   double stdrp = theObsSigmas[0]/thePt.metersPerDegree().y/DEG_PER_RAD; //lat
+   double stdrl = theObsSigmas[1]/thePt.metersPerDegree().x/DEG_PER_RAD; //lon
+
+   cov(1,1) = stdrp*stdrp;
+   cov(2,2) = stdrl*stdrl;
+   cov(3,3) = theObsSigmas[2]*theObsSigmas[2];
+}
+
+
+void ossimPointObservation::getResiduals(const int index, NEWMAT::Matrix& resid)
+{
+   ossimDpt computedImagePosition;
+   getImageGeom(index)->worldToLocal(refGroundPoint(), computedImagePosition);
+   ossimDpt residual  = theMeas[index] - computedImagePosition;
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)<<"\n========getResiduals======== "<<index;
+      theMeas[index].print(ossimNotify(ossimNotifyLevel_DEBUG),1);
+      computedImagePosition.print(ossimNotify(ossimNotifyLevel_DEBUG),1);
+      refGroundPoint().print(ossimNotify(ossimNotifyLevel_DEBUG));
+   }
+
+   resid = NEWMAT::Matrix(1, 2);
+   resid[0][0] = residual.x;
+   resid[0][1] = residual.y;
+}
+
+
+void ossimPointObservation::getParameterPartials(const int index, NEWMAT::Matrix& parPartials)
+{
+   parPartials = NEWMAT::Matrix(theNumPars[index], 2);
+   getImageGeom(index)->computeImageToGroundPartialsWRTAdjParams(parPartials, refGroundPoint());
+}
+
+
+void ossimPointObservation::getObjSpacePartials(const int index, NEWMAT::Matrix& objPartials)
+{
+   objPartials = NEWMAT::Matrix(3, 2);
+   getImageGeom(index)->computeGroundToImagePartials(objPartials, refGroundPoint());
+}
+
+
+std::ostream& ossimPointObservation::print(std::ostream& os) const
+{
+   // Observation
+   os << "\n "<<theID;
+   if (ossim::isnan(theScore) == false)
+   {
+      os << std::setiosflags(std::ios::fixed) << std::setprecision(2);
+      os << "\t" << theScore;
+   }
+   else
+   {
+      os << "\t" << "nan";
+   }
+   os << "\t" << dynamic_cast<const ossimGpt&>(*this);
+
+   // Measurements
+   for (ossim_uint32 i=0; i<numMeas(); ++i)
+   {
+      os << "\n\t\t\t";
+      theMeas[i].print(os,1);
+   }
+
+   return os;
+}
+
+
+std::ostream& operator<<(std::ostream& os, const ossimPointObservation& pt)
+{
+   return pt.print(os);
+}
diff --git a/src/ossim/base/ossimPolygon.cpp b/src/ossim/base/ossimPolygon.cpp
index 8ed4a94..630e0f7 100644
--- a/src/ossim/base/ossimPolygon.cpp
+++ b/src/ossim/base/ossimPolygon.cpp
@@ -1,7 +1,5 @@
 //*****************************************************************************
-// FILE: ossimPolygon.cc
-//
-// Copyright (C) 2001 ImageLinks, Inc.
+// FILE: ossimPolygon.cpp
 //
 // License:  LGPL
 //
@@ -12,12 +10,7 @@
 // LIMITATIONS: None.
 //
 //*****************************************************************************
-//  $Id: ossimPolygon.cpp 19180 2011-03-22 17:36:33Z oscarkramer $
-
-#include <algorithm>
-#include <iterator>
-#include <sstream>
-#include <iterator>
+//  $Id: ossimPolygon.cpp 19682 2011-05-31 14:21:20Z dburken $
 
 #include <ossim/base/ossimPolygon.h>
 #include <ossim/base/ossimLine.h>
@@ -26,6 +19,10 @@
 #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";
@@ -36,16 +33,17 @@ static const int RECT_RIGHT_EDGE  = 2;
 static const int RECT_BOTTOM_EDGE = 3;
 
 ossimPolygon::ossimPolygon()
-   :theVertexList(),
-    theCurrentVertex(0),
-    theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN)
+   : theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN),
+    theVertexList(),
+    theCurrentVertex(0)
+   
 {}
 
 ossimPolygon::ossimPolygon(const vector<ossimIpt>& polygon)
-   :
+   :theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN),
    theVertexList(polygon.size()),
-   theCurrentVertex(0),
-   theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN)
+   theCurrentVertex(0)
+   
 {
    // Assign std::vector<ossimIpt> list to std::vector<ossimDpt> theVertexList.
    for (std::vector<ossimIpt>::size_type i = 0; i < polygon.size(); ++i)
@@ -55,9 +53,9 @@ ossimPolygon::ossimPolygon(const vector<ossimIpt>& polygon)
 }
 
 ossimPolygon::ossimPolygon(const vector<ossimDpt>& polygon)
-   :theVertexList(polygon),
-    theCurrentVertex(0),
-    theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN)
+   :theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN),
+   theVertexList(polygon),
+    theCurrentVertex(0)
 {
 }
 
@@ -66,8 +64,9 @@ ossimPolygon::ossimPolygon(const vector<ossimDpt>& polygon)
 //  
 //*****************************************************************************
 ossimPolygon::ossimPolygon(int numVertices, const ossimDpt* v)
-   : theCurrentVertex(0),
-     theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN)
+   : theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN),
+     theCurrentVertex(0)
+     
 {
    theVertexList.insert(theVertexList.begin(),
                         v, v+numVertices);
@@ -94,9 +93,10 @@ ossimPolygon::ossimPolygon(ossimDpt v1,
                            ossimDpt v2,
                            ossimDpt v3,
                            ossimDpt v4)
-   : theVertexList(4),
-     theCurrentVertex(0),
-     theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN)
+   : theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN),
+     theVertexList(4),
+     theCurrentVertex(0)
+     
 {
    theVertexList[0] = v1;
    theVertexList[1] = v2;
@@ -105,9 +105,9 @@ ossimPolygon::ossimPolygon(ossimDpt v1,
 }
 
 ossimPolygon::ossimPolygon(const ossimIrect& rect)
-   : theVertexList(4),
-     theCurrentVertex(0),
-     theOrderingType(OSSIM_CLOCKWISE_ORDER)
+: theOrderingType(OSSIM_CLOCKWISE_ORDER),
+  theVertexList(4),
+  theCurrentVertex(0)
 {
    theVertexList[0] = rect.ul();
    theVertexList[1] = rect.ur();
@@ -116,9 +116,9 @@ ossimPolygon::ossimPolygon(const ossimIrect& rect)
 }
 
 ossimPolygon::ossimPolygon(const ossimDrect& rect)
-   : theVertexList(4),
-     theCurrentVertex(0),
-     theOrderingType(OSSIM_CLOCKWISE_ORDER)
+: theOrderingType(OSSIM_CLOCKWISE_ORDER),
+theVertexList(4),
+theCurrentVertex(0)
 {
    theVertexList[0] = rect.ul();
    theVertexList[1] = rect.ur();
@@ -833,8 +833,8 @@ bool ossimPolygon::loadState(const ossimKeywordlist& kwl,
       ossimString v = kwl.find(prefix, (ossimString("v")+ossimString::toString(i)).c_str());
       v = v.trim();
 
-      istringstream vStream(v);
-      vStream >> x >> y;
+      istringstream vStream(v.string());
+      vStream >> x.string() >> y.string();
       theVertexList.push_back(ossimDpt(x.toDouble(),y.toDouble()));
    }
 
@@ -1012,7 +1012,7 @@ void ossimPolygon::removeSmallestContributingVertex()
    if (!numvertices)
       return;
 
-   int smallest_vertex,n1,n2;
+   int smallest_vertex=-1,n1,n2;
    double smallest_area=1.0/DBL_EPSILON;
    ossimPolygon tmp;
 
@@ -1178,13 +1178,13 @@ void ossimPolygon::getCentroid(ossimDpt &centroid) const
 */
 void ossimPolygon::fitCircleInsideVertex(ossimDpt &destPt, unsigned int vertex, double radius) const
 {
-   int num_vertices=(int)theVertexList.size(),n1,n2;
+   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 || (int)vertex>=num_vertices) {
+   if(num_vertices<3 || vertex>=num_vertices) {
       destPt=ossimDpt(0,0);
       return;
    }
diff --git a/src/ossim/base/ossimProperty.cpp b/src/ossim/base/ossimProperty.cpp
index 8cb2ba9..52cd5e1 100644
--- a/src/ossim/base/ossimProperty.cpp
+++ b/src/ossim/base/ossimProperty.cpp
@@ -5,7 +5,7 @@
 // Author: Garrett Potts (gpotts at imagelinks.com)
 //
 //*************************************************************************
-// $Id: ossimProperty.cpp 18406 2010-11-10 20:45:37Z gpotts $
+// $Id: ossimProperty.cpp 19917 2011-08-09 11:12:24Z gpotts $
 #include <ossim/base/ossimProperty.h>
 #include <ossim/base/ossimContainerProperty.h>
 #include <ossim/base/ossimKeywordlist.h>
@@ -79,24 +79,36 @@ ossimContainerProperty* ossimProperty::asContainer()
    return 0;
 }
 
+bool ossimProperty::isChangeTypeSet(int type)const
+{
+   return ((type&theChangeType)!=0);
+}
+
 void ossimProperty::clearChangeType()
 {
    theChangeType = ossimPropertyChangeType_NOTSPECIFIED;
 }
 
-void ossimProperty::setChangeType(ossimPropertyChangeType type)
+void ossimProperty::setChangeType(int type, bool on)
 {
-   theChangeType = type;
+   if(on)
+   {
+      theChangeType = static_cast<ossimPropertyChangeType>(theChangeType | type);
+   }
+   else 
+   {
+      theChangeType = static_cast<ossimPropertyChangeType>((~type)&theChangeType);
+   }
 }
 
 void ossimProperty::setFullRefreshBit()
 {
-   theChangeType = (ossimPropertyChangeType)(theChangeType | ossimPropertyChangeType_FULL_REFRESH);
+   setChangeType(ossimPropertyChangeType_FULL_REFRESH);
 }
 
 void ossimProperty::setCacheRefreshBit()
 {
-   theChangeType = (ossimPropertyChangeType)(theChangeType | ossimPropertyChangeType_CACHE_REFRESH);
+   setChangeType(ossimPropertyChangeType_CACHE_REFRESH);
 }
 
 ossimProperty::ossimPropertyChangeType ossimProperty::getChangeType()const
@@ -106,12 +118,12 @@ ossimProperty::ossimPropertyChangeType ossimProperty::getChangeType()const
 
 bool ossimProperty::isFullRefresh()const
 {
-   return ((theChangeType & ossimPropertyChangeType_FULL_REFRESH) != 0);
+   return isChangeTypeSet(ossimPropertyChangeType_FULL_REFRESH);
 }
 
 bool ossimProperty::isCacheRefresh()const
 {
-   return ((theChangeType & ossimPropertyChangeType_CACHE_REFRESH) != 0);
+   return isChangeTypeSet(ossimPropertyChangeType_CACHE_REFRESH);
 }
 
 bool ossimProperty::isChangeTypeSpecified()const
@@ -119,6 +131,11 @@ bool ossimProperty::isChangeTypeSpecified()const
    return (theChangeType != ossimPropertyChangeType_NOTSPECIFIED);
 }
 
+bool ossimProperty::affectsOthers()const
+{
+   return isChangeTypeSet(ossimPropertyChangeType_AFFECTS_OTHERS);
+}
+
 void ossimProperty::setReadOnlyFlag(bool flag)
 {
    theReadOnlyFlag = flag;
@@ -164,6 +181,11 @@ ossimString ossimProperty::getDescription()const
    return theDescription;
 }
 
+void ossimProperty::accept(ossimVisitor& visitor)
+{
+   ossimObject::accept(visitor);
+}
+
 ossimRefPtr<ossimXmlNode> ossimProperty::toXml()const
 {
    ossimRefPtr<ossimXmlNode> result = new ossimXmlNode();
diff --git a/src/ossim/base/ossimRectilinearDataObject.cpp b/src/ossim/base/ossimRectilinearDataObject.cpp
index b7776da..4be74da 100644
--- a/src/ossim/base/ossimRectilinearDataObject.cpp
+++ b/src/ossim/base/ossimRectilinearDataObject.cpp
@@ -8,10 +8,11 @@
 // Contributor: David A. Horner (DAH) - http://dave.thehorners.com
 //
 //*************************************************************************
-// $Id: ossimRectilinearDataObject.cpp 17195 2010-04-23 17:32:18Z dburken $
+// $Id: ossimRectilinearDataObject.cpp 20045 2011-09-06 15:03:11Z oscarkramer $
 
 #include <ossim/base/ossimRectilinearDataObject.h>
 #include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimKeywordlist.h>
 
 RTTI_DEF1(ossimRectilinearDataObject, "ossimRectilinearDataObject", ossimDataObject);
 
@@ -239,3 +240,54 @@ const ossimRectilinearDataObject& ossimRectilinearDataObject::operator=(
    }
    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/src/ossim/base/ossimRefreshEvent.cpp b/src/ossim/base/ossimRefreshEvent.cpp
index be55c84..effe6b8 100644
--- a/src/ossim/base/ossimRefreshEvent.cpp
+++ b/src/ossim/base/ossimRefreshEvent.cpp
@@ -7,7 +7,20 @@
 //
 //
 //*************************************************************************
-// $Id: ossimRefreshEvent.cpp 9963 2006-11-28 21:11:01Z gpotts $
+// $Id: ossimRefreshEvent.cpp 19717 2011-06-03 17:26:52Z gpotts $
 #include <ossim/base/ossimRefreshEvent.h>
 
 RTTI_DEF1(ossimRefreshEvent, "ossimRefreshEvent", ossimEvent);
+
+
+void ossimRefreshEvent::setRefreshType(int refreshType, bool on)
+{
+   if(on)
+   {
+      m_refreshType = static_cast<RefreshType>(m_refreshType | refreshType);
+   }
+   else 
+   {
+      m_refreshType = static_cast<RefreshType>(((~refreshType)&(m_refreshType))&REFRESH_ALL);
+   }
+}
diff --git a/src/ossim/base/ossimScalarTypeLut.cpp b/src/ossim/base/ossimScalarTypeLut.cpp
index da9a1c1..f4db442 100644
--- a/src/ossim/base/ossimScalarTypeLut.cpp
+++ b/src/ossim/base/ossimScalarTypeLut.cpp
@@ -9,15 +9,13 @@
 // Contains class definition for ossimScalarTypeLUT.
 // 
 //*******************************************************************
-//  $Id: ossimScalarTypeLut.cpp 11913 2007-10-28 18:26:39Z dburken $
+//  $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;
 
-static const int TABLE_SIZE = 21;
-
 ossimScalarTypeLut* ossimScalarTypeLut::instance()
 {
    if (!theInstance)
@@ -28,75 +26,138 @@ ossimScalarTypeLut* ossimScalarTypeLut::instance()
 }
 
 ossimScalarTypeLut::ossimScalarTypeLut()
-   :
-      ossimLookUpTable(TABLE_SIZE)
 {
    //---
    // Complete initialization of data member "theTable".
    // Note:  Scalar types defined in constants.h file.
    //---
-   theTable[0].theKey   = OSSIM_SCALAR_UNKNOWN;
-   theTable[0].theValue = "unknown";
+   ossimKeyValueMap entry;
+   entry.init(OSSIM_SCALAR_UNKNOWN, "unknown");
+   theTable.push_back(entry);
    
-   theTable[1].theKey   = OSSIM_UINT8;
-   theTable[1].theValue = "ossim_uint8";
+   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);
 
-   theTable[2].theKey   = OSSIM_SINT8;
-   theTable[2].theValue = "ossim_sint8";
+   entry.init(OSSIM_SINT16, "ossim_sint16");
+   theTable.push_back(entry);
 
-   theTable[3].theKey   = OSSIM_UINT16;
-   theTable[3].theValue = "ossim_uint16";
+   entry.init(OSSIM_UINT32, "ossim_uint32");
+   theTable.push_back(entry);
 
-   theTable[4].theKey   = OSSIM_SINT16;
-   theTable[4].theValue = "ossim_sint16";
+   entry.init(OSSIM_SINT32, "ossim_sint32");
+   theTable.push_back(entry);
 
-   theTable[5].theKey   = OSSIM_UINT32;
-   theTable[5].theValue = "ossim_uint32";
+   entry.init(OSSIM_UINT64, "ossim_uint64");
+   theTable.push_back(entry);
 
-   theTable[6].theKey   = OSSIM_SINT32;
-   theTable[6].theValue = "ossim_sint32";
+   entry.init(OSSIM_SINT64, "ossim_sint64");
+   theTable.push_back(entry);
 
-   theTable[7].theKey   = OSSIM_FLOAT32;
-   theTable[7].theValue = "ossim_float32";
+   entry.init(OSSIM_FLOAT32, "ossim_float32");
+   theTable.push_back(entry);
 
-   theTable[8].theKey   = OSSIM_FLOAT64;
-   theTable[8].theValue = "ossim_float64";
+   entry.init(OSSIM_FLOAT64, "ossim_float64");
+   theTable.push_back(entry);
 
-   theTable[9].theKey   = OSSIM_CINT16;
-   theTable[9].theValue = "ossim_cint16";
+   entry.init(OSSIM_CINT16, "ossim_cint16");
+   theTable.push_back(entry);
 
-   theTable[10].theKey   = OSSIM_CINT32;
-   theTable[10].theValue = "ossim_cint32";
+   entry.init(OSSIM_CINT32, "ossim_cint32");
+   theTable.push_back(entry);
 
-   theTable[11].theKey   = OSSIM_CFLOAT32;
-   theTable[11].theValue = "ossim_cfloat32";
+   entry.init(OSSIM_CFLOAT32, "ossim_cfloat32");
+   theTable.push_back(entry);
 
-   theTable[12].theKey   = OSSIM_CFLOAT64;
-   theTable[12].theValue = "ossim_cfloat64";
+   entry.init(OSSIM_CFLOAT64, "ossim_cfloat64");
+   theTable.push_back(entry);
    
-   theTable[13].theKey   = OSSIM_UCHAR;
-   theTable[13].theValue = "uchar";
+   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);
 
-   theTable[14].theKey   = OSSIM_USHORT16;
-   theTable[14].theValue = "ushort16";
+   entry.init(OSSIM_FLOAT, "float");
+   theTable.push_back(entry);
 
-   theTable[15].theKey   = OSSIM_SSHORT16;
-   theTable[15].theValue = "sshort16";
+   entry.init(OSSIM_NORMALIZED_FLOAT, "normalized_float");
+   theTable.push_back(entry);
 
-   theTable[16].theKey   = OSSIM_USHORT11;
-   theTable[16].theValue = "ushort11";
+   entry.init(OSSIM_NORMALIZED_DOUBLE, "normalized_double");
+   theTable.push_back(entry);
 
-   theTable[17].theKey   = OSSIM_FLOAT;
-   theTable[17].theValue = "float";   
+   entry.init(OSSIM_DOUBLE, "double");
+   theTable.push_back(entry);
 
-   theTable[18].theKey   = OSSIM_NORMALIZED_FLOAT;
-   theTable[18].theValue = "normalized_float";   
+   // Short forms:
 
-   theTable[19].theKey   = OSSIM_NORMALIZED_DOUBLE;
-   theTable[19].theValue = "normalized_double";
+   entry.init(OSSIM_UINT8, "U8");
+   theTable.push_back(entry);
 
-   theTable[20].theKey   = OSSIM_DOUBLE;
-   theTable[20].theValue = "double";
+   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()
diff --git a/src/ossim/base/ossimSevenParamDatum.cpp b/src/ossim/base/ossimSevenParamDatum.cpp
index f3a4f86..2f8dc3d 100644
--- a/src/ossim/base/ossimSevenParamDatum.cpp
+++ b/src/ossim/base/ossimSevenParamDatum.cpp
@@ -9,7 +9,7 @@
 // SevenParamDatum. This is a base class for all
 // seven param datums.
 //*******************************************************************
-//  $Id: ossimSevenParamDatum.cpp 9963 2006-11-28 21:11:01Z gpotts $
+//  $Id: ossimSevenParamDatum.cpp 19795 2011-06-30 15:04:48Z gpotts $
 
 #include <ossim/base/ossimSevenParamDatum.h>
 #include <ossim/base/ossimDatumFactory.h>
@@ -17,6 +17,7 @@
 #include <ossim/base/ossimEcefPoint.h>
 #include <ossim/base/ossimWgs84Datum.h>
 
+RTTI_DEF1(ossimSevenParamDatum, "ossimSevenParamDatum", ossimDatum);
 ossimGpt ossimSevenParamDatum::shift(const ossimGpt &aPt)const
 {
    const ossimDatum* aDatum = aPt.datum();
@@ -156,3 +157,24 @@ ossimGpt ossimSevenParamDatum::shiftFromWgs84(const ossimGpt &aPt)const
    return ossimGpt(p2, this);
 }
 
+bool ossimSevenParamDatum::isEqualTo(const ossimObject& obj, ossimCompareType compareType)const
+{
+   const ossimSevenParamDatum* datum = dynamic_cast<const ossimSevenParamDatum*> (&obj);
+   
+   bool result = datum&&ossimDatum::isEqualTo(obj, compareType);
+   
+   if(result)
+   {
+      result = (ossim::almostEqual(theParam1, datum->theParam1)&&
+                ossim::almostEqual(theParam2, datum->theParam2)&&
+                ossim::almostEqual(theParam3, datum->theParam3)&&
+                ossim::almostEqual(theParam4, datum->theParam4)&&
+                ossim::almostEqual(theParam5, datum->theParam5)&&
+                ossim::almostEqual(theParam6, datum->theParam6)&&
+                ossim::almostEqual(theParam7, datum->theParam7)
+                );
+   }
+   
+   return result;
+}
+
diff --git a/src/ossim/base/ossimString.cpp b/src/ossim/base/ossimString.cpp
index 4ae48ff..5ea9986 100644
--- a/src/ossim/base/ossimString.cpp
+++ b/src/ossim/base/ossimString.cpp
@@ -9,7 +9,7 @@
 // Description: This class extends the stl's string class.
 // 
 //********************************************************************
-// $Id: ossimString.cpp 17999 2010-08-30 18:00:08Z gpotts $
+// $Id: ossimString.cpp 22160 2013-02-25 12:09:35Z gpotts $
 
 #include <cctype> /* for toupper */
 #include <cstdlib> /* for getenv() */
@@ -28,14 +28,14 @@
 static ossimTrace traceDebug("ossimString:debug");
 
 #ifdef OSSIM_ID_ENABLED
-static char OSSIM_ID[] = "$Id: ossimString.cpp 17999 2010-08-30 18:00:08Z gpotts $";
+static char OSSIM_ID[] = "$Id: ossimString.cpp 22160 2013-02-25 12:09:35Z gpotts $";
 #endif
 
 ossimString ossimString::upcase(const ossimString& aString)
 {
-   ossimString s(aString);
-
-   ossimString::iterator eachCharacter = s.begin();
+   std::string s = aString.string();
+   
+   std::string::iterator eachCharacter = s.begin();
    while(eachCharacter != s.end())
    {
       *eachCharacter = toupper(*eachCharacter);
@@ -47,25 +47,25 @@ ossimString ossimString::upcase(const ossimString& aString)
 
 ossimString ossimString::downcase(const ossimString& aString)
 {
-   ossimString s(aString);
+   std::string s = aString.m_str;
 
-   ossimString::iterator eachCharacter = s.begin();
+   std::string::iterator eachCharacter = s.begin();
    while(eachCharacter != s.end())
    {
       *eachCharacter = tolower(*eachCharacter);
-      eachCharacter++;
+      ++eachCharacter;
    }
 
-   return s;
+   return ossimString(s);
 }
 
 ossimString& ossimString::upcase()
 {
-   ossimString::iterator eachCharacter = begin();
-   while(eachCharacter != end())
+   std::string::iterator eachCharacter = m_str.begin();
+   while(eachCharacter != m_str.end())
    {
       *eachCharacter = toupper(*eachCharacter);
-      eachCharacter++;
+      ++eachCharacter;
    }
 
    return *this;
@@ -80,11 +80,11 @@ ossimString ossimString::upcase()const
 
 ossimString& ossimString::downcase()
 {
-   ossimString::iterator eachCharacter=begin();
-   while(eachCharacter != end())
+   std::string::iterator eachCharacter = m_str.begin();
+   while(eachCharacter != m_str.end())
    {
       *eachCharacter = tolower(*eachCharacter);
-      eachCharacter++;
+      ++eachCharacter;
    }
    
    return *this;
@@ -109,14 +109,14 @@ char* ossimString::stringDup()const
    else
    {  
       ossim_uint32 index = 0;
-      ossim_uint32 len = (ossim_uint32)length();
+      ossim_uint32 len = (ossim_uint32)m_str.length();
       result = new char[len+1];
-      const char* sourceString = c_str();
+      const char* sourceString = m_str.c_str();
 
       while(index < len) 
       {
          result[index] = sourceString[index];
-         index++;
+         ++index;
       }
       result[len] = '\0';
    }
@@ -125,68 +125,68 @@ char* ossimString::stringDup()const
 
 ossimString ossimString::stripLeading(const ossimString &value, char characterToStrip)
 {
-   ossimString result;
-   ossimString::const_iterator stringIter = value.begin();
+   std::string s;
+   ossimString::const_iterator stringIter = value.m_str.begin();
    
-   while((*stringIter == characterToStrip)&&(stringIter!=value.end()))
+   while((*stringIter == characterToStrip)&&(stringIter!=value.m_str.end()))
    {
       ++stringIter;
    }
 
-   while(stringIter != value.end())
+   while(stringIter != value.m_str.end())
    {
-      result += *stringIter;
+      s += *stringIter;
       ++stringIter;
    }
    
-   return result;
+   return ossimString(s);
 }
 
 ossimString ossimString::substitute(const ossimString &searchKey,
                                     const ossimString &replacementValue,
                                     bool replaceAll)const
 {
-   ossimString result = *this;
+   std::string result = m_str;
 
-   size_type pos = result.find(searchKey);
+   size_type pos = result.find(searchKey.m_str);
    
-   if (pos == npos) return result;  // Search key not found.
+   if (pos == std::string::npos) return result;  // Search key not found.
    
    if(replaceAll)
    {
-      while(pos != npos)
+      while(pos != std::string::npos)
       {
-         result.replace(pos, searchKey.size(), replacementValue.c_str());
-         pos = result.find(searchKey, pos+replacementValue.size());
+         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.size(), replacementValue.c_str());
+      result.replace(pos, searchKey.m_str.size(), replacementValue.m_str.c_str());
    }
 
-   return result;
+   return ossimString(result);
 }
 
 ossimString& ossimString::gsub(const ossimString &searchKey,
                                const ossimString &replacementValue,
                                bool replaceAll)
 {
-   size_type pos = find(searchKey);
+   size_type pos = m_str.find(searchKey.m_str);
    
-   if (pos == npos) return *this;  // Search key not found.
+   if (pos == std::string::npos) return *this;  // Search key not found.
    
    if(replaceAll)
    {
-      while(pos < size())
+      while(pos < m_str.size())
       {
-         replace(pos, searchKey.size(), replacementValue.c_str());
-         pos = find(searchKey, pos+replacementValue.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.
    {
-      replace(pos, searchKey.size(), replacementValue.c_str());
+      m_str.replace(pos, searchKey.m_str.size(), replacementValue.m_str.c_str());
    }
 
    return *this;
@@ -201,7 +201,7 @@ ossimString  ossimString::trim(const ossimString& valueToTrim) const
 
 ossimString& ossimString::trim(const ossimString& valueToTrim)
 {
-   if(this->size() == 0) return *this;
+   if(m_str.size() == 0) return *this;
    if(valueToTrim.empty()) return *this;
    iterator startPos = (*this).begin();
    iterator endPos   = (*this).begin() + ((*this).size()-1);
@@ -232,7 +232,7 @@ ossimString ossimString::beforePos(std::string::size_type pos)const
 
    if(pos < length())
    {
-      result.erase(pos, npos);
+      result.erase(pos, std::string::npos);
    }
 
    return result;
@@ -261,12 +261,12 @@ std::vector<ossimString> ossimString::explode(const ossimString& delimeter) cons
    std::vector<ossimString> result;
    char* tokenPtr;
 
-   tokenPtr = strtok((char*)exp_str.chars(), (char*)delimeter.chars());
+   tokenPtr = strtok((char*)exp_str.c_str(), (char*)delimeter.c_str());
 
    while(tokenPtr != NULL)
    {
       result.push_back(tokenPtr);
-      tokenPtr = strtok(NULL, delimeter.chars());
+      tokenPtr = strtok(NULL, delimeter.c_str());
    }
 
    return result;
@@ -278,10 +278,8 @@ ossimString ossimString::expandEnvironmentVariable() const
    std::stack<ossim_uint32> startChars;
    ossimRegExp regExpStart("\\$\\(");
 
-   ossim_uint32 startIndex = 0;
    if(regExpStart.find(result.c_str()))
    {
-      startIndex = regExpStart.start();
       startChars.push(regExpStart.start());
       while(!startChars.empty())
       {
@@ -302,7 +300,7 @@ ossimString ossimString::expandEnvironmentVariable() const
             {
                ossimString envVarStr(result.begin()+startChars.top()+2,
                                      result.begin()+startChars.top()+regExpEnd.start());
-               char* lookup = getenv( envVarStr.c_str() );
+               const char* lookup = getenv( envVarStr.c_str() );
                if ( lookup )
                {
                   result.replace(result.begin()+startChars.top(),
@@ -529,7 +527,7 @@ ossim_uint8 ossimString::toUInt8()const
    ossim_uint16 i = 0;
    if (!empty())
    {
-      std::istringstream is(*this);
+      std::istringstream is(m_str);
       is >> i;
       if(is.fail())
       {
@@ -549,7 +547,7 @@ int ossimString::toInt()const
    int i = 0;
    if (!empty())
    {
-      std::istringstream is(*this);
+      std::istringstream is(m_str);
       is >> i;
       if(is.fail())
       {
@@ -569,7 +567,7 @@ ossim_int16 ossimString::toInt16()const
    ossim_int16 i = 0;
    if (!empty())
    {
-      std::istringstream is(*this);
+      std::istringstream is(m_str);
       is >> i;
       if(is.fail())
       {
@@ -589,7 +587,7 @@ ossim_uint16 ossimString::toUInt16()const
    ossim_uint16 i = 0;
    if (!empty())
    {
-      std::istringstream is(*this);
+      std::istringstream is(m_str);
       is >> i;
       if(is.fail())
       {
@@ -609,7 +607,7 @@ ossim_int32 ossimString::toInt32()const
    ossim_int32 i = 0;
    if (!empty())
    {
-      std::istringstream is(*this);
+      std::istringstream is(m_str);
       is >> i;
       if(is.fail())
       {
@@ -629,7 +627,7 @@ ossim_uint32 ossimString::toUInt32()const
    ossim_uint32 i = 0;
    if (!empty())
    {
-      std::istringstream is(*this);
+      std::istringstream is(m_str);
       is >> i;
       if(is.fail())
       {
@@ -649,7 +647,7 @@ ossim_int64 ossimString::toInt64()const
    ossim_int64 i = 0;
    if (!empty())
    {
-      std::istringstream is(*this);
+      std::istringstream is(m_str);
       is >> i;
       if(is.fail())
       {
@@ -669,7 +667,7 @@ ossim_uint64 ossimString::toUInt64()const
    ossim_uint64 i = 0;
    if (!empty())
    {
-      std::istringstream is(*this);
+      std::istringstream is(m_str);
       is >> i;
       if(is.fail())
       {
@@ -689,7 +687,7 @@ long ossimString::toLong()const
   long i = 0;
    if (!empty())
    {
-      std::istringstream is(*this);
+      std::istringstream is(m_str);
       is >> i;
       if(is.fail())
       {
@@ -709,7 +707,7 @@ unsigned long  ossimString::toULong()const
    unsigned long i = 0;
    if (!empty())
    {
-      std::istringstream is(*this);
+      std::istringstream is(m_str);
       is >> i;
       if(is.fail())
       {
@@ -735,13 +733,13 @@ ossim_float32 ossimString::toFloat32()const
    // There is a possibility that this isn't a thread safe implementation
    // in mingw stl.  Let's resort back to atof for now
 
-#if 1
+#if 0
    d = (ossim_float32)atof(c_str());
 #endif
-#if 0
+#if 1
    if (!empty())
    {
-      std::istringstream is(*this);
+      std::istringstream is(c_str());
       is >> d;
       if(is.fail())
       {
@@ -768,13 +766,13 @@ ossim_float64 ossimString::toFloat64()const
    // There is a possibility that this isn't a thread safe implementation
    // in mingw stl.  Let's resort back to atof for now
 
-#if 1
+#if 0
    d = (ossim_float64)atof(c_str());
 #endif
-#if 0
+#if 1
    if (!empty())
    {
-      std::istringstream is(*this);
+      std::istringstream is(c_str());
       is >> d;
       if(is.fail())
       {
@@ -804,15 +802,18 @@ double ossimString::toDouble()const
 
    if (!empty())
    {
-#if 1
+#if 0
       d = atof(c_str());
 #endif
-#if 0
-      std::istringstream is(*this);
-      is >> d;
-      if(is.fail())
+#if 1
+      if(!empty())
       {
-         d = 0.0;
+         std::istringstream is(c_str());
+         is >> d;
+         if(is.fail())
+         {
+            d = 0.0;
+         }
       }
 #endif
    }
@@ -930,24 +931,64 @@ ossimString ossimString::before(const ossimString& str,
    if(*this == "") return ossimString();
 
    size_type last = find(str.c_str(), pos);
-   if(last >= npos) return *this;
+   if(last >= std::string::npos) return *this;
    
-   return substr(0, last);
+   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 >= npos) return ossimString();
+   if (last >= std::string::npos) return ossimString();
    
-   return substr(last+str.length());
+   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)const
+                        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;
 
@@ -956,32 +997,29 @@ void ossimString::split(std::vector<ossimString>& result,
 
    for(std::string::size_type i = 0; i < separatorList.size(); ++ i)
    {
-      if((*(this->begin())) == separatorList.c_str()[i])
-      {
+      if (((*(this->begin())) == separatorList.c_str()[i]) && !skipBlankFields)
          result.push_back("");
-      }
    }
    while(s)
    {
       result.push_back(ossimString(s));
-      s = strtok(NULL,
-                 separatorList.c_str());
+      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])
-      {
+      if (((*(this->end()-1)) == separatorList.c_str()[i]) && !skipBlankFields)
          result.push_back("");
-      }
    }
+#endif
 }
 
-std::vector<ossimString> ossimString:: split(const ossimString& separatorList)const
+std::vector<ossimString> ossimString:: split(const ossimString& separatorList,
+                                             bool skipBlankFields)const
 {
    std::vector<ossimString> result;
 
-   split(result, separatorList);
+   split(result, separatorList, skipBlankFields);
    
    return result;
 }
@@ -1046,3 +1084,4 @@ ossimString ossimString::getOssimId() const
 #endif
    return ossimString("");
 }
+
diff --git a/src/ossim/base/ossimStringListProperty.cpp b/src/ossim/base/ossimStringListProperty.cpp
index 175df1c..28b365c 100644
--- a/src/ossim/base/ossimStringListProperty.cpp
+++ b/src/ossim/base/ossimStringListProperty.cpp
@@ -6,7 +6,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimStringListProperty.cpp 12911 2008-05-28 13:36:06Z gpotts $
+// $Id: ossimStringListProperty.cpp 19682 2011-05-31 14:21:20Z dburken $
 //
 #include <sstream>
 #include <algorithm>
@@ -103,7 +103,7 @@ void ossimStringListProperty::valueToString(ossimString& valueResult)const
 
    for(idx = 0; idx < (int)theValueList.size(); ++idx)
    {
-      kwl.add(ossimString::toString(idx),
+      kwl.add(ossimString::toString(idx).c_str(),
               theValueList[idx],
               true);
    }
diff --git a/src/ossim/base/ossimThreeParamDatum.cpp b/src/ossim/base/ossimThreeParamDatum.cpp
index 5fa0b52..9648e62 100644
--- a/src/ossim/base/ossimThreeParamDatum.cpp
+++ b/src/ossim/base/ossimThreeParamDatum.cpp
@@ -6,7 +6,7 @@
 //
 // Description:
 //*******************************************************************
-//  $Id: ossimThreeParamDatum.cpp 17815 2010-08-03 13:23:14Z dburken $
+//  $Id: ossimThreeParamDatum.cpp 19795 2011-06-30 15:04:48Z gpotts $
 
 #include <cmath>
 
@@ -18,6 +18,7 @@
 #include <ossim/base/ossimEcefPoint.h>
 #include <ossim/base/ossimWgs84Datum.h>
 
+RTTI_DEF1(ossimThreeParamDatum, "ossimThreeParamDatum", ossimDatum);
 ossimGpt ossimThreeParamDatum::shiftToWgs84(const ossimGpt &aPt)const
 {
    
@@ -143,3 +144,19 @@ ossimGpt ossimThreeParamDatum::shift(const ossimGpt &aPt)const
 
    return aPt;
 }
+
+bool ossimThreeParamDatum::isEqualTo(const ossimObject& obj, ossimCompareType compareType)const
+{
+   const ossimThreeParamDatum* datum = dynamic_cast<const ossimThreeParamDatum*> (&obj);
+   
+   bool result = datum&&ossimDatum::isEqualTo(obj, compareType);
+   
+   if(result)
+   {
+      result = (ossim::almostEqual(theParam1, datum->theParam1)&&
+                ossim::almostEqual(theParam2, datum->theParam2)&&
+                ossim::almostEqual(theParam3, datum->theParam3));
+   }
+   
+   return result;
+}
diff --git a/src/ossim/base/ossimUrl.cpp b/src/ossim/base/ossimUrl.cpp
new file mode 100644
index 0000000..85e9bc0
--- /dev/null
+++ b/src/ossim/base/ossimUrl.cpp
@@ -0,0 +1,109 @@
+#include <ossim/base/ossimUrl.h>
+
+ossimUrl::ossimUrl()
+{
+
+}
+
+ossimUrl::ossimUrl(const ossimString& url)
+{
+    setFieldsFromUrl(url);
+}
+
+ossimUrl::ossimUrl(const ossimString& protocol,
+                   const ossimString& ip,
+                   const ossimString& port,
+                   const ossimString& path,
+                   const ossimString& params)
+:m_protocol(protocol),
+m_ip(ip),
+m_port(port),
+m_path(path),
+m_params(params)
+{
+
+}
+void ossimUrl::setIp(const ossimString& ip)
+{
+    const std::string& s = ip.string();
+    std::string::size_type pos = s.find_first_of(':');
+    if(pos != std::string::npos)
+    {
+        m_ip = ossimString(s.begin(), s.begin()+pos);
+        m_port = ossimString(s.begin()+pos+1, s.end());
+    }
+    else
+    {
+        m_ip = ip;
+    }
+}
+
+void ossimUrl::setParams(const ossimKeywordlist& kwl)
+{
+    m_params = "";
+    const ossimKeywordlist::KeywordMap& map = kwl.getMap();
+    ossimKeywordlist::KeywordMap::const_iterator iter = map.begin();
+    while(iter!=map.end())
+    {
+        if(m_params.empty())
+        {
+            m_params = iter->first + "=" + iter->second;
+        }
+        else
+        {
+            m_params+=("&"+iter->first + "=" + iter->second);
+        }
+        ++iter;
+    }
+}
+
+void ossimUrl::setFieldsFromUrl(const ossimString& url)
+{
+    m_protocol = m_ip = m_port = m_path = m_params = "";
+    
+    // look for something of the form <protocol>://
+    const std::string& s = url.string();
+    std::string::size_type pos = s.find_first_of(":");
+    
+    if(pos == std::string::npos) return;
+    
+    m_protocol = ossimString(s.begin(), s.begin()+pos);
+    
+    // now find the ip and then extract port if embedded in IP
+    //
+    pos = s.find_first_not_of('/', pos+1);
+    
+    if(pos == std::string::npos) return;
+    
+    std::string::size_type nextPos = s.find_first_of('/', pos+1);
+    
+    if(nextPos == std::string::npos)
+    {
+        setIp(ossimString(s.begin()+pos, s.end()));
+        return;
+    }
+    else
+    {
+        setIp(ossimString(s.begin()+pos, s.begin()+nextPos));
+    }
+    // now find the path portion
+    //
+    pos = s.find_first_of('?', nextPos);
+    if(pos == std::string::npos)
+    {
+        m_path = ossimString(s.begin()+nextPos+1, s.end());
+        return;
+    }
+    else
+    {
+        m_path = ossimString(s.begin()+nextPos+1, s.begin()+pos);
+    }
+    
+    m_params = ossimString(s.begin()+pos+1, s.end());
+    
+}
+
+ossimString ossimUrl::toString()const
+{
+    return (m_protocol+"://"+m_ip + (m_port.empty()?"":":"+m_port) +"/"+m_path + (m_params.empty()?"":("?"+m_params)));
+}
diff --git a/src/ossim/base/ossimVisitor.cpp b/src/ossim/base/ossimVisitor.cpp
index ae3fbb8..e113fac 100644
--- a/src/ossim/base/ossimVisitor.cpp
+++ b/src/ossim/base/ossimVisitor.cpp
@@ -1,5 +1,9 @@
+// $Id: ossimVisitor.cpp 22158 2013-02-20 12:29:10Z gpotts $
+
 #include <ossim/base/ossimVisitor.h>
 #include <ossim/base/ossimConnectableObject.h>
+#include <ossim/base/ossimPropertyEvent.h>
+#include <ossim/base/ossimViewInterface.h>
 
 
 ossimVisitor::ossimVisitor(int visitorType)
@@ -21,26 +25,40 @@ ossimVisitor::VisitorType ossimVisitor::getVisitorType()const
    return m_visitorType;
 }
 
-void  ossimVisitor::setVisitorType(int vType)
+void  ossimVisitor::setVisitorType(int vType, bool on)
 {
-   m_visitorType = (VisitorType)(vType&VISIT_ALL);
+   if(on)
+   {
+      m_visitorType = (VisitorType)((vType|m_visitorType)&VISIT_ALL);
+   }
+   else 
+   {
+      m_visitorType = (VisitorType)(((~vType) & m_visitorType)&VISIT_ALL);
+   }
 }
 
 void ossimVisitor::turnOffVisitorType(int vType)
 {
-   m_visitorType = (VisitorType)(((~vType) & m_visitorType)&VISIT_ALL);
+   setVisitorType(vType, false);
 }
 
 void ossimVisitor::reset()
 {
    m_markNode.clear();
+   m_stopTraversalFlag = false;
 }
-void ossimVisitor::visit(ossimConnectableObject* obj)
+
+void ossimVisitor::visit(ossimObject* obj)
 {
    m_markNode.insert(obj);
 }
 
-bool ossimVisitor::hasVisited(ossimConnectableObject* obj)const
+void ossimVisitor::visit(ossimConnectableObject* obj)
+{
+   visit(static_cast<ossimObject*>(obj));
+}
+
+bool ossimVisitor::hasVisited(ossimObject* obj)const
 {
    return m_markNode.find(obj) != m_markNode.end(); 
 }
@@ -50,49 +68,82 @@ bool ossimVisitor::stopTraversal()const
    return m_stopTraversalFlag;
 }
 
+
+ossimIdVisitor::ossimIdVisitor()
+   :
+   ossimVisitor(ossimVisitor::VISIT_INPUTS|ossimVisitor::VISIT_CHILDREN),
+   m_object(0),
+   m_id(0)
+{
+}
+
+ossimIdVisitor::ossimIdVisitor(int visitorType)
+   :
+   ossimVisitor(visitorType),
+   m_object(0),
+   m_id(0)
+{
+}
+
 ossimIdVisitor::ossimIdVisitor(const ossimId& id, int visitorType)
-:ossimVisitor(visitorType),
-m_id(id)
+   :
+   ossimVisitor(visitorType),
+   m_object(0),
+   m_id(id)
 {
 }
 
 ossimIdVisitor::ossimIdVisitor(const ossimIdVisitor& src)
-:ossimVisitor(src),
-m_connectableObject(src.m_connectableObject),
-m_id(src.m_id)
+   :
+   ossimVisitor(src),
+   m_object(src.m_object),
+   m_id(src.m_id)
 {
 }
 
-ossimVisitor* ossimIdVisitor::dup()const
+ossimRefPtr<ossimVisitor> ossimIdVisitor::dup()const
 {
    return new ossimIdVisitor(*this);
 }
 
 void ossimIdVisitor::visit(ossimConnectableObject* obj)
 {
-   ossimVisitor::visit(obj);
-   if(obj->getId() == m_id)
+   if ( !hasVisited(obj) )
    {
-      m_connectableObject = obj;
-      m_stopTraversalFlag = true;
+      if(obj->getId() == m_id)
+      {
+         m_object = obj;
+         m_stopTraversalFlag = true;
+      }
+      ossimVisitor::visit(obj);
    }
 }
 
 void ossimIdVisitor::reset()
 {
-   m_connectableObject = 0;
+   ossimVisitor::reset();
+   m_object = 0;
+}
+
+ossimConnectableObject* ossimIdVisitor::getObject()
+{
+   return m_object;
 }
 
-ossimConnectableObject* ossimIdVisitor::connectableObject()
+const ossimConnectableObject* ossimIdVisitor::getObject()const
 {
-   return m_connectableObject;
+   return m_object;
 }
 
-const ossimConnectableObject* ossimIdVisitor::connectableObject()const
+void ossimIdVisitor::setId(const ossimId& id)
 {
-   return m_connectableObject;
+   m_id = id;
 }
 
+const ossimId& ossimIdVisitor::getId()const
+{
+   return m_id;
+}
 
 ossimCollectionVisitor::ossimCollectionVisitor(int visitorType)
 :ossimVisitor(visitorType)
@@ -104,32 +155,54 @@ ossimCollectionVisitor::ossimCollectionVisitor(const ossimCollectionVisitor& src
 {
 }
 
-ossimCollectionVisitor::List& ossimCollectionVisitor::getObjects()
+ossimCollectionVisitor::ListRef& ossimCollectionVisitor::getObjects()
 {
    return m_collection;
 }
 
-const ossimCollectionVisitor::List& ossimCollectionVisitor::getObjects()const
+const ossimCollectionVisitor::ListRef& ossimCollectionVisitor::getObjects()const
 {
    return m_collection;
 }
 
+ossimObject* ossimCollectionVisitor::getObject(ossim_uint32 idx)
+{
+   if(idx < m_collection.size())
+   {
+      return m_collection[idx].get();
+   }
+   return 0;
+}
+
+const ossimObject* ossimCollectionVisitor::getObject(ossim_uint32 idx)const
+{
+   if(idx < m_collection.size())
+   {
+      return m_collection[idx].get();
+   }
+   return 0;
+}
+
 void ossimCollectionVisitor::reset()
 {
    ossimVisitor::reset();
    m_collection.clear();
 }
 
-
 ossimTypeNameVisitor::ossimTypeNameVisitor(int visitorType)
-:ossimCollectionVisitor(visitorType)
+   :ossimCollectionVisitor(visitorType),
+    m_typeName(),
+    m_firstOfTypeFlag(false)
 {
 }
 
-ossimTypeNameVisitor::ossimTypeNameVisitor(const ossimString& typeName, bool firstOfTypeFlag, int visitorType)
-:ossimCollectionVisitor(visitorType),
-m_typeName(typeName),
- m_firstOfTypeFlag(firstOfTypeFlag)
+ossimTypeNameVisitor::ossimTypeNameVisitor(const ossimString& typeName,
+                                           bool firstOfTypeFlag,
+                                           int visitorType)
+   :
+   ossimCollectionVisitor(visitorType),
+   m_typeName(typeName),
+   m_firstOfTypeFlag(firstOfTypeFlag)
 {
 }
 
@@ -139,12 +212,12 @@ ossimTypeNameVisitor::ossimTypeNameVisitor(const ossimTypeNameVisitor& src)
 {
 }
 
-ossimVisitor* ossimTypeNameVisitor::dup()const
+ossimRefPtr<ossimVisitor> ossimTypeNameVisitor::dup()const
 {
    return new ossimTypeNameVisitor(*this);
 }
 
-void ossimTypeNameVisitor::visit(ossimConnectableObject* obj)
+void ossimTypeNameVisitor::visit(ossimObject* obj)
 {
    if(!hasVisited(obj))
    {
@@ -152,11 +225,31 @@ void ossimTypeNameVisitor::visit(ossimConnectableObject* obj)
       if(obj&&obj->canCastTo(m_typeName))
       {
          m_collection.push_back(obj);
+         if(m_firstOfTypeFlag) m_stopTraversalFlag = true;
       }
-      //traverse(obj);
   }
 }
 
+void ossimTypeNameVisitor::setTypeName(const ossimString& typeName)
+{
+   m_typeName = typeName;
+}
+
+const ossimString& ossimTypeNameVisitor::getTypeName()const
+{
+   return m_typeName;
+}
+
+void ossimTypeNameVisitor::setFirstOfTypeFlag(bool flag)
+{
+   m_firstOfTypeFlag = flag;
+}
+
+bool ossimTypeNameVisitor::getFirstOfTypeFlag() const
+{
+   return m_firstOfTypeFlag;
+}
+
 ossimTypeIdVisitor::ossimTypeIdVisitor(int visitorType)
 :ossimCollectionVisitor(visitorType)
 {
@@ -174,13 +267,8 @@ ossimTypeIdVisitor::ossimTypeIdVisitor(const ossimTypeIdVisitor& src)
 m_firstOfTypeFlag(src.m_firstOfTypeFlag)
 {
 }
-/*
-void ossimTypeIdVisitor::traverse(ossimConnectableObject* obj)
-{
-   ossimCollectionVisitor::traverse(obj);
-}
-*/
-ossimVisitor* ossimTypeIdVisitor::dup()const
+
+ossimRefPtr<ossimVisitor> ossimTypeIdVisitor::dup()const
 {
    return new ossimTypeIdVisitor(*this);
 }
@@ -190,7 +278,12 @@ void ossimTypeIdVisitor::setTypeId(const RTTItypeid& typeId)
    m_typeId = typeId;
 }
 
-void ossimTypeIdVisitor::visit(ossimConnectableObject* obj)
+const RTTItypeid& ossimTypeIdVisitor::getTypeId()const
+{
+   return m_typeId;
+}
+
+void ossimTypeIdVisitor::visit(ossimObject* obj)
 {
    if(!hasVisited(obj))
    {
@@ -198,6 +291,89 @@ void ossimTypeIdVisitor::visit(ossimConnectableObject* obj)
       if(obj&&obj->canCastTo(m_typeId))
       {
          m_collection.push_back(obj);
+         if(m_firstOfTypeFlag) m_stopTraversalFlag = true;
+      }
+   }
+}
+
+ossimEventVisitor::ossimEventVisitor(ossimEvent* evt, int visitorType)
+:ossimVisitor(visitorType),
+m_event(evt)
+{
+}
+ossimEventVisitor::ossimEventVisitor(const ossimEventVisitor& src)
+:ossimVisitor(src),
+m_event(src.m_event)
+{
+}
+
+ossimRefPtr<ossimVisitor> ossimEventVisitor::dup()const
+{
+   return new ossimEventVisitor(*this);
+}
+
+void ossimEventVisitor::visit(ossimObject* obj)
+{
+   if(!hasVisited(obj))
+   {
+      ossimListenerManager* manager = dynamic_cast<ossimListenerManager*> (obj);
+      if(manager)
+      {
+         manager->fireEvent(*m_event);
+         ossimVisitor::visit(obj);
+      }
+   }
+}
+
+ossimViewInterfaceVisitor::ossimViewInterfaceVisitor(ossimObject* view, int visitorType)
+   :
+   ossimVisitor(visitorType),
+   m_view(view)
+{
+}
+
+ossimViewInterfaceVisitor::ossimViewInterfaceVisitor(const ossimViewInterfaceVisitor& src)
+   :
+   ossimVisitor(src),
+   m_view(src.m_view)
+{
+}
+
+ossimRefPtr<ossimVisitor> ossimViewInterfaceVisitor::dup()const
+{
+   return new ossimViewInterfaceVisitor(*this);
+}
+
+ossimObject* ossimViewInterfaceVisitor::getView()
+{
+   return m_view.get();
+}
+
+const ossimObject* ossimViewInterfaceVisitor::getView()const
+{
+   return m_view.get();
+}
+
+void ossimViewInterfaceVisitor::visit(ossimObject* obj)
+{
+   if( !hasVisited(obj) )
+   {
+      if ( m_view.get() )
+      {
+         ossimViewInterface* vi = dynamic_cast<ossimViewInterface*>(obj);
+         if ( vi )
+         {
+            // Set the view:
+            vi->setView( m_view.get() );
+
+            // Send property event for outputs connected to us.
+            ossimRefPtr<ossimEvent> propEvent = new ossimPropertyEvent(obj);
+            ossimEventVisitor ev( propEvent.get(), VISIT_OUTPUTS );
+            obj->accept(ev);
+         }
       }
+      
+      // This will put the obj in the m_markNode for hasVisited method.
+      ossimVisitor::visit(obj);
    }
 }
diff --git a/src/ossim/base/ossimWLSBundleSolution.cpp b/src/ossim/base/ossimWLSBundleSolution.cpp
new file mode 100644
index 0000000..cb6dac4
--- /dev/null
+++ b/src/ossim/base/ossimWLSBundleSolution.cpp
@@ -0,0 +1,494 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Hicks
+//
+// Description: Weighted least squares bundle solution.
+//
+//----------------------------------------------------------------------------
+
+#include <ossim/base/ossimWLSBundleSolution.h>
+#include <ossim/base/ossimAdjSolutionAttributes.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNotify.h>
+
+#include <iostream>
+#include <iomanip>
+
+static ossimTrace traceDebug(ossimString("ossimWLSBundleSolution:debug"));
+static ossimTrace traceExec(ossimString("ossimWLSBundleSolution:exec"));
+
+
+//*****************************************************************************
+//  METHOD: ossimWLSBundleSolution::ossimWLSBundleSolution()
+//  
+//  Constructor.
+//  
+//*****************************************************************************
+ossimWLSBundleSolution::ossimWLSBundleSolution()
+{
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimWLSBundleSolution::ossimWLSBundleSolution()
+//  
+//  Destructor.
+//  
+//*****************************************************************************
+ossimWLSBundleSolution::~ossimWLSBundleSolution()
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG: ~ossimWLSBundleSolution(): returning..." << std::endl;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimWLSBundleSolution::run()
+//  
+//  Execute solution.
+//  
+//*****************************************************************************
+bool ossimWLSBundleSolution::run(ossimAdjSolutionAttributes* solAttributes)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nossimWLSBundleSolution::run DEBUG:" << std::endl;
+   }
+   
+   theSolValid = false;
+
+
+   // Initialize traits
+   int numObs    = solAttributes->numObjObs();
+   int numImages = solAttributes->numImages();
+
+   int Nrank = solAttributes->theImgNumparXref[0];
+   //int NdIndex[numImages];
+   std::vector<int> NdIndex(numImages);
+   NdIndex[0] = 1;
+   for (int n=1; n<numImages; ++n)
+   {
+      NdIndex[n] = NdIndex[n-1] + solAttributes->theImgNumparXref[n-1];
+      Nrank += solAttributes->theImgNumparXref[n];
+   }
+
+   // N-dot rank before adding ground partition
+   int Nd_rank = Nrank;
+
+   // Full rank
+   Nrank += numObs*3;
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         <<"\n Bundle........"
+         <<"\n   numObs    = "<<numObs
+         <<"\n   numImages = "<<numImages
+         <<"\n   Nd_rank   = "<<Nd_rank
+         <<"\n   Nrank     = "<<Nrank;
+      for (int n=0; n<numImages; ++n)
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            <<"\n    NdIndex     = "<<n<<" "<<NdIndex[n];
+      ossimNotify(ossimNotifyLevel_DEBUG)<<std::endl;
+   }
+
+
+   // NORMAL EQUATION ARRAYS
+   NEWMAT::UpperTriangularMatrix N(Nrank);//coefficient matrix
+   NEWMAT::ColumnVector C(Nrank);         // normal constant vector
+	NEWMAT::ColumnVector D(Nrank);         // solution vector 
+
+   // IMAGE PARTITION ARRAYS (for image having "p" parameters)
+   NEWMAT::Matrix Bd;                     // [B-dot] matrix            (2Xp)
+   NEWMAT::Matrix Bdt_w;                  // [B-dot(t) * w] matrix     (2Xp)
+   NEWMAT::UpperTriangularMatrix Nd;      // [N-dot] matrix            (pXp)
+   NEWMAT::Matrix Cd;                     // [C-dot] matrix            (pX1)
+   NEWMAT::Matrix Nb;                     // [N-bar] matrix            (pX3)
+   
+   NEWMAT::ColumnVector eps(2);           // image pt residual matrix  (2X1)
+   NEWMAT::Matrix w(2,2);                 // image pt weight matrix    (2X2)
+
+   // GROUND PARTITION ARRAYS
+   NEWMAT::Matrix Bdd(2,3);               // [B-dbl-dot] matrix        (2X3)
+   NEWMAT::Matrix Bddt_w(2,3);            // [B-dbl-dot(t) * w] matrix (2X3)
+   NEWMAT::UpperTriangularMatrix Ndd(3);  // [N-dbl-dot] matrix        (3X3)
+   NEWMAT::ColumnVector Cdd(3);           // [C-dbl_dot] matrix        (3X1)
+   NEWMAT::Matrix Wdd(3,3);               // [W-dbl-dot] matrix        (3X3)
+
+
+	// initialize N and C partions with weights
+   N = 0.0;
+   C = 0.0;
+
+   for (int img=0; img<numImages; img++)
+   {
+      int size = solAttributes->theImgNumparXref[img];
+      int rcBeg = NdIndex[img];
+      int rcEnd = rcBeg+size-1;
+
+      //  TODO....  theAdjParCov is not stacked because npar/image may vary.
+      //            However, it's not treated as a full matrix in the solution due to
+      //            to current use of simple partitioning, assuming no correlation.
+      NEWMAT::Matrix Wd(size,size);
+      Wd = solAttributes->theAdjParCov.SubMatrix(rcBeg,rcEnd,rcBeg,rcEnd).i();
+
+      NEWMAT::ColumnVector Ed(size);
+      Ed = solAttributes->theTotalCorrections.Rows(rcBeg,rcEnd);
+
+      N.SymSubMatrix(rcBeg,rcEnd) << Wd;
+      C.Rows(rcBeg,rcEnd) = Wd * Ed;
+   }
+
+   //*******************
+   // object point loop 
+   //*******************
+   int cMeas = 1;
+   int cImgIdx = 1;
+   int cObjIdx = 1;
+
+   for (int obs=0; obs<numObs; obs++)
+   {
+      // Initialize Ndd & Cdd partitions with weight matrix
+      int idx = obs*3 + 1;
+      Wdd = solAttributes->theObjectPtCov.Rows(idx,idx+2).i();
+      int NddIdx = Nd_rank + idx;
+      N.SymSubMatrix(NddIdx, NddIdx+2) << Wdd;
+
+      NEWMAT::ColumnVector Edd(3);
+      Edd = solAttributes->theTotalCorrections.Rows(NddIdx, NddIdx+2);
+      C.Rows(NddIdx, NddIdx+2) = Wdd * Edd;
+
+
+      //*******************************************
+      // image point loop for current object point 
+      //*******************************************
+      int nMeasOnObs = (int) solAttributes->theObjImgXref.count(obs);
+      ObjImgMapIterPair_t imgRng;
+      imgRng = solAttributes->theObjImgXref.equal_range(obs);
+      ObjImgMapIter_t currImg = imgRng.first;
+
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            <<"\n=========obs, nMeasOnObs ========="<<obs<<"  "<<nMeasOnObs;
+      }
+
+      for (int meas=0; meas<nMeasOnObs; meas++)
+      {
+
+         // object point partials
+         Bdd = solAttributes->theObjPartials.Rows(cObjIdx,cObjIdx+2).t();
+         cObjIdx += 3;
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n cObjIdx "<<cObjIdx;
+         }
+
+         //image parameter partials
+         int cNumPar = solAttributes->theImgNumparXref[currImg->second];
+         Bd = solAttributes->theParPartials.Rows(cImgIdx,cImgIdx+cNumPar-1).t();
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n cImgIdx,cNumPar "<<cImgIdx<<"  "<<cNumPar;
+         }
+
+         //***********************************************************
+         // form all image parameter & object pt parameter partitions 
+         //***********************************************************
+         int NdIdx = NdIndex[currImg->second];
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n NdIdx,NddIdx "<<NdIdx<<"  "<<NddIdx;
+         }
+
+         // residuals
+		   eps = solAttributes->theMeasResiduals.Row(cMeas).t();
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n resid ("<<eps(1)<<","<<eps(2)<<")";
+         }
+
+         // compute N-dot & C-dot contributions
+         int start = (cMeas-1)*2 + 1;
+         w = solAttributes->theImagePtCov.Rows(start,start+1).i();
+         Bdt_w << Bd.t() * w;
+         Nd    << Bdt_w * Bd;
+         Cd    << Bdt_w * eps;
+
+         // compute N-dd & C-dd contributions
+         Bddt_w << Bdd.t() * w;
+         Ndd    << Bddt_w * Bdd;
+         Cdd    << Bddt_w * eps;
+
+         // compute N-bar for PT "obs" & IMAGE "meas"
+         Nb << Bdt_w * Bdd;
+
+         // SUM Nd into N
+         N.SymSubMatrix(NdIdx,NdIdx+cNumPar-1) += Nd;
+
+         // SUM Ndd into N
+         N.SymSubMatrix(NddIdx,NddIdx+2) += Ndd;
+
+         // INSERT Nb into N
+         N.SubMatrix(NdIdx,NdIdx+cNumPar-1,NddIdx,NddIdx+2) = Nb;
+
+         // SUM Cd into C
+         C.Rows(NdIdx,NdIdx+cNumPar-1) += Cd;
+
+         // SUM Cdd into C
+         C.Rows(NddIdx,NddIdx+2) += Cdd;
+
+         // Increment index counters
+         cImgIdx += cNumPar;
+         cMeas++;
+         currImg++;
+
+      }
+      //**********************
+      // END image point loop 
+      //**********************
+
+	}
+   //***********************
+   // END object point loop 
+   //***********************
+
+
+   //******************************
+   // solve normal equation system 
+   //******************************
+   NEWMAT::LowerTriangularMatrix Nl = N.t();
+
+   // Solve
+   //   Note: solveSystem uses 1-based indexing
+	if (!solveSystem(Nl.Store()-1, C.Store()-1, D.Store()-1, Nrank))
+   {
+      theSolValid = false;
+   }
+   else
+   {
+      theSolValid = true;
+
+      //******************
+      // load corrections 
+      //******************
+      solAttributes->theLastCorrections = -D;
+      solAttributes->theTotalCorrections -= D;
+
+
+      //************************
+      // load covariance matrix 
+      //   Note: recurBack uses 1-based indexing
+      //************************
+      if (recurBack(Nl.Store()-1, Nrank))
+      {
+         solAttributes->theFullCovMatrix = Nl.t();
+      }
+      else
+      {
+         theSolValid = false;
+      }
+   }
+
+   return theSolValid;
+}
+
+
+//*****************************************************************************
+// method: recursive forward solution
+//
+// output: d = folded matrix
+//*****************************************************************************
+bool ossimWLSBundleSolution::recurFwd(double* d, double* c, std::vector<double>& tmp, std::vector<int>& nz, int rank)
+{
+   int i,j,k,jj,jk,ik,nsize,jcol,kcol,ksize,nbr,ncol;
+   double r,q,diag;
+
+   nsize = rank*(rank+1)/2;
+
+   for (jcol=rank; jcol>=2; --jcol)
+   {
+      diag = d[nsize];
+
+      if(diag!=0.0)
+      {
+         r = 1.0/diag;
+         tmp[jcol] = r*c[jcol];
+         kcol = jcol-1;
+         k = nsize-jcol;
+         ksize = k;
+         nbr = 0;
+         for (i=1;i<=kcol;++i)
+         {
+            k++;
+            if(d[k]!=0.0)
+            {
+               ++nbr;
+               nz[nbr] = k;
+               c[i] -= d[k]*tmp[jcol];
+            }
+         }
+
+         if(nbr!=0.0)
+         {
+            for (jk=nbr; jk>=1; --jk)
+            {
+               j = nz[jk];
+               q = r*d[j];
+               ncol = j-ksize;
+               jj = ncol*(ncol-1)/2 - ksize;
+               for (ik=jk;ik>=1;--ik)
+               {
+                  i = nz[ik];
+                  k = jj+i;
+                  d[k] -= d[i]*q;
+               }
+               d[j] = q;
+            }
+         }
+         d[nsize] = r;
+         nsize -= jcol;
+      }
+      else
+      {
+         return false;
+      }
+   }
+
+   return true;
+}
+
+
+//*****************************************************************************
+// method: recursive back solution
+//
+// output: d = unfolded matrix
+//*****************************************************************************
+bool ossimWLSBundleSolution::recurBack(double* d, int rank)
+{
+   int jcol,iq,jcol1,nsize,i,j;
+   double sum;
+   std::vector<double> tmp(rank+1);//workspace vector
+
+   if(d[1]==0.0)
+   {
+      return false;
+   }
+   else
+      d[1] = 1.0/d[1];
+
+   for (jcol=2; jcol<=rank; jcol++)
+   {
+      nsize = jcol*(jcol+1)/2;
+      iq = nsize-jcol+1;
+      jcol1 = jcol-1;
+      trimv(d,d,1,iq,jcol1,tmp);
+      sum = 0.0;
+      for (i=iq,j=1; i<=iq+jcol1-1; i++,j++)
+      {
+         if (d[i] != 0.0)
+            sum += d[i]*tmp[j];
+      }
+      moveAndNegate(tmp, d, 1, iq, jcol1);
+      d[nsize] += sum;
+   }
+
+   tmp.clear();
+
+   return true;
+}
+
+
+//*****************************************************************************
+// method: triangular move
+//
+//*****************************************************************************
+void ossimWLSBundleSolution::trimv(double* pc, double* h, int pcIndex, int hIndex, int mr, std::vector<double>& sum)
+{
+   for (int k=1; k<=mr; k++)
+      sum[k]=0.0;
+
+   for (int j=1; j<=mr; j++)
+   {
+      if (h[j+hIndex-1]!=0.0)
+      {
+         int k = j*(j-1)/2+1;
+         int jadd = j;
+         double hj = h[j+hIndex-1];
+         for (int i=1; i<=mr; i++)
+         {
+            sum[i] += pc[k+pcIndex-1]*hj;
+            if (i<j)
+               k++;
+            else
+            {
+               k += jadd;
+               jadd++;
+            }
+         }
+      }
+   }
+}
+
+
+//*****************************************************************************
+// method: block move and negate
+//
+// output: to = pointer to new location
+//*****************************************************************************
+void ossimWLSBundleSolution::moveAndNegate
+   (std::vector<double>& from, double* to, int indexFrom, int indexTo, int nElements)
+{
+   for (int i=indexFrom,j=indexTo; i<=indexFrom+nElements-1; i++,j++)
+     to[j] = -from[i]; 
+}
+
+
+/*******************************************************************************
+*  method: linear system solution
+*
+*  input:  d     = upper triangular coeff matrix (rankXrank)
+*          c     = constant vector (rank)
+*          delta = solution vector (rank)
+*
+*  output: delta = solution vector
+*******************************************************************************/
+bool ossimWLSBundleSolution::solveSystem(double* d, double* c, double* delta, int rank)
+{
+   std::vector<int> nz(rank+1);    //indexing vector
+   int i,j,jcol1,k;
+   std::vector<double> tmp(rank+1);//workspace vector
+   double sum;
+
+
+   if (!recurFwd(d, c, tmp, nz, rank))
+      return false;
+   else if (d[1]==0.0)
+   {
+      return false;
+   }
+   else
+      delta[1] = c[1]/d[1];
+
+   for (j=2; j<=rank; j++)
+   {
+      jcol1 = j-1;
+      k = j*(j-1)/2;
+      sum = 0.0;
+      for (i=1; i<=jcol1; i++)
+      {
+         k++;
+         sum += d[k]*delta[i];
+      }
+      delta[j] = tmp[j]-sum;
+   }
+
+   nz.clear();
+   tmp.clear();
+
+   return true;
+}
diff --git a/src/ossim/base/ossimWebRequest.cpp b/src/ossim/base/ossimWebRequest.cpp
new file mode 100644
index 0000000..24696dd
--- /dev/null
+++ b/src/ossim/base/ossimWebRequest.cpp
@@ -0,0 +1,3 @@
+#include <ossim/base/ossimWebRequest.h>
+
+RTTI_DEF1(ossimWebRequest, "ossimWebRequest", ossimObject);
diff --git a/src/ossim/base/ossimWebRequestFactoryBase.cpp b/src/ossim/base/ossimWebRequestFactoryBase.cpp
new file mode 100644
index 0000000..82c2f4b
--- /dev/null
+++ b/src/ossim/base/ossimWebRequestFactoryBase.cpp
@@ -0,0 +1,17 @@
+#include <ossim/base/ossimWebRequestFactoryBase.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimHttpRequest.h>
+
+#if 0
+ossimHttpRequest* ossimWebRequestFactoryBase::createHttpRequest(const ossimUrl& url,
+                                            const ossimString& method)
+{
+   ossimKeywordlist kwl;
+   kwl["type"] = url.getProtocol().c_str();
+   kwl["method"] = method.c_str();
+   ossimRefPtr<ossimObject> httpRequestResult = createObject(kwl);
+   ossimRefPtr<ossimHttpRequest> result = dynamic_cast<ossimHttpRequest*>(httpRequestResult.get());
+
+   return result.release();
+}
+#endif
diff --git a/src/ossim/base/ossimWebRequestFactoryRegistry.cpp b/src/ossim/base/ossimWebRequestFactoryRegistry.cpp
new file mode 100644
index 0000000..dfea520
--- /dev/null
+++ b/src/ossim/base/ossimWebRequestFactoryRegistry.cpp
@@ -0,0 +1,51 @@
+#include <ossim/base/ossimWebRequestFactoryRegistry.h>
+#include <ossim/base/ossimHttpRequest.h>
+
+ossimWebRequestFactoryRegistry* ossimWebRequestFactoryRegistry::m_instance = 0;
+
+ossimWebRequestFactoryRegistry::ossimWebRequestFactoryRegistry()
+{
+   m_instance = this;
+}
+
+ossimWebRequestFactoryRegistry* ossimWebRequestFactoryRegistry::instance()
+{
+   if(!m_instance)
+   {
+      m_instance = new ossimWebRequestFactoryRegistry();
+   }
+   
+   return m_instance;
+}
+
+
+ossimObject* ossimWebRequestFactoryRegistry::createObject(const ossimKeywordlist& kwl,
+                                                          const char* prefix)const
+{
+  return createObjectFromRegistry(kwl, prefix);
+}
+
+ossimWebRequest* ossimWebRequestFactoryRegistry::create(const ossimUrl& url)
+{
+   ossim_uint32 idx = 0;
+   ossimWebRequest* result = 0;
+   for(idx = 0; ((idx < m_factoryList.size())&&!result); ++idx)
+   {
+      result = m_factoryList[idx]->create(url);
+   }
+   
+   return result;
+}
+
+ossimHttpRequest* ossimWebRequestFactoryRegistry::createHttp(const ossimUrl& url)
+{
+   ossimRefPtr<ossimWebRequest> request = create(url);
+   ossimRefPtr<ossimHttpRequest> result;
+   if(request.valid())
+   {
+      result = dynamic_cast<ossimHttpRequest*>(request.get());
+      request = 0;
+   }
+   
+   return result.release();
+}
\ No newline at end of file
diff --git a/src/ossim/base/ossimWebResponse.cpp b/src/ossim/base/ossimWebResponse.cpp
new file mode 100644
index 0000000..5e7a8ab
--- /dev/null
+++ b/src/ossim/base/ossimWebResponse.cpp
@@ -0,0 +1,24 @@
+#include <ossim/base/ossimWebResponse.h>
+
+RTTI_DEF1(ossimWebResponse, "ossimWebResponse" , ossimObject);
+
+
+void ossimWebResponse::copyAllDataFromInputStream(ByteBuffer& buffer)
+{
+   std::istream* input = getInputStream();
+   
+   if(input)
+   {
+      input->seekg(0, std::ios::beg);
+      char buf[1024];
+      while(!input->eof()&&input->good())
+      {
+         input->read(buf, 1024);
+         int gcount = input->gcount();
+         if(gcount)
+         {
+            buffer.insert(buffer.end(), buf , buf + gcount);
+         }
+      }
+   }
+}
diff --git a/src/ossim/base/ossimWgs72Datum.cpp b/src/ossim/base/ossimWgs72Datum.cpp
index 611ac3d..baa0b6f 100644
--- a/src/ossim/base/ossimWgs72Datum.cpp
+++ b/src/ossim/base/ossimWgs72Datum.cpp
@@ -10,7 +10,7 @@
 // instance of a Wgs72Ellipsoid and set the initial defaults for
 // that are specific to a Wgs72Datum
 //*******************************************************************
-//  $Id: ossimWgs72Datum.cpp 9963 2006-11-28 21:11:01Z gpotts $
+//  $Id: ossimWgs72Datum.cpp 20096 2011-09-14 16:44:20Z dburken $
 
 #include <iostream>
 using namespace std;
@@ -28,7 +28,7 @@ using namespace std;
  *                               DEFINES FROM GEOTRANS
  */
 
-
+RTTI_DEF1(ossimWgs72Datum, "ossimWgs72Datum", ossimThreeParamDatum);
 ossimWgs72Datum::ossimWgs72Datum()
    :ossimThreeParamDatum("WGD",
                          "World Geodetic System 1972",
@@ -157,7 +157,6 @@ ossimGpt ossimWgs72Datum::shiftFromWgs84(const ossimGpt &aPt)const
    double WGS84_a;       /* Semi-major axis of WGS84 ellipsoid               */
    double WGS84_f;       /* Flattening of WGS84 ellipsoid                    */
    double WGS72_a;       /* Semi-major axis of WGS72 ellipsoid               */
-   double WGS72_b;       /* Semi-minor axis of WGS72 ellipsoid               */
    double WGS72_f;       /* Flattening of WGS72 ellipsoid                    */
    double da;            /* WGS72_a - WGS84_a                                */
    double df;            /* WGS72_f - WGS84_f                                */
@@ -179,7 +178,6 @@ ossimGpt ossimWgs72Datum::shiftFromWgs84(const ossimGpt &aPt)const
    WGS84_a = wgs84Ellipsoid->a();
    WGS84_f = wgs84Ellipsoid->flattening();
    WGS72_a = wgs72Ellipsoid->a();
-   WGS72_b = wgs72Ellipsoid->b();  
    WGS72_f = wgs72Ellipsoid->flattening();
    
    da = WGS72_a - WGS84_a;
diff --git a/src/ossim/base/ossimWgs84Datum.cpp b/src/ossim/base/ossimWgs84Datum.cpp
index 3927fbc..b564268 100644
--- a/src/ossim/base/ossimWgs84Datum.cpp
+++ b/src/ossim/base/ossimWgs84Datum.cpp
@@ -10,7 +10,7 @@
 // instance of a Wgs84Ellipsoid and set the initial defaults for
 // that are specific to a Wgs84Datum
 //*******************************************************************
-//  $Id: ossimWgs84Datum.cpp 9963 2006-11-28 21:11:01Z gpotts $
+//  $Id: ossimWgs84Datum.cpp 19795 2011-06-30 15:04:48Z gpotts $
 
 #include <ossim/base/ossimWgs84Datum.h>
 #include <ossim/base/ossimConstants.h>
@@ -18,6 +18,7 @@
 #include <ossim/base/ossimEllipsoid.h>
 
 
+RTTI_DEF1(ossimWgs84Datum, "ossimWgs84Datum", ossimThreeParamDatum);
 
 ossimWgs84Datum::ossimWgs84Datum()
    :ossimThreeParamDatum("WGE",
diff --git a/src/ossim/base/ossimXmlAttribute.cpp b/src/ossim/base/ossimXmlAttribute.cpp
index 7fb97da..62c1742 100644
--- a/src/ossim/base/ossimXmlAttribute.cpp
+++ b/src/ossim/base/ossimXmlAttribute.cpp
@@ -10,7 +10,7 @@
 // Contains definition of class ossimXmlAttribute.
 // 
 //*****************************************************************************
-// $Id: ossimXmlAttribute.cpp 17503 2010-06-02 11:18:49Z dburken $
+// $Id: ossimXmlAttribute.cpp 19682 2011-05-31 14:21:20Z dburken $
 
 #include <iostream>
 #include <sstream>
@@ -51,11 +51,11 @@ ossimXmlAttribute::ossimXmlAttribute(const ossimXmlAttribute& src)
 
 bool ossimXmlAttribute::read(std::istream& in)
 {
-   in >> xmlskipws;
+   xmlskipws(in);
    if(in.fail()) return false;
    if(readName(in))
    {
-      in >> xmlskipws;
+      xmlskipws(in);
       if((in.peek() != '=')||
          (in.fail()))
       {
@@ -160,7 +160,7 @@ std::ostream& operator << (std::ostream& os, const ossimXmlAttribute* xml_attr)
 
 bool ossimXmlAttribute::readName(std::istream& in)
 {
-   in >>xmlskipws;
+   xmlskipws(in);
    theName = "";
    char c = in.peek();
    while((c != ' ')&&
@@ -183,7 +183,7 @@ bool ossimXmlAttribute::readName(std::istream& in)
 
 bool ossimXmlAttribute::readValue(std::istream& in)
 {
-   in >>xmlskipws;
+   xmlskipws(in);
    if(in.fail()) return false;
    theValue = "";
    char c = in.peek();
@@ -217,8 +217,8 @@ bool ossimXmlAttribute::readValue(std::istream& in)
 
    if(theValue != "")
    {
-      ossimString::iterator startIter = theValue.begin();
-      ossimString::iterator endIter   = theValue.end();
+      std::string::iterator startIter = theValue.begin();
+      std::string::iterator endIter   = theValue.end();
       --endIter;
       if(*startIter == startQuote)
       {
diff --git a/src/ossim/base/ossimXmlDocument.cpp b/src/ossim/base/ossimXmlDocument.cpp
index 2608a2b..d66a033 100644
--- a/src/ossim/base/ossimXmlDocument.cpp
+++ b/src/ossim/base/ossimXmlDocument.cpp
@@ -1,6 +1,5 @@
 //*******************************************************************
-// Copyright (C) 2001 ImageLinks Inc.  All rights reserved.
-//
+// 
 // License:  LGPL
 // 
 // See LICENSE.txt file in the top level directory for more details.
@@ -12,22 +11,21 @@
 // Contains definition of class ossimXmlDocument. This class provides read-only
 // parsing and accessing of an XML document file.
 //*****************************************************************************
-// $Id: ossimXmlDocument.cpp 12521 2008-02-28 20:09:25Z gpotts $
+// $Id: ossimXmlDocument.cpp 21579 2012-08-31 14:24:11Z dburken $
+
 
-#include <stack>
-#include <iostream>
-#include <fstream>
 #include <ossim/base/ossimXmlDocument.h>
 #include <ossim/base/ossimXmlAttribute.h>
-#include <ossim/base/ossimXmlNode.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");
 
@@ -35,10 +33,7 @@ static std::istream& xmlskipws(std::istream& in)
 {
    int c = in.peek();
    while((!in.fail())&&
-         ((c == ' ') ||
-          (c == '\t') ||
-          (c == '\n')|
-          (c == '\r')))
+         (( (c == ' ') || (c == '\t') || (c == '\n')|| (c == '\r') || (c<0x20) || (c>=0x7f) )))//|| (c<0x20) || (c >=0x2f) )))
    {
       in.ignore(1);
       c = in.peek();
@@ -54,7 +49,8 @@ RTTI_DEF1(ossimXmlDocument, "ossimXmlDocument", ossimObject)
 ossimXmlDocument::ossimXmlDocument(const ossimFilename& xmlFileName)
    :
    theRootNode  (0),
-   theXmlHeader("<?xml version='1.0'?>")
+   theXmlHeader("<?xml version='1.0'?>"),
+   theStrictCheckFlag(false)
 {
 
    if(xmlFileName != "")
@@ -66,7 +62,8 @@ ossimXmlDocument::ossimXmlDocument(const ossimXmlDocument& src)
 :ossimObject(src),
 theRootNode(src.theRootNode.valid()?(ossimXmlNode*)src.theRootNode->dup():(ossimXmlNode*)0),
 theXmlHeader(src.theXmlHeader),
-theFilename(src.theFilename)
+theFilename(src.theFilename),
+theStrictCheckFlag(src.theStrictCheckFlag)
 {
    
 }
@@ -77,7 +74,7 @@ ossimXmlDocument::~ossimXmlDocument()
 
 bool ossimXmlDocument::write(const ossimFilename& file)
 {
-   std::ofstream out(file);
+   std::ofstream out(file.c_str());
 
    if(out)
    {
@@ -148,7 +145,6 @@ bool ossimXmlDocument::read(std::istream& in)
    }
    startTagCharacterFound = true;
 
-   theXmlHeader = "";
    if(readHeader(in))
    {
       if(theXmlHeader=="")
@@ -165,7 +161,7 @@ bool ossimXmlDocument::read(std::istream& in)
       }
    }
    if((!theXmlHeader.contains("xml version"))&&
-      (!startTagCharacterFound))
+      (!startTagCharacterFound)&&theStrictCheckFlag)
    {
       if (traceDebug())
       {
@@ -374,7 +370,10 @@ void ossimXmlDocument::fromKwl(const ossimKeywordlist& kwlToConvert)
 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;
@@ -383,7 +382,6 @@ void ossimXmlDocument::toKwl(ossimKeywordlist& kwl ,
 //    {
 //       children[idx]->toKwl(kwl, prefix);
 //    }
-   theRootNode->toKwl(kwl, prefix);
 }
 
 bool ossimXmlDocument::readHeader(std::istream& in)
diff --git a/src/ossim/base/ossimXmlNode.cpp b/src/ossim/base/ossimXmlNode.cpp
index c5e6705..ed7309a 100644
--- a/src/ossim/base/ossimXmlNode.cpp
+++ b/src/ossim/base/ossimXmlNode.cpp
@@ -9,7 +9,7 @@
 // Contains definition of class ossimXmlNode.
 // 
 //*****************************************************************************
-// $Id: ossimXmlNode.cpp 16742 2010-02-28 16:05:43Z dburken $
+// $Id: ossimXmlNode.cpp 20747 2012-04-18 15:24:12Z gpotts $
 
 #include <iostream>
 #include <stack>
@@ -28,7 +28,8 @@ static std::istream& xmlskipws(std::istream& in)
 {
    int c = in.peek();
    while( !in.fail() &&
-         ( (c == ' ') || (c == '\t') || (c == '\n')|| (c == '\r') ) )
+         (( (c== ' ') || (c == '\t') || (c == '\n')|| (c == '\r') || (c<0x20) || (c>=0x7f) ))
+         )
    {
       in.ignore(1);
       c = in.peek();
@@ -125,7 +126,7 @@ bool ossimXmlNode::read(std::istream& in)
          << "ossimXmlNode::read: entered ......" << std::endl;
    }
    char c;
-   in >> xmlskipws;
+   xmlskipws(in);
    if(in.fail())
    {
       if(traceDebug())
@@ -148,7 +149,7 @@ bool ossimXmlNode::read(std::istream& in)
       }
       return false;
    }
-   streampos file_pos = in.tellg();
+
    ossimString endTag;
    
    if(!readTag(in, theTag))
@@ -196,7 +197,7 @@ bool ossimXmlNode::read(std::istream& in)
    }
    // skip white space characters
    //
-   in >> xmlskipws;
+   xmlskipws(in);
    
    if(!in.fail()&&readEndTag(in, endTag))
    {
@@ -248,7 +249,7 @@ bool ossimXmlNode::read(std::istream& in)
       }
       return false;
    }
-   in >> xmlskipws;
+   xmlskipws(in);
    c = in.peek();
    
    if(c != '<')
@@ -310,7 +311,7 @@ bool ossimXmlNode::read(std::istream& in)
          }
          return false;
       }
-      in >> xmlskipws;
+      xmlskipws(in);
       
       c = in.peek();
       if(c != '<')
@@ -380,10 +381,13 @@ void ossimXmlNode::findChildNodes(const ossimString& xpath,
    if (rel_xpath[static_cast<std::string::size_type>(0)] ==
        XPATH_DELIM[static_cast<std::string::size_type>(0)])
    {
-      ossimNotify(ossimNotifyLevel_WARN)
-      << "WARNING: ossimXmlNode::findChildNodes\n"
-      << "Only relative XPaths can be searched from a node. "
-      << "Returning null list...\n";
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "WARNING: ossimXmlNode::findChildNodes\n"
+            << "Only relative XPaths can be searched from a node. "
+             << "Returning null list...\n";
+         }
       return;
    }
    
@@ -444,10 +448,14 @@ const ossimRefPtr<ossimXmlNode> ossimXmlNode::findFirstNode(const ossimString& x
    if (rel_xpath[static_cast<std::string::size_type>(0)] ==
        XPATH_DELIM[static_cast<std::string::size_type>(0)])
    {
-      ossimNotify(ossimNotifyLevel_WARN)
-      << "WARNING: ossimXmlNode::findChildNodes\n"
-      << "Only relative XPaths can be searched from a node. "
-      << "Returning null list...\n";
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+         << "WARNING: ossimXmlNode::findChildNodes\n"
+         << "Only relative XPaths can be searched from a node. "
+         << "Returning null list...\n";
+
+      }
       return 0;
    }
    
@@ -510,10 +518,13 @@ ossimRefPtr<ossimXmlNode> ossimXmlNode::findFirstNode(const ossimString& xpath)
    if (rel_xpath[static_cast<std::string::size_type>(0)] ==
        XPATH_DELIM[static_cast<std::string::size_type>(0)])
    {
-      ossimNotify(ossimNotifyLevel_WARN)
-      << "WARNING: ossimXmlNode::findChildNodes\n"
-      << "Only relative XPaths can be searched from a node. "
-      << "Returning null list...\n";
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+         << "WARNING: ossimXmlNode::findChildNodes\n"
+         << "Only relative XPaths can be searched from a node. "
+         << "Returning null list...\n";
+      }
       return 0;
    }
    
@@ -803,9 +814,13 @@ ossimRefPtr<ossimXmlNode> ossimXmlNode::addNode(const ossimString& relPath,
    if (relXpath[static_cast<std::string::size_type>(0)] ==
        XPATH_DELIM[static_cast<std::string::size_type>(0)])
    {
-      ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimXmlNode::findChildNodes\n"
-      << "Only relative XPaths can be searched from a node. "
-      << "Returning null list...\n";
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimXmlNode::findChildNodes\n"
+         << "Only relative XPaths can be searched from a node. "
+         << "Returning null list...\n";
+         
+      }
       return 0;
    }
    
@@ -964,60 +979,38 @@ void ossimXmlNode::clearAttributes()
 void ossimXmlNode::toKwl(ossimKeywordlist& kwl,
                          const ossimString& prefix)const
 {
-   ossimRefPtr<ossimXmlAttribute> nameAtt  = findAttribute("name");
-   ossimRefPtr<ossimXmlAttribute> valueAtt = findAttribute("value");
-   ossimRefPtr<ossimXmlAttribute> typeAtt  = findAttribute("type");
-   
-   ossimString name;
-   ossimString value;
-   ossimString type;
-   if(nameAtt.valid())
-   {
-      name = nameAtt->getValue();
-   }
-   if(valueAtt.valid())
-   {
-      value = valueAtt->getValue();
-   }
-   else
-   {
-      value = theText;
-   }
+   ossimString name = getTag();
+   ossimString value = getText();
    
-   if(typeAtt.valid())
-   {
-      type = typeAtt->getValue();
-   }
    ossimString copyPrefix = prefix;
    
    if(name != "")
    {
       copyPrefix += (name+".");
    }
-   if(type!= "")
-   {
-      kwl.add(copyPrefix,
-              "type",
-              typeAtt->getValue(),
-              true);
-   }
-   
    if(theChildNodes.size() < 1)
    {
       kwl.add(prefix+name,
               value,
               true);
    }
-   else
+
+   ossimString attributePrefix = copyPrefix + "@";
+   ossim_uint32 attributeIdx = 0;
+   for(attributeIdx = 0; attributeIdx < theAttributes.size(); ++attributeIdx)
    {
-      ossim_uint32 idx=0;
-      
-      for(idx = 0; idx < theChildNodes.size();++idx)
-      {
-         theChildNodes[idx]->toKwl(kwl,
-                                   copyPrefix);
-      }
+      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,
@@ -1028,7 +1021,7 @@ bool ossimXmlNode::readTag(std::istream& in,
       ossimNotify(ossimNotifyLevel_DEBUG)
          << "ossimXmlNode::readTag: entered ......\n";
    }
-   in >> xmlskipws;
+   xmlskipws(in);
    
    tag = "";
    int c = in.peek();
@@ -1116,7 +1109,7 @@ bool ossimXmlNode::readCDataContent(std::istream& in)
 #if 0
 bool ossimXmlNode::readTextContent(std::istream& in)
 {
-   in >> xmlskipws;
+   xmlskipws(in);
    
    theText = "";
    theCDataFlag = false;
@@ -1183,7 +1176,7 @@ bool ossimXmlNode::readTextContent(std::istream& in)
 #if 0
 bool ossimXmlNode::readTextContent(std::istream& in)
 {
-   in >> xmlskipws;
+   xmlskipws(in);
    
    theText = "";
    theCDataFlag = false;
@@ -1282,7 +1275,7 @@ bool ossimXmlNode::readTextContent(std::istream& in)
    theText = "";
    theCDataFlag = false;
    
-   in >> xmlskipws;
+   xmlskipws(in);
 
    if ( !in.fail() )
    {
@@ -1408,7 +1401,7 @@ bool ossimXmlNode::readEndTag(std::istream& in,
       in.ignore();
       readTag(in, endTag);
       if(in.fail()) return false;
-      in >> xmlskipws;
+      xmlskipws(in);
       c = in.peek();
       result = true;
    }
diff --git a/src/ossim/base/ossimXmlString.cpp b/src/ossim/base/ossimXmlString.cpp
index c6fce05..7e5ee9b 100644
--- a/src/ossim/base/ossimXmlString.cpp
+++ b/src/ossim/base/ossimXmlString.cpp
@@ -6,19 +6,44 @@
 // Description: This class provides manipulation of filenames.
 //
 //*************************************************************************
-// $Id: ossimXmlString.cpp 9963 2006-11-28 21:11:01Z gpotts $
+// $Id: ossimXmlString.cpp 22328 2013-07-25 17:17:52Z gpotts $
 #include <ossim/base/ossimXmlString.h>
 
+bool ossimXmlString::containsSpecialXmlCharacters(const ossimString& value)
+{
+   for(ossimString::const_iterator it = value.begin();
+      it != value.end();++it)
+   {
+      switch(*it)
+      {
+         case '&':
+         case '<':
+         case '>':
+         case '"':
+         case '\'':
+         {
+            return true;
+         }
+         default:
+         {
+            break;
+         }
+      }
+
+   }
+   return false;
+}
+
 const ossimXmlString& ossimXmlString::assign(const ossimString& s)
 {
    ossimString result = s;
    
-   size_type pos = 0;
+   std::string::size_type pos = 0;
 
    pos = result.find("&");
    // do ampersand first
    //
-   while(pos != npos)
+   while(pos != std::string::npos)
    {
       ossimString s1(result.begin() + pos,
                      result.begin()+pos+5);
@@ -56,3 +81,18 @@ const ossimXmlString& ossimXmlString::assign(const ossimString& s)
 
    return *this;
 }
+
+ossimString ossimXmlString::wrapCDataIfNeeded(const ossimString& input)
+{
+   if(containsSpecialXmlCharacters(input))
+   {
+      return wrapCData(input);
+   }
+
+   return input;
+}
+ossimString ossimXmlString::wrapCData(const ossimString& input)
+{
+   return "<![CDATA[" + input + "]]>";
+}
+
diff --git a/src/ossim/elevation/ossimDtedElevationDatabase.cpp b/src/ossim/elevation/ossimDtedElevationDatabase.cpp
index da357ed..dd3e549 100644
--- a/src/ossim/elevation/ossimDtedElevationDatabase.cpp
+++ b/src/ossim/elevation/ossimDtedElevationDatabase.cpp
@@ -13,11 +13,26 @@ RTTI_DEF1(ossimDtedElevationDatabase, "ossimDtedElevationDatabase", ossimElevati
 double ossimDtedElevationDatabase::getHeightAboveMSL(const ossimGpt& gpt)
 {
    if(!isSourceEnabled()) return ossim::nan();
-   ossimRefPtr<ossimElevCellHandler> handler = getOrCreateCellHandler(gpt);
-   if(handler.valid())
+   m_mutex.lock();
+   if(m_lastHandler.valid())
    {
-      return handler->getHeightAboveMSL(gpt); // still need to shift
+      if(m_lastHandler->pointHasCoverage(gpt))
+      {
+         double result = m_lastHandler->getHeightAboveMSL(gpt);
+         m_mutex.unlock();
+         
+         return result;
+      }
+   }
+   m_lastHandler = getOrCreateCellHandler(gpt);
+   
+   if(m_lastHandler.valid())
+   {
+      double result = m_lastHandler->getHeightAboveMSL(gpt);
+      m_mutex.unlock();
+     return result; // still need to shift
    }
+   m_mutex.unlock();
    return ossim::nan();
 }
 
@@ -130,6 +145,22 @@ bool ossimDtedElevationDatabase::openDtedDirectory(const ossimFilename& dir)
    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;
diff --git a/src/ossim/elevation/ossimDtedHandler.cpp b/src/ossim/elevation/ossimDtedHandler.cpp
index eaa1d9d..7a0c4ba 100644
--- a/src/ossim/elevation/ossimDtedHandler.cpp
+++ b/src/ossim/elevation/ossimDtedHandler.cpp
@@ -9,7 +9,7 @@
 //   from disk. This elevation files are memory mapped.
 //
 //*****************************************************************************
-// $Id: ossimDtedHandler.cpp 17599 2010-06-20 13:52:34Z dburken $
+// $Id: ossimDtedHandler.cpp 21214 2012-07-03 16:20:11Z dburken $
 
 #include <cstdlib>
 #include <cstring> /* for memcpy */
@@ -48,6 +48,7 @@ ossimDtedHandler::ossimDtedHandler(const ossimFilename& dted_file, bool memoryMa
       m_swCornerPost(),
       m_swapBytesFlag(false)
 {
+
    static const char MODULE[] = "ossimDtedHandler (Filename) Constructor";
    if (traceExec())
    {
@@ -97,15 +98,29 @@ 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 getHeightAboveMSLFile(gpt);
+      return getHeightAboveMSL(gpt, true);
    }
    else if(m_memoryMap.size())
    {
-      return getHeightAboveMSLMemory(gpt);
+      return getHeightAboveMSL(gpt, false);
    }
    
    return ossim::nan();
@@ -177,6 +192,18 @@ bool ossimDtedHandler::open(const ossimFilename& file, bool memoryMapFlag)
    
    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:
    //***
@@ -215,7 +242,7 @@ bool ossimDtedHandler::open(const ossimFilename& file, bool memoryMapFlag)
    return true;
 }
 
-double ossimDtedHandler::getHeightAboveMSLFile(const ossimGpt& gpt)
+double ossimDtedHandler::getHeightAboveMSL(const ossimGpt& gpt, bool readFromFile)
 {
    // Establish the grid indexes:
    double xi = (gpt.lon - m_swCornerPost.lon) / m_lonSpacing;
@@ -245,11 +272,6 @@ double ossimDtedHandler::getHeightAboveMSLFile(const ossimGpt& gpt)
       return ossim::nan();
    }
 
-   double p00;
-   double p01;
-   double p10;
-   double p11;
-
    //***
    // Grab the four points from the dted cell needed.  These are big endian,
    // signed magnitude shorts so they must be interpreted accordingly.
@@ -257,187 +279,84 @@ double ossimDtedHandler::getHeightAboveMSLFile(const ossimGpt& gpt)
    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 )
    {
-      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_fileStrMutex);
-      // Put the file pointer at the start of the first elevation post.
-      m_fileStr.seekg(offset, std::ios::beg);
-      
-      ossim_sint16 ss;
-      ossim_uint16 us;
-      
-      // Get the first post.
-      m_fileStr.read((char*)&us, POST_SIZE);
-      ss = convertSignedMagnitude(us);
-      p00 = ss;
-      
-      // Get the second post.
-      m_fileStr.read((char*)&us, POST_SIZE);
-      ss = convertSignedMagnitude(us);
-      p01 = ss;
-      
-      // Move over to the next column.
-      offset += m_dtedRecordSizeInBytes;
-      m_fileStr.seekg(offset, std::ios::beg);
-      
-      // Get the third post.
-      m_fileStr.read((char*)&us, POST_SIZE);
-      ss = convertSignedMagnitude(us);
-      p10 = ss;
-      
-      // Get the fourth post.
-      m_fileStr.read((char*)&us, POST_SIZE);
-      ss = convertSignedMagnitude(us);
-      p11 = ss;
+     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;
    
-   double w00 = wx0*wy0;
-   double w01 = wx0*wy1;
-   double w10 = wx1*wy0;
-   double w11 = wx1*wy1;
-
-   //***
-   // Test for null posts and set the corresponding weights to 0:
-   //***
-   if (p00 == NULL_POST)
-      w00 = 0.0;
-   if (p01 == NULL_POST)
-      w01 = 0.0;
-   if (p10 == NULL_POST)
-      w10 = 0.0;
-   if (p11 == NULL_POST)
-      w11 = 0.0;
+   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... */
-   cout << "\np00:  " << p00
-        << "\np01:  " << p01
-        << "\np10:  " << p10
-        << "\np11:  " << p11
-        << "\nw00:  " << w00
-        << "\nw01:  " << w01
-        << "\nw10:  " << w10
-        << "\nw11:  " << w11
-        << std::endl;
+   postData.debug();
 #endif
 
-   double sum_weights = w00 + w01 + w10 + w11;
-
-   if (sum_weights)
-   {
-      return (p00*w00 + p01*w01 + p10*w10 + p11*w11) / sum_weights;
-   }
-   
-   return ossim::nan();
+   return postData.calcHeight();
 }
 
-double ossimDtedHandler::getHeightAboveMSLMemory(const ossimGpt& gpt)
+void ossimDtedHandler::readPostsFromFile( DtedHeight &postData, int offset)
 {
-   ossim_uint8* buf = &m_memoryMap.front();
-   // 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);
-
-   // Check for right edge.
-//    if (gpt.lon == theGroundRect.lr().lon)
-   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();
-   }
-
-   double p00;
-   double p01;
-   double p10;
-   double p11;
-
-   //***
-   // Grab the four points from the dted cell needed.  These are big endian,
-   // signed magnitude shorts so they must be interpreted accordingly.
-   //***
-   ossim_uint64 offset = m_offsetToFirstDataRecord + x0 * m_dtedRecordSizeInBytes +
-                         y0 * 2 + DATA_RECORD_OFFSET_TO_POST;
-   {
-      ossim_uint16 us;
-      
-      memcpy(&us, buf+offset, POST_SIZE); 
-      p00 = convertSignedMagnitude(us);
-      memcpy(&us, buf+offset+POST_SIZE, POST_SIZE); 
-      p01 = convertSignedMagnitude(us);
-      
-      // Move over to the next column.
-      offset += m_dtedRecordSizeInBytes;
-      memcpy(&us, buf+offset, POST_SIZE); 
-      p10 = convertSignedMagnitude(us);
-      memcpy(&us, buf+offset+POST_SIZE, POST_SIZE); 
-      p11 = convertSignedMagnitude(us);
-   }
-    
-   // Perform bilinear interpolation:
-   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;
-
-   //***
-   // Test for null posts and set the corresponding weights to 0:
-   //***
-   if (p00 == NULL_POST)
-      w00 = 0.0;
-   if (p01 == NULL_POST)
-      w01 = 0.0;
-   if (p10 == NULL_POST)
-      w10 = 0.0;
-   if (p11 == NULL_POST)
-      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
-        << std::endl;
-#endif
-
-   double sum_weights = w00 + w01 + w10 + w11;
-
-   if (sum_weights)
-   {
-      return (p00*w00 + p01*w01 + p10*w10 + p11*w11) / sum_weights;
-   }
-   
-   return ossim::nan();
+  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
@@ -605,3 +524,55 @@ 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/src/ossim/elevation/ossimElevCellHandler.cpp b/src/ossim/elevation/ossimElevCellHandler.cpp
index 18258cd..3095947 100644
--- a/src/ossim/elevation/ossimElevCellHandler.cpp
+++ b/src/ossim/elevation/ossimElevCellHandler.cpp
@@ -15,7 +15,7 @@
 //              Initial coding.
 //<
 //*****************************************************************************
-// $Id: ossimElevCellHandler.cpp 17195 2010-04-23 17:32:18Z dburken $
+// $Id: ossimElevCellHandler.cpp 21214 2012-07-03 16:20:11Z dburken $
 
 #include <ossim/elevation/ossimElevCellHandler.h>
 #include <ossim/base/ossimKeyword.h>
@@ -79,6 +79,7 @@ const ossimElevCellHandler& ossimElevCellHandler::operator=(
    return *this;
 }
 
+
 ossimFilename ossimElevCellHandler::getFilename() const
 {
    return theFilename;
@@ -89,14 +90,14 @@ double ossimElevCellHandler::getMeanSpacingMeters() const
    return theMeanSpacing;
 }
 
-double ossimElevCellHandler::getAccuracyLE90(const ossimGpt&) const
+bool ossimElevCellHandler::getAccuracyInfo(ossimElevationAccuracyInfo& info,
+                                           const ossimGpt& /* gpt*/ ) const
 {
-   return theAbsLE90;
-}
+  info.m_confidenceLevel = .9;
+  info.m_absoluteLE = theAbsLE90;
+  info.m_absoluteCE = theAbsCE90;
 
-double ossimElevCellHandler::getAccuracyCE90(const ossimGpt&) const
-{
-   return theAbsCE90;
+  return info.hasValidAbsoluteError();
 }
 
 bool ossimElevCellHandler::canConnectMyInputTo(
diff --git a/src/ossim/elevation/ossimElevManager.cpp b/src/ossim/elevation/ossimElevManager.cpp
index 2f66a7f..d7e604e 100644
--- a/src/ossim/elevation/ossimElevManager.cpp
+++ b/src/ossim/elevation/ossimElevManager.cpp
@@ -19,22 +19,38 @@
 //              Initial coding.
 //<
 //**************************************************************************
-// $Id: ossimElevManager.cpp 17784 2010-07-22 17:32:04Z gpotts $
+// $Id: ossimElevManager.cpp 21970 2012-12-05 18:19:32Z okramer $
 
 #include <algorithm>
 #include <ossim/elevation/ossimElevManager.h>
 #include <ossim/base/ossimEnvironmentUtility.h>
+#include <ossim/elevation/ossimElevationDatabase.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>
 
-
-
 ossimElevManager* ossimElevManager::m_instance = 0;
 static ossimTrace traceDebug("ossimElevManager:debug");
 
+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()
 {
    if (!m_instance)
@@ -46,77 +62,83 @@ ossimElevManager* ossimElevManager::instance()
    return m_instance;
 }
 ossimElevManager::ossimElevManager()
-:ossimElevSource()
+   :ossimElevSource(),
+    m_elevationDatabaseList(0),
+    m_defaultHeightAboveEllipsoid(ossim::nan()),
+    m_elevationOffset(ossim::nan()),
+    m_useGeoidIfNullFlag(false),
+    m_mutex()
 {
    m_instance = this;
-   m_defaultHeightAboveEllipsoid = ossim::nan();
-   m_elevationOffset = ossim::nan();
-   m_useGeoidIfNullFlag = false;
 }
 
 ossimElevManager::~ossimElevManager()
 {
-   
 }
 
 double ossimElevManager::getHeightAboveEllipsoid(const ossimGpt& gpt)
 {
-   if(!isSourceEnabled())
-   {
+   if (!isSourceEnabled())
       return ossim::nan();
-   }
+
    double result = ossim::nan();
-   ossim_uint32 idx = 0;
+   for (ossim_uint32 idx = 0; (idx < m_elevationDatabaseList.size()) && ossim::isnan(result); ++idx)
    {
-      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
-      for(;(idx < m_elevationDatabaseList.size())&&ossim::isnan(result); ++idx)
-      {
-         result = m_elevationDatabaseList[idx]->getHeightAboveEllipsoid(gpt);
-      }
+      result = m_elevationDatabaseList[idx]->getHeightAboveEllipsoid(gpt);
    }
-   if(ossim::isnan(result))
-   {
-      result = m_defaultHeightAboveEllipsoid;
-   }
-   if(m_useGeoidIfNullFlag&&ossim::isnan(result))
+
+   if (ossim::isnan(result))
    {
-      result = ossimGeoidManager::instance()->offsetFromEllipsoid(gpt);
+      // 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);
+      }
    }
-   if(!ossim::isnan(result)&&!ossim::isnan(m_elevationOffset))
-   {
+
+   // 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)
 {
-   if(!isSourceEnabled())
-   {
+   if (!isSourceEnabled())
       return ossim::nan();
-   }
+
    double result = ossim::nan();
+   for (ossim_uint32 idx = 0; (idx < m_elevationDatabaseList.size()) && ossim::isnan(result); ++idx)
    {
-      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
-      
-      ossim_uint32 idx = 0;
-      for(;(idx < m_elevationDatabaseList.size())&&ossim::isnan(result); ++idx)
-      {
-         result = m_elevationDatabaseList[idx]->getHeightAboveMSL(gpt);
-      }
+      result = m_elevationDatabaseList[idx]->getHeightAboveMSL(gpt);
    }
-   if(ossim::isnan(result)&&!ossim::isnan(m_defaultHeightAboveEllipsoid))
+
+   if (ossim::isnan(result) && m_useGeoidIfNullFlag)
    {
-      result = m_defaultHeightAboveEllipsoid;
-      // Use first available geoid to offset the ellipsoid height. This at least gets us close: 
-      double dh = ossimGeoidManager::instance()->offsetFromEllipsoid(gpt);
-      if (!ossim::isnan(dh))
-         result -= dh;
+      // 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;
+      }
    }
-   if(!ossim::isnan(result)&&(!ossim::isnan(m_elevationOffset)))
-   {
+
+   // 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;
 }
 
@@ -192,8 +214,7 @@ bool ossimElevManager::loadElevationPath(const ossimFilename& path)
 
 void ossimElevManager::getOpenCellList(std::vector<ossimFilename>& list) const
 {
-   ossim_uint32 idx = 0;
-   for(;idx < m_elevationDatabaseList.size(); ++idx)
+   for(ossim_uint32 idx = 0; idx < m_elevationDatabaseList.size(); ++idx)
    {
       m_elevationDatabaseList[idx]->getOpenCellList(list);
    }
@@ -201,12 +222,33 @@ void ossimElevManager::getOpenCellList(std::vector<ossimFilename>& list) const
 
 void ossimElevManager::clear()
 {
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
+   //OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
 
   m_elevationDatabaseList.clear();
 
 }
 
+void ossimElevManager::accept(ossimVisitor& visitor)
+{
+   for(ossim_uint32 idx = 0; ((idx < m_elevationDatabaseList.size())&&!visitor.stopTraversal()); ++idx)
+   {
+      m_elevationDatabaseList[idx]->accept(visitor);
+   }
+}
+
+bool ossimElevManager::getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const
+{
+   for(ossim_uint32 idx = 0;(idx < m_elevationDatabaseList.size()); ++idx)
+   {
+      if(m_elevationDatabaseList[idx]->getAccuracyInfo(info, gpt))
+      {
+         return true;
+      }
+   }
+
+   return false;
+}
+
 bool ossimElevManager::saveState(ossimKeywordlist& kwl,
                                  const char* prefix) const
 {
@@ -283,7 +325,9 @@ bool ossimElevManager::loadState(const ossimKeywordlist& kwl,
         {
            ossimNotify(ossimNotifyLevel_DEBUG)
            << "DEBUG ossimElevManager::loadState:"
-           << "\nadding elevation database:  " << database->getConnectionString()
+           << "\nadding elevation database:  "
+           << database->getClassName()
+           << ": " << database->getConnectionString()
            << std::endl;
         }  
         addDatabase(database.get());
@@ -310,7 +354,7 @@ void ossimElevManager::addDatabase(ossimElevationDatabase* database)
 {
    if(!database) return;
    ossimRefPtr<ossimElevationDatabase> tempDb = database;
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
+  // OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
    if(std::find(m_elevationDatabaseList.begin(), 
                 m_elevationDatabaseList.end(),
                 database) == m_elevationDatabaseList.end())
diff --git a/src/ossim/elevation/ossimElevSource.cpp b/src/ossim/elevation/ossimElevSource.cpp
index 2d1df9b..875ff9b 100644
--- a/src/ossim/elevation/ossimElevSource.cpp
+++ b/src/ossim/elevation/ossimElevSource.cpp
@@ -15,7 +15,7 @@
 //              Initial coding.
 //<
 //*****************************************************************************
-// $Id: ossimElevSource.cpp 17195 2010-04-23 17:32:18Z dburken $
+// $Id: ossimElevSource.cpp 21380 2012-07-25 13:18:31Z gpotts $
 
 #include <ossim/elevation/ossimElevSource.h>
 #include <ossim/base/ossimPreferences.h>
@@ -135,7 +135,7 @@ double ossimElevSource::getHeightAboveEllipsoid(const ossimGpt& /* argGpt */)
 //  algorithm will be employed.
 //
 //*****************************************************************************
-bool ossimElevSource::intersectRay(const ossimEcefRay& ray, ossimGpt& gpt)
+bool ossimElevSource::intersectRay(const ossimEcefRay& ray, ossimGpt& gpt, double defaultElevValue)
 {
    if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimElevSource::intersectRay: entering..." << std::endl;
 
@@ -182,7 +182,7 @@ bool ossimElevSource::intersectRay(const ossimEcefRay& ray, ossimGpt& gpt)
       // Intersect ray with ellipsoid inflated by h_ellips:
       //
       h_ellips = getHeightAboveEllipsoid(gpt);
-      if ( ossim::isnan(h_ellips) ) h_ellips = 0.0;
+      if ( ossim::isnan(h_ellips) ) h_ellips = defaultElevValue;
       
       intersected = ellipsoid->nearestIntersection(ray,
                                                    h_ellips,
diff --git a/src/ossim/elevation/ossimElevationDatabase.cpp b/src/ossim/elevation/ossimElevationDatabase.cpp
index 07f27ac..46c9f79 100644
--- a/src/ossim/elevation/ossimElevationDatabase.cpp
+++ b/src/ossim/elevation/ossimElevationDatabase.cpp
@@ -3,6 +3,18 @@
 RTTI_DEF1(ossimElevationDatabase, "ossimElevationDatabase", ossimObject);
 RTTI_DEF1(ossimElevationCellDatabase, "ossimElevationCellDatabase", ossimElevationDatabase);
 
+const ossimElevationDatabase& ossimElevationDatabase::operator=(const ossimElevationDatabase& rhs)
+{
+   if ( this != &rhs )
+   {
+      ossimElevSource::operator=(rhs);
+      m_connectionString = rhs.m_connectionString;
+      m_geoid            = rhs.m_geoid;
+      m_meanSpacing      = rhs.m_meanSpacing;
+   }
+   return *this;
+}
+
 double ossimElevationDatabase::getOffsetFromEllipsoid(const ossimGpt& gpt)const
 {
    double result = 0.0;
@@ -54,6 +66,20 @@ bool ossimElevationDatabase::saveState(ossimKeywordlist& kwl, const char* prefix
    return ossimObject::saveState(kwl, prefix);
 }
 
+const ossimElevationCellDatabase& ossimElevationCellDatabase::operator=(
+   const ossimElevationCellDatabase& rhs)
+{
+   if ( this != &rhs )
+   {
+      ossimElevationDatabase::operator=(rhs);
+      m_minOpenCells       = rhs.m_minOpenCells;
+      m_maxOpenCells       = rhs.m_maxOpenCells;
+      m_cacheMap           = rhs.m_cacheMap;
+      m_memoryMapCellsFlag = rhs.m_memoryMapCellsFlag;
+   }
+   return *this;
+}
+
 void ossimElevationCellDatabase::getOpenCellList(std::vector<ossimFilename>& list) const
 {
    CellMap::const_iterator iter = m_cacheMap.begin();
@@ -90,15 +116,16 @@ ossimRefPtr<ossimElevCellHandler> ossimElevationCellDatabase::getOrCreateCellHan
     if(result.valid())
     {
       m_cacheMap.insert(std::make_pair(id, new CellInfo(id, result.get())));
-    }
-    if(m_cacheMap.size() > m_maxOpenCells)
-    {
-      flushCacheToMinOpenCells();
+
+      // 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)
diff --git a/src/ossim/elevation/ossimElevationDatabaseFactory.cpp b/src/ossim/elevation/ossimElevationDatabaseFactory.cpp
index ccb86a7..da031cc 100644
--- a/src/ossim/elevation/ossimElevationDatabaseFactory.cpp
+++ b/src/ossim/elevation/ossimElevationDatabaseFactory.cpp
@@ -2,6 +2,7 @@
 #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;
@@ -38,6 +39,13 @@ ossimElevationDatabase* ossimElevationDatabaseFactory::createDatabase(const ossi
    {
       return new ossimGeneralRasterElevationDatabase();
    }
+   else if( (typeName == "ossimImageElevationDatabase") ||
+            (typeName == "image")||
+            (typeName == "image_directory"))
+      
+   {
+      return new ossimImageElevationDatabase();
+   }
    
    return 0;
 }
@@ -65,7 +73,6 @@ ossimElevationDatabase* ossimElevationDatabaseFactory::createDatabase(const ossi
 ossimElevationDatabase* ossimElevationDatabaseFactory::open(const ossimString& connectionString)const
 {
    ossimRefPtr<ossimElevationDatabase> result = new ossimDtedElevationDatabase();
-   
    if(!result->open(connectionString))
    {
       result = new ossimSrtmElevationDatabase;
@@ -76,9 +83,26 @@ ossimElevationDatabase* ossimElevationDatabaseFactory::open(const ossimString& c
          {
             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();
 }
 
@@ -87,4 +111,5 @@ void ossimElevationDatabaseFactory::getTypeNameList(std::vector<ossimString>& ty
    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/src/ossim/elevation/ossimGeneralRasterElevHandler.cpp b/src/ossim/elevation/ossimGeneralRasterElevHandler.cpp
index 161dbdd..7ad8867 100644
--- a/src/ossim/elevation/ossimGeneralRasterElevHandler.cpp
+++ b/src/ossim/elevation/ossimGeneralRasterElevHandler.cpp
@@ -231,8 +231,7 @@ bool ossimGeneralRasterElevHandler::open(const ossimFilename& file, bool memoryM
    close();
    if(!setFilename(file)) return false;
    m_inputStream.clear();
-   m_inputStream.open(theGeneralRasterInfo.theFilename,
-                      ios::in | ios::binary);
+   m_inputStream.open(theGeneralRasterInfo.theFilename.c_str(), ios::in | ios::binary);
 
    if(memoryMapFlag)
    {
@@ -306,7 +305,7 @@ bool ossimGeneralRasterElevHandler::setFilename(const ossimFilename& file)
    kwl.clear();
    if(kwl.addFile(geomFile))
    {
-      theGeneralRasterInfo.theNullHeightValue = generalInfo.getNullPixelValue(0);
+      theGeneralRasterInfo.theNullHeightValue = generalInfo.getImageMetaData().getNullPix(0);
       theGeneralRasterInfo.theImageRect       = generalInfo.imageRect();
       theGeneralRasterInfo.theUl              = theGeneralRasterInfo.theImageRect.ul();
       theGeneralRasterInfo.theLr              = theGeneralRasterInfo.theImageRect.lr();
@@ -314,7 +313,7 @@ bool ossimGeneralRasterElevHandler::setFilename(const ossimFilename& file)
       theGeneralRasterInfo.theHeight          = theGeneralRasterInfo.theImageRect.height();
       theGeneralRasterInfo.theImageRect       = generalInfo.imageRect();
       theGeneralRasterInfo.theByteOrder       = generalInfo.getImageDataByteOrder();
-      theGeneralRasterInfo.theScalarType      = generalInfo.getScalarType();
+      theGeneralRasterInfo.theScalarType      = generalInfo.getImageMetaData().getScalarType();
       theGeneralRasterInfo.theBytesPerRawLine = generalInfo.bytesPerRawLine();
 
       //add  by simbla
diff --git a/src/ossim/elevation/ossimHgtRef.cpp b/src/ossim/elevation/ossimHgtRef.cpp
index 851fb28..faf9ec4 100644
--- a/src/ossim/elevation/ossimHgtRef.cpp
+++ b/src/ossim/elevation/ossimHgtRef.cpp
@@ -15,12 +15,15 @@
 #include <ossim/base/ossimString.h>
 #include <ossim/base/ossimTrace.h>
 #include <ossim/base/ossimNotify.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/elevation/ossimElevationAccuracyInfo.h>
 
 
 static ossimTrace traceDebug(ossimString("ossimHgtRef:debug"));
 
 #ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimHgtRef.cpp 17195 2010-04-23 17:32:18Z dburken $";
+static const char OSSIM_ID[] = "$Id: ossimHgtRef.cpp 21399 2012-07-27 18:19:22Z gpotts $";
 #endif
 
 
@@ -104,6 +107,65 @@ ossim_float64 ossimHgtRef::getRefHeight(const ossimGpt& pg) const
    return refHgt;
 }
 
+//*****************************************************************************
+//  METHOD: ossimHgtRef::getSurfaceInfo()
+//  
+//  Get reference surface information.
+//  
+//*****************************************************************************
+
+#if 0
+bool ossimHgtRef::getSurfaceInfo(const ossimGpt& pg,
+                                       ossimElevationAccuracyInfo& info) const
+{
+   bool infoOK = false;
+
+  // ossimElevManager::ElevationDatabaseListType dbList;  
+  // std::vector<ossimFilename> cellList;
+
+
+   //double hgt =  ossimElevManager::instance()->getHeightAboveEllipsoid(pg);
+
+
+/*
+
+   dbList = ossimElevManager::instance()->getElevationDatabaseList();
+   ossim_uint32 idx;
+
+   for(idx=0; idx < dbList.size(); ++idx)
+   {
+      double h = dbList[idx]->getHeightAboveEllipsoid(pg);
+      if (!ossim::isnan(h))
+      {
+         hgt = h;
+         break;
+      }
+   }
+  */ 
+   /*
+   if (!ossim::isnan(hgt))
+   {
+      ossimElevManager::instance()->getOpenCellList(cellList);
+
+      ossimRefPtr<ossimImageHandler> ih =
+            ossimImageHandlerRegistry::instance()->open(cellList[idx]);
+      ossimString hanType(ih->getClassName().c_str());
+
+      ossimImageGeometry* geom = ih->getImageGeometry().get();
+      gsd = geom->getMetersPerPixel();
+
+      info = hanType;
+   }
+   else
+   {
+      info = "No Surface";
+   }
+   */
+   infoOK = true;
+
+   return infoOK;
+}
+#endif
 
 //*****************************************************************************
 //  METHOD: ossimHgtRef::getSurfaceCovMatrix()
@@ -111,12 +173,14 @@ ossim_float64 ossimHgtRef::getRefHeight(const ossimGpt& pg) const
 //  Get reference surface covariance matrix.
 //  
 //*****************************************************************************
-bool ossimHgtRef::getSurfaceCovMatrix(const ossimGpt& /* pg */, NEWMAT::Matrix& cov) const
+bool ossimHgtRef::getSurfaceCovMatrix(const ossimGpt& pg, NEWMAT::Matrix& cov) const
 {
    
    ossim_float64 refCE;
    ossim_float64 refLE;
-   
+   ossimString info;
+   ossimDpt gsd;
+
    switch (theCurrentHeightRefType)
    {
       case AT_HGT:
@@ -128,16 +192,85 @@ bool ossimHgtRef::getSurfaceCovMatrix(const ossimGpt& /* pg */, NEWMAT::Matrix&
          break;
          
       case AT_DEM:
+      {
+
          // Set the reference CE/LE
          //   Note: currently set to SRTM spec in METERS
+         //    refCE = 20.0;
+         //    refLE = 16.0;
          //        (ref: www2.jpl.nas.gov/srtm/statistics.html)
          //  "refCE = ossimElevManager::instance()->getAccuracyCE90(pg)" is
          //    the desirable operation here (if it is implemented)
-         refCE = 20.0;
-         refLE = 16.0;
-         
+         // ================================================
+         //  This is one step closer to automatic
+         //  access to elevation surface accuracy
+         //   TODO...
+         //     [1] load from OSSIM_PREFERENCES?
+         //     [2] does DTED header/metadata have info?
+         // ================================================
+         ossimElevationAccuracyInfo info;
+         ossimElevManager::instance()->getAccuracyInfo(info, pg);
+
+         if(info.hasValidAbsoluteError())
+         {
+            refCE = info.m_absoluteCE;
+            refLE = info.m_absoluteLE;
+         }
+         else
+         {
+            refCE = 20.0;
+            refLE = 16.0;
+         }
+#if 0
+         if (getSurfaceInfo(pg, info, gsd))
+         {
+            if (info.contains("Srtm"))
+            {
+               if (gsd.x < 50.0)
+               {
+                  // SRTM 1 arc
+                  refCE = 20.0;
+                  refLE = 10.0;
+               }
+               else
+               {
+                  // SRTM 3 arc
+                  refCE = 20.0;
+                  refLE = 16.0;
+               }
+            }
+            else if (info.contains("Dted"))
+            {
+               if (gsd.x < 50.0)
+               {
+                  // DTED level 2
+                  refCE = 40.0;
+                  refLE = 20.0;
+               }
+               else
+               {
+                  // DTED level 1
+                  refCE = 50.0;
+                  refLE = 30.0;
+               }
+            }
+            else
+            {
+               // Other
+               refCE = 20.0;
+               refLE = 16.0;
+            }
+         }
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               //<< "DEBUG: info: " << info
+               << " ref: " << refCE << "/" << refLE << endl;
+         }
+#endif
+
          break;
-         
+      }
       default:
          return false;
          break;
@@ -279,6 +412,8 @@ ossimColumnVector3d ossimHgtRef::getLocalTerrainNormal(const ossimGpt& pg) const
             mpd = pg.metersPerDegree();
             ossim_float64 dLon = delta/mpd.x;
             ossim_float64 dLat = delta/mpd.y;
+
+
             for (ossim_int32 lon=-1; lon<=1; ++lon)
             {
                ossim_float64 clon = pg.lond()+lon*dLon;
@@ -318,10 +453,14 @@ ossimColumnVector3d ossimHgtRef::getLocalTerrainNormal(const ossimGpt& pg) const
              ossim::isnan(tNorm[2]))
          {
             tNorm = tNorm.zAligned();
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "WARNING: ossimHgtRef::getLocalTerrainNormal(): "
-               << "\n   error... terrain normal set to vertical..."
-               << std::endl;
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "WARNING: ossimHgtRef::getLocalTerrainNormal(): "
+                  << "\n   error... terrain normal set to vertical..."
+                  << std::endl;
+               
+            }
          }
          break;
          
diff --git a/src/ossim/elevation/ossimImageElevationDatabase.cpp b/src/ossim/elevation/ossimImageElevationDatabase.cpp
new file mode 100644
index 0000000..f4160ac
--- /dev/null
+++ b/src/ossim/elevation/ossimImageElevationDatabase.cpp
@@ -0,0 +1,449 @@
+//----------------------------------------------------------------------------
+//
+// 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/ossimCallback1.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", ossimElevationDatabase);
+
+//---
+// Call back class to register with ossimFileWalker for call to
+// ossimImageElevationDatabase::processFile
+//
+// Placed here as it is unique to this class.
+//---
+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);
+};
+
+ossimImageElevationDatabase::ossimImageElevationDatabase()
+   :
+   ossimElevationCellDatabase(),
+   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)
+{
+   if(isSourceEnabled())
+   {
+      ossimRefPtr<ossimElevCellHandler> handler = getOrCreateCellHandler(gpt);
+      if(handler.valid())
+      {
+         return handler->getHeightAboveMSL(gpt); // still need to shift
+      }
+   }
+   return ossim::nan();
+}
+
+double ossimImageElevationDatabase::getHeightAboveEllipsoid(const ossimGpt& gpt)
+{
+   double h = getHeightAboveMSL(gpt);
+   if(h != ossim::nan())
+   {
+      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;
+}
+
+
+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 = ossimElevationDatabase::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 ossimElevationDatabase::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();
+      ossimCallback1<const ossimFilename&>* cb =
+         new ProcessFileCB(this, &ossimImageElevationDatabase::processFile);
+      fw->registerProcessFileCallback(cb);
+      
+      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;
+      delete cb;
+      cb = 0;
+   }
+}
+
+// Hidden from use:
+ossimImageElevationDatabase::ossimImageElevationDatabase(
+   const ossimImageElevationDatabase& /* copy_this */)
+{
+}
+
+// Hidden from use:
+const ossimImageElevationDatabase& ossimImageElevationDatabase::operator=(
+   const ossimImageElevationDatabase& /* rhs */)
+{
+   return *this;
+}
+
+// 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();
+}
+
diff --git a/src/ossim/elevation/ossimImageElevationHandler.cpp b/src/ossim/elevation/ossimImageElevationHandler.cpp
new file mode 100644
index 0000000..d9483bc
--- /dev/null
+++ b/src/ossim/elevation/ossimImageElevationHandler.cpp
@@ -0,0 +1,246 @@
+//----------------------------------------------------------------------------
+//
+// 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/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()
+{
+}
+
+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;
+      }
+   
+      ossimRefPtr<ossimImageData> data = m_ih->getTile( ossimIrect(x0, y0, x0+1, y0+1), 0 );
+      if ( data.valid() )
+      {
+         ossimIrect dataRect = data->getImageRectangle();
+
+         double v00 = data->getPix( ossimIpt(x0,   y0)   );
+         double v01 = data->getPix( ossimIpt(x0+1, y0)   );
+         double v10 = data->getPix( ossimIpt(x0,   y0+1) );
+         double v11 = data->getPix( ossimIpt(x0+1, y0+1) );
+         
+         double p00 = v00;
+         double p01 = v01;
+         double p10 = v10;
+         double p11 = v11;
+         
+         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() )
+      
+   } // 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());
+      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);
+      }
+   }
+   return height;
+}
+
+// Hidden from use...
+ossimImageElevationHandler::ossimImageElevationHandler(const ossimImageElevationHandler& /* obj */)
+{
+}
+
+// Hidden from use...
+const ossimImageElevationHandler&
+ossimImageElevationHandler::operator=(const ossimImageElevationHandler& /* rhs */)
+{
+   return *this;
+}
diff --git a/src/ossim/elevation/ossimSrtmElevationDatabase.cpp b/src/ossim/elevation/ossimSrtmElevationDatabase.cpp
index dddd196..489dd74 100644
--- a/src/ossim/elevation/ossimSrtmElevationDatabase.cpp
+++ b/src/ossim/elevation/ossimSrtmElevationDatabase.cpp
@@ -53,6 +53,41 @@ bool ossimSrtmElevationDatabase::open(const ossimString& connectionString)
    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())
diff --git a/src/ossim/elevation/ossimSrtmHandler.cpp b/src/ossim/elevation/ossimSrtmHandler.cpp
index d4a4e2d..fb3d888 100644
--- a/src/ossim/elevation/ossimSrtmHandler.cpp
+++ b/src/ossim/elevation/ossimSrtmHandler.cpp
@@ -9,7 +9,7 @@
 // Shuttle Radar Topography Mission (SRTM) elevation source.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimSrtmHandler.cpp 17195 2010-04-23 17:32:18Z dburken $
+// $Id: ossimSrtmHandler.cpp 19444 2011-04-25 18:20:59Z dburken $
 
 #include <ossim/elevation/ossimSrtmHandler.h>
 #include <ossim/base/ossimCommon.h>
@@ -266,7 +266,8 @@ double ossimSrtmHandler::getHeightAboveMSLMemoryTemplate(T /* dummy */,
       //       std::cout << "ossimSrtmHandler::getHeightAboveMSLTemplate: leaving 1" << std::endl;
       return ossim::nan();
    }
-   
+
+   // Grab the four points from the srtm cell needed.
    ossim_uint64 offset = y0 * m_srtmRecordSizeInBytes + x0 * sizeof(T);
    ossim_uint64 offset2 =offset+m_srtmRecordSizeInBytes;
    T v00 = *(reinterpret_cast<T*> (&m_memoryMap[offset]));
@@ -285,10 +286,6 @@ double ossimSrtmHandler::getHeightAboveMSLMemoryTemplate(T /* dummy */,
    double p10 = v10;
    double p11 = v11;
    
-   //---
-   // Grab the four points from the srtm cell needed.
-   //---
-   
    double xt0 = xi - x0;
    double yt0 = yi - y0;
    double xt1 = 1-xt0;
diff --git a/src/ossim/elevation/ossimTiledElevationDatabase.cpp b/src/ossim/elevation/ossimTiledElevationDatabase.cpp
new file mode 100644
index 0000000..7a9000a
--- /dev/null
+++ b/src/ossim/elevation/ossimTiledElevationDatabase.cpp
@@ -0,0 +1,683 @@
+//----------------------------------------------------------------------------
+//
+// 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/ossimCallback1.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);
+
+//---
+// Call back class to register with ossimFileWalker for call to
+// ossimTiledElevationDatabase::processFile
+//
+// Placed here as it is unique to this class.
+//---
+class ProcessFileCB: public ossimCallback1<const ossimFilename&>
+{
+public:
+   ProcessFileCB(
+      ossimTiledElevationDatabase* obj,
+      void (ossimTiledElevationDatabase::*func)(const ossimFilename&))
+      :
+      m_obj(obj),
+      m_func(func)
+   {}
+      
+   virtual void operator()(const ossimFilename& file) const
+   {
+      (m_obj->*m_func)(file);
+   }
+
+private:
+   ossimTiledElevationDatabase* m_obj;
+   void (ossimTiledElevationDatabase::*m_func)(const ossimFilename& file);
+};
+
+ossimTiledElevationDatabase::ossimTiledElevationDatabase()
+   :
+   ossimElevationDatabase(),
+   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;
+   }
+}
+
+bool ossimTiledElevationDatabase::open(const ossimString& connectionString)
+{
+   return false; // tmp drb...
+   
+   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() )
+   {
+      // Put these outside the try block so we can delete if exception thrown.
+      ossimCallback1<const ossimFilename&>* cb = 0;
+
+      // Wrap in try catch block as excptions can be thrown under the hood.
+      try
+      {
+         m_requestedRect = region;
+         
+         ossimFilename f = m_connectionString;
+         if ( f.exists() )
+         {
+            // Walk the directory
+            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 );
+            
+            cb = new ProcessFileCB(this, &ossimTiledElevationDatabase::processFile);
+            m_fileWalker->registerProcessFileCallback(cb);
+            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 ( cb )
+      {
+         delete cb;
+         cb = 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<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 */)
+{
+}
+
+// Hidden from ues...
+const ossimTiledElevationDatabase& ossimTiledElevationDatabase::operator=(
+   const ossimTiledElevationDatabase& /* rhs */)
+{
+   return *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)
+{}
+
diff --git a/src/ossim/font/ossimFreeTypeFont.cpp b/src/ossim/font/ossimFreeTypeFont.cpp
index e61d022..0a0d2ba 100644
--- a/src/ossim/font/ossimFreeTypeFont.cpp
+++ b/src/ossim/font/ossimFreeTypeFont.cpp
@@ -6,7 +6,7 @@
 // Author: Garrett Potts
 // 
 //********************************************************************
-// $Id: ossimFreeTypeFont.cpp 17108 2010-04-15 21:08:06Z dburken $
+// $Id: ossimFreeTypeFont.cpp 21518 2012-08-22 21:15:56Z dburken $
 
 // ossimFreeTypeFont.h should be load prior to checking for OSSIM_HAS_FREETYPE.
 #include <ossim/font/ossimFreeTypeFont.h>
@@ -51,7 +51,7 @@ ossimFreeTypeFont::ossimFreeTypeFont(const ossimFilename& fontFile)
                               fontFile.c_str(),
                               0,
                               &theFontFace );
-         if((error == FT_Err_Unknown_File_Format))
+         if (error == FT_Err_Unknown_File_Format)
          {
             if (traceDebug())
             {
@@ -109,7 +109,7 @@ ossimFreeTypeFont::ossimFreeTypeFont(const ossimFreeTypeFont& rhs)
                               rhs.theFontFile.c_str(),
                               0,
                               &theFontFace );
-         if((error == FT_Err_Unknown_File_Format))
+         if(error == FT_Err_Unknown_File_Format)
          {
             if (traceDebug())
             {
@@ -169,8 +169,8 @@ void ossimFreeTypeFont::layoutGlyphs(const ossimString& s )
    int        n;
    FT_Vector  origin;
    FT_Pos     origin_x = 0;
-   FT_UInt    load_flags;
-   FT_UInt    num_grays;
+   // FT_UInt    load_flags;
+   // FT_UInt    num_grays;
    FT_UInt    prev_index = 0;
    FT_UInt num_glyphs = (FT_UInt)s.size();
    int error = 0;
@@ -185,9 +185,9 @@ void ossimFreeTypeFont::layoutGlyphs(const ossimString& s )
    
    int hasKerning = FT_HAS_KERNING(theFontFace);
    
-   load_flags = FT_LOAD_DEFAULT;
+   // load_flags = FT_LOAD_DEFAULT;
+   // num_grays = 256;
    
-   num_grays = 256;
    const char* c = s.c_str();
    for ( n = 0; n < (int)num_glyphs; n++)
    {
diff --git a/src/ossim/imaging/ossimAdrgTileSource.cpp b/src/ossim/imaging/ossimAdrgTileSource.cpp
index 39df31d..007fbb8 100644
--- a/src/ossim/imaging/ossimAdrgTileSource.cpp
+++ b/src/ossim/imaging/ossimAdrgTileSource.cpp
@@ -9,9 +9,7 @@
 //              ADRG file.
 //
 //********************************************************************
-// $Id: ossimAdrgTileSource.cpp 17932 2010-08-19 20:34:35Z dburken $
-
-#include <iostream>
+// $Id: ossimAdrgTileSource.cpp 21631 2012-09-06 18:10:55Z dburken $
 
 #include <ossim/imaging/ossimAdrgTileSource.h>
 #include <ossim/imaging/ossimAdrgHeader.h>
@@ -25,12 +23,14 @@
 #include <ossim/base/ossimUnitTypeLut.h>
 #include <ossim/base/ossimStringProperty.h>
 #include <ossim/base/ossimContainerProperty.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/imaging/ossimTiffTileSource.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)
 
diff --git a/src/ossim/imaging/ossimAppFixedTileCache.cpp b/src/ossim/imaging/ossimAppFixedTileCache.cpp
index 96ed9e2..6423b2f 100644
--- a/src/ossim/imaging/ossimAppFixedTileCache.cpp
+++ b/src/ossim/imaging/ossimAppFixedTileCache.cpp
@@ -9,7 +9,7 @@
 // Description: This file contains the Application cache algorithm
 //
 //***********************************
-// $Id: ossimAppFixedTileCache.cpp 19303 2011-04-07 19:55:37Z gpotts $
+// $Id: ossimAppFixedTileCache.cpp 20127 2011-10-12 11:27:10Z gpotts $
 #include <algorithm>
 #include <sstream>
 #include <ossim/imaging/ossimAppFixedTileCache.h>
@@ -254,8 +254,9 @@ ossimRefPtr<ossimImageData> ossimAppFixedTileCache::getTile(
 
 
 ossimRefPtr<ossimImageData> ossimAppFixedTileCache::addTile(
-   ossimAppFixedCacheId cacheId,
-   ossimRefPtr<ossimImageData> data)
+                                                            ossimAppFixedCacheId cacheId,
+                                                            ossimRefPtr<ossimImageData> data,
+                                                            bool duplicateData)
 {
    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
    ossimRefPtr<ossimImageData> result = 0;
@@ -284,7 +285,7 @@ ossimRefPtr<ossimImageData> ossimAppFixedTileCache::addTile(
    }
    {
       cacheSize = aCache->getCacheSize();
-      result    = aCache->addTile(data);
+      result    = aCache->addTile(data, duplicateData);
    
       theCurrentCacheSize += (aCache->getCacheSize() - cacheSize);
    }
diff --git a/src/ossim/imaging/ossimAtCorrGridRemapper.cpp b/src/ossim/imaging/ossimAtCorrGridRemapper.cpp
index c91a88e..3075924 100644
--- a/src/ossim/imaging/ossimAtCorrGridRemapper.cpp
+++ b/src/ossim/imaging/ossimAtCorrGridRemapper.cpp
@@ -6,8 +6,9 @@
 //
 // Description:
 //*******************************************************************
-//  $Id: ossimAtCorrGridRemapper.cpp 12912 2008-05-28 15:05:54Z gpotts $
+//  $Id: ossimAtCorrGridRemapper.cpp 21631 2012-09-06 18:10:55Z dburken $
 #include <ossim/imaging/ossimAtCorrGridRemapper.h>
+#include <ossim/imaging/ossimImageData.h>
 
 RTTI_DEF1(ossimAtCorrGridRemapper, "ossimAtCorrGridRemapper", ossimAtCorrRemapper);
 
diff --git a/src/ossim/imaging/ossimBandClipFilter.cpp b/src/ossim/imaging/ossimBandClipFilter.cpp
index aa3b518..8ab31e0 100644
--- a/src/ossim/imaging/ossimBandClipFilter.cpp
+++ b/src/ossim/imaging/ossimBandClipFilter.cpp
@@ -8,10 +8,11 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimBandClipFilter.cpp 12912 2008-05-28 15:05:54Z gpotts $
+// $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);
 
diff --git a/src/ossim/imaging/ossimBandSelector.cpp b/src/ossim/imaging/ossimBandSelector.cpp
index 85a50ef..386e5f2 100644
--- a/src/ossim/imaging/ossimBandSelector.cpp
+++ b/src/ossim/imaging/ossimBandSelector.cpp
@@ -10,18 +10,20 @@
 // Contains class declaration for ossimBandSelector.
 // 
 //*******************************************************************
-//  $Id: ossimBandSelector.cpp 18996 2011-03-02 14:01:58Z gpotts $
-
-#include <iostream>
-#include <algorithm>
+//  $Id: ossimBandSelector.cpp 22230 2013-04-12 16:34:05Z dburken $
 
 #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)
@@ -30,8 +32,9 @@ ossimBandSelector::ossimBandSelector()
    :
       ossimImageSourceFilter(),
       theTile(0),
+      theOutputBandList(0),
       theWithinRangeFlag(ossimBandSelectorWithinRangeFlagState_NOT_SET),
-      theOrderedCorrectlyFlag(false)
+      thePassThroughFlag(false)
 
 {
 //   theEnableFlag = false; // Start off disabled.
@@ -53,18 +56,17 @@ ossimRefPtr<ossimImageData> ossimBandSelector::getTile(
    }
 
    // Get the tile from the source.
-   ossimRefPtr<ossimImageData> t = theInputConnection->getTile(tileRect,
-                                                               resLevel);
+   ossimRefPtr<ossimImageData> t = theInputConnection->getTile(tileRect, resLevel);
 
-   if (!theEnableFlag)
+   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 (theOrderedCorrectlyFlag)
+//   {
+//      return t; // Input band order same as output band order.
+//   }
 
    if(!theTile.valid()) // First time through, might not be initialized...
    {
@@ -79,7 +81,8 @@ ossimRefPtr<ossimImageData> ossimBandSelector::getTile(
    theTile->setImageRectangle(tileRect);
    if(theWithinRangeFlag == ossimBandSelectorWithinRangeFlagState_NOT_SET)
    {
-      theWithinRangeFlag = ((outputBandsWithinInputRange() == true)?ossimBandSelectorWithinRangeFlagState_IN_RANGE:
+      theWithinRangeFlag = ((outputBandsWithinInputRange() == true) ?
+                            ossimBandSelectorWithinRangeFlagState_IN_RANGE:
                             ossimBandSelectorWithinRangeFlagState_OUT_OF_RANGE);
    }
    if(theWithinRangeFlag == ossimBandSelectorWithinRangeFlagState_OUT_OF_RANGE)
@@ -111,48 +114,112 @@ ossimRefPtr<ossimImageData> ossimBandSelector::getTile(
    return theTile;
 }
 
-void ossimBandSelector::setOutputBandList(
-   const vector<ossim_uint32>& outputBandList)
+void ossimBandSelector::setOutputBandList( const vector<ossim_uint32>& outputBandList )
 {
    if (outputBandList.size())
    {
       theOutputBandList = outputBandList;  // Assign the new list.
-      theTile = 0;       // Force an allocate call next getTile.
 
-      theWithinRangeFlag = ossimBandSelectorWithinRangeFlagState_NOT_SET;
-      theOrderedCorrectlyFlag = isOrderedCorrectly();
+      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
 {
-   if(theEnableFlag)
+   ossim_uint32 bands;
+   
+   if(isSourceEnabled())
    {
-      return (ossim_uint32)theOutputBandList.size();
+      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 getNumberOfInputBands();
+   return bands;
 }
 
 void ossimBandSelector::initialize()
 {
    // Base class will recapture "theInputConnection".
    ossimImageSourceFilter::initialize();
-   theWithinRangeFlag =  ossimBandSelectorWithinRangeFlagState_NOT_SET;  
+   
+   theWithinRangeFlag =  ossimBandSelectorWithinRangeFlagState_NOT_SET;
+
    if(theInputConnection)
    {
       if ( !theOutputBandList.size() ) 
       {
-         //---
          // First time through set the output band list to input.
-         //---
          theInputConnection->getOutputBandList(theOutputBandList);
       }
 
-      if ( theEnableFlag )
+      // See if we have a single image chain with band selectable image handler.
+      ossimRefPtr<ossimImageHandler> ih = getBandSelectableImageHandler();
+      if ( ih.valid() )
       {
-         theOrderedCorrectlyFlag = isOrderedCorrectly();
-
+         if ( theOutputBandList.size() )
+         {
+            ih->setOutputBandList( theOutputBandList );
+         }
+         thePassThroughFlag = true;
+      }
+      else
+      {
+         checkPassThrough();
+      }
+      
+      if ( isSourceEnabled() )
+      {
+         // theOrderedCorrectlyFlag = isOrderedCorrectly();
+         
          if ( theTile.valid() )
          {
             //---
@@ -161,8 +228,7 @@ void ossimBandSelector::initialize()
             // - band change
             // - scalar change
             //---
-            if( theOrderedCorrectlyFlag ||
-                ( theTile->getNumberOfBands() != theOutputBandList.size() ) ||
+            if( ( theTile->getNumberOfBands() != theOutputBandList.size() ) ||
                 ( theTile->getScalarType() !=
                   theInputConnection->getOutputScalarType() ) )
             {
@@ -170,13 +236,14 @@ void ossimBandSelector::initialize()
             }
          }
       }
-      else
-      {
-         theTile = 0;
-      }
    }
    else // No input connection.
    {
+      thePassThroughFlag = true;
+   }
+
+   if ( !isSourceEnabled() )
+   {
       theTile = 0;
    }
 }
@@ -189,11 +256,23 @@ void ossimBandSelector::allocate()
    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 (theEnableFlag)
+      if (isSourceEnabled())
       {
          if(band < theOutputBandList.size())
          {
@@ -217,7 +296,7 @@ double ossimBandSelector::getNullPixelValue(ossim_uint32 band)const
 {
    if(theInputConnection)
    {
-      if (theEnableFlag)
+      if (isSourceEnabled())
       {
          if(band < theOutputBandList.size())
          {
@@ -242,7 +321,7 @@ double ossimBandSelector::getMaxPixelValue(ossim_uint32 band)const
 {
    if(theInputConnection)
    {
-      if (theEnableFlag)
+      if (isSourceEnabled())
       {
          if(band < theOutputBandList.size())
          {
@@ -297,9 +376,9 @@ bool ossimBandSelector::loadState(const ossimKeywordlist& kwl,
                                   const char* prefix)
 {
    ossimImageSourceFilter::loadState(kwl, prefix);
-   
-   // call ossimSource method to delete the list of objects   
+
    theOutputBandList.clear();
+   
    ossimString copyPrefix = prefix;
    
    ossimString bands = kwl.find(prefix, ossimKeywordNames::BANDS_KW);
@@ -307,7 +386,7 @@ bool ossimBandSelector::loadState(const ossimKeywordlist& kwl,
    {
       ossim::toSimpleVector(theOutputBandList, bands);
    }
-   else 
+   else
    {
       ossimString regExpression =  ossimString("^(") + copyPrefix + "band[0-9]+)";
       
@@ -337,10 +416,13 @@ bool ossimBandSelector::loadState(const ossimKeywordlist& kwl,
    return true;
 }
 
-bool ossimBandSelector::isOrderedCorrectly() const
+void ossimBandSelector::checkPassThrough()
 {
-   bool result = false;
-
+   thePassThroughFlag = ((theInputConnection == 0)||!outputBandsWithinInputRange());
+   
+   // check if marked with improper bands
+   if(thePassThroughFlag) return;
+   
    if(theInputConnection)
    {
       std::vector<ossim_uint32> inputList;
@@ -362,7 +444,7 @@ bool ossimBandSelector::isOrderedCorrectly() const
          }
          if (i == SIZE)
          {
-            result = true;
+            thePassThroughFlag = true;
          }
       }
    }
@@ -376,43 +458,49 @@ bool ossimBandSelector::isOrderedCorrectly() const
       }
    }
 
-   return result;
 }
 
 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)
          {
-            ossimNotify(ossimNotifyLevel_WARN)
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
                << "ossimBandSelector::outputBandsWithinInputRange() ERROR:"
                << "Output band greater than highest input band. "
                << theOutputBandList[i] << " > " << HIGHEST_BAND << "."
                << std::endl;
-            return false;
+            }
+            result = false;
+            break;
          }
       }
-      return true;
    }
    else
    {
-      ossimNotify(ossimNotifyLevel_WARN)
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
          << "ossimBandSelector::outputBandsWithinInputRange() ERROR:"
          << "Method called prior to initialization!" << std::endl;
+      }
    }
-
-   return false;
+   return result;
 }
 
-void ossimBandSelector::getOutputBandList(
-   std::vector<ossim_uint32>& bandList) const
+void ossimBandSelector::getOutputBandList(std::vector<ossim_uint32>& bandList) const
 {
-   if ( theOutputBandList.size() )
+   if ( isSourceEnabled()&&theOutputBandList.size() )
    {
       bandList = theOutputBandList;
    }
@@ -457,6 +545,14 @@ void ossimBandSelector::setProperty(ossimRefPtr<ossimProperty> property)
      }
      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);
@@ -490,13 +586,54 @@ ossimRefPtr<ossimProperty> ossimBandSelector::getProperty(const ossimString& nam
       
       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("bandSelection");
+   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()
diff --git a/src/ossim/imaging/ossimBandSeparateHandler.cpp b/src/ossim/imaging/ossimBandSeparateHandler.cpp
new file mode 100644
index 0000000..6d4c5be
--- /dev/null
+++ b/src/ossim/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/ossim/imaging/ossimBitMaskTileSource.cpp b/src/ossim/imaging/ossimBitMaskTileSource.cpp
new file mode 100644
index 0000000..d2ba39b
--- /dev/null
+++ b/src/ossim/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/ossim/imaging/ossimBitMaskWriter.cpp b/src/ossim/imaging/ossimBitMaskWriter.cpp
new file mode 100644
index 0000000..31283b2
--- /dev/null
+++ b/src/ossim/imaging/ossimBitMaskWriter.cpp
@@ -0,0 +1,481 @@
+//*************************************************************************************************
+//
+// 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:
+      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/ossim/imaging/ossimBlendMosaic.cpp b/src/ossim/imaging/ossimBlendMosaic.cpp
index 6e0fd5e..af2db43 100644
--- a/src/ossim/imaging/ossimBlendMosaic.cpp
+++ b/src/ossim/imaging/ossimBlendMosaic.cpp
@@ -5,7 +5,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimBlendMosaic.cpp 15766 2009-10-20 12:37:09Z gpotts $
+// $Id: ossimBlendMosaic.cpp 20696 2012-03-19 12:36:40Z dburken $
 
 #include <ossim/imaging/ossimBlendMosaic.h>
 #include <ossim/imaging/ossimImageData.h>
@@ -61,7 +61,7 @@ ossimRefPtr<ossimImageData> ossimBlendMosaic::getTile(
    const ossimIrect& tileRect,
    ossim_uint32 resLevel)
 {   
-   ossimIpt origin = tileRect.ul();
+   // ossimIpt origin = tileRect.ul();
    if(!isSourceEnabled())
    {
       return ossimImageMosaic::getTile(tileRect, resLevel);
@@ -219,7 +219,7 @@ template <class T> ossimRefPtr<ossimImageData> ossimBlendMosaic::combine(
   ossim_uint32 band;
   double currentWeight = 1.0;
   double previousWeight = 1.0;
-  double sumOfWeights   = 1;
+  // double sumOfWeights   = 1;
   long offset = 0;
   long row    = 0;
   long col    = 0;
@@ -251,7 +251,7 @@ template <class T> ossimRefPtr<ossimImageData> ossimBlendMosaic::combine(
       // set the current weight for the current tile.
       currentWeight = theWeights[layerIdx];
 
-      sumOfWeights = previousWeight+currentWeight;
+      // sumOfWeights = previousWeight+currentWeight;
       if( (currentStatus != OSSIM_EMPTY) &&
 	  (currentStatus != OSSIM_NULL))
        {	 
@@ -332,123 +332,121 @@ template <class T> ossimRefPtr<ossimImageData> ossimBlendMosaic::combine(
 }
 
 template <class T> ossimRefPtr<ossimImageData> ossimBlendMosaic::combineNorm(
-   T,
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
+   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);
+   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()];
+   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();
+   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];
+      // 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();
+      // 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];
-        }
+         // 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];
-                    }
-                 }
+         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;
-              }
-           }
-        }
-     }
-     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;   
+               }
+            }
+         }
+         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,
@@ -508,7 +506,7 @@ void ossimBlendMosaic::setNumberOfWeights(ossim_uint32 numberOfWeights)
 {
    if(numberOfWeights > theWeights.size())
    {
-      ossim_uint32 length = numberOfWeights - theWeights.size();
+      ossim_uint32 length = numberOfWeights - (ossim_uint32) theWeights.size();
       for(ossim_uint32 index= 0; index < length; ++ index)
       {
          theWeights.push_back(1.0);
diff --git a/src/ossim/imaging/ossimBumpShadeTileSource.cpp b/src/ossim/imaging/ossimBumpShadeTileSource.cpp
index 5893315..15debc1 100644
--- a/src/ossim/imaging/ossimBumpShadeTileSource.cpp
+++ b/src/ossim/imaging/ossimBumpShadeTileSource.cpp
@@ -8,7 +8,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimBumpShadeTileSource.cpp 19197 2011-03-23 16:22:08Z dburken $
+// $Id: ossimBumpShadeTileSource.cpp 20198 2011-11-03 13:23:40Z dburken $
 
 #include <ossim/imaging/ossimBumpShadeTileSource.h>
 #include <ossim/imaging/ossimImageDataFactory.h>
@@ -267,11 +267,23 @@ void ossimBumpShadeTileSource::computeColor(ossim_uint8& r,
 
 void ossimBumpShadeTileSource::initialize()
 {
-  ossimImageCombiner::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();
-  
+   computeLightDirection();
 }
 
 void ossimBumpShadeTileSource::allocate()
@@ -284,7 +296,7 @@ void ossimBumpShadeTileSource::computeLightDirection()
 {
    NEWMAT::Matrix m = ossimMatrix3x3::createRotationMatrix(m_lightSourceElevationAngle,
                                                            0.0,
-                                                           m_lightSourceAzimuthAngle);
+                                                           -m_lightSourceAzimuthAngle); // make positive rotation clockwise for azimuth
    NEWMAT::ColumnVector v(3);
    v[0] = 0;
    v[1] = 1;
@@ -477,7 +489,7 @@ ossimRefPtr<ossimProperty> ossimBumpShadeTileSource::getProperty(const ossimStri
    }
    else if(name == "lightSourceAzimuthAngle")
    {
-      ossimProperty* prop = new ossimNumericProperty(name, ossimString::toString(m_lightSourceAzimuthAngle), 0.0, 90.0);
+      ossimProperty* prop = new ossimNumericProperty(name, ossimString::toString(m_lightSourceAzimuthAngle), 0, 360);
       prop->setCacheRefreshBit();
       return prop;
    }
diff --git a/src/ossim/imaging/ossimCacheTileSource.cpp b/src/ossim/imaging/ossimCacheTileSource.cpp
index e83495b..4c8e96c 100644
--- a/src/ossim/imaging/ossimCacheTileSource.cpp
+++ b/src/ossim/imaging/ossimCacheTileSource.cpp
@@ -7,7 +7,7 @@
 // Description:  ossimCacheTileSource
 // 
 //*******************************************************************
-//  $Id: ossimCacheTileSource.cpp 16276 2010-01-06 01:54:47Z gpotts $
+//  $Id: ossimCacheTileSource.cpp 20459 2012-01-17 01:30:36Z gpotts $
 
 #include <ossim/base/ossimTrace.h>
 #include <ossim/base/ossimNotify.h>
@@ -23,41 +23,46 @@
 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()),
+     //theCacheId(ossimAppFixedTileCache::instance()->newTileCache()),
      theTile(0),
      theFixedTileSize(),
      theCachingEnabled(true),
      theEventProgressFlag(false),
-     theCacheRLevel(0),
-     theBoundingRect()     
+     theUseInputTileSizeFlag(false)
 {
-   theBoundingRect.makeNan();
-   theFixedTileSize = ossimAppFixedTileCache::instance()->getTileSize(theCacheId);
+   ossim::defaultTileSize(theFixedTileSize);
 }
 
 ossimCacheTileSource::~ossimCacheTileSource()
 {
-   ossimAppFixedTileCache::instance()->deleteCache(theCacheId);
+   deleteRlevelCache();
+   //ossimAppFixedTileCache::instance()->deleteCache(theCacheId);
    
-   theCacheId = -1;
-   theBoundingRect.makeNan();
+   //theCacheId = -1;
+  // theBoundingRect.makeNan();
 }
 
 void ossimCacheTileSource::flush()
 {
-   ossimAppFixedTileCache::instance()->flush(theCacheId);
+   //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();
-   theCacheRLevel = 999999999;
    theTile = 0;
 }
    
@@ -80,24 +85,6 @@ ossimRefPtr<ossimImageData> ossimCacheTileSource::getTile(
    {
       if ( isSourceEnabled() )
       {
-         if( (resLevel != theCacheRLevel) ||  theBoundingRect.hasNans() )
-         {
-            flush();
-            // allocate();
-            
-            // theCacheRLevel = 9999999;
-            theCacheRLevel = resLevel;
-            theBoundingRect = getBoundingRect(resLevel);
-            if( !theBoundingRect.hasNans() )
-            {
-               theFixedTileSize = ossimAppFixedTileCache::instance()->getTileSize(theCacheId);
-               theBoundingRect.stretchToTileBoundary(theFixedTileSize);
-               ossimAppFixedTileCache::instance()->setRect(theCacheId,
-                                                           theBoundingRect);
-               // theCacheRLevel = resLevel;
-            }
-         }
-         
          if(!theTile.valid())
          {
             allocate();
@@ -107,15 +94,12 @@ ossimRefPtr<ossimImageData> ossimCacheTileSource::getTile(
          {
             theTile->setImageRectangle(tileRect);
             theTile->makeBlank();
-            
-            if( !theBoundingRect.hasNans() )
-            {
-               result = fillTile(resLevel);
-            }
-            else
+            // see if we can get a valid cache at the given resolution level
+            if(getCacheId(resLevel) < 0)
             {
-               result = theTile;
+               return theInputConnection->getTile(tileRect, resLevel);
             }
+            result = fillTile(resLevel);
          }
       }
       else // Not enabled...
@@ -133,20 +117,20 @@ ossimRefPtr<ossimImageData> ossimCacheTileSource::fillTile(
 {
    ossimRefPtr<ossimImageData> tempTile = 0;
    fireProgressEvent(0.0);
-   ossimIrect boundingRect = theBoundingRect;
+   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(theFixedTileSize);
-      ossimAppFixedTileCache::ossimAppFixedCacheId cacheId = theCacheId;
+      allignedRect.stretchToTileBoundary(cacheTileSize);
+     // ossimAppFixedTileCache::ossimAppFixedCacheId cacheId = theCacheId;
       
       // check to see if we need to loop
       if((allignedRect == tileRect)&&
-         (static_cast<ossim_int32>(tileRect.width())  == theFixedTileSize.x)&&
-         (static_cast<ossim_int32>(tileRect.height()) == theFixedTileSize.y))
+         (static_cast<ossim_int32>(tileRect.width())  == cacheTileSize.x)&&
+         (static_cast<ossim_int32>(tileRect.height()) == cacheTileSize.y))
       {
          ossimIpt origin = tileRect.ul();
          if(theCachingEnabled)
@@ -169,14 +153,17 @@ ossimRefPtr<ossimImageData> ossimCacheTileSource::fillTile(
                }
             }
          }
+//         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->setDataObjectStatus(tempTile->getDataObjectStatus());
                theTile->loadTile(tempTile.get());
             }
          }
@@ -184,10 +171,11 @@ ossimRefPtr<ossimImageData> ossimCacheTileSource::fillTile(
       }
       else
       {
+         
          ossim_int32 boundaryHeight = allignedRect.height();
          ossim_int32 boundaryWidth  = allignedRect.width();
          ossimIpt origin(allignedRect.ul());
-         ossim_int32 totalTiles  = (boundaryHeight/theFixedTileSize.y)*
+         ossim_int32 totalTiles  = (boundaryHeight/cacheTileSize.y)*
             (boundaryWidth/theFixedTileSize.x);
          ossim_int32 currentTile = 0;
          for(ossim_int32 row = 0;
@@ -214,8 +202,8 @@ ossimRefPtr<ossimImageData> ossimCacheTileSource::fillTile(
                {
                   ossimIrect rect(origin.x,
                                   origin.y,
-                                  origin.x + theFixedTileSize.x-1,
-                                  origin.y + theFixedTileSize.y-1);
+                                  origin.x + cacheTileSize.x-1,
+                                  origin.y + cacheTileSize.y-1);
                   
                   tempTile = theInputConnection->getTile(rect, resLevel);
                   
@@ -231,6 +219,11 @@ ossimRefPtr<ossimImageData> ossimCacheTileSource::fillTile(
                      }
                   }
                }
+             //  else
+             //  {
+             //     std::cout << "FOUND IN CACHE AT RES " << resLevel << "\n";
+             // }
+               
                if(tempTile.valid())
                {
                   if(tempTile->getBuf()&&
@@ -245,10 +238,9 @@ ossimRefPtr<ossimImageData> ossimCacheTileSource::fillTile(
             }
             origin.y += theFixedTileSize.y;
          }
+         theTile->validate();
          fireProgressEvent(100);
       }
-
-      theTile->validate();
       
    } // End of:  if ( !allignedRect.hasNans() )
    
@@ -268,15 +260,21 @@ ossim_uint32 ossimCacheTileSource::getTileHeight() const
 bool ossimCacheTileSource::loadState(const ossimKeywordlist& kwl,
                                      const char* prefix)
 {
-   ossimAppFixedTileCache::instance()->deleteCache(theCacheId);
+   //ossimAppFixedTileCache::instance()->deleteCache(theCacheId);
    
-   theCacheId = ossimAppFixedTileCache::instance()->newTileCache();
+   //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)
@@ -300,6 +298,10 @@ bool ossimCacheTileSource::saveState(ossimKeywordlist& kwl,
            ossimKeywordNames::ENABLE_CACHE_KW,
            theCachingEnabled,
            true);
+   kwl.add(prefix,
+           USE_INPUT_TILE_SIZE_KW,
+           theUseInputTileSizeFlag,
+           true);
    
    kwl.add(prefix,
            TILE_SIZE_XY_KW,
@@ -327,6 +329,13 @@ ossimRefPtr<ossimProperty> ossimCacheTileSource::getProperty(
       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);
 }
 
@@ -340,8 +349,7 @@ void ossimCacheTileSource::setProperty(ossimRefPtr<ossimProperty> property)
       ossimIpt pt;
       pt.toPoint(property->valueToString());
 
-      // Rule: Must be positive and at least 32.
-      if ( (pt.x > 31) && (pt.y > 31) )
+      if ( (pt.x > 7) && (pt.y > 7) )
       {
          setTileSize(pt);
       }
@@ -349,7 +357,7 @@ void ossimCacheTileSource::setProperty(ossimRefPtr<ossimProperty> property)
       {
          ossimNotify(ossimNotifyLevel_NOTICE)
             << "ossimCacheTileSource::setProperty NOTICE:"
-            << "\nTile dimensions must be at least 32!"
+            << "\nTile dimensions must be at least 8!"
             << "\nFormat = ( x, y )"
             << std::endl;
       }
@@ -358,6 +366,15 @@ void ossimCacheTileSource::setProperty(ossimRefPtr<ossimProperty> property)
    {
       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);
@@ -369,6 +386,7 @@ void ossimCacheTileSource::getPropertyNames(
 {
    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);
 }
@@ -408,7 +426,8 @@ void ossimCacheTileSource::setTileSize(const ossimIpt& size)
    {
       theTile = 0; // Force an allocate of new tile.
       theFixedTileSize = size;
-      ossimAppFixedTileCache::instance()->setTileSize(theCacheId, size);
+      initializeRlevelCache();
+     // ossimAppFixedTileCache::instance()->setTileSize(theCacheId, size);
    }
 }
 
@@ -420,3 +439,72 @@ void ossimCacheTileSource::fireProgressEvent(double 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/src/ossim/imaging/ossimCibCadrgTileSource.cpp b/src/ossim/imaging/ossimCibCadrgTileSource.cpp
index ce95b15..7762b79 100644
--- a/src/ossim/imaging/ossimCibCadrgTileSource.cpp
+++ b/src/ossim/imaging/ossimCibCadrgTileSource.cpp
@@ -7,7 +7,7 @@
 // Author: Garrett Potts
 //
 //********************************************************************
-// $Id: ossimCibCadrgTileSource.cpp 18342 2010-10-29 20:29:13Z dburken $
+// $Id: ossimCibCadrgTileSource.cpp 19900 2011-08-04 14:19:57Z dburken $
 #include <algorithm>
 
 #include <ossim/imaging/ossimCibCadrgTileSource.h>
@@ -40,7 +40,7 @@
 static ossimTrace traceDebug = ossimTrace("ossimCibCadrgTileSource:debug");
 
 #ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimCibCadrgTileSource.cpp 18342 2010-10-29 20:29:13Z dburken $";
+static const char OSSIM_ID[] = "$Id: ossimCibCadrgTileSource.cpp 19900 2011-08-04 14:19:57Z dburken $";
 #endif
 
 RTTI_DEF1(ossimCibCadrgTileSource, "ossimCibCadrgTileSource", ossimImageHandler)
@@ -161,10 +161,8 @@ bool ossimCibCadrgTileSource::open()
                   if(theEntryToRender)
                   {
                      // a CADRG is 1536x1536 per frame.
-                     theNumberOfLines   =
-                        theEntryToRender->getNumberOfFramesVertical()*CIBCADRG_FRAME_HEIGHT;
-                     theNumberOfSamples =
-                        theEntryToRender->getNumberOfFramesHorizontal()*CIBCADRG_FRAME_WIDTH;
+                     theNumberOfLines   = theEntryToRender->getNumberOfLines();
+                     theNumberOfSamples = theEntryToRender->getNumberOfSamples();
                   }
 
                   if(theEntryToRender->getProductType().trim().upcase() == "CADRG")
@@ -511,10 +509,9 @@ void ossimCibCadrgTileSource::setTocEntryToRender(const ossimRpfTocEntry* entry)
 {
    if(isOpen()&&entry)
    {
-      // a CIB is 1536x1536 per frame.
       theEntryToRender = entry;
-      theNumberOfLines   = theEntryToRender->getNumberOfFramesVertical()*CIBCADRG_FRAME_HEIGHT;
-      theNumberOfSamples = theEntryToRender->getNumberOfFramesHorizontal()*CIBCADRG_FRAME_HEIGHT;
+      theNumberOfLines   = theEntryToRender->getNumberOfLines();
+      theNumberOfSamples = theEntryToRender->getNumberOfSamples();
       theEntryNumberToRender = theTableOfContents->getTocEntryIndex(entry);
    }
 }
diff --git a/src/ossim/imaging/ossimColorNormalizedFusion.cpp b/src/ossim/imaging/ossimColorNormalizedFusion.cpp
index 519dd27..a8c5184 100644
--- a/src/ossim/imaging/ossimColorNormalizedFusion.cpp
+++ b/src/ossim/imaging/ossimColorNormalizedFusion.cpp
@@ -10,11 +10,12 @@
 // Description: Color normalized fusion
 //
 //*************************************************************************
-// $Id: ossimColorNormalizedFusion.cpp 11136 2007-06-04 13:26:35Z gpotts $
+// $Id: ossimColorNormalizedFusion.cpp 21631 2012-09-06 18:10:55Z dburken $
 
 #include <ossim/imaging/ossimColorNormalizedFusion.h>
-#include <ossim/base/ossimErrorContext.h>
 #include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/imaging/ossimImageData.h>
 
 RTTI_DEF1(ossimColorNormalizedFusion,
           "ossimColorNormalizedFusion",
diff --git a/src/ossim/imaging/ossimDespeckleFilter.cpp b/src/ossim/imaging/ossimDespeckleFilter.cpp
new file mode 100644
index 0000000..35993a3
--- /dev/null
+++ b/src/ossim/imaging/ossimDespeckleFilter.cpp
@@ -0,0 +1,236 @@
+//*******************************************************************
+//
+// 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:
+      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/ossim/imaging/ossimDoqqTileSource.cpp b/src/ossim/imaging/ossimDoqqTileSource.cpp
index da11ea7..542233b 100644
--- a/src/ossim/imaging/ossimDoqqTileSource.cpp
+++ b/src/ossim/imaging/ossimDoqqTileSource.cpp
@@ -8,14 +8,15 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimDoqqTileSource.cpp 17932 2010-08-19 20:34:35Z dburken $
+//  $Id: ossimDoqqTileSource.cpp 21631 2012-09-06 18:10:55Z dburken $
 #include <ossim/imaging/ossimDoqqTileSource.h>
-#include <ossim/support_data/ossimDoqq.h>
-#include <ossim/imaging/ossimGeneralRasterInfo.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",
diff --git a/src/ossim/imaging/ossimDtedElevationImageSource.cpp b/src/ossim/imaging/ossimDtedElevationImageSource.cpp
deleted file mode 100644
index 17fc506..0000000
--- a/src/ossim/imaging/ossimDtedElevationImageSource.cpp
+++ /dev/null
@@ -1,716 +0,0 @@
-//----------------------------------------------------------------------------
-// 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:
-//
-// Contains class declaration of ossimDtedElevationImageSource.
-//
-// $Id: ossimDtedElevationImageSource.cpp 17206 2010-04-25 23:20:40Z dburken $
-//----------------------------------------------------------------------------
-
-#include <vector>
-#include <sstream>
-using namespace std;
-
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/elevation/ossimDtedHandler.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/imaging/ossimDtedElevationImageSource.h>
-#include <ossim/imaging/ossimDtedTileSource.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageRenderer.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageChain.h>
-
-static ossimTrace traceDebug("ossimDtedElevationImageSource:degug");
-
-ossimDtedElevationImageSource::ossimDtedElevationImageSource()
-   :
-   theDirectory(),
-   theCellExtension("dt2"),
-   theResamplerType(ossimDtedElevationImageSource::BILINEAR)
-{
-}
-
-ossimDtedElevationImageSource::~ossimDtedElevationImageSource()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimDtedElevationImageSource::getBlock(
-   const ossimGrect& rect,
-   ossim_uint32 lines,
-   ossim_uint32 samples) const
-{
-
-   ossimDpt postSpacing;
-   getPostSpacing(rect, lines, samples, postSpacing);
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimDtedElevationImageSource::getBlock DEBUG:"
-         << "\nrect:          " << rect
-         << "\nlines:         " << lines
-         << "\nsamples:       " << samples
-         << "\npost spacing:  " << postSpacing
-         << "\ntheDirectory:  " << theDirectory
-         << endl;
-   }
-
-   // Get a list of needed cells.
-   vector<ossimFilename> vf;
-   findCells(rect, vf);
-
-   // Create a mosaic of them.
-   ossimRefPtr<ossimImageChain> mosaic = createMosaic(vf);
-   if (!mosaic)
-   {
-      return 0;
-   }
-
-   // Get the view.
-   ossimMapProjection* view = getView(mosaic.get());
-   if (!view)
-   {
-      mosaic = 0;
-      return 0;
-   }
-   
-   // Set the output resolution.
-   view->setDecimalDegreesPerPixel(postSpacing);
-
-   // Set the tie point to be the upper left of the requested rect.
-   view->setUlTiePoints(rect.ul());
-
-   // Convert the ground rectangle to the view's image space.
-   ossimIrect tileRect;
-   computeImageRect(view, rect, tileRect);
-
-   cout << "tileRect:  " << tileRect << endl;
-   
-   ossimRefPtr<ossimImageData> result = mosaic->getTile(tileRect);
-
-   mosaic = 0;
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimDtedElevationImageSource::getBlock DEBUG:"
-         << *result
-         << "\nReturning..."
-         << endl;
-   }
-
-   return result;
-}
-
-void ossimDtedElevationImageSource::setDirectory(const ossimFilename& directory)
-{
-   theDirectory = directory;
-}
-
-void ossimDtedElevationImageSource::getDirectory(ossimFilename& directory) const
-{
-   directory = theDirectory;
-}
-
-void ossimDtedElevationImageSource::findCells(
-   const ossimGrect& rect,
-   vector<ossimFilename>& vf) const
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimDtedElevationImageSource::findCells entered..." << endl;
-   }
-
-   // Clear the vector of filenames passed to us.
-   vf.clear();
-
-   if (!theDirectory.isDir())
-   {
-      return;
-   }   
-
-   //---
-   // Expand out the rectangle to even degree boundaries.
-   // Handle wrapping???
-   //---
-   
-   ossimGrect expandedRect = rect.stretchToEvenBoundary(1.0, 1.0);
-
-
-   ossim_int32 startLat = static_cast<ossim_int32>(expandedRect.ll().latd());
-   ossim_int32 startLon = static_cast<ossim_int32>(expandedRect.ll().lond());
-   ossim_int32 stopLat  =
-      static_cast<ossim_int32>(expandedRect.ur().latd()-1);
-   ossim_int32 stopLon  =
-      static_cast<ossim_int32>(expandedRect.ur().lond()-1);
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG:"
-         << "\nepandedRect:  " << expandedRect
-         << "\nstartLat:  " << startLat
-         << "\nstartLon:  " << startLon
-         << "\nstopLat:   " << stopLat
-         << "\nstopLon:   " << stopLon
-         
-         << endl;
-   }
-
-   
-   for (ossim_int32 lon = startLon; lon <= stopLon; ++lon)
-   {
-      // Build up a dted file name.
-      ossimString lonBase;
-      if (lon < 0)
-      {
-         lonBase = "w";
-      }
-      else
-      {
-         lonBase = "e";
-      }
-
-      ossim_int32 tmpLon = abs(lon);
-      ostringstream  s1;
-      s1<< setfill('0')<<setw(3)<< tmpLon;
-
-      lonBase += s1.str().c_str();
-      lonBase += "/";
-
-      for (ossim_int32 lat = startLat; lat <= stopLat; ++lat)
-      {
-         ossimFilename dtedFile = theDirectory.dirCat(lonBase);
-         if (lat >= 0)
-         {
-            dtedFile += "n";
-         }
-         else
-         {
-            dtedFile += "s";
-         }
-         
-         ossim_int32 tmpLat = abs(lat);
-         ostringstream  s2;
-         s2<< setfill('0')<<setw(2)<<tmpLat;
-         dtedFile += s2.str().c_str();
-         
-         dtedFile.setExtension(theCellExtension);
-
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "\nSearching for:  " << dtedFile
-               << endl;
-         }
-
-         if (dtedFile.exists())
-         {
-            vf.push_back(dtedFile);
-         }
-      }
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "Cell list:\n";
-      
-      vector<ossimFilename>::const_iterator i = vf.begin();
-      while (i != vf.end())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << (*i) << "\n";
-         ++i;
-      }
-      ossimNotify(ossimNotifyLevel_DEBUG) << endl;
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimDtedElevationImageSource::findCells exited..." << endl;
-   }
-}
-
-void ossimDtedElevationImageSource::resampleCell(
-   const ossimGrect& rect,
-   const ossimFilename& dtedFile,
-   ossimImageData& id,
-   const ossimDpt& postSpacing) const
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimDtedElevationImageSource::resampleCell DEBUG:  Entered..."
-         << endl;
-   }
-
-   switch (theResamplerType)
-   {
-      case NEAREST_NEIGHBOR:
-         resampleCellNearestNeighbor(rect, dtedFile, id, postSpacing);
-         break;
-
-      case BILINEAR:
-         resampleCellBilinear(rect, dtedFile, id, postSpacing);
-         break;
-
-      default:
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimDtedElevationImageSource::resampleCell type not handled!"
-            << endl;
-         break;
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimDtedElevationImageSource::resampleCell DEBUG:  Exited..."
-         << endl;
-   }
-}
-
-void ossimDtedElevationImageSource::resampleCellBilinear(
-   const ossimGrect& rect,
-   const ossimFilename& dtedFile,
-   ossimImageData& id,
-   const ossimDpt& postSpacing) const
-{
-   cout << dtedFile << endl;
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimDtedElevationImageSource::resampleCellBilinear DEBUG:"
-         << " Entered..."
-         << endl;
-   }
-
-   ossimRefPtr<ossimDtedHandler> dh = new ossimDtedHandler(dtedFile);
-   if (!dh)
-   {
-      return;
-   }
-   if (dh->getErrorStatus() != ossimErrorCodes::OSSIM_OK)
-   {
-      dh = 0;
-      return;
-   }
-
-   ossim_float32* buf = id.getFloatBuf();
-   if (!buf)
-   {
-      dh = 0;
-      return;
-   }
-   
-   // Get the clip rectangle.
-   const ossimGrect clipRect = rect.clipToRect(dh->getBoundingGndRect());
-   const ossimGpt STOP_GPT = clipRect.lr();
-   ossimGpt gpt = clipRect.ul();
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "clipRect:  " << clipRect
-         << "\nSTOP_GPT:  " << STOP_GPT
-         << "\nStarting gpt:       " << gpt
-         << endl;
-   }
-
-   // Walk in the latitude (line) direction.
-   while (gpt.lat >= STOP_GPT.lat)
-   {
-      // Walk in longitude (sample) direction.
-      gpt.lon = clipRect.ul().lon;
-      while (gpt.lon <= STOP_GPT.lon)
-      {
-         ossim_int32 index = computeIndex(id, rect, gpt, postSpacing);
-//         cout << "index:  " << index << endl;
-         if (index != OSSIM_INT_NAN)
-         {
-            ossim_float32 hgt =
-               static_cast<ossim_float32>(dh->getHeightAboveMSL(gpt));
-//             cout << "index: " << index
-//                  << "\ngpt: " << gpt
-//                  << "\nhgt: " << hgt
-//                  << endl;
-            buf[index] = hgt;
-            if (hgt == -32767.0)
-            {
-               cout << gpt << endl;
-            }
-            // static_cast<ossim_float32>(dh->getHeightAboveMSL(gpt));
-         }
-         else
-         {
-            cout << "nan index for gpt:\n" << gpt << endl;
-         }
-         
-         gpt.lon = gpt.lon + postSpacing.x;
-      }
-      gpt.lat = gpt.lat - postSpacing.y;
-   }
-//   cout << "Ending gpt:  " << gpt << endl;
-
-//    // Walk in the latitude direction
-//    while (gpt.lat <= STOP_GPT.lat)
-//    {
-//       while (gpt.lon <= STOP_GPT.lon)
-//       {
-//          gpt.lon += postSpacing.x;
-//       }
-//       gpt.lat += postSpacing.y;
-//    }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimDtedElevationImageSource::resampleCellBilinear DEBUG:"
-         << " Exited..."
-         << endl;
-   }
-
-   dh = 0;
-}
-
-void ossimDtedElevationImageSource::resampleCellNearestNeighbor(
-   const ossimGrect& /* rect */,
-   const ossimFilename& dtedFile,
-   ossimImageData& /* id */,
-   const ossimDpt& /* requestedPostSpacing */) const
-{
-   // Open the cell.
-   ossimRefPtr<ossimImageHandler> dts = new ossimDtedTileSource();
-   dts->open(dtedFile);
-
-   if (dts->isOpen() == false)
-   {
-      dts = 0;
-      return;
-   }
-
-   // Get the post spacing of the cell.
-   ossimDpt cellPostSpacing;
-   ((ossimDtedTileSource*)dts.get())->getPostSpacing(cellPostSpacing);
-
-//    // Compute the rlevel to grab from.
-//    ossim_uint32 rLevel = computeRLevel(dts->getNumberOfDecimationLevels(),
-//                                        requestedPostSpacing,
-//                                        cellPostSpacing);
-
-   
-}
-
-void ossimDtedElevationImageSource::getPostSpacing(const ossimGrect& rect,
-                                                   ossim_uint32 lines,
-                                                   ossim_uint32 samples,
-                                                   ossimDpt& result) const
-{
-   result.lat = (rect.ul().lat - rect.ll().lat) / (lines   - 1);
-   result.lon = (rect.lr().lon - rect.ll().lon) / (samples - 1);
-}
-
-void ossimDtedElevationImageSource::snap(const ossimGrect& rect,
-                                         const ossimDpt& postSpacing,
-                                         ossimGrect& clipRect) const
-{
-   ossim_float64 d;
-
-   // upper left latitude
-   d = (rect.ul().lat - clipRect.ul().lat) / postSpacing.y;
-   if (d != 0.0)
-   {
-      clipRect.ul().lat = floor(d) * postSpacing.y;
-   }
-
-   // upper left longitude
-   d = (rect.ul().lon - clipRect.ul().lon) / postSpacing.x;
-   if (d != 0.0)
-   {
-      clipRect.ul().lon = ceil(d) * postSpacing.x;
-   }
-
-   // upper right latitude
-   d = (rect.ul().lat - clipRect.ur().lat) / postSpacing.y;
-   if (d != 0.0)
-   {
-      clipRect.ur().lat = floor(d) * postSpacing.y;
-   }
-
-   // upper right longitude
-   d = (rect.ul().lon - clipRect.ur().lon) / postSpacing.x;
-   if (d != 0.0)
-   {
-      clipRect.ul().lon = floor(d) * postSpacing.x;
-   }
-
-   // lower right latitude
-   d = (rect.ul().lat - clipRect.lr().lat) / postSpacing.y;
-   if (d != 0.0)
-   {
-      clipRect.lr().lat = ceil(d) * postSpacing.y;
-   }
-
-   // lower right longitude
-   d = (rect.ul().lon - clipRect.lr().lon) / postSpacing.x;
-   if (d != 0.0)
-   {
-      clipRect.ul().lon = floor(d) * postSpacing.x;
-   }
-
-   // lower left latitude
-   d = (rect.ul().lat - clipRect.ll().lat) / postSpacing.y;
-   if (d != 0.0)
-   {
-      clipRect.ll().lat = ceil(d) * postSpacing.y;
-   }
-
-   // lower left longitude
-   d = (rect.ul().lon - clipRect.ll().lon) / postSpacing.x;
-   if (d != 0.0)
-   {
-      clipRect.ul().lon = ceil(d) * postSpacing.x;
-   }
-}
-
-ossim_uint32 ossimDtedElevationImageSource::computeIndex(
-   const ossimImageData& id,
-   const ossimGrect& idRect,
-   const ossimGpt& gpt,
-   const ossimDpt& postSpacing) const
-{
-   if ( ! idRect.pointWithin(gpt) )
-   {
-      return OSSIM_INT_NAN;
-   }
-
-   ossim_uint32 line = static_cast<ossim_uint32>( (idRect.ul().lat - gpt.lat)
-                                                  / postSpacing.y );
-   ossim_uint32 samp = static_cast<ossim_uint32>( (gpt.lon - idRect.ul().lon)
-                                                  / postSpacing.x );
-   return ( (line * id.getWidth()) + samp );
-}
-
-ossim_uint32 ossimDtedElevationImageSource::computeRLevel(
-   ossim_uint32 numberOfRLevels,
-   const ossimDpt& requestedPostSpacing,
-   const ossimDpt& cellPostSpacing) const
-{
-   if (numberOfRLevels == 1)
-   {
-      return 0;
-   }
-
-   // Start the check at r1 postspacing.
-   ossimDpt rLevelPostSpacing(cellPostSpacing.x * 2.0,
-                              cellPostSpacing.y * 2.0);
-   ossim_uint32 level = 0;
-
-   for (ossim_uint32 i = 1; i < numberOfRLevels; ++i)
-   {
-      if ( (rLevelPostSpacing.x > requestedPostSpacing.x) &&
-           (rLevelPostSpacing.y > requestedPostSpacing.y) )
-      {
-         break;
-      }
-      
-      rLevelPostSpacing.x = rLevelPostSpacing.x * 2.0;
-      rLevelPostSpacing.y = rLevelPostSpacing.y * 2.0;
-      ++level;
-   }
-
-   return level;
-}
-
-void ossimDtedElevationImageSource::setCellExtension(const ossimString& ext)
-{
-   theCellExtension = ext;
-}
-
-void ossimDtedElevationImageSource::getCellExtension(ossimString& ext) const
-{
-   ext = theCellExtension;
-}
-
-ossimConnectableObject* ossimDtedElevationImageSource::createRawChain(
-   const ossimFilename& file) const
-{
-   ossimImageHandler* ih  = ossimImageHandlerRegistry::instance()->open(file);
-   ossimConnectableObject* result = NULL;
-   if(ih)
-   {
-      ossimImageChain* chain = new ossimImageChain;
-      chain->add(ih);
-      chain->setDescription(file);
-      result = chain;
-   }
-
-   return result;
-}
-
-ossimImageChain* ossimDtedElevationImageSource::createMosaic(
-   const std::vector<ossimFilename>& inputs) const
-{
-   std::vector<ossimConnectableObject*> inputObjects;
-   for(int idx = 0; idx < (int)inputs.size();++idx)
-   {
-      ossimConnectableObject* obj = createRawChain(inputs[idx]);
-      if(obj)
-      {
-         inputObjects.push_back(obj);
-      }
-   }
-   return createMosaic(inputObjects);
-}
-
-ossimImageChain* ossimDtedElevationImageSource::createMosaic(
-   const std::vector<ossimConnectableObject*>& inputs) const
-{
-   if(!inputs.size())
-   {
-      return NULL;
-   }
-
-   std::vector<ossimConnectableObject*> inputList;
-   ossim_uint32 idx = 0;
-
-   for(idx = 0; idx < inputs.size(); ++idx)
-   {
-      ossimImageChain* chain = PTR_CAST(ossimImageChain, inputs[idx]);
-      if(chain)
-      {
-         inputList.push_back(chain);
-      }
-   }
-   if(!inputList.size())
-   {
-      return NULL;
-   }
-   
-   ossimString defaultDescription="ossimOrthoImageMosaic";;
-   ossimKeywordlist kwl;
-   
-   kwl.add("type",
-           "ossimImageChain",
-           true);
-   
-   kwl.add("id",
-           0,
-           true);
-   
-   kwl.add("object1.type",
-           "ossimOrthoImageMosaic",
-           true);
-   kwl.add("object1.id",
-           1,
-           true);
-   
-   
-   kwl.add("object10.type",
-           "ossimCacheTileSource",
-           true);
-   kwl.add("object10.id",
-           10,
-           true);
-   kwl.add("object10.input_connection1",
-           1,
-           true);
-   
-   kwl.add("object20.type",
-           "ossimImageRenderer",
-           true);
-   kwl.add("object20.id",
-           20,
-           true);
-   kwl.add("object20.input_connection1",
-           10,
-           true);
-   
-   ossimRefPtr<ossimObject> objResult =
-   ossimObjectFactoryRegistry::instance()->createObject(kwl);
-   ossimRefPtr<ossimImageChain> chainResult      = PTR_CAST(ossimImageChain, objResult.get());
-   if(chainResult.valid())
-   {
-      chainResult->makeUniqueIds();
-      chainResult->setDescription(defaultDescription);
-      for(idx = 0; idx < inputList.size(); ++idx)
-      {
-         chainResult->connectMyInputTo(inputList[idx]);
-      }
-   }
-   else
-   {
-      chainResult = 0;
-   }
-   return chainResult.release();
-}
-
-ossimMapProjection* ossimDtedElevationImageSource::getView(
-   ossimConnectableObject* container) const
-{
-   if (!container)
-   {
-      cerr << "a..." << endl;
-      return NULL;
-   }
-
-   // Find the resampler.
-   ossimImageRenderer* rs =
-      (ossimImageRenderer*)container->
-      findObjectOfType("ossimImageRenderer",
-                       ossimConnectableObject::CONNECTABLE_DIRECTION_INPUT);
-
-   if (!rs)
-   {
-      cerr << "b..." << endl;
-      return NULL;
-   }
-   
-   const ossimObject* obj = rs->getView();
-   if (!obj)
-   {
-      cerr << "b2..." << endl;
-   }
-
-   return PTR_CAST(ossimMapProjection, obj);
-}
-
-void ossimDtedElevationImageSource::computeImageRect(
-   const ossimMapProjection* view,
-   const ossimGrect& grect,
-   ossimIrect& irect) const
-{
-   if (!view)
-   {
-      return;
-   }
-   
-   ossimDpt dpt;
-   view->worldToLineSample(grect.ul(), dpt);
-   irect.set_ul(dpt);
-   view->worldToLineSample(grect.lr(), dpt);
-   irect.set_lr(dpt);
-}
-
-void ossimDtedElevationImageSource::setResamplerType(ossimDtedElevationImageSource::ResamplerType type)
-{
-   theResamplerType = type;
-}
-
-ossimDtedElevationImageSource::ResamplerType ossimDtedElevationImageSource::getResamplerType() const
-{
-   return theResamplerType;
-}
-
diff --git a/src/ossim/imaging/ossimDtedTileSource.cpp b/src/ossim/imaging/ossimDtedTileSource.cpp
index 0129bab..d6bc7fa 100644
--- a/src/ossim/imaging/ossimDtedTileSource.cpp
+++ b/src/ossim/imaging/ossimDtedTileSource.cpp
@@ -11,11 +11,7 @@
 // Contains class declaration for ossimDtedTileSource.
 //
 //********************************************************************
-// $Id: ossimDtedTileSource.cpp 17941 2010-08-19 22:39:13Z dburken $
-
-#include <cstdlib>
-#include <iostream>
-using namespace std;
+// $Id: ossimDtedTileSource.cpp 21631 2012-09-06 18:10:55Z dburken $
 
 #include <ossim/imaging/ossimDtedTileSource.h>
 #include <ossim/base/ossimConstants.h>
@@ -27,10 +23,14 @@ using namespace std;
 #include <ossim/base/ossimDatum.h>
 #include <ossim/projection/ossimMapProjection.h>
 #include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/imaging/ossimTiffTileSource.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)
 
@@ -399,47 +399,52 @@ bool ossimDtedTileSource::loadState(const ossimKeywordlist& kwl,
 //**************************************************************************************************
 ossimRefPtr<ossimImageGeometry> ossimDtedTileSource::getImageGeometry()
 {
-   if ( !theGeometry.valid() )
-   {
-      //---
-      // 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()),
-                                       ossimGpt(0.0, 0.0, 0.0, datum),
-                                       0.0,   // false easting
-                                       0.0);  // false northing
-      
-      //---
-      // Set the tie point.
-      // NOTE: Latitude southwest corner we need northwest.
-      //---
-      ossim_float64 lat = m_uhl.latOrigin() + (m_uhl.latInterval() * (m_uhl.numLatPoints()-1.0));
-      ossim_float64 lon = m_uhl.lonOrigin();
-      ossimGpt tie(lat, lon, 0.0, datum);
-      eq->setUlTiePoints(tie);
+   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:
-      ossimDpt gsd(m_uhl.lonInterval(), m_uhl.latInterval());
-      eq->setDecimalDegreesPerPixel(gsd);
+   eq->setOrigin(origin);
+   eq->setUlTiePoints(tie);
+   ossimDpt gsd(m_uhl.lonInterval(), m_uhl.latInterval());
+   eq->setDecimalDegreesPerPixel(gsd);
 
-      // Set the pcs code. Was determined that 4326 was preferred over 6326 (OLK 08/2010)
-      eq->setPcsCode(4326); // used to be 6326
-      
-      // Give it to the geometry object.
-      ossimRefPtr<ossimProjection> proj = eq.get();
-      
-      // Make the geometry:
-      theGeometry = new ossimImageGeometry;
-      
-      // Set the projection.
-      theGeometry->setProjection( proj.get() );
+   // 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() );
-   }
+   // Set image things the geometry object should know about.
+   initImageParameters( theGeometry.get() );
    
    return theGeometry;
 }
diff --git a/src/ossim/imaging/ossimERSFileWriter.cpp b/src/ossim/imaging/ossimERSFileWriter.cpp
index d634b28..576e808 100644
--- a/src/ossim/imaging/ossimERSFileWriter.cpp
+++ b/src/ossim/imaging/ossimERSFileWriter.cpp
@@ -10,12 +10,13 @@
 // writing an ERS header file.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimERSFileWriter.cpp 17932 2010-08-19 20:34:35Z dburken $
+// $Id: ossimERSFileWriter.cpp 21631 2012-09-06 18:10:55Z dburken $
 
 #include <ossim/imaging/ossimERSFileWriter.h>
 #include <ossim/base/ossimKeywordlist.h>
 #include <ossim/base/ossimKeywordNames.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>
diff --git a/src/ossim/imaging/ossimERSTileSource.cpp b/src/ossim/imaging/ossimERSTileSource.cpp
index d9787b4..b022ac9 100644
--- a/src/ossim/imaging/ossimERSTileSource.cpp
+++ b/src/ossim/imaging/ossimERSTileSource.cpp
@@ -15,7 +15,7 @@
 // as the raster file but with an .ers extension.
 //
 //*******************************************************************
-//  $Id: ossimERSTileSource.cpp 17932 2010-08-19 20:34:35Z dburken $
+//  $Id: ossimERSTileSource.cpp 21512 2012-08-22 11:53:57Z dburken $
 
 #include <ossim/imaging/ossimERSTileSource.h>
 #include <ossim/support_data/ossimERS.h>
@@ -100,7 +100,7 @@ bool ossimERSTileSource::open(const ossimFilename& fileName)
          ossim_uint32 bands = static_cast<ossim_uint32>(theHdr->theBands);
          for(i = 0; i < bands; ++i)
          {
-            genRasterInfo.setNullPixelValue(i, theHdr->theNullCell);
+            genRasterInfo.getImageMetaData().setNullPix(i, theHdr->theNullCell);
          }
       }
       ossimFilename metadataFile = fne;
@@ -119,15 +119,15 @@ bool ossimERSTileSource::open(const ossimFilename& fileName)
          {
             if(theMetaData.getMinValuesValidFlag())
             {
-               genRasterInfo.setMinPixelValue(i, theMetaData.getMinPix(i));
+               genRasterInfo.getImageMetaData().setMinPix(i, theMetaData.getMinPix(i));
             }
             if(theMetaData.getMaxValuesValidFlag())
             {
-               genRasterInfo.setMaxPixelValue(i, theMetaData.getMaxPix(i));
+               genRasterInfo.getImageMetaData().setMaxPix(i, theMetaData.getMaxPix(i));
             }
             if(theMetaData.getNullValuesValidFlag())
             {
-               genRasterInfo.setNullPixelValue(i, theMetaData.getNullPix(i));
+               genRasterInfo.getImageMetaData().setNullPix(i, theMetaData.getNullPix(i));
             }
          }
       }
diff --git a/src/ossim/imaging/ossimEdgeFilter.cpp b/src/ossim/imaging/ossimEdgeFilter.cpp
index c4ccc22..89c6936 100644
--- a/src/ossim/imaging/ossimEdgeFilter.cpp
+++ b/src/ossim/imaging/ossimEdgeFilter.cpp
@@ -8,7 +8,7 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimEdgeFilter.cpp 17195 2010-04-23 17:32:18Z dburken $
+//  $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>
@@ -188,6 +188,11 @@ void ossimEdgeFilter::setProperty(ossimRefPtr<ossimProperty> property)
    {
       theFilterType = property->valueToString();
    }
+   else 
+   {
+      ossimImageSourceFilter::setProperty(property.get());
+   }
+
 }
 
 ossimRefPtr<ossimProperty> ossimEdgeFilter::getProperty(const ossimString& name)const
diff --git a/src/ossim/imaging/ossimElevImageSource.cpp b/src/ossim/imaging/ossimElevImageSource.cpp
index 40b59af..2be5c1a 100644
--- a/src/ossim/imaging/ossimElevImageSource.cpp
+++ b/src/ossim/imaging/ossimElevImageSource.cpp
@@ -11,9 +11,7 @@
 // manager.
 // 
 //*******************************************************************
-//  $Id: ossimElevImageSource.cpp 9094 2006-06-13 19:12:40Z dburken $
-
-#include <time.h>
+//  $Id: ossimElevImageSource.cpp 21631 2012-09-06 18:10:55Z dburken $
 
 #include <ossim/imaging/ossimElevImageSource.h>
 #include <ossim/elevation/ossimElevManager.h>
@@ -21,6 +19,8 @@
 #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)
 
diff --git a/src/ossim/imaging/ossimEnviHeaderFileWriter.cpp b/src/ossim/imaging/ossimEnviHeaderFileWriter.cpp
index 783a6f3..90f6207 100644
--- a/src/ossim/imaging/ossimEnviHeaderFileWriter.cpp
+++ b/src/ossim/imaging/ossimEnviHeaderFileWriter.cpp
@@ -13,11 +13,12 @@
 // writing an ENVI (The Environment for Visualizing Images) header file.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimEnviHeaderFileWriter.cpp 17932 2010-08-19 20:34:35Z dburken $
+// $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>
diff --git a/src/ossim/imaging/ossimEnviTileSource.cpp b/src/ossim/imaging/ossimEnviTileSource.cpp
new file mode 100644
index 0000000..73fa333
--- /dev/null
+++ b/src/ossim/imaging/ossimEnviTileSource.cpp
@@ -0,0 +1,282 @@
+//----------------------------------------------------------------------------
+//
+// 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/src/ossim/imaging/ossimFgdcFileWriter.cpp b/src/ossim/imaging/ossimFgdcFileWriter.cpp
index c833fab..db68c03 100644
--- a/src/ossim/imaging/ossimFgdcFileWriter.cpp
+++ b/src/ossim/imaging/ossimFgdcFileWriter.cpp
@@ -11,20 +11,21 @@
 // Committe (FGDC) format.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimFgdcFileWriter.cpp 17932 2010-08-19 20:34:35Z dburken $
+// $Id: ossimFgdcFileWriter.cpp 21631 2012-09-06 18:10:55Z dburken $
 
-#include <fstream>
-using namespace std;
 
 #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)
 
diff --git a/src/ossim/imaging/ossimFilterResampler.cpp b/src/ossim/imaging/ossimFilterResampler.cpp
index 8ca1786..37d54c8 100644
--- a/src/ossim/imaging/ossimFilterResampler.cpp
+++ b/src/ossim/imaging/ossimFilterResampler.cpp
@@ -11,7 +11,7 @@
 //         David A. Horner (DAH) http://dave.thehorners.com
 //
 //*************************************************************************
-// $Id: ossimFilterResampler.cpp 17195 2010-04-23 17:32:18Z dburken $
+// $Id: ossimFilterResampler.cpp 20326 2011-12-07 13:48:18Z dburken $
 
 #include <ossim/imaging/ossimFilterResampler.h>
 #include <ossim/base/ossimCommon.h>
@@ -313,15 +313,18 @@ template <class T> void ossimFilterResampler::resampleBilinearTile(
    const ossimDpt& deltaUr,
    const ossimDpt& outLength)
 {
-//    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;
-   ossim_uint32  band,centerOffset;
-   ossim_float64 tmpFlt64,stepSizeWidth,stepSizeHeight;
+#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);
@@ -329,12 +332,6 @@ template <class T> void ossimFilterResampler::resampleBilinearTile(
       stepSizeWidth   = 1.0;
    }
 
-   if(outLength.y>1) {
-      stepSizeHeight = 1.0/(outLength.y-1.0);   
-   } else {
-      stepSizeHeight = 1.0;
-   }
-
    // INPUT INFORMATION
    ossim_uint32       inWidth      = input->getWidth();
    ossim_uint32       inBandSize   = input->getSizePerBand();  // fix for out-of-bounds check OLK 06/2005
@@ -383,9 +380,9 @@ template <class T> void ossimFilterResampler::resampleBilinearTile(
    double pointx,pointy,deltaX,deltaY;
    ossim_int32 starty,startx; 
 
-   // USING NEAREST NEIGHBOR
    if(xkernel_width==0 || ykernel_height==0)
    {
+      // USING NEAREST NEIGHBOR
       for(ossim_uint32 resultY = 0; resultY < resultRectH; ++resultY)
       {
 //          deltaX = (terminalx-initialx) * stepSizeWidth;
@@ -418,10 +415,10 @@ template <class T> void ossimFilterResampler::resampleBilinearTile(
          terminaly  += deltaUr.y;
       } // End of loop in y direction.
       
-   // USING A KERNEL
    }
    else
    {
+      // USING A KERNEL
       const double* kernel;
       ossim_uint32 iy,ix,sourceIndex,nullCount;
       for(ossim_uint32 resultY = 0; resultY < resultRectH; ++resultY)
@@ -434,8 +431,7 @@ template <class T> void ossimFilterResampler::resampleBilinearTile(
          {
             starty  = ossim::round<int>(pointy - ykernel_half_height + .5);
             startx  = ossim::round<int>(pointx - xkernel_half_width + .5);
-            centerOffset = (ossim_uint32)((starty+ykernel_half_height)*inWidth +
-                                          (startx+xkernel_half_width));
+            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.
@@ -503,13 +499,19 @@ template <class T> void ossimFilterResampler::resampleBilinearTile(
                   {
                      if(densityvals[band]<=FLT_EPSILON)
                      {
-                        tmpFlt64 = pixelvals[band];
+                        //---
+                        // 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.
diff --git a/src/ossim/imaging/ossimGeneralRasterInfo.cpp b/src/ossim/imaging/ossimGeneralRasterInfo.cpp
index 0362100..63ee8a0 100644
--- a/src/ossim/imaging/ossimGeneralRasterInfo.cpp
+++ b/src/ossim/imaging/ossimGeneralRasterInfo.cpp
@@ -8,22 +8,24 @@
 // Author:  David Burken
 //
 // Description:
-//
+// Contains class definition for ossimGeneralRasterInfo
 //*******************************************************************
-//  $Id: ossimGeneralRasterInfo.cpp 17504 2010-06-02 11:22:37Z dburken $
-
-#include <cstdlib>
-#include <iostream>
-#include <iomanip>
+// $Id: ossimGeneralRasterInfo.cpp 21745 2012-09-16 15:21:53Z dburken $
 
 #include <ossim/imaging/ossimGeneralRasterInfo.h>
-#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimInterleaveTypeLut.h>
 #include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimNotify.h>
 #include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimInterleaveTypeLut.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",
@@ -31,7 +33,7 @@ NUMBER_LINES("number_lines",
 
 static const ossimKeyword
 NUMBER_SAMPLES("number_samples",
-              "Number of samples in the raster image.");
+               "Number of samples in the raster image.");
 
 static const ossimKeyword
 VALID_START_LINE("valid_start_line",
@@ -78,40 +80,44 @@ static ossimTrace traceDebug("ossimGeneralRasterInfo:debug");
 
 ossimGeneralRasterInfo::ossimGeneralRasterInfo()
    :
-      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)
-{}
+   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_uint32        numberOfBands,
-                                               ossim_uint32        lines,
-                                               ossim_uint32        samples,
-                                               ossim_uint32        headerSize,
+                                               ossim_int32         numberOfBands,
+                                               ossim_int32         lines,
+                                               ossim_int32         samples,
+                                               ossim_int32         headerSize,
                                                ossimFillMode       nullsMode,
-                                               ossim_uint32        pixelsToChop)
+                                               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)
+   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);
@@ -122,84 +128,120 @@ ossimGeneralRasterInfo::ossimGeneralRasterInfo(const std::vector<ossimFilename>&
 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)
+   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.
-   //***
-   out << std::setiosflags(std::ios::left);
-   ossim_uint32 i;
-   for (i=0; i<theImageFileList.size(); ++i)
-   {
-      out << ossimKeywordNames::FILENAME_KW << (i+1) << ":  "
-          << theImageFileList[i].c_str() << std::endl;
-   }
-            
-   out  << ossimScalarTypeLut::instance()->getKeyword().key() << ":  "
-        << ossimScalarTypeLut::instance()->getEntryString(getScalarType())
-        << "\n" << INTERLEAVE_TYPE_LUT.getKeyword().key() << ":  "
-        << INTERLEAVE_TYPE_LUT.getEntryString(theInterleaveType)
-        << "\n" << ossimKeywordNames::NUMBER_BANDS_KW << ":  "
-        << numberOfBands()
-        << "\n" << NUMBER_LINES.key() << ":  "
-        << rawLines()
-        << "\n" << NUMBER_SAMPLES.key() << ":  "
-        << rawSamples()
-        << "\n" << VALID_START_LINE.key() << ":  "
-        << theValidImageRect.ul().y
-        << "\n" << VALID_STOP_LINE.key() << ":  "
-        << theValidImageRect.lr().y
-        << "\n" << VALID_START_SAMPLE.key() << ":  "
-        << theValidImageRect.ul().x
-        << "\n" << VALID_STOP_SAMPLE.key() << ":  "
-        << theValidImageRect.lr().x
-        << "\n" << SUB_IMAGE_OFFSET_LINE.key() << ":  "
-        << theSubImageOffset.line
-        << "\n" << SUB_IMAGE_OFFSET_SAMP.key() << ":  "
-        << theSubImageOffset.samp
-        << "\n" << HEADER_SIZE.key() << ":  "
-        << theHeaderSize
-        << "\n" << SET_NULLS.key() << ":  "
-        << (ossim_uint32)theSetNullsMode
-        << "\n" << PIXELS_TO_CHOP.key() << ":  "
-        << thePixelsToChop
-        << std::endl;
-   
-   if (bytesPerPixel() > 1)
-   {
-      out << ossimKeywordNames::BYTE_ORDER_KW << ":  "
-          << (theImageDataByteOrder == OSSIM_LITTLE_ENDIAN ? "little_endian" :
-              "big_endian")
-          << std::endl;
-   }
-   for (i=0; i<numberOfBands(); ++i)
-   {
-      out << "band" << i+1 << ".min_value: "  << theMetaData.getMinPix(i)
-          << "\nband" << i+1 << ".max_value: "  << theMetaData.getMaxPix(i)
-          << "\nband" << i+1 << ".null_value: " << theMetaData.getNullPix(i)
-          << std::endl;
-   }
-   
-   return ossimErrorStatusInterface::print(out);
+   //---
+   ossimKeywordlist kwl;
+   saveState( kwl, 0 );
+   out << kwl << std::endl;
+   return out;
 }
 
 void ossimGeneralRasterInfo::setFillToNullsMode(ossim_uint32 mode)
@@ -218,54 +260,72 @@ void ossimGeneralRasterInfo::setFillToNullsMode(ossim_uint32 mode)
    }
 }
 
-ossim_uint32 ossimGeneralRasterInfo::bytesPerPixel(ossimScalarType type) const
+ossim_int32 ossimGeneralRasterInfo::pixelsToChop() const
 {
-   ossim_uint32 bpp;
-   
-   switch (type)
-   {
-      case OSSIM_UINT8:
-      case OSSIM_SINT8:
-      {
-         bpp = 1;
-         break;
-      }
-      case OSSIM_UINT16:
-      case OSSIM_SINT16:
-      case OSSIM_USHORT11:
-      {
-         bpp = 2;
-         break;
-      }
-      case OSSIM_FLOAT32:
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_UINT32:
-      case OSSIM_SINT32:
-      {     
-         bpp = 4;
-         break;
-      }
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-      {
-         bpp = 8;
-         break;
-      }
-      default:
-      {
-         bpp = 0;
-         break;
-      }
-   }
+   return thePixelsToChop;
+} 
 
-   return bpp;
+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
 {
@@ -280,11 +340,10 @@ bool ossimGeneralRasterInfo::saveState(ossimKeywordlist& kwl,
 
    kwl.add(prefix,
            NUMBER_LINES,
-           ossimString::toString(rawLines()),
-           true);
+           ossimString::toString( rawLines() ), true);
    kwl.add(prefix,
            NUMBER_SAMPLES,
-           ossimString::toString(rawSamples()),
+           ossimString::toString( rawSamples() ),
            true);
    kwl.add(prefix,
            HEADER_SIZE,
@@ -345,289 +404,892 @@ bool ossimGeneralRasterInfo::saveState(ossimKeywordlist& kwl,
 bool ossimGeneralRasterInfo::loadState(const ossimKeywordlist& kwl, const char* prefix)
 {
    static const char MODULE[] = "ossimGeneralRasterInfo::loadState";
-   // Check for errors in the ossimKeywordlist.
-   if(kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " ERROR:\n"
-         << "Detected an error in the keywordlist:  " << kwl
-         << std::endl;
-      return false;
-   }
-
-   if (traceDebug())
+   if ( traceDebug() )
    {
-      CLOG << "DEBUG:"
+      CLOG << "DEBUG: entered..."
            << "\nprefix:  " << (prefix ? prefix : "")
-           << "\nInput keyword list\n"
+           << "\nInput keyword list:\n"
            << kwl
            << std::endl;
-   }
-
-   const char* kwlLookup = 0; // Use for keyword list lookups.
+   }   
 
-   if(!theMetaData.loadState(kwl, prefix))
-     {
-       return false;
-     }
+   bool result = false;
 
-   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.
-   
-   theImageFileList.clear(); // Start with a clean list.
-   
-   if (theInterleaveType != OSSIM_BSQ_MULTI_FILE)
+   //---
+   // Look for required and option keyword.  Break from loop if required
+   // keyword is not found.
+   //---
+   while( 1 )
    {
-      // Look for "filename" first, then deprecated "image_file".      
-      kwlLookup = kwl.find(ossimKeywordNames::FILENAME_KW);
-      if (!kwlLookup)
+      // Check for errors in the ossimKeywordlist.
+      if(kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
       {
-         // deprecated keyword...
-         kwlLookup = kwl.find(ossimKeywordNames::IMAGE_FILE_KW);
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " ERROR:\n"
+            << "Detected an error in the keywordlist:  " << kwl
+            << std::endl;
+         break;
       }
-      
-      if (kwlLookup)
+
+      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() )
       {
-         theImageFileList.push_back(ossimFilename(kwlLookup));
+         lines = value.toInt32();
+         if ( !lines )
+         {
+            if (traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << " ERROR:\n"
+                  << "Required number of lines is 0!" << std::endl;
+            }
+            break;
+         } 
       }
       else
       {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
          if (traceDebug())
          {
             ossimNotify(ossimNotifyLevel_WARN)
-               << "ERROR:\n"
-               << "Required keyword not found:  "
-               << ossimKeywordNames::FILENAME_KW << std::endl;
+               << " ERROR:\n"
+               << "Required keyword not found:  " << key << std::endl;
          }
-         return false;
+         break;
       }
-   }
-   else
-   {
-      // multiple file names.
-      ossim_uint32 count = 0;
 
-      // look for image file key word with no number.
-      // Required to have this.
-      kwlLookup = kwl.find(ossimKeywordNames::FILENAME_KW);
-      if (!kwlLookup)
+      // Samples (required):
+      key = NUMBER_SAMPLES;
+      value.string() = kwl.findKey( key );  // Required to have this.
+      if ( value.size() )
       {
-         // deprecated keyword...
-         kwlLookup = kwl.find(ossimKeywordNames::IMAGE_FILE_KW);
+         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;
       }
       
-      if (kwlLookup)
+      // 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
       {
-         theImageFileList.push_back(ossimFilename(kwlLookup));
-         ++count;
+         theInterleaveType = static_cast<ossimInterleaveType>(tmp);
       }
       
-      ossim_int32 i = 0;
-      while ( (count < numberOfBands()) && (i < 1000) )
+      // 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
       {
-         ossimString kw = ossimKeywordNames::FILENAME_KW;
-         kw += ossimString::toString(i);
-         kwlLookup = kwl.find(kw);
-         if (!kwlLookup)
+         // 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() )
          {
-            // Lookup for deprecated keyword.
-            kw = ossimKeywordNames::IMAGE_FILE_KW;
-            kw += ossimString::toString(i);
-            kwlLookup = kwl.find(kw);
+            // deprecated keyword...
+            key = ossimKeywordNames::IMAGE_FILE_KW;
+            value.string() = kwl.findKey( key );
          }
          
-         if (kwlLookup)
+         if ( value.size() )
          {
-            theImageFileList.push_back(ossimFilename(kwlLookup));
+            theImageFileList.push_back(ossimFilename(value));
             ++count;
          }
-         ++i;
+         
+         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;
+         }
       }
 
-      if (count != numberOfBands())  // Error, count should equal bands!
+      key = VALID_START_LINE;
+      value.string() = kwl.findKey( key ); // Default is zero.
+      if ( value.size() )
       {
-         if (traceDebug())
+         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)
-               << " ERROR:\n"
-               << "Required keyword not found:  "
-               << ossimKeywordNames::FILENAME_KW
-               << "\nInterleave type is multi file; however,"
-               << " not enough were pick up!"  << std::endl;
+               << " WARNING:"
+               << "\nset_fill_to_nulls_mode value out of range."
+               << "\nDefaulted to 2" << std::endl;
          }
-         return false; 
       }
-   }
 
-   kwlLookup = kwl.find(NUMBER_LINES);  // Required to have this.
-   if (kwlLookup)
-   {
-      theRawImageRect.set_lry(atoi(kwlLookup) - 1);
-   }
-   else
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      if (traceDebug())
+      key = PIXELS_TO_CHOP;
+      value.string() = kwl.findKey( key ); // Default is zero.
+      if ( value.size() )
       {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << " ERROR:\n"
-            << "Required keyword not found:  " << NUMBER_LINES << std::endl;
+         thePixelsToChop = value.toInt32();
       }
-      return false;
+      
+      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;
    }
 
-   kwlLookup = kwl.find(NUMBER_SAMPLES);  // Required to have this.
-   if (kwlLookup)
+   bool result = false;
+
+   // Wipe any previous state slick.
+   clear();
+
+   ossimFilename copyFile = imageFile;
+   if ( !imageFile.exists() )
    {
-      theRawImageRect.set_lrx(atoi(kwlLookup) - 1);
+      copyFile = imageFile.expand();
    }
-   else
+
+   // 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() )
    {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      if (traceDebug())
+      hdr = imageFile;
+      hdr.string() += ".hdr"; // image.ras.hdr
+      if ( ! hdr.exists() )
       {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << " ERROR:\n"
-            << "Required keyword not found:  " << NUMBER_SAMPLES << std::endl;
+         hdr = imageFile;
+         hdr.setExtension("xml"); // image.xml
       }
-      return false;
    }
 
-   kwlLookup = kwl.find(VALID_START_LINE); // Default is zero.
-   if (kwlLookup)
+   if ( hdr.exists() )
    {
-      theValidImageRect.set_uly(atoi(kwlLookup));
-   }
+      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 );
+         }
 
-   kwlLookup = kwl.find(VALID_STOP_LINE); // Default is last line.
-   if (kwlLookup)
-   {
-      theValidImageRect.set_lry(atoi(kwlLookup));
+         if ( !result )
+         {
+            // Could be an ossim meta data file:
+            ossimKeywordlist kwl( hdr );
+            result = loadState( kwl, 0 );
+         }
+      }
+      else if ( ext == "xml" )
+      {
+         result = initializeFromXml( imageFile, hdr );
+      }
    }
-   else
+   
+   //---
+   // 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() )
    {
-      theValidImageRect.set_lry(theRawImageRect.lr().y);
+      setImageFile( imageFile );
    }
-
-   if (theValidImageRect.lr().y < theValidImageRect.ul().y)
+   
+   ossimFilename omd = imageFile;
+   omd.setExtension("omd"); // image.omd
+   if ( !omd.exists() )
    {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      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;
-      return false;
+      omd.setExtension("kwl"); // image.kwl
    }
 
-   kwlLookup = kwl.find(VALID_START_SAMPLE); // Default is zero.
-   if (kwlLookup)
+   if ( omd.exists() )
    {
-     theValidImageRect.set_ulx(atoi(kwlLookup));
-   }
+      if ( traceDebug() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << "omd file: " << omd << std::endl;
+      }
 
-   kwlLookup = kwl.find(VALID_STOP_SAMPLE); // Default is last sample.
-   if (kwlLookup) 
-   {
-      theValidImageRect.set_lrx(atoi(kwlLookup));
+      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 );
+      }
    }
-   else
+   
+   if ( traceDebug() )
    {
-      theValidImageRect.set_lrx(theRawImageRect.lr().x); 
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE  << " Exit status: " << (result?"true":"false") << std::endl;
    }
+   
+   return result;
+}
 
-   if (theValidImageRect.lr().x < theValidImageRect.ul().x)
+bool ossimGeneralRasterInfo::initializeFromHdr( const ossimFilename& imageFile,
+                                                const ossimFilename& headerFile )
+{
+   bool result = false;
+
+   ossimKeywordlist kwl;
+   char delimeter = ' ';
+   kwl.change_delimiter(delimeter);
+
+   if ( kwl.addFile(headerFile) )
    {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      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;
-      return false;
+      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.
+      }
    }
 
-   theImageRect.set_lry(theValidImageRect.lr().y -
-                        theValidImageRect.ul().y);
-   theImageRect.set_lrx(theValidImageRect.lr().x -
-                        theValidImageRect.ul().x);
+   return result;
+   
+} // End: ossimGeneralRasterInfo::initializeFromHdr
 
-   kwlLookup = kwl.find(SUB_IMAGE_OFFSET_LINE); // Default is zero.
-   if (kwlLookup)
-      theSubImageOffset.line = atoi(kwlLookup);
 
-   kwlLookup = kwl.find(SUB_IMAGE_OFFSET_SAMP); // Default is zero.
-   if (kwlLookup)
-      theSubImageOffset.samp = atoi(kwlLookup);
-      
-   kwlLookup = kwl.find(HEADER_SIZE); // Default is zero.
-   if (kwlLookup)
+bool ossimGeneralRasterInfo::initializeFromEnviHdr( const ossimFilename& headerFile )
+{
+   bool result = false;
+   ossimEnviHeader hdr;
+   if( hdr.open( headerFile ) )
    {
-      theHeaderSize = atoi(kwlLookup);
+      result = initializeFromEnviHdr( hdr );
    }
+   return result;
+}
+
+bool ossimGeneralRasterInfo::initializeFromEnviHdr( const ossimEnviHeader& enviHdr )
+{
+   bool result = false;
 
-   kwlLookup = kwl.find(SET_NULLS); // Default is 2.
-   if (kwlLookup)
+   while( 1 ) 
    {
-      int tmp;
-      tmp = atoi(kwlLookup);
-      if ((tmp < 3) && (tmp > -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 )
       {
-         theSetNullsMode = (ossimFillMode)tmp;
+         theMetaData.setScalarType( enviHdr.getOssimScalarType() );
       }
       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;
+         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;         
 
-   kwlLookup = kwl.find(PIXELS_TO_CHOP); // Default is zero.
-   if (kwlLookup)
-   {
-      thePixelsToChop = atoi(kwlLookup);
+      // 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& )
 
-   if (bytesPerPixel() > 1)
+bool ossimGeneralRasterInfo::initializeFromXml( const ossimFilename& imageFile,
+                                                const ossimFilename& headerFile )
+{
+   bool result = false;
+
+   ossimFgdcXmlDoc file;
+   if (file.open( headerFile ))
    {
-      // get the byte order of the data.
-      kwlLookup = kwl.find(ossimKeywordNames::BYTE_ORDER_KW);
-      if (kwlLookup)
+      while( 1 ) 
       {
-         ossimString s(kwlLookup);
-         if (s.trim() != "")  // Check for empty string.
+         //---
+         // 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.
          {
-            s.downcase();
-            if (s.contains("big"))
+            // lines, samples ( required ):
+            if ( !size.x || !size.y )
             {
-               theImageDataByteOrder = OSSIM_BIG_ENDIAN;
+               break;
             }
-            else if(s.contains("little"))
+         }
+         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"))
             {
-               theImageDataByteOrder = OSSIM_LITTLE_ENDIAN;
+               theMetaData.setScalarType( OSSIM_FLOAT32 );
+            }
+            else
+            {
+               theMetaData.setScalarType( OSSIM_UINT32 );
             }
          }
+
+         result = true;
+         break; // Trailing break to get out.
       }
    }
-   if (traceDebug())
+
+   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() )
    {
-     CLOG << "Exiting....." << std::endl;
+      result = ( fileSize / rectSize.x / rectSize.y / numberOfBands() ) * 8;
    }
-   return true;
+   return result;
 }
+
diff --git a/src/ossim/imaging/ossimGeneralRasterTileSource.cpp b/src/ossim/imaging/ossimGeneralRasterTileSource.cpp
index 9209e1f..d1eb1e7 100644
--- a/src/ossim/imaging/ossimGeneralRasterTileSource.cpp
+++ b/src/ossim/imaging/ossimGeneralRasterTileSource.cpp
@@ -10,23 +10,27 @@
 //
 // Contains class definition for ossimGeneralRasterTileSource.
 //*******************************************************************
-//  $Id: ossimGeneralRasterTileSource.cpp 17815 2010-08-03 13:23:14Z dburken $
+//  $Id: ossimGeneralRasterTileSource.cpp 22366 2013-08-09 12:13:24Z gpotts $
 
 #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/ossimScalarTypeLut.h>
-#include <ossim/base/ossimEndian.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/ossimKeywordNames.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
 #include <ossim/base/ossimTrace.h>
 #include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimStreamFactoryRegistry.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",
@@ -43,54 +47,46 @@ static const ossimInterleaveTypeLut ILUT;
 ossimGeneralRasterTileSource::ossimGeneralRasterTileSource()
    :
       ossimImageHandler(),
-      theTile(NULL),
-      theBuffer(NULL),
-      theBufferInterleave(OSSIM_BIL),
-      theFileStrList(0),
-      theImageData(),
-      theBufferRect(0, 0, 0, 0),
-      theSwapBytesFlag(false),
-      theBufferSizeInPixels(0)
+      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()
 {
-   if (theBuffer)
-   {
-      delete [] theBuffer;
-      theBuffer = NULL;
-   }
-
-   std::vector<ossimRefPtr<ossimIFStream> >::iterator is =
-      theFileStrList.begin();
-
-   while (is != theFileStrList.end())
-   {
-      (*is)->close();
-      ++is;
-   }
-
-   theFileStrList.clear();
+   close();
 }
 
 ossimRefPtr<ossimImageData> ossimGeneralRasterTileSource::getTile(
    const ossimIrect& tile_rect, ossim_uint32 resLevel)
 {
-   if (theTile.valid())
+   if ( m_tile.valid() == false )
+   {
+      allocateTile(); // First time through...
+   }
+   
+   if (m_tile.valid())
    {
       // Image rectangle must be set prior to calling getTile.
-      theTile->setImageRectangle(tile_rect);
+      m_tile->setImageRectangle(tile_rect);
       
-      if ( getTile( theTile.get(), resLevel ) == false )
+      if ( getTile( m_tile.get(), resLevel ) == false )
       {
-         if (theTile->getDataObjectStatus() != OSSIM_NULL)
+         if (m_tile->getDataObjectStatus() != OSSIM_NULL)
          {
-            theTile->makeBlank();
+            m_tile->makeBlank();
          }
       }
    }
    
-   return theTile;
+   return m_tile;
 }
 
 bool ossimGeneralRasterTileSource::getTile(ossimImageData* result,
@@ -145,9 +141,6 @@ bool ossimGeneralRasterTileSource::getTile(ossimImageData* result,
             // Make the tile rectangle zero base.
             result->setImageRectangle(tile_rect);
 
-            // This will reallocate the buffer if needed.
-            checkBuffer(tile_rect);
-
             // Initialize the tile if needed as we're going to stuff it.
             if (result->getDataObjectStatus() == OSSIM_NULL)
             {
@@ -156,10 +149,9 @@ bool ossimGeneralRasterTileSource::getTile(ossimImageData* result,
 
             ossimIrect clip_rect = tile_rect.clipToRect(image_rect);
 
-            if ( ! tile_rect.completely_within(theBufferRect) )
+            if ( ! tile_rect.completely_within(m_bufferRect) )
             {
                // A new buffer must be loaded.
-               
                if ( !tile_rect.completely_within(clip_rect) )
                {
                   //---
@@ -169,15 +161,21 @@ bool ossimGeneralRasterTileSource::getTile(ossimImageData* result,
                   //---
                   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..."
-                     << endl;
+                     << std::endl;
                   //---
                   // Error in filling buffer.
                   //---
@@ -186,10 +184,10 @@ bool ossimGeneralRasterTileSource::getTile(ossimImageData* result,
                }
             }
             
-            result->loadTile(theBuffer,
-                             theBufferRect,
+            result->loadTile(m_buffer,
+                             m_bufferRect,
                              clip_rect,
-                             theBufferInterleave);
+                             m_bufferInterleave);
             result->validate();
 
             // Set the rectangle back.
@@ -205,144 +203,150 @@ bool ossimGeneralRasterTileSource::getTile(ossimImageData* result,
    return status;
 }
 
-//*******************************************************************
-// Private Method:
-//*******************************************************************
-     bool ossimGeneralRasterTileSource::fillBuffer(const ossimIpt& origin,
-                                                   const ossimIpt& size)
+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 (theImageData.interleaveType())
+   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(theImageData.interleaveType())
-            << endl;
+            << ILUT.getEntryString(m_rasterInfo.interleaveType())
+            << std::endl;
+      }
    }
    
-   if (status && theSwapBytesFlag)
+   if (status && m_swapBytesFlag)
    {
       ossimEndian oe;
-      oe.swap(theImageData.getScalarType(),
-              theBuffer,
-              theBufferSizeInPixels);
+      oe.swap(m_rasterInfo.getImageMetaData().getScalarType(),
+              m_buffer,
+              m_bufferSizeInPixels);
    }
 
    return status;
 }
 
-//*******************************************************************
-// Private Method:
-//*******************************************************************
-bool ossimGeneralRasterTileSource::fillBIP(const ossimIpt& origin,
-                                           const ossimIpt& size )
+bool ossimGeneralRasterTileSource::fillBIP(const ossimIpt& origin, const ossimIpt& size )
 {
-   static const char MODULE[] = "ossimGeneralRasterTileSource::fillBIP";
+   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;
    
-   //***
-   // This will fill a buffer the full width of valid samples * getHeight().
-   //***
-   theBufferRect.set_ul(origin);
+   // Seek position.
+   std::streamoff rasterOffset = m_rasterInfo.offsetToFirstValidSample() +
+        origin.y * m_rasterInfo.bytesPerRawLine() +
+        origin.x * INPUT_BYTES_PER_SAMPLE;
 
-   theBufferRect.set_lry(min( (origin.y + size.y -1),
-                              theImageData.imageRect().lr().y));
-   theBufferRect.set_lrx(min( (origin.x + size.x -1),
-                              theImageData.imageRect().lr().x));
-   
-   ossim_sint64 currentLine = origin.y;
-   
-   //***
-   // Seek position.  The seek position must take into account:
-   // 1).  Any header offset "theOffsetInBytes".
-   // 2).  Any line offset "theLineOffset."
-   // 3).  Number of bands.
-   //
-   // NOTE:  seekPos is in bytes so theBytesPerPixel must be taken into
-   //        account also.
-   //***
-   std::streampos offset = theImageData.offsetToFirstValidSample() +
-        currentLine * theImageData.bytesPerRawLine() +
-        static_cast<ossim_uint64>(origin.x) * theImageData.bytesPerPixel() *
-        static_cast<ossim_uint64>(theImageData.numberOfBands());
+    // 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
-   if (traceDebug())
-   {
+#if 0 /* Please keep for debug. (drb) */
       ossimNotify(ossimNotifyLevel_DEBUG)
          << "\nDEBUG:"
          << "\norigin:                 " << origin
-         << "\nSeek position:          " << offset
-         << "\nStarting line number:   " << currentLine << endl;
-   }
+         << "\nSeek position:          " << rasterOffset
+         << "\ninputLineBufferWidth:   " << inputLineBufferWidth
+         << "\noutputLineBufferWidth:  " << outputLineBufferWidth
+         << "\nINPUT_BANDS:            " << INPUT_BANDS
+         << "\nOUTPUT_BANDS:           " << OUTPUT_BANDS
+         << std::endl;
 #endif
    
-   //***
-   // Loop through and process lines. 
-   //***
-   ossim_uint64 linesProcessed = 0;
-   
-   size_t buffer_width = theBufferRect.width() * theImageData.numberOfBands() *
-                         theImageData.bytesPerPixel();
-   
-   ossim_uint8* buf = theBuffer;
-
-   ossim_uint64 height = size.y;
+   ossim_int32 bufferOffset = 0;   
    
-   while ((currentLine <= static_cast<ossim_sint64>(theImageData.imageRect().lr().y)) &&
-          linesProcessed < height)
+   // Line loop:
+   ossim_int32 currentLine = 0;
+   while ( currentLine < HEIGHT )
    {
-      //***
       // Seek to line.
-      //***
-      theFileStrList[0]->seekg(offset, ios::beg);
-      if (!(*theFileStrList[0]))
+      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..." << endl;
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " ERROR:\n"
+            << " Seek error!  Returning with error..." << std::endl;
          return false;
       }
 
-      //***
-      // Read the line of image data.   
-      //***
-      theFileStrList[0]->read((char*)buf, (std::streamsize)buffer_width);
-      if ((long)theFileStrList[0]->gcount() !=  (long)buffer_width) 
+      // 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." << endl;
+         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;
-      ++linesProcessed;
-      buf += buffer_width;
-      offset += theImageData.bytesPerRawLine();
+      bufferOffset += outputLineBufferWidth;
+      rasterOffset += m_rasterInfo.bytesPerRawLine();
    }
    
    return true;
-}
    
-//*******************************************************************
-// Private Method:
-//*******************************************************************
+} // End: bool ossimGeneralRasterTileSource::fillBipBandSelect(...
+
 bool ossimGeneralRasterTileSource::fillBIL(const ossimIpt& origin,
                                            const ossimIpt& size)
 {
@@ -351,80 +355,83 @@ bool ossimGeneralRasterTileSource::fillBIL(const ossimIpt& origin,
    //***
    // This will fill a buffer the full width of valid samples * tileHeight().
    //***
-   theBufferRect.set_ul(origin);
-   theBufferRect.set_lry(min((origin.y + size.y - 1),
-                             theImageData.imageRect().lr().y));
-   theBufferRect.set_lrx(min((origin.x + size.x - 1),
-                             theImageData.imageRect().lr().x));
+   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::streampos offset = (static_cast<ossim_uint64>(theImageData.offsetToFirstValidSample()) +
-                            currentLine * static_cast<ossim_uint64>(theImageData.bytesPerRawLine()) *
-                            theImageData.numberOfBands() +
-                            origin.x * theImageData.bytesPerPixel());
+   std::streamoff offset = ( m_rasterInfo.offsetToFirstValidSample() +
+                             currentLine * LINE_OFFSET +
+                             origin.x * m_rasterInfo.bytesPerPixel() );
 
-   //***
+   //---
    // Loop through and process lines. 
-   //***
-   ossim_uint64 linesProcessed = 0;
-   
-   size_t buffer_width = theBufferRect.width() * theImageData.bytesPerPixel();
-   
-   ossim_uint8* buf = theBuffer;
-
-#if 0
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "\nDEBUG:"
-         << "\norigin:                 " << origin
-         << "\nSeek position:          " << offset
-         << "\nStarting line number:   " << currentLine
-         << "\nbuffer_width:           " << buffer_width << endl;
-   }
+   //---
+   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
 
-   ossim_uint64 height    = size.y;
-   ossim_sint64 num_bands = theImageData.numberOfBands();
-   
-   while ((currentLine <= static_cast<ossim_sint64>(theImageData.imageRect().lr().y)) &&
-          linesProcessed < height)
+   // Line loop:
+   while ((currentLine <= static_cast<ossim_sint64>(m_rasterInfo.imageRect().lr().y)) &&
+          linesProcessed < size.y)
    {
-      for (ossim_int32 band = 0; band < num_bands; ++band)
+      // 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.
-         //***
-         theFileStrList[0]->seekg(offset, ios::beg);
-         if (!theFileStrList[0])
+         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..." << endl;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR:\n"
+               << " Seek error!  Returning with error..." << std::endl;
             return false;
          }
          
-         //***
          // Read the line of image data.   
-         //***
-         theFileStrList[0]->read((char*)buf, (std::streamsize)buffer_width);
-         if ((long)theFileStrList[0]->gcount() !=  (long)buffer_width) 
+         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 << endl;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << "\nERROR:  Reading image line."
+               << "\ncurrentLine:  " << currentLine << std::endl;
             return false;
          }
-
+         
          buf += buffer_width;
-         offset += theImageData.bytesPerRawLine();
+         ++i;
 
       } // End of band loop.
       
       ++linesProcessed;
       ++currentLine;
-   }
+      offset += LINE_OFFSET;
+      
+   } // End: line loop
    
    return true;
 }
@@ -437,92 +444,82 @@ bool ossimGeneralRasterTileSource::fillBSQ(const ossimIpt& origin,
 {
    static const char MODULE[] = "ossimGeneralRasterTileSource::fillBSQ";
 
-   //***
    // This will fill a buffer the full width of valid samples * tileHeight().
-   //***
-   theBufferRect.set_ul(origin);
+
+   m_bufferRect.set_ul(origin);
    
-   theBufferRect.set_lry(min((origin.y + size.y -1),
-                             theImageData.imageRect().lr().y));
-   theBufferRect.set_lrx(min((origin.x + size.x - 1),
-                             theImageData.imageRect().lr().x));
+   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::streampos startSeekPosition
-      = theImageData.offsetToFirstValidSample() +
-        static_cast<ossim_sint64>(origin.y) *
-        theImageData.bytesPerRawLine() +
-        static_cast<ossim_sint64>(origin.x) *
-        theImageData.bytesPerPixel();
+   std::streamoff startSeekPosition
+      = m_rasterInfo.offsetToFirstValidSample() +
+        origin.y * m_rasterInfo.bytesPerRawLine() +
+        origin.x * m_rasterInfo.bytesPerPixel();
 
-   //***
-   // Loop through and process lines. 
-   //***
-   size_t buffer_width = theBufferRect.width() * theImageData.bytesPerPixel();
+   std::streamsize buffer_width = m_bufferRect.width() * m_rasterInfo.bytesPerPixel();
    
-   ossim_uint8* buf = (ossim_uint8*)theBuffer;
-
-#if 0
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "\nDEBUG:"
-         << "\norigin:                 " << origin
-         << "\nSeek position:          " << startSeekPosition
-         << "\nStarting line number:   " << origin.y
-         << "\nbuffer_width:           " << buffer_width
-         << "\nbytesPerRawLine():      "
-         << theImageData.bytesPerRawLine()
-         << "\ntheImageData.offsetToFirstValidSample():  "
-         << theImageData.offsetToFirstValidSample() << endl;
-   }
+   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
 
-   std::streampos bandOffset
-      = theImageData.bytesPerRawLine() * theImageData.rawLines();
-
-   ossim_int32 num_bands = theImageData.numberOfBands();
+   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::streampos offset = startSeekPosition + (band * bandOffset);
-      
-      while (currentLine <= theImageData.imageRect().lr().y &&
+      std::streamoff offset = startSeekPosition + (band * bandOffset);
+
+      // Line loop:
+      while (currentLine <= m_rasterInfo.imageRect().lr().y &&
              linesProcessed < height)
       {
-         //***
          // Seek to line.
-         //***
-         theFileStrList[0]->seekg(offset, ios::beg);
-         if (!theFileStrList[0])
+         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..." << endl;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR:\n"
+               << " Seek error!  Returning with error..." << std::endl;
             return false;
          }
          
-         //***
          // Read the line of image data.   
-         //***
-         theFileStrList[0]->read((char*)buf, (std::streamsize)buffer_width);
-         if ((long)theFileStrList[0]->gcount() !=  (long)buffer_width) 
+         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 << endl;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << "\nERROR:  Reading image line."
+               << "\ncurrentLine:  " << currentLine << std::endl;
             return false;
          }
 
          // Increment everybody accordingly.
          buf += buffer_width;
-         offset += theImageData.bytesPerRawLine();
+         offset += m_rasterInfo.bytesPerRawLine();
          ++linesProcessed;
          ++currentLine;
 
@@ -536,39 +533,34 @@ bool ossimGeneralRasterTileSource::fillBSQ(const ossimIpt& origin,
 //*******************************************************************
 // Private Method:
 //*******************************************************************
-bool ossimGeneralRasterTileSource::fillBsqMultiFile(const ossimIpt& origin,
-                                                    const ossimIpt& size)
+bool ossimGeneralRasterTileSource::fillBsqMultiFile(const ossimIpt& origin, const ossimIpt& size)
 {
-   static const char MODULE[]
-      = "ossimGeneralRasterTileSource::fillBsqMultiFile";
+   static const char MODULE[] = "ossimGeneralRasterTileSource::fillBsqMultiFile";
 
-   if (traceDebug()) CLOG << " Entered..." << endl;
-   
+   if (traceDebug()) CLOG << " Entered..." << std::endl;
    
-   //***
+
    // This will fill a buffer the full width of valid samples * tileHeight().
-   //***
-   theBufferRect.set_ul(origin);
+   m_bufferRect.set_ul(origin);
    
-   theBufferRect.set_lry(min((origin.y + size.y -1),
-                             theImageData.imageRect().lr().y));
-   theBufferRect.set_lrx(min((origin.x + size.x - 1),
-                             theImageData.imageRect().lr().x));
+   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::streampos startSeekPosition
-      = theImageData.offsetToFirstValidSample() +
-      origin.y * theImageData.bytesPerRawLine() +
-      origin.x * theImageData.bytesPerPixel();
-
-   //***
+   //---
+   std::streamoff startSeekPosition = m_rasterInfo.offsetToFirstValidSample() +
+      origin.y * m_rasterInfo.bytesPerRawLine() +
+      origin.x * m_rasterInfo.bytesPerPixel();
+   
+   //---
    // Loop through and process lines. 
-   //***
-   size_t buffer_width = theBufferRect.width() * theImageData.bytesPerPixel();
+   //---
+   std::streamsize buffer_width = m_bufferRect.width() * m_rasterInfo.bytesPerPixel();
    
-   ossim_uint8* buf = (ossim_uint8*)theBuffer;
+   ossim_uint8* buf = (ossim_uint8*)m_buffer;
 
 #if 0
    if (traceDebug())
@@ -579,60 +571,63 @@ bool ossimGeneralRasterTileSource::fillBsqMultiFile(const ossimIpt& origin,
          << "\nSeek position:          " << startSeekPosition
          << "\nStarting line number:   " << origin.y
          << "\nbuffer_width:           " << buffer_width
-         << "\nbuffer_rect:            " << theBufferRect
+         << "\nbuffer_rect:            " << m_bufferRect
          << "\nbytesPerRawLine():      "
-         << theImageData.bytesPerRawLine()
-         << "\ntheImageData.offsetToFirstValidSample():  "
-         << theImageData.offsetToFirstValidSample() << endl;
+         << m_rasterInfo.bytesPerRawLine()
+         << "\nm_rasterInfo.offsetToFirstValidSample():  "
+         << m_rasterInfo.offsetToFirstValidSample() << std::endl;
    }
 #endif
 
-   ossim_int32 num_bands = theImageData.numberOfBands();
-   ossim_int32 height    = size.y;
-   
-   for (ossim_int32 band = 0; band < num_bands; ++band)
+   // 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;
+      ossim_int64 offset         = startSeekPosition;
       
-      while (currentLine <= theImageData.imageRect().lr().y &&
-             linesProcessed < height)
+      while (currentLine <= m_rasterInfo.imageRect().lr().y && linesProcessed < size.y)
       {
-         //***
+         //---
          // Seek to line.
-         //***
-         theFileStrList[band]->seekg(offset, ios::beg);
-         if (!theFileStrList[band])
+         //---
+         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..." << endl;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR:\n"
+               << " Seek error!  Returning with error..." << std::endl;
             return false;
          }
          
-         //***
+         //---
          // Read the line of image data.   
-         //***
-         theFileStrList[band]->read((char*)buf, (std::streamsize)buffer_width);
-         if ((long)theFileStrList[band]->gcount() !=  (long)buffer_width) 
+         //---
+         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 << endl;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << "\nERROR:  Reading image line."
+               << "\ncurrentLine:  " << currentLine << std::endl;
             return false;
          }
 
          // Increment everybody accordingly.
          buf += buffer_width;
-         offset += theImageData.bytesPerRawLine();
+         offset += m_rasterInfo.bytesPerRawLine();
          ++linesProcessed;
          ++currentLine;
-
+         
       } // End of line loop.
 
-   } // End of band loop.
+      ++bandIter; // Next band...
+
+   } // End: while ( bandIter ! = m_outputBandList.end() )
    
    return true;
 }
@@ -641,11 +636,29 @@ bool ossimGeneralRasterTileSource::fillBsqMultiFile(const ossimIpt& origin,
 // Public method:
 //*******************************************************************
 bool ossimGeneralRasterTileSource::saveState(ossimKeywordlist& kwl,
-                                        const char* prefix) const
-{
-   theImageData.saveState(kwl, prefix);
+                                             const char* prefix) const
+{   
+   // Our stuff:
+   m_rasterInfo.saveState(kwl, prefix);
+
+   // Base class:
+   bool result = ossimImageHandler::saveState(kwl, prefix);
    
-   return 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;
 }
 
 //*******************************************************************
@@ -654,15 +667,23 @@ bool ossimGeneralRasterTileSource::saveState(ossimKeywordlist& kwl,
 bool ossimGeneralRasterTileSource::loadState(const ossimKeywordlist& kwl,
                                              const char* prefix)
 {
-   if (ossimImageHandler::loadState(kwl, prefix))
-   {
-      if (open())
+   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() )
       {
-         return true;
+         ossim::toSimpleVector( m_outputBandList, value );
       }
+      result = open();
    }
-
-   return false;
+   return result;
 }
 
 //*******************************************************************
@@ -670,8 +691,7 @@ bool ossimGeneralRasterTileSource::loadState(const ossimKeywordlist& kwl,
 //*******************************************************************
 ossimScalarType ossimGeneralRasterTileSource::getOutputScalarType() const
 {
-   return ( theTile.valid() ? theTile->getScalarType()
-            : OSSIM_SCALAR_UNKNOWN );
+   return m_rasterInfo.getImageMetaData().getScalarType();
 }
 
 //*******************************************************************
@@ -679,7 +699,18 @@ ossimScalarType ossimGeneralRasterTileSource::getOutputScalarType() const
 //*******************************************************************
 ossim_uint32 ossimGeneralRasterTileSource::getTileWidth() const
 {
-   return ( theTile.valid() ? theTile->getWidth() : 0 );
+   ossim_uint32 result = 0;
+   if ( m_tile.valid() )
+   {
+      m_tile->getWidth();
+   }
+   else
+   {
+      ossimIpt tileSize;
+      ossim::defaultTileSize(tileSize);
+      result = tileSize.x;
+   }
+   return result;
 }
 
 //*******************************************************************
@@ -687,7 +718,18 @@ ossim_uint32 ossimGeneralRasterTileSource::getTileWidth() const
 //*******************************************************************
 ossim_uint32 ossimGeneralRasterTileSource::getTileHeight() const
 {
-   return ( theTile.valid() ? theTile->getHeight() : 0 );
+   ossim_uint32 result = 0;
+   if ( m_tile.valid() )
+   {
+      m_tile->getHeight();
+   }
+   else
+   {
+      ossimIpt tileSize;
+      ossim::defaultTileSize(tileSize);
+      result = tileSize.y;
+   }
+   return result;
 }
 
 //*******************************************************************
@@ -712,7 +754,7 @@ ossimGeneralRasterTileSource::isValidRLevel(ossim_uint32 reduced_res_level) cons
          << MODULE
          << " Invalid reduced_res_level:  " << reduced_res_level
          << "\nHighest available:  " << (getNumberOfDecimationLevels() - 1)
-         << endl;
+         << std::endl;
       return false;
    }
 }
@@ -727,7 +769,7 @@ ossimGeneralRasterTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) c
 {
    if (reduced_res_level == 0)
    {
-      return theImageData.validLines();
+      return m_rasterInfo.validLines();
    }
    else if (theOverview.valid())
    {
@@ -740,12 +782,12 @@ ossimGeneralRasterTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) c
 //*******************************************************************
 // Public method:
 //*******************************************************************
-ossim_uint32 ossimGeneralRasterTileSource::
-getNumberOfSamples(ossim_uint32 reduced_res_level) const
+ossim_uint32 ossimGeneralRasterTileSource::getNumberOfSamples(
+   ossim_uint32 reduced_res_level) const
 {
    if (reduced_res_level == 0)
    {
-      return theImageData.validSamples();
+      return m_rasterInfo.validSamples();
    }
    else if (theOverview.valid())
    {
@@ -757,124 +799,87 @@ getNumberOfSamples(ossim_uint32 reduced_res_level) const
 
 double ossimGeneralRasterTileSource::getNullPixelValue(ossim_uint32 band) const
 {
-   return theImageData.getNullPixelValue(band);
+   return m_rasterInfo.getImageMetaData().getNullPix(band);
 }
 
 double ossimGeneralRasterTileSource::getMinPixelValue(ossim_uint32 band)const
 {
-   return theImageData.getMinPixelValue(band);
+   return m_rasterInfo.getImageMetaData().getMinPix(band);
 }
 
 double ossimGeneralRasterTileSource::getMaxPixelValue(ossim_uint32 band)const
 {
-   return theImageData.getMaxPixelValue(band);
+   return m_rasterInfo.getImageMetaData().getMaxPix(band);
 }
 
 bool ossimGeneralRasterTileSource::open()
 {
-  if(isOpen())
-  {
-     close();
-  }
-  static const char MODULE[] = "ossimGeneralRasterTileSource::open";
-  
-  if (traceDebug()) CLOG << " Entered..." << endl;
-  
-  //
-  // 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 three types of extensions: ".omd", ".hdr" and ".kwl"
-  // 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.
-  //
-  
-  ossimFilename hdr = theImageFile;
-  
-  hdr.setExtension("omd");   
-  
-  // See if it's readable.
-  if ( ! hdr.isReadable() )
-  {
-     hdr.setExtension("hdr");   
-     
-     // See if this one's readable.
-     if ( ! hdr.isReadable() )
-     {
-        // Ok try .kwl extension.
-        hdr.setExtension("kwl");   
-        if ( ! hdr.isReadable() )
-        {
-           // No header file so get out.
-           return false;
-        }
-     }
-  }
+   static const char MODULE[] = "ossimGeneralRasterTileSource::open";
 
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE
-         << "\nHeader file:  " << hdr.c_str() << endl;
-   }
+   if (traceDebug()) CLOG << " Entered..." << std::endl;
    
-   // Give the header file to the keyword list object.
-   ossimKeywordlist kwl(hdr);
-
-   // Check for errors.
-   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   bool result = false;
+   
+   if(isOpen())
    {
-      if (traceDebug())
-      {
-          ossimNotify(ossimNotifyLevel_WARN)
-             << MODULE
-             << " Keywordlist open error detected." << endl;
-      }
-      
-      return false;
+      close();
    }
    
+   //---
+   // Find the header file:
    //
-   // If the file name passed to us was the header it's assumed the image_file
-   // keyword is present else assume it's the image file and add if to the
-   // keyword list.  This will overwrite the "image_file" in the header if
-   // it's in there.
-   //
-   if (theImageFile != hdr)
+   // 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 ) )
    {
-      kwl.add(ossimKeywordNames::FILENAME_KW,
-              theImageFile.c_str(),
-              true);
+      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 );
+         }
+      }
    }
 
-   ossimGeneralRasterInfo generalRasterInfo;
-   
-   bool status = generalRasterInfo.loadState(kwl);
-   theMetaData.loadState(kwl);
-   // Let the load state do the rest...
-   //   bool status = loadState(kwl);
-   if(status)
+   if ( traceDebug() )
    {
-      status = open(generalRasterInfo);
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " Exit status: " << (result?"true":"false") << std::endl;
    }
-   
-   if (traceDebug()) CLOG << " Exited..." << endl;
-   
-   return status;
+   return result;
 }
-
-bool ossimGeneralRasterTileSource::open(const ossimGeneralRasterInfo& info)
+                                             
+bool ossimGeneralRasterTileSource::open( const ossimGeneralRasterInfo& info )
 {
-   if(isOpen())
+   if( isOpen() )
    {
       close();
    }
    
-   theImageData = info;
+   m_rasterInfo = info;
    
-   if(initializeHandler())
+   if( initializeHandler() )
    {
-      completeOpen();
+      completeOpen();  
+
+       if ( isBandSelector() && m_outputBandList.size() && ( isIdentityBandList( m_outputBandList ) == false ) )
+       { 
+          // This does range checking and will pass to overview if open.
+          setOutputBandList( m_outputBandList );
+       }
    }
    else
    {
@@ -886,48 +891,20 @@ bool ossimGeneralRasterTileSource::open(const ossimGeneralRasterInfo& info)
 
 bool ossimGeneralRasterTileSource::initializeHandler()
 {
-   //***
-   // This private method assumes that "theImageData" object has been
+   //---
+   // 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.
-   //***
-   if(isOpen())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimGeneralRasterTileSource::initialize() Coding Error!"
-         << "\nFile was not closed prior to initialize call!"
-         << "\nReturning false..."
-         << endl;
-      return false;
-   }
-   
-//   theSubImageOffset = theImageData.subImageOffset();
-
-   ossim_uint32 number_of_bands = theImageData.numberOfBands();
-
-//    std::streampos expectedSizeInBytes;
-
-//    if (theImageData.interleaveType() != OSSIM_BSQ_MULTI_FILE)
-//    {
-//       expectedSizeInBytes = theImageData.validSamples()  *
-//                             theImageData.validLines()    *
-//                             number_of_bands *
-//                             theImageData.bytesPerPixel();
-//    }
-//    else
-//    {
-//       expectedSizeInBytes = theImageData.validSamples()  *
-//                             theImageData.validLines()    *
-//                             theImageData.bytesPerPixel();
-//    }
-   
-   vector<ossimFilename> aList = theImageData.getImageFileList();
+   //---
+   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(aList[i], std::ios::in|std::ios::binary);
+         createNewIFStream(f, std::ios::in|std::ios::binary);
 
       // check the stream...
       if(is.valid())
@@ -938,192 +915,103 @@ bool ossimGeneralRasterTileSource::initializeHandler()
             theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
             ossimNotify(ossimNotifyLevel_WARN)
                << "ossimGeneralRasterTileSource::open" << " ERROR:\n"
-               << "Cannot open:  " << aList[i].c_str() << endl;
+               << "Cannot open:  " << f.c_str() << std::endl;
             is = 0;
             return false;
          }
       }
-#if 0
-      // check the size
-      if ((!is->isCompressed()) &&
-          (aList[i].fileSize() < expectedSizeInBytes))
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimGeneralRasterTileSource::open ERROR:"
-               << "\nFile size not big enough!"
-               << "\nExpected:  " << expectedSizeInBytes
-               << "\nGot:       " << aList[i].fileSize()
-               << "\nFile:      " << aList[i]
-               << "\nReturning with error..." << endl;
-         }
-         return false;
-      }
-#endif
-      theFileStrList.push_back(is); // Add it to the list...
+
+      // Check the file size (removed).
+
+      m_fileStrList.push_back(is); // Add it to the list...
    }
 
    if ((aList.size()==1) && theImageFile.empty())
    {
       theImageFile = aList[0];
    }
-   
-   //***
-   // Determine the pixel type and make the appropriate tiles.
-   //***
-   ossimScalarType scalar = theImageData.getScalarType();
-   
-   if (traceDebug())
+
+   // Set the buffer interleave type.
+   m_bufferInterleave = m_rasterInfo.interleaveType();
+   if (m_bufferInterleave == OSSIM_BSQ_MULTI_FILE)
    {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimGeneralRasterTileSource::open DEBUG:"
-         << "\nScalar type:  "
-         << ossimScalarTypeLut::instance()->
-         getEntryString(theImageData.getScalarType())
-         << endl;
+      m_bufferInterleave = OSSIM_BSQ;
    }
 
-   // Make the tiles for the getTile return.
-                            
-   ossimImageDataFactory* idf = ossimImageDataFactory::instance();
+   if ( m_outputBandList.empty() )
+   {
+      // Set starting output band list to identity.
+      ossimImageSource::getOutputBandList( m_outputBandList );
+   }
 
-   theTile = idf->create(this,
-                         scalar,
-                         number_of_bands);
-   
-   theTile->initialize();
-
-   // These values can be overridden by loadState...
-   for(ossim_uint32 band = 0; band < number_of_bands; ++ band)
-     {
-       theTile->setNullPix(theImageData.getNullPixelValue(band), band);
-       theTile->setMinPix(theImageData.getMinPixelValue(band), band);
-       theTile->setMaxPix(theImageData.getMaxPixelValue(band), band);
-     }
-   theTile->makeBlank();
-   // Store the size of the buffer in pixels for swapping bytes.
-   theBufferSizeInPixels = theTile->getWidth() * theTile->getHeight() *
-                           number_of_bands;
-   
-   // Get the buffer size.  This is bytes, not pixels.
-   ossim_int32 buffer_size = theBufferSizeInPixels * theImageData.bytesPerPixel();
-
-   if(theBuffer)
-   {
-      delete [] theBuffer;
-      theBuffer = 0;
-   }
-   theBuffer = new ossim_uint8[buffer_size];
-
-   // Set the buffer interleave type.
-   theBufferInterleave = theImageData.interleaveType();
-   if (theBufferInterleave == OSSIM_BSQ_MULTI_FILE)
-   {
-      theBufferInterleave = OSSIM_BSQ;
-   }
-
-   // Zero out the buffer rect.
-   theBufferRect = ossimIrect(0, 0, 0, 0);
-   
-//    // Check for an overview if not already initialized.
-//    if (!theOverview)
-//    {
-//       openOverview();
-//    }
-
-//    // Check for valid image vertices file if not already initialized.
-//    if (theValidImageVertices.size() == 0)
-//    {
-//       openValidVertices();
-//    }
-
-   //***
+   //---
    // Get the byte order of the image data and host machine.  If different,
    // set the swap bytes flag...
-   //***
-   if (theImageData.getImageDataByteOrder() != ossim::byteOrder())
+   //---
+   if (m_rasterInfo.getImageDataByteOrder() != ossim::byteOrder())
    {
-      theSwapBytesFlag = true;
+      m_swapBytesFlag = true;
    }
 
    if (traceDebug())
    {
       ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimGeneralRasterTileSource::open" << " DEBUG:"
+         << "ossimGeneralRasterTileSource::initializeHandler()" << " DEBUG:"
+         << "\nScalar type:  "
+         << ossimScalarTypeLut::instance()->
+         getEntryString(m_rasterInfo.getImageMetaData().getScalarType())
          << "\nByte swapping is "
-         << (theSwapBytesFlag?"enabled.":"not enabled.")
-         << "\ntheBufferSizeInPixels:  " << theBufferSizeInPixels
-         << "\nbuffer size:  " << buffer_size
-         << "\nImageData:\n";
-      theImageData.print(ossimNotify(ossimNotifyLevel_DEBUG));
+         << (m_swapBytesFlag?"enabled.":"not enabled.")
+         // << "\nm_bufferSizeInPixels:  " << m_bufferSizeInPixels
+         // << "\nbuffer size:  " << buffer_size
+         << "\nRasterInfo:\n";
+      m_rasterInfo.print(ossimNotify(ossimNotifyLevel_DEBUG));
    }
    
    return true;
 }
 
-void ossimGeneralRasterTileSource::checkBuffer(const ossimIrect& rect)
-{
-  if((theBufferRect.width()*theBufferRect.height()) !=
-     (rect.width()*rect.height()))
-    {
-      if(theBuffer)
-	{
-	  delete [] theBuffer;
-	  theBuffer = NULL;
-	}
-    }
-
-  if(!theBuffer)
-    {
-      ossim_uint32 number_of_bands = theImageData.numberOfBands();
-      theBufferSizeInPixels = rect.width()*rect.height()*number_of_bands;
-      
-      // Get the buffer size.  This is bytes, not pixels.
-      ossim_int32 buffer_size = theBufferSizeInPixels * theImageData.bytesPerPixel();
-      
-      theBuffer = new ossim_uint8[buffer_size];
-      theBufferRect = ossimIrect(0,0,0,0);
-    }
-}
-
-
 bool ossimGeneralRasterTileSource::isOpen() const
 {
-   if (theFileStrList.size() > 0)
+   bool result = false;
+   if (m_fileStrList.size() > 0)
    {
-      if(theFileStrList[0].valid())
+      if(m_fileStrList[0].valid())
       {
-         return !(theFileStrList[0]->fail());
+         result = !(m_fileStrList[0]->fail());
       }
-//      return  const_cast<ifstream*>(theFileStrList[0])->is_open();
    }
-
-   return false;
+   return result;
 }
 
 void ossimGeneralRasterTileSource::close()
 {
    ossimImageHandler::close();  // base class
 
-   theTile = NULL;
-   if (theBuffer)
+   m_tile = 0; // Not a leak, ref ptr.
+   
+   if ( m_buffer )
    {
-      delete [] theBuffer;
-      theBuffer = 0;
+      delete [] m_buffer;
+      m_buffer = 0;
+      m_bufferSizeInPixels = 0; // Must zero out for check in getTile method.
    }
 
-   // Delete the list of input streams and clear the list.
-//    vector<istream*>::iterator is = theFileStrList.begin();
-//    while (is != theFileStrList.end())
-//    {
-//       delete *is;
-//       *is = NULL;
-//       ++is;
-//    }
+   if ( m_lineBuffer )
+   {
+      delete [] m_lineBuffer;
+      m_lineBuffer = 0;
+   }
 
-   theFileStrList.clear();
+   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
@@ -1138,7 +1026,7 @@ ossim_uint32 ossimGeneralRasterTileSource::getImageTileHeight() const
 
 ossimString ossimGeneralRasterTileSource::getShortName()const
 {
-   return ossimString("ras");
+   return ossimString("ossim_raster");
 }
 
 ossimString ossimGeneralRasterTileSource::getLongName()const
@@ -1148,11 +1036,565 @@ ossimString ossimGeneralRasterTileSource::getLongName()const
 
 ossim_uint32 ossimGeneralRasterTileSource::getNumberOfInputBands() const
 {
-   return theImageData.numberOfBands();
+   return m_rasterInfo.getImageMetaData().getNumberOfBands();
 }
 
 ossim_uint32 ossimGeneralRasterTileSource::getNumberOfOutputBands() const
 {
-   return getNumberOfInputBands();
+   ossim_uint32 result = 0;
+   if ( isBandSelector() && m_outputBandList.size() )
+   {
+      result = 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 = 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/src/ossim/imaging/ossimGeneralRasterWriter.cpp b/src/ossim/imaging/ossimGeneralRasterWriter.cpp
index a045dc2..964da3f 100644
--- a/src/ossim/imaging/ossimGeneralRasterWriter.cpp
+++ b/src/ossim/imaging/ossimGeneralRasterWriter.cpp
@@ -6,10 +6,7 @@
 // Author:  David Burken
 //
 //*******************************************************************
-//  $Id: ossimGeneralRasterWriter.cpp 16081 2009-12-10 20:56:36Z eshirschorn $
-
-#include <cstdlib>
-#include <fstream>
+//  $Id: ossimGeneralRasterWriter.cpp 21962 2012-11-30 15:44:32Z dburken $
 
 #include <ossim/imaging/ossimGeneralRasterWriter.h>
 #include <ossim/imaging/ossimImageData.h>
@@ -24,6 +21,8 @@
 #include <ossim/base/ossimScalarTypeLut.h>
 #include <ossim/base/ossimEndian.h>
 
+#include <cstdlib>
+#include <fstream>
 
 static ossimTrace traceDebug("ossimGeneralRasterWriter:debug");
 
@@ -36,22 +35,12 @@ static const char DEFAULT_FILE_NAME[] = "output.ras";
 ossimGeneralRasterWriter::ossimGeneralRasterWriter()
    :
       ossimImageFileWriter(),
-      theRlevel(0)
-{
-  setOutputImageType(OSSIM_GENERAL_RASTER_BSQ);
-
-  // Since there is no internal geometry set the flag to write out one.
-  setWriteExternalGeometryFlag(true);
-  theOutputByteOrder = ossimEndian().getSystemEndianType();
-}
-
-ossimGeneralRasterWriter::ossimGeneralRasterWriter(
-   ossimImageSource* inputSource, const ossimFilename& file)
-   :
-      ossimImageFileWriter(file,
-                         inputSource,
-                         NULL),
-      theRlevel(0)
+      theOutputStream(0),
+      theOwnsStreamFlag(false),
+      theRlevel(0),
+      theOutputByteOrder(OSSIM_LITTLE_ENDIAN),
+      theMinPerBand(0),
+      theMaxPerBand(0)
 {
   setOutputImageType(OSSIM_GENERAL_RASTER_BSQ);
 
@@ -70,121 +59,150 @@ ossimGeneralRasterWriter::~ossimGeneralRasterWriter()
 
 bool ossimGeneralRasterWriter::isOpen()const
 {
-   // fstream::is_open not const; hence, the messy code...
-   return const_cast<std::ofstream*>(&theFileStream)->is_open();
+   return ( theOutputStream ? true : false );
 }
 
 bool ossimGeneralRasterWriter::open()
 {
-   if(isOpen())
-   {
-      close();
-   }
-
-   theFileStream.open(theFilename.c_str(), ios::out | ios::binary);
+   bool result = false;
    
-   if(theFileStream.is_open())
+   close();
+
+   // Check for empty filenames.
+   if ( theFilename.size() )
    {
-      return true;
+      std::ofstream* os = new std::ofstream();
+      os->open(theFilename.c_str(), ios::out | ios::binary);
+      
+      if(os->is_open())
+      {
+         theOutputStream = os;
+         theOwnsStreamFlag = true;
+         result = true;
+      }
+      else
+      {
+         delete os;
+         os = 0;
+      }
    }
 
-   return false;
+   return result;
 }
 
 void ossimGeneralRasterWriter::close()
 {
-   if (theFileStream.is_open())
+   if (theOutputStream)      
    {
-      theFileStream.close();
+      theOutputStream->flush();
+      if (theOwnsStreamFlag)
+      {
+         delete theOutputStream;
+         theOwnsStreamFlag = false;
+      }
+      theOutputStream = 0;
    }
-   theFileStream.clear();
 }
 
 bool ossimGeneralRasterWriter::writeFile()
 {
-   static const char MODULE[] = "ossimGeneralRasterWriter::writeFile";
-   
-   if( getErrorStatus() != ossimErrorCodes::OSSIM_OK )
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)
-         << MODULE << " ERROR:"
-         << "\nError status previously set!" << std::endl;
-      return false;
-   }
-   
-   if(!theInputConnection->isMaster())
+   bool result = false;
+
+   if( theInputConnection.valid() && ( getErrorStatus() == ossimErrorCodes::OSSIM_OK ) )
    {
-      theInputConnection->slaveProcessTiles();
-      return true;
+      //---
+      // Make sure we can open the file.  Note only the master process is used for
+      // writing...
+      //---
+      if(theInputConnection->isMaster())
+      {
+         if (!isOpen())
+         {
+            open();
+         }
+      }
+
+      result = writeStream();
+
+      if ( result )
+      {
+         // Do this only on the master process. Note left to right precedence!
+         if (getSequencer() && getSequencer()->isMaster())
+         {
+            //---
+            // Write the header out.  We do this last since we must
+            // compute min max pixel while we are writting the image.
+            // since the header is an external text file this is Ok
+            // to do.
+            //---
+            writeHeader();
+            
+            if (theOutputImageType.contains("envi"))
+            {
+               writeEnviHeader();
+            }
+         }
+      } 
+
+      close();
    }
+
+   return result;
    
-   open();
-   
-   if(theFileStream.fail())
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)
-         << MODULE << " ERROR:"
-         << "\nOutput file not open:  " << theFilename.c_str()
-         << "\nReturning from method." << std::endl;
-      setErrorStatus();
-      return false;
-   }
+} // End: ossimGeneralRasterWriter::writeFile()
 
-   bool result = true;
-   // Write the file with the image data.
-   if ( (theOutputImageType == "general_raster_bip") ||
-        (theOutputImageType == "general_raster_bip_envi") )
-   {
-      result = writeToBip();
-   }
-   else if ( (theOutputImageType == "general_raster_bil") ||
-             (theOutputImageType == "general_raster_bil_envi") )
-   {
-      result = writeToBil();
-   }
-   else if ( (theOutputImageType == "general_raster_bsq") ||
-             (theOutputImageType == "general_raster_bsq_envi") )
-   {
-      result = writeToBsq();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)
-         << MODULE << " ERROR:"
-         << "\nUnsupported output type:  " << theOutputImageType << std::endl;
-      result = false;
-   }
+bool ossimGeneralRasterWriter::writeStream()
+{
+   static const char MODULE[] = "ossimGeneralRasterWriter::writeStream";
+
+   bool result = false;
    
-   if (result)
+   if( theInputConnection.valid() && theOutputStream &&
+       ( getErrorStatus() == ossimErrorCodes::OSSIM_OK ) )
    {
-      // Flush the stream to disk...
-      theFileStream.flush();
-
-      // Do this only on the master process. Note left to right precedence!
-      if (getSequencer() && getSequencer()->isMaster())
+      if ( theInputConnection->isMaster() )
       {
-         //---
-         // Write the header out.  We do this last since we must
-         // compute min max pixel while we are writting the image.
-         // since the header is an external text file this is Ok
-         // to do.
-         //---
-         writeHeader();
-
-         if (theOutputImageType.contains("envi"))
+         // Write the file with the image data.
+         if ( (theOutputImageType == "general_raster_bip") ||
+              (theOutputImageType == "general_raster_bip_envi") )
+         {
+            result = writeToBip();
+         }
+         else if ( (theOutputImageType == "general_raster_bil") ||
+                   (theOutputImageType == "general_raster_bil_envi") )
+         {
+            result = writeToBil();
+         }
+         else if ( (theOutputImageType == "general_raster_bsq") ||
+                   (theOutputImageType == "general_raster_bsq_envi") )
+         {
+            result = writeToBsq();
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_FATAL)
+               << MODULE << " ERROR:"
+               << "\nUnsupported output type:  " << theOutputImageType << std::endl;
+            result = false;
+         }
+
+         if ( result )
          {
-            writeEnviHeader();
+            // Flush the stream to disk...
+            theOutputStream->flush();
          }
       }
+      else // Matching else: if ( theInputConnection->isMaster() )
+      {
+         // Slave process:
+         theInputConnection->slaveProcessTiles();
+         result = true;
+      }
    }
-   
-   if (traceDebug()) CLOG << " Exited..." << std::endl;
 
-   close();
-   
    return result;
-}
-
+   
+} // End: ossimGeneralRasterWriter::writeStream()
 
 bool ossimGeneralRasterWriter::writeToBip()
 {
@@ -294,8 +312,8 @@ bool ossimGeneralRasterWriter::writeToBip()
                            buf,
                            lineBytes/ossim::scalarSizeInBytes(scalarType));
             }
-            theFileStream.write((char*)buf, lineBytes);
-            if (theFileStream.fail())
+            theOutputStream->write((char*)buf, lineBytes);
+            if (theOutputStream->fail())
             {
                ossimNotify(ossimNotifyLevel_FATAL)
                   << MODULE << " ERROR:"
@@ -426,8 +444,8 @@ bool ossimGeneralRasterWriter::writeToBil()
                            buf,
                            bytesInLine/ossim::scalarSizeInBytes(scalarType));
             }
-            theFileStream.write((char*)buf, bytesInLine);
-            if (theFileStream.fail())
+            theOutputStream->write((char*)buf, bytesInLine);
+            if (theOutputStream->fail())
             {
                ossimNotify(ossimNotifyLevel_FATAL)
                   << MODULE << " ERROR:"
@@ -566,8 +584,8 @@ bool ossimGeneralRasterWriter::writeToBsq()
          
          // Put the file pointer in the right spot.
          streampos pos = file_band_offset * band + start_line * bytesInLine;
-         theFileStream.seekp(pos, ios::beg);
-         if (theFileStream.fail())
+         theOutputStream->seekp(pos, ios::beg);
+         if (theOutputStream->fail())
          {
             ossimNotify(ossimNotifyLevel_FATAL) << MODULE << " ERROR:"
                  << "Error returned seeking to image data position!" << std::endl;
@@ -585,9 +603,9 @@ bool ossimGeneralRasterWriter::writeToBsq()
                            bytesInLine/ossim::scalarSizeInBytes(scalarType));
             }
 
-            theFileStream.write((char*)buf, bytesInLine);
+            theOutputStream->write((char*)buf, bytesInLine);
             
-            if (theFileStream.fail())
+            if (theOutputStream->fail())
             {
                ossimNotify(ossimNotifyLevel_FATAL) << MODULE << " ERROR:"
                     << "Error returned writing line!" << std::endl;
@@ -709,19 +727,19 @@ void ossimGeneralRasterWriter::writeHeader() const
                                                      getOutputScalarType());
    
    os << "// *** ossim meta data general raster header file ***\n"
-      << ossimKeywordNames::IMAGE_FILE_KW << ":  "
+      << ossimKeywordNames::FILENAME_KW << ": " 
       << theFilename.file().c_str() << "\n"
-      << ossimKeywordNames::IMAGE_TYPE_KW << ":  "
+      << ossimKeywordNames::IMAGE_TYPE_KW << ": "
       << getOutputImageTypeString() << "\n"
-      << ossimKeywordNames::INTERLEAVE_TYPE_KW << ":  "
+      << ossimKeywordNames::INTERLEAVE_TYPE_KW << ": "
       << interleaveType.c_str() << "\n"
       << ossimKeywordNames::NUMBER_BANDS_KW << ":  "
       << theInputConnection->getNumberOfOutputBands() << "\n"
-      << ossimKeywordNames::NUMBER_LINES_KW << ":  "
+      << ossimKeywordNames::NUMBER_LINES_KW << ": "
       << (theAreaOfInterest.lr().y - theAreaOfInterest.ul().y + 1) << "\n"
-      << ossimKeywordNames::NUMBER_SAMPLES_KW << ":  "
+      << ossimKeywordNames::NUMBER_SAMPLES_KW << ": "
       << (theAreaOfInterest.lr().x - theAreaOfInterest.ul().x + 1) << "\n"
-      << ossimKeywordNames::SCALAR_TYPE_KW << ":  "
+      << ossimKeywordNames::SCALAR_TYPE_KW << ": "
       << scalar.c_str() << "\n"
       << ossimKeywordNames::BYTE_ORDER_KW <<": "
       << ((theOutputByteOrder==OSSIM_BIG_ENDIAN)?"big_endian":"little_endian")
@@ -800,7 +818,8 @@ void ossimGeneralRasterWriter::writeEnviHeader() const
 
 ossimString ossimGeneralRasterWriter::getExtension() const
 {
-   return getInterleaveString();
+   return "ras";
+   //return getInterleaveString();
 }
 
 void ossimGeneralRasterWriter::getImageTypeList(std::vector<ossimString>& imageTypeList)const
@@ -833,3 +852,14 @@ ossimString ossimGeneralRasterWriter::getInterleaveString() const
    }
    return interleaveType;
 }
+
+bool ossimGeneralRasterWriter::setOutputStream(std::ostream& stream)
+{
+   if (theOwnsStreamFlag && theOutputStream)
+   {
+      delete theOutputStream;
+   }
+   theOutputStream = &stream;
+   theOwnsStreamFlag = false;
+   return true;
+}
diff --git a/src/ossim/imaging/ossimGeoAnnotationPolyObject.cpp b/src/ossim/imaging/ossimGeoAnnotationPolyObject.cpp
index d8b92e6..c6128e0 100644
--- a/src/ossim/imaging/ossimGeoAnnotationPolyObject.cpp
+++ b/src/ossim/imaging/ossimGeoAnnotationPolyObject.cpp
@@ -6,7 +6,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimGeoAnnotationPolyObject.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
+// $Id: ossimGeoAnnotationPolyObject.cpp 19734 2011-06-06 23:45:36Z dburken $
 
 #include <sstream>
 
@@ -30,7 +30,8 @@ ossimGeoAnnotationPolyObject::ossimGeoAnnotationPolyObject(bool enableFill,
                                                            ossim_uint8 thickness)
    :ossimGeoAnnotationObject(r, g, b, thickness),
     thePolygon(),
-    theProjectedPolyObject(NULL)
+    theProjectedPolyObject(0),
+    m_PolyType(OSSIM_POLY_EXTERIOR_RING)
 {
    theProjectedPolyObject = new ossimAnnotationPolyObject(enableFill,
                                                           r,
@@ -48,7 +49,8 @@ ossimGeoAnnotationPolyObject::ossimGeoAnnotationPolyObject(
    ossim_uint8 thickness)
    :ossimGeoAnnotationObject(r, g, b, thickness),
     thePolygon(),
-    theProjectedPolyObject(NULL)
+    theProjectedPolyObject(0),
+    m_PolyType(OSSIM_POLY_EXTERIOR_RING)
 {
    
    thePolygon = groundPts;
@@ -71,13 +73,14 @@ ossimGeoAnnotationPolyObject::ossimGeoAnnotationPolyObject(
    const ossimGeoAnnotationPolyObject& rhs)
    :ossimGeoAnnotationObject(rhs),
     thePolygon(rhs.thePolygon),
-    theProjectedPolyObject(rhs.theProjectedPolyObject.valid()?(ossimAnnotationPolyObject*)rhs.theProjectedPolyObject->dup():(ossimAnnotationPolyObject*)NULL)
+    theProjectedPolyObject(rhs.theProjectedPolyObject.valid()?(ossimAnnotationPolyObject*)rhs.theProjectedPolyObject->dup():(ossimAnnotationPolyObject*)0),
+    m_PolyType(rhs.m_PolyType)
 {
 }
 
 ossimGeoAnnotationPolyObject::~ossimGeoAnnotationPolyObject()
 {
-   theProjectedPolyObject = NULL;
+   theProjectedPolyObject = 0;
 }
 
 ossimObject* ossimGeoAnnotationPolyObject::dup()const
@@ -152,7 +155,7 @@ ossimAnnotationObject* ossimGeoAnnotationPolyObject::getNewClippedObject(
       return theProjectedPolyObject->getNewClippedObject(rect);
    }
    
-   return (ossimAnnotationObject*)NULL;
+   return (ossimAnnotationObject*)0;
 }
 
 bool ossimGeoAnnotationPolyObject::intersects(const ossimDrect& rect)const
diff --git a/src/ossim/imaging/ossimGeoAnnotationSource.cpp b/src/ossim/imaging/ossimGeoAnnotationSource.cpp
index 980f23b..33f4b22 100644
--- a/src/ossim/imaging/ossimGeoAnnotationSource.cpp
+++ b/src/ossim/imaging/ossimGeoAnnotationSource.cpp
@@ -6,7 +6,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimGeoAnnotationSource.cpp 18423 2010-11-16 16:05:12Z gpotts $
+// $Id: ossimGeoAnnotationSource.cpp 19900 2011-08-04 14:19:57Z dburken $
 
 #include <ossim/imaging/ossimGeoAnnotationSource.h>
 #include <ossim/imaging/ossimGeoAnnotationObject.h>
@@ -80,6 +80,7 @@ void ossimGeoAnnotationSource::setGeometry(ossimImageGeometry* geom)
 
 bool ossimGeoAnnotationSource::setView(ossimObject* baseObject)
 {
+   bool result = false;
    ossimProjection* proj = PTR_CAST(ossimProjection, baseObject);
    if(proj)
    {
@@ -92,13 +93,17 @@ bool ossimGeoAnnotationSource::setView(ossimObject* baseObject)
          m_geometry = new ossimImageGeometry(0, proj);
       }
       setGeometry(m_geometry.get());
-      return true;
+      result = true;
    }
    else
    {
       m_geometry = dynamic_cast<ossimImageGeometry*>(baseObject);
+      if ( m_geometry.valid() )
+      {
+         result = true;
+      }
    }
-   return false;
+   return result;
 }
 
 ossimObject* ossimGeoAnnotationSource::getView()
diff --git a/src/ossim/imaging/ossimGeoPolyCutter.cpp b/src/ossim/imaging/ossimGeoPolyCutter.cpp
index e416809..c772e80 100644
--- a/src/ossim/imaging/ossimGeoPolyCutter.cpp
+++ b/src/ossim/imaging/ossimGeoPolyCutter.cpp
@@ -5,12 +5,14 @@
 // Author: Garrett Potts (gpotts at imagelinks.com)
 //
 //*************************************************************************
-// $Id: ossimGeoPolyCutter.cpp 18423 2010-11-16 16:05:12Z gpotts $
-#include <algorithm>
+// $Id: ossimGeoPolyCutter.cpp 21631 2012-09-06 18:10:55Z dburken $
+
 #include <ossim/imaging/ossimGeoPolyCutter.h>
-#include <ossim/projection/ossimProjection.h>
 #include <ossim/base/ossimCommon.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/projection/ossimProjection.h>
 #include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <algorithm>
 
 static const char* NUMBER_POLYGONS_KW = "number_polygons";
 
diff --git a/src/ossim/imaging/ossimGeomFileWriter.cpp b/src/ossim/imaging/ossimGeomFileWriter.cpp
index 619600b..f1e2977 100644
--- a/src/ossim/imaging/ossimGeomFileWriter.cpp
+++ b/src/ossim/imaging/ossimGeomFileWriter.cpp
@@ -5,7 +5,7 @@
 // Author:  Kenneth Melero
 //
 //*******************************************************************
-//  $Id: ossimGeomFileWriter.cpp 16293 2010-01-07 16:19:47Z dburken $
+//  $Id: ossimGeomFileWriter.cpp 20506 2012-01-27 17:02:30Z dburken $
 
 #include <ossim/base/ossimDpt.h>
 #include <ossim/base/ossimGpt.h>
@@ -13,6 +13,7 @@
 #include <ossim/base/ossimRefPtr.h>
 #include <ossim/base/ossimTrace.h>
 #include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
 #include <ossim/base/ossimUnitTypeLut.h>
 #include <ossim/imaging/ossimGeomFileWriter.h>
 #include <ossim/imaging/ossimImageGeometry.h>
@@ -44,6 +45,26 @@ bool ossimGeomFileWriter::writeFile()
       ossimRefPtr<ossimImageGeometry> geom = theInputConnection->getImageGeometry();
       if(geom.valid())
       {
+         //---
+         // First check the ossimImageGeometry image size and adjust to area of interest if
+         // necessary.  The ossimImageGeometry::applyScale method sometimes has rounding
+         // issues so fix it here...
+         //---
+         if ( geom->getImageSize().hasNans() ||
+              ( geom->getImageSize() != theAreaOfInterest.size() ) )
+         {
+            if ( traceDebug() )
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimGeomFileWriter::writeFile DEBUG:"
+                  << "\nAdjusting ossimImageGeometry size to reflect the area of interest."
+                  << "\narea of interest size: " << theAreaOfInterest.size()
+                  << "\nossimImageGeometry size: " << geom->getImageSize()
+                  << std::endl;
+            }
+            geom->setImageSize( theAreaOfInterest.size() );
+         }
+               
          // Save the state to keyword list.
          ossimKeywordlist kwl;
          geom->saveState(kwl);
diff --git a/src/ossim/imaging/ossimGridRemapSource.cpp b/src/ossim/imaging/ossimGridRemapSource.cpp
index 5c4dad6..4a032a0 100644
--- a/src/ossim/imaging/ossimGridRemapSource.cpp
+++ b/src/ossim/imaging/ossimGridRemapSource.cpp
@@ -1,8 +1,6 @@
 //*****************************************************************************
 // FILE: ossimGridRemapper.cc
 //
-// Copyright (C) 2001 ImageLinks, Inc.
-//
 // License:  See top level LICENSE.txt file.
 //
 // AUTHOR: Oscar Kramer
@@ -14,7 +12,7 @@
 // LIMITATIONS: None.
 //
 //*****************************************************************************
-//  $Id: ossimGridRemapSource.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
+//  $Id: ossimGridRemapSource.cpp 19682 2011-05-31 14:21:20Z dburken $
 
 #include <ossim/imaging/ossimGridRemapSource.h>
 
@@ -22,14 +20,15 @@ RTTI_DEF1(ossimGridRemapSource,
           "ossimGridRemapSource",
           ossimImageSourceFilter);
 
-#include <stdio.h>
-#include <fstream>
 #include <ossim/imaging/ossimImageData.h>
 #include <ossim/base/ossimDrect.h>
 #include <ossim/base/ossimDpt.h>
 #include <ossim/base/ossimDblGrid.h>
 #include <ossim/base/ossimKeywordlist.h>
 #include <ossim/imaging/ossimGridRemapEngineFactory.h>
+#include <cstdio>
+#include <fstream>
+
 
 //***
 // Define Trace flags for use within this file:
@@ -272,7 +271,7 @@ bool ossimGridRemapSource::saveState(ossimKeywordlist& kwl,
       //***
       // Loop over each remap component to write out the grid:
       //***
-      ofstream os (theGridFilename);
+      ofstream os (theGridFilename.c_str());
       bool successful = true;
       int num_components = theRemapEngine->getNumberOfParams();
       for (int p=0; (p<num_components)&&successful; p++)
diff --git a/src/ossim/imaging/ossimHistogramMatchFilter.cpp b/src/ossim/imaging/ossimHistogramMatchFilter.cpp
index 03ba7ac..440b9ad 100644
--- a/src/ossim/imaging/ossimHistogramMatchFilter.cpp
+++ b/src/ossim/imaging/ossimHistogramMatchFilter.cpp
@@ -1,6 +1,9 @@
 #include <ossim/imaging/ossimHistogramMatchFilter.h>
 #include <ossim/base/ossimFilenameProperty.h>
 #include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimVisitor.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageHandler.h>
 
 RTTI_DEF1(ossimHistogramMatchFilter, "ossimHistogramMatchFilter", ossimImageSourceFilter);
 ossimHistogramMatchFilter::ossimHistogramMatchFilter()
@@ -231,17 +234,24 @@ bool ossimHistogramMatchFilter::saveState(ossimKeywordlist& kwl,
 
 void ossimHistogramMatchFilter::autoLoadInputHistogram()
 {
-   ossimConnectableObject* obj = findObjectOfType("ossimImageHandler",
-                                                  CONNECTABLE_DIRECTION_INPUT);
-   if(obj)
+   ossimTypeNameVisitor visitor(ossimString("ossimImageHandler"),
+                                true,
+                                ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS);
+   accept(visitor);
+   
+   if ( visitor.getObjects().size() )
    {
-      ossimRefPtr<ossimProperty> prop = obj->getProperty("histogram_filename");
-      if(prop.valid())
+      ossimRefPtr<ossimImageHandler> ih = visitor.getObjectAs<ossimImageHandler>( 0 );
+      if ( ih.valid() )
       {
-         ossimFilename inputHisto = ossimFilename(prop->valueToString());
-         if(inputHisto.exists())
+         ossimRefPtr<ossimProperty> prop = ih->getProperty("histogram_filename");
+         if( prop.valid() )
          {
-            setInputHistogram(inputHisto);
+            ossimFilename inputHisto = ossimFilename(prop->valueToString());
+            if( inputHisto.exists() )
+            {
+               setInputHistogram(inputHisto);
+            }
          }
       }
    }
diff --git a/src/ossim/imaging/ossimHistogramRemapper.cpp b/src/ossim/imaging/ossimHistogramRemapper.cpp
index 3d9464a..cc4fe86 100644
--- a/src/ossim/imaging/ossimHistogramRemapper.cpp
+++ b/src/ossim/imaging/ossimHistogramRemapper.cpp
@@ -11,9 +11,8 @@
 // Remaps a tile based on mode and histogram clip points.
 //
 //*************************************************************************
-// $Id: ossimHistogramRemapper.cpp 18914 2011-02-18 20:00:45Z gpotts $
+// $Id: ossimHistogramRemapper.cpp 22187 2013-03-07 20:29:00Z dburken $
 
-#include <cstdlib>
 #include <ossim/imaging/ossimHistogramRemapper.h>
 #include <ossim/base/ossimMultiResLevelHistogram.h>
 #include <ossim/base/ossimMultiBandHistogram.h>
@@ -22,6 +21,9 @@
 #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)
 
@@ -43,7 +45,7 @@ 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 18914 2011-02-18 20:00:45Z gpotts $";
+static const char OSSIM_ID[] = "$Id: ossimHistogramRemapper.cpp 22187 2013-03-07 20:29:00Z dburken $";
 #endif
 
 ossimHistogramRemapper::ossimHistogramRemapper()
@@ -58,7 +60,8 @@ ossimHistogramRemapper::ossimHistogramRemapper()
    theMinOutputValue(),
    theMaxOutputValue(),
    theBandList(),
-   theBypassFlag(true)
+   theBypassFlag(true),
+   theResetBandIndicesFlag(false)
 {
    setNumberOfInputs(2);
    if (traceDebug())
@@ -84,6 +87,8 @@ void ossimHistogramRemapper::initialize()
          << "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...
@@ -93,7 +98,16 @@ void ossimHistogramRemapper::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())
@@ -119,6 +133,10 @@ void ossimHistogramRemapper::initialize()
          }
       }
    }
+   else
+   {
+      initializeMinMaxOutput();
+   }
 
    // Update the band list with the latest.
    theBandList = bandList;
@@ -128,14 +146,16 @@ void ossimHistogramRemapper::initialize()
       ossimNotify(ossimNotifyLevel_DEBUG)
          << "ossimHistogramRemapper::initialize exited..." << endl;
    }
+   verifyEnabled();
+
 }
 
 void ossimHistogramRemapper::reset()
 {
    // We could delete theTable to free up memory???
    setStretchMode(LINEAR_ONE_PIECE, false);
-   setBypassFlag(true);
    initializeClips();
+   verifyEnabled();
 }
 
 void
@@ -176,19 +196,9 @@ ossimRefPtr<ossimImageData> ossimHistogramRemapper::getTile(
 #endif
    ossimRefPtr<ossimImageData> result = 0;
 
-   if (theEnableFlag && theDirtyFlag) // Enabled and dirty.
-   {
-      // Always rebuild table if dirty.
-      buildTable();
-      
-      // Check for internal bypass.
-      verifyEnabled();
-
-      // Always clear the dirty flag.
-      theDirtyFlag = false;
-   }
+   makeClean();
    
-   if (!theBypassFlag) // Not bypassed...
+   if (!theBypassFlag||!theEnableFlag) // Not bypassed...
    {
       // Base handles the rest...
       result = ossimTableRemapper::getTile(tile_rect, resLevel);
@@ -198,6 +208,7 @@ ossimRefPtr<ossimImageData> ossimHistogramRemapper::getTile(
       // Fetch tile from pointer from the input source.
       result = theInputConnection->getTile(tile_rect, resLevel);
    }
+
    return result;
 }
 
@@ -210,8 +221,22 @@ void ossimHistogramRemapper::setLowNormalizedClipPoint(const ossim_float64& clip
    }
 }
 
-void
-ossimHistogramRemapper::setLowNormalizedClipPoint(const ossim_float64& clip,
+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();
@@ -724,10 +749,8 @@ bool ossimHistogramRemapper::loadState(const ossimKeywordlist& kwl,
       CLOG << " Entered..."
            << "\nprefix:  " << prefix << endl;
    }
-
    // Load the base class states...
    bool status = ossimTableRemapper::loadState(kwl, prefix);
-
    if (status)
    {
       const char* lookup = 0;
@@ -745,7 +768,7 @@ bool ossimHistogramRemapper::loadState(const ossimKeywordlist& kwl,
             return false;
          }
       }
-      
+     
       //---
       // Get the band specific keywords.
       // NOTES:
@@ -766,7 +789,11 @@ bool ossimHistogramRemapper::loadState(const ossimKeywordlist& kwl,
          keyword = NORMALIZED_LOW_CLIP_POINT_KW;
          bands = kwl.numberOf(prefix, keyword);
       }
-      
+      //if(!bands&&theHistogram.valid())
+     // {
+     //    bands = theHistogram->getNumberOfBands();
+     // }
+
       if (traceDebug())
       {
          ossimNotify(ossimNotifyLevel_DEBUG)
@@ -774,13 +801,11 @@ bool ossimHistogramRemapper::loadState(const ossimKeywordlist& kwl,
             << "\nBands:  " << bands
             << endl;
       }
-      
       if (bands)
       {
          // Start with fresh clips.
          initializeClips(bands);
-         
-         for (ossim_uint32 band = 0; band < bands; ++band)
+        for (ossim_uint32 band = 0; band < bands; ++band)
          {
             // Get the low clip.
             keyword = NORMALIZED_LOW_CLIP_POINT_KW;
@@ -837,8 +862,8 @@ bool ossimHistogramRemapper::loadState(const ossimKeywordlist& kwl,
                theMaxOutputValue[band] = atof(lookup);
             }      
          }
-      }
-      
+     }
+     
       lookup = kwl.find(prefix, STRETCH_MODE_KW);
       if (lookup)
       {
@@ -873,14 +898,14 @@ bool ossimHistogramRemapper::loadState(const ossimKeywordlist& kwl,
       // Always set the dirty flag.
       theDirtyFlag = true;
    }
-   
+   verifyEnabled();
+
    if (traceDebug())
    {
       CLOG << "ossimHistogramRemapper::loadState DEBUG:"
            << *this
            << "\nExited..." << endl;
    }
-   
    return status;
 }
 
@@ -894,7 +919,6 @@ bool ossimHistogramRemapper::saveState(ossimKeywordlist& kwl,
               theHistogram->getHistogramFile().c_str(),
               true);
    }
-	
    kwl.add(prefix,
            STRETCH_MODE_KW,
            getStretchModeString().c_str(),
@@ -942,6 +966,7 @@ bool ossimHistogramRemapper::saveState(ossimKeywordlist& kwl,
               true);
 		
       // Save the min output value.
+
       keyword = MIN_OUTPUT_VALUE_KW;
       keyword += ".";
       keyword += ossimKeywordNames::BAND_KW;
@@ -956,6 +981,7 @@ bool ossimHistogramRemapper::saveState(ossimKeywordlist& kwl,
       keyword += ".";
       keyword += ossimKeywordNames::BAND_KW;
       keyword += ossimString::toString(band+1);
+
       kwl.add(prefix,
               keyword,
               theMaxOutputValue[band],
@@ -1079,6 +1105,18 @@ void ossimHistogramRemapper::buildLinearTable()
          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:
@@ -1209,11 +1247,11 @@ template <class T> void ossimHistogramRemapper::buildLinearTable(T /* dummy */)
          }
          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 =
@@ -1224,6 +1262,7 @@ template <class T> void ossimHistogramRemapper::buildLinearTable(T /* dummy */)
       
       table[index] = NULL_PIX;
       ++index;
+
       for (ossim_uint32 pix = 1; pix < theTableBinCount; ++pix)
       {
          ossim_float64 p = pix;
@@ -1249,7 +1288,7 @@ template <class T> void ossimHistogramRemapper::buildLinearTable(T /* dummy */)
          ++index;
       }
    } // End of band loop.
-	
+
    // Clear the dirty flag so the table's not rebuilt on the next getTile.
    theDirtyFlag = false;
 }
@@ -1278,7 +1317,11 @@ template <class T> void ossimHistogramRemapper::buildAutoLinearMinMaxTableTempla
          ossim_uint32 n     = h->GetRes();
          ossim_float64 low  = h->GetMinVal();
          ossim_float64 high = h->GetMaxVal();
-         
+
+ // std::cout << "LOW ========= " << low << std::endl;
+  //std::cout << "HIGH ========= " << high << std::endl;
+
+         double percentChange = .006;
          if(n > 0)
          {
             double newCount       = 0.0;
@@ -1297,8 +1340,10 @@ template <class T> void ossimHistogramRemapper::buildAutoLinearMinMaxTableTempla
                percentage = newCount / count;
                nextPercentage =
                   (newCount + counts[idx+1]) / count;
-               if (std::fabs(percentage - 0.006) <
-                   std::fabs(nextPercentage - 0.006))
+//               if (std::fabs(percentage - 0.006) <
+//                   std::fabs(nextPercentage - 0.006))
+                  if (std::fabs(percentage - percentChange) <
+                      std::fabs(nextPercentage - percentChange))
                {
                   low = idx+1;
                   break;
@@ -1312,8 +1357,8 @@ template <class T> void ossimHistogramRemapper::buildAutoLinearMinMaxTableTempla
                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))
                {
                   high=idx-1;
                   break;
@@ -1324,6 +1369,11 @@ template <class T> void ossimHistogramRemapper::buildAutoLinearMinMaxTableTempla
                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);
          }
@@ -1411,7 +1461,7 @@ void ossimHistogramRemapper::initializeClips()
 void ossimHistogramRemapper::initializeClips(ossim_uint32 bands)
 {
    //---
-   // NOTE: This method does not set theDirtyFlag by design.
+   // NOTE: This method deoes not set theDirtyFlag by design.
    //---
    if (bands)
    {
@@ -1430,8 +1480,8 @@ void ossimHistogramRemapper::initializeClips(ossim_uint32 bands)
          // Must have an output scalar type for getMin/Max call.
          if (theOutputScalarType != OSSIM_SCALAR_UNKNOWN)
          {
-            theMinOutputValue[band] = getMinPixelValue(band);
-            theMaxOutputValue[band] = getMaxPixelValue(band);
+            theMinOutputValue[band] = ossim::defaultMin(theOutputScalarType);//getMinPixelValue(band);
+            theMaxOutputValue[band] = ossim::defaultMax(theOutputScalarType);//getMaxPixelValue(band);
          }
          else
          {
@@ -1442,6 +1492,28 @@ void ossimHistogramRemapper::initializeClips(ossim_uint32 bands)
    }
 }
 
+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!
@@ -1544,7 +1616,7 @@ void ossimHistogramRemapper::setupTable()
          bytes_per_pixel = 1;
          theTableType = ossimTableRemapper::NATIVE;
          break;
-			
+         
       case OSSIM_USHORT11:
          values_per_band = 2048; // 2 ^ 11
          bytes_per_pixel = 2;
@@ -1557,6 +1629,13 @@ void ossimHistogramRemapper::setupTable()
          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:
@@ -1653,32 +1732,39 @@ void ossimHistogramRemapper::verifyEnabled()
    // Since this filter can be constructed with no input connection do not
    // output and error, simply return.
    //---	
-   if (theInputConnection)
+      setBypassFlag(true);
+   //if (theInputConnection)
    {
+
+#if 1     
       // Start off bypassed.
-      setBypassFlag(true);
 
       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 = getMinPixelValue(band);
-            const double MAX = getMaxPixelValue(band);
-            
+            //const double MIN = ossimTableRemapper::getMinPixelValue(band);
+            //const double MAX = ossimTableRemapper::getMaxPixelValue(band);
             if ( theNormalizedLowClipPoint[band]  != 0.0   ||
-                 theNormalizedHighClipPoint[band] != 1.0   ||
-                 // theMidPoint != 0.0 || ????
-                 theMinOutputValue[band] != MIN ||
-                 theMaxOutputValue[band] != MAX )
+                 theNormalizedHighClipPoint[band] != 1.0 )
+                // theMinOutputValue[band] != MIN ||
+                 //theMaxOutputValue[band] != MAX )
             {
                // Need to turn filter on.
                setBypassFlag(false);
                break;
             }
          }
+         */
       }
+#endif
    }
    if (traceDebug())
    {
@@ -1688,12 +1774,22 @@ void ossimHistogramRemapper::verifyEnabled()
    }
 }
 
+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));
@@ -1727,6 +1823,7 @@ ossimFilename ossimHistogramRemapper::getHistogramFile() const
 ossim_uint32
 ossimHistogramRemapper::getHistogramBand(ossim_uint32 input_band) const
 {
+   if(theResetBandIndicesFlag) return input_band;
    vector<ossim_uint32> bandList;
    getOutputBandList(bandList);
    
@@ -1785,20 +1882,33 @@ void ossimHistogramRemapper::setBypassFlag(bool flag)
 
 double ossimHistogramRemapper::getMinPixelValue(ossim_uint32 band)const
 {
+   double result = ossimTableRemapper::getMinPixelValue(band);
    if(theEnableFlag&&!theBypassFlag &&(band < theMinOutputValue.size()))
    {
-      return theMinOutputValue[band];
+      result = theMinOutputValue[band];
    }
-   return ossimTableRemapper::getMinPixelValue(band);
+  // if(theOutputScalarType != OSSIM_SCALAR_UNKNOWN)
+  // {
+  //    return ossim::defaultMin(theOutputScalarType);
+  // }
+
+   return result;
 }
 
 double ossimHistogramRemapper::getMaxPixelValue(ossim_uint32 band)const
 {
-   if(!theBypassFlag &&(band < theMaxOutputValue.size()))
+   double result = ossimTableRemapper::getMaxPixelValue(band);
+
+   if(theEnableFlag&&!theBypassFlag &&(band < theMaxOutputValue.size()))
    {
-      return theMaxOutputValue[band];
+      result = theMaxOutputValue[band];
    }
-   return ossimTableRemapper::getMaxPixelValue(band);
+   //if(theOutputScalarType != OSSIM_SCALAR_UNKNOWN)
+  // {
+  //    result = ossim::defaultMax(theOutputScalarType);
+  // }
+
+   return result;
 }
 
 bool ossimHistogramRemapper::canConnectMyInputTo(ossim_int32 inputIndex,
diff --git a/src/ossim/imaging/ossimHistogramWriter.cpp b/src/ossim/imaging/ossimHistogramWriter.cpp
index 12d8143..28e6490 100644
--- a/src/ossim/imaging/ossimHistogramWriter.cpp
+++ b/src/ossim/imaging/ossimHistogramWriter.cpp
@@ -7,7 +7,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimHistogramWriter.cpp 17194 2010-04-23 15:05:19Z dburken $
+// $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>
@@ -249,7 +249,8 @@ void ossimHistogramWriter::writeHistogram()
    
    ossimRefPtr<ossimMultiResLevelHistogram> histo = histoSource->getHistogram();
 
-   if(histo.valid())
+   // Don't write histogram if abort flag was set...
+   if(histo.valid() && !isAborted() )
    {
       ossimKeywordlist kwl;
       histo->saveState(kwl);
@@ -264,7 +265,7 @@ void ossimHistogramWriter::writeHistogram()
             }
          }
       }
-      if(isOpen())
+      if( isOpen() )
       {
          kwl.writeToStream(*theFileStream);
       }
@@ -274,7 +275,7 @@ void ossimHistogramWriter::writeHistogram()
    if(deleteHistoSource)
    {
       delete histoSource;
-      histoSource = NULL;
+      histoSource = 0;
    }
    theHistogramSource = 0;
    
@@ -283,7 +284,10 @@ void ossimHistogramWriter::writeHistogram()
 
 void ossimHistogramWriter::abort()
 {
-   // Call base...
+   //---
+   // Call base abort. This sets the status to PROCESS_STATUS_ABORT_REQUEST so the processor
+   // knows to abort.
+   //---
    ossimProcessInterface::abort();
 
    // Propagate to histo source.
@@ -296,4 +300,10 @@ void ossimHistogramWriter::abort()
          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/ossim/imaging/ossimHsiRemapper.cpp b/src/ossim/imaging/ossimHsiRemapper.cpp
index 8ad39d4..eea773c 100644
--- a/src/ossim/imaging/ossimHsiRemapper.cpp
+++ b/src/ossim/imaging/ossimHsiRemapper.cpp
@@ -12,7 +12,7 @@
 // Remapper to adjust hue, saturation and intensity.
 //
 //*************************************************************************
-// $Id: ossimHsiRemapper.cpp 13764 2008-10-22 19:30:19Z gpotts $
+// $Id: ossimHsiRemapper.cpp 19714 2011-06-03 17:23:45Z gpotts $
 
 #include <cstdlib>
 #include <ossim/imaging/ossimHsiRemapper.h>
@@ -21,6 +21,7 @@
 #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)
 
@@ -144,8 +145,8 @@ ossimHsiRemapper::ossimHsiRemapper()
    // Set the base class "theEnableFlag" to off since no adjustments have been
    // made yet.
    //***
-   disableSource();
-
+   //disableSource();
+   theValidFlag = false;
    // Construction not complete.
 }
 
@@ -173,7 +174,7 @@ ossimRefPtr<ossimImageData> ossimHsiRemapper::getTile(
       tile_rect, resLevel);
 
    // Check for remap bypass or a null tile return from input:
-   if (!theEnableFlag || !inputTile)
+   if (!isSourceEnabled() || !inputTile||!theValidFlag)
    {
       return inputTile;
    }
@@ -461,6 +462,453 @@ void ossimHsiRemapper::initialize()
    }
 }
 
+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)
 {
    
@@ -963,8 +1411,8 @@ void ossimHsiRemapper::resetAll()
    theMagentaIntensityOffset   = 0.0;
 
    theWhiteObjectClip          = 1.0;
-   
-   disableSource();
+   theValidFlag = false;
+   //disableSource();
 }
 
 void ossimHsiRemapper::resetMaster()
@@ -1053,8 +1501,8 @@ void ossimHsiRemapper::resetMagenta()
 void ossimHsiRemapper::verifyEnabled()
 {
    // Start off disabled...
-   disableSource();
-
+   //disableSource();
+   theValidFlag = false;
    if (!theInputConnection)
    {
       //***
@@ -1095,7 +1543,8 @@ void ossimHsiRemapper::verifyEnabled()
         theMasterIntensityHighClip != 1.0 ||
         theWhiteObjectClip != 1.0 )
    {
-      enableSource();
+      theValidFlag = true;
+     // enableSource();
    }
 }
 
@@ -2051,7 +2500,7 @@ double ossimHsiRemapper::calculateMinNormValue()
 
 ossim_uint32 ossimHsiRemapper::getNumberOfOutputBands() const
 {
-   if (theEnableFlag) // Always rgb tile out...
+   if (isSourceEnabled()&&theValidFlag) // Always rgb tile out...
    {
       return 3;
    }
diff --git a/src/ossim/imaging/ossimIgenGenerator.cpp b/src/ossim/imaging/ossimIgenGenerator.cpp
index 712e7b7..61da6b0 100644
--- a/src/ossim/imaging/ossimIgenGenerator.cpp
+++ b/src/ossim/imaging/ossimIgenGenerator.cpp
@@ -8,7 +8,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimIgenGenerator.cpp 15766 2009-10-20 12:37:09Z gpotts $
+// $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>
@@ -464,7 +464,6 @@ void ossimIgenGenerator::generateNoTiledSpecList(bool outputToFileFlag)
       theOutputKwl.getSize())
    {
       ossimKeywordlist kwl;
-      long id = 0;
       if(theOutputGeoPolygon.size())
       {
          ossimRefPtr<ossimObject> obj = createInput();
@@ -478,7 +477,6 @@ void ossimIgenGenerator::generateNoTiledSpecList(bool outputToFileFlag)
             
             chain->add(cutter);
             chain->saveState(kwl, "object1.");
-            id = chain->getId().getId();
          }
          else
          {
diff --git a/src/ossim/imaging/ossimImageCacheBase.cpp b/src/ossim/imaging/ossimImageCacheBase.cpp
new file mode 100644
index 0000000..bb25c55
--- /dev/null
+++ b/src/ossim/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/ossim/imaging/ossimImageCacheTileSource.cpp b/src/ossim/imaging/ossimImageCacheTileSource.cpp
new file mode 100644
index 0000000..0449bef
--- /dev/null
+++ b/src/ossim/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/ossim/imaging/ossimImageChain.cpp b/src/ossim/imaging/ossimImageChain.cpp
index efc5437..83552bb 100644
--- a/src/ossim/imaging/ossimImageChain.cpp
+++ b/src/ossim/imaging/ossimImageChain.cpp
@@ -8,16 +8,13 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimImageChain.cpp 19484 2011-05-03 16:28:27Z gpotts $
-#include <algorithm>
-#include <iostream>
-#include <iterator>
+// $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/imaging/ossimImageData.h>
 #include <ossim/base/ossimObjectFactoryRegistry.h>
 #include <ossim/base/ossimKeywordlist.h>
 #include <ossim/base/ossimTrace.h>
@@ -25,6 +22,11 @@
 #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");
 
@@ -32,31 +34,16 @@ static ossimTrace traceDebug("ossimImageChain");
 RTTI_DEF3(ossimImageChain, "ossimImageChain", ossimImageSource,
           ossimConnectableObjectListener, ossimConnectableContainerInterface);
 
-class ossimImageChainChildListener : public ossimConnectableObjectListener
-{
-public:
-   ossimImageChainChildListener(ossimImageChain* owner)
-      :theChain(owner)
-      {
-      }
-   virtual void processEvent(ossimEvent& event);
-//   virtual void propertyEvent(ossimPropertyEvent& event);
-//   virtual void refreshEvent(ossimRefreshEvent& /* event */);
-   ossimImageChain* theChain;
-};
-
-void ossimImageChainChildListener::processEvent(ossimEvent& event)
+void ossimImageChain::processEvent(ossimEvent& event)
 {
-   if(!theChain) return;
    ossimConnectableObjectListener::processEvent(event);
-   ossimConnectableObject* obj = PTR_CAST(ossimConnectableObject,
-                                          event.getCurrentObject());
+   ossimConnectableObject* obj = PTR_CAST(ossimConnectableObject, event.getCurrentObject());
    
-   if((ossimConnectableObject*)theChain->getFirstSource() == obj)
+   if((ossimConnectableObject*)getFirstSource() == obj)
    {
       if(event.isPropagatingToOutputs())
       {
-         ossimConnectableObject::ConnectableObjectList& outputList = theChain->getOutputList();
+         ossimConnectableObject::ConnectableObjectList& outputList = getOutputList();
          ossim_uint32 idx = 0;
          for(idx = 0; idx < outputList.size();++idx)
          {
@@ -69,43 +56,6 @@ void ossimImageChainChildListener::processEvent(ossimEvent& event)
       }
    }
 }
-#if 0
-void ossimImageChainChildListener::propertyEvent(ossimPropertyEvent& event)
-{
-   ossimConnectableObject* obj = PTR_CAST(ossimConnectableObject,
-                                          event.getObject());
-   
-   
-   // if it originated from within my chain then propagate up to parent
-   // only if I have no outputs
-   //
-   if(obj)
-   {
-      if(!theChain->findObject(PTR_CAST(ossimConnectableObject,event.getObject())))
-      {
-         ossimConnectableObject* interface = theChain->findObject(obj->getId(), false);
-         
-         if(interface)
-         {
-            ossimConnectableObject* parent = PTR_CAST(ossimConnectableObject,
-                                                      theChain->getOwner());
-            if(parent&&
-               !theChain->getNumberOfOutputs())
-            {
-               parent->propagateEventToOutputs(event);
-            }
-         }
-      }
-      else
-      {
-         if(!theChain->thePropagateEventFlag)
-         {
-            theChain->propagateEventToOutputs(event);
-         }
-      }
-   }
-}
-#endif
 
 ossimImageChain::ossimImageChain()
 :ossimImageSource(0,
@@ -120,19 +70,12 @@ ossimImageChain::ossimImageChain()
    ossimConnectableContainerInterface::theBaseObject = this;
    //thePropagateEventFlag = false;
    addListener((ossimConnectableObjectListener*)this);
-   theChildListener = new ossimImageChainChildListener(this);
 }
 
 ossimImageChain::~ossimImageChain()
 {
    removeListener((ossimConnectableObjectListener*)this);
    deleteList();
-
-   if(theChildListener)
-   {
-      delete theChildListener;
-      theChildListener = 0;
-   }
 }
 
 bool ossimImageChain::addFirst(ossimConnectableObject* obj)
@@ -145,11 +88,11 @@ bool ossimImageChain::addFirst(ossimConnectableObject* obj)
 
 bool ossimImageChain::addLast(ossimConnectableObject* obj)
 {
-   if(theImageChainList.size() > 0)
+   if(imageChainList().size() > 0)
    {
-      ossimConnectableObject* lastSource = theImageChainList[ theImageChainList.size() -1].get();
+      ossimConnectableObject* lastSource = imageChainList()[ imageChainList().size() -1].get();
 //      if(dynamic_cast<ossimImageSource*>(obj)&&lastSource)
-         if(lastSource)
+      if(lastSource)
       {
 //         obj->disconnect();
          ossimConnectableObject::ConnectableObjectList tempIn = getInputList();
@@ -161,9 +104,14 @@ bool ossimImageChain::addLast(ossimConnectableObject* obj)
          tempIn = obj->getInputList();
          theInputListIsFixedFlag = obj->getInputListIsFixedFlag();
          setNumberOfInputs(obj->getNumberOfInputs());
-         theImageChainList.push_back(obj);
+         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;
       }
    }
@@ -177,19 +125,27 @@ bool ossimImageChain::addLast(ossimConnectableObject* obj)
 
 ossimImageSource* ossimImageChain::getFirstSource()
 {
-   if(theImageChainList.size()>0)
+   if(imageChainList().size()>0)
    {
-      return dynamic_cast<ossimImageSource*>(theImageChainList[0].get());
+      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(theImageChainList.size()>0)
+   if(imageChainList().size()>0)
    {
-      return dynamic_cast<ossimImageSource*>(theImageChainList[0].get());
+      return dynamic_cast<ossimImageSource*>(imageChainList()[0].get());
    }
 
    return 0;
@@ -197,19 +153,27 @@ ossimObject* ossimImageChain::getFirstObject()
 
 ossimImageSource* ossimImageChain::getLastSource()
 {
-   if(theImageChainList.size()>0)
+   if(imageChainList().size()>0)
    {
-      return dynamic_cast<ossimImageSource*>((*(theImageChainList.end()-1)).get());
+      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(theImageChainList.size()>0)
+   if(imageChainList().size()>0)
    {
-      return dynamic_cast<ossimImageSource*>((*(theImageChainList.end()-1)).get());
+      return dynamic_cast<ossimImageSource*>((*(imageChainList().end()-1)).get());
    }
 
    return 0;
@@ -218,9 +182,9 @@ ossimObject* ossimImageChain::getLastObject()
 ossimConnectableObject* ossimImageChain::findObject(const ossimId& id,
                                                     bool /* recurse */)
 {
-   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  theImageChainList.begin();
+   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  imageChainList().begin();
    
-   while(current != theImageChainList.end())
+   while(current != imageChainList().end())
    {
       if((*current).get())
       {
@@ -233,9 +197,9 @@ ossimConnectableObject* ossimImageChain::findObject(const ossimId& id,
       ++current;
    }
    
-   current =  theImageChainList.begin();
+   current =  imageChainList().begin();
    
-   while(current != theImageChainList.end())
+   while(current != imageChainList().end())
    {
       ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface,
                                                          (*current).get());
@@ -255,9 +219,9 @@ ossimConnectableObject* ossimImageChain::findObject(const ossimId& id,
 ossimConnectableObject* ossimImageChain::findObject(const ossimConnectableObject* obj,
                                                     bool /* recurse */)
 {
-   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  theImageChainList.begin();
+   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  imageChainList().begin();
    
-   while(current != theImageChainList.end())
+   while(current != imageChainList().end())
    {
       if((*current).valid())
       {
@@ -270,9 +234,9 @@ ossimConnectableObject* ossimImageChain::findObject(const ossimConnectableObject
       ++current;
    }
    
-   current =  theImageChainList.begin();
+   current =  imageChainList().begin();
    
-   while(current != theImageChainList.end())
+   while(current != imageChainList().end())
    {
       ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, (*current).get());
       
@@ -291,9 +255,9 @@ ossimConnectableObject* ossimImageChain::findObject(const ossimConnectableObject
 ossimConnectableObject* ossimImageChain::findFirstObjectOfType(const RTTItypeid& typeInfo,
                                                                bool recurse)
 {
-   vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  theImageChainList.begin();
+   vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  imageChainList().begin();
    
-   while(current != theImageChainList.end())
+   while(current != imageChainList().end())
    {
       if((*current).valid()&&
          (*current)->canCastTo(typeInfo))
@@ -305,8 +269,8 @@ ossimConnectableObject* ossimImageChain::findFirstObjectOfType(const RTTItypeid&
 
    if(recurse)
    {
-      current =  theImageChainList.begin();
-      while(current != theImageChainList.end())
+      current =  imageChainList().begin();
+      while(current != imageChainList().end())
       {
          ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, 
                                                             (*current).get());
@@ -329,9 +293,9 @@ ossimConnectableObject* ossimImageChain::findFirstObjectOfType(const RTTItypeid&
 ossimConnectableObject* ossimImageChain::findFirstObjectOfType(const ossimString& className,
                                                                bool recurse)
 {
-   vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  theImageChainList.begin();
+   vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  imageChainList().begin();
    
-   while(current != theImageChainList.end())
+   while(current != imageChainList().end())
    {
       if((*current).valid()&&
          (*current)->canCastTo(className) )
@@ -343,8 +307,8 @@ ossimConnectableObject* ossimImageChain::findFirstObjectOfType(const ossimString
 
    if(recurse)
    {
-      current =  theImageChainList.begin();
-      while(current != theImageChainList.end())
+      current =  imageChainList().begin();
+      while(current != imageChainList().end())
       {
          ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, (*current).get());
          
@@ -367,9 +331,9 @@ ossimConnectableObject::ConnectableObjectList ossimImageChain::findAllObjectsOfT
                                                                            bool recurse)
 {
    ossimConnectableObject::ConnectableObjectList result;
-   ossimConnectableObject::ConnectableObjectList::iterator current =  theImageChainList.begin();
+   ossimConnectableObject::ConnectableObjectList::iterator current =  imageChainList().begin();
    
-   while(current != theImageChainList.end())
+   while(current != imageChainList().end())
    {
       if((*current).valid()&&
          (*current)->canCastTo(typeInfo))
@@ -387,8 +351,8 @@ ossimConnectableObject::ConnectableObjectList ossimImageChain::findAllObjectsOfT
 
    if(recurse)
    {
-      current =  theImageChainList.begin();
-      while(current != theImageChainList.end())
+      current =  imageChainList().begin();
+      while(current != imageChainList().end())
       {
          ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, (*current).get());
          
@@ -417,9 +381,9 @@ ossimConnectableObject::ConnectableObjectList ossimImageChain::findAllObjectsOfT
                                                                            bool recurse)
 {
    ossimConnectableObject::ConnectableObjectList result;
-   ossimConnectableObject::ConnectableObjectList::iterator current =  theImageChainList.begin();
+   ossimConnectableObject::ConnectableObjectList::iterator current =  imageChainList().begin();
    
-   while(current != theImageChainList.end())
+   while(current != imageChainList().end())
    {
       if((*current).valid()&&
          (*current)->canCastTo(className))
@@ -437,8 +401,8 @@ ossimConnectableObject::ConnectableObjectList ossimImageChain::findAllObjectsOfT
 
    if(recurse)
    {
-      current =  theImageChainList.begin();
-      while(current != theImageChainList.end())
+      current =  imageChainList().begin();
+      while(current != imageChainList().end())
       {
          ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, (*current).get());
          
@@ -466,19 +430,19 @@ ossimConnectableObject::ConnectableObjectList ossimImageChain::findAllObjectsOfT
 void ossimImageChain::makeUniqueIds()
 {
    setId(ossimIdManager::instance()->generateId());
-   for(long index = 0; index < (long)theImageChainList.size(); ++index)
+   for(long index = 0; index < (long)imageChainList().size(); ++index)
    {
       ossimConnectableContainerInterface* container = PTR_CAST(ossimConnectableContainerInterface,
-                                                               theImageChainList[index].get());
+                                                               imageChainList()[index].get());
       if(container)
       {
          container->makeUniqueIds();
       }
       else
       {
-         if(theImageChainList[index].valid())
+         if(imageChainList()[index].valid())
          {
-            theImageChainList[index]->setId(ossimIdManager::instance()->generateId());
+            imageChainList()[index]->setId(ossimIdManager::instance()->generateId());
          }
       }
    }
@@ -486,13 +450,13 @@ void ossimImageChain::makeUniqueIds()
 
 ossim_uint32 ossimImageChain::getNumberOfObjects(bool recurse)const
 {
-   ossim_uint32 result = (ossim_uint32)theImageChainList.size();
+   ossim_uint32 result = (ossim_uint32)imageChainList().size();
    
    if(recurse)
    {
-      for(ossim_uint32 i = 0; i < theImageChainList.size(); ++i)
+      for(ossim_uint32 i = 0; i < imageChainList().size(); ++i)
       {
-         ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, theImageChainList[i].get());
+         ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, imageChainList()[i].get());
          if(child)
          {
             result += child->getNumberOfObjects(true);
@@ -519,106 +483,80 @@ bool ossimImageChain::addChild(ossimConnectableObject* object)
 
 bool ossimImageChain::removeChild(ossimConnectableObject* object)
 {
-   vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  theImageChainList.begin();
-   ossim_uint32 i = 0;
-   while(current != theImageChainList.end())
+   bool result = false;
+   vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  std::find(imageChainList().begin(), imageChainList().end(), object);
+   
+   
+   if(current!=imageChainList().end())
    {
-      if((*current).valid())
+      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 
       {
-         if(object == (*current).get())
+         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())
          {
-            // Send an event to any listeners.
-            ossimContainerEvent event((ossimObject*)this,
-                                      (ossimObject*)object,
-                                      OSSIM_EVENT_REMOVE_OBJECT_ID);
-            fireEvent(event);
-            object->changeOwner(NULL);
-
-            // Remove listerners we added.
-            object->removeListener((ossimConnectableObjectListener*)this);
-            if ( i == 0 )
+            if(erasingBeginning) // the one that receives the first getTile
             {
-               object->removeListener((ossimConnectableObjectListener*)theChildListener);
+               (*imageChainList().begin())->addListener(this);
             }
             
-            ossimConnectableObject::ConnectableObjectList input  = object->getInputList();
-            ossimConnectableObject::ConnectableObjectList output = object->getOutputList();
-            
-            // remember the old size before removing
-            ossim_uint32 chainSize = (ossim_uint32)theImageChainList.size();
-
-            // Erase from our list.
-            current = theImageChainList.erase(current);
-
-            // Disconnect input and outputs.
-            object->disconnect();
-
-            if( (i == 0) &&  theImageChainList.size() ) 
+            else if(current==imageChainList().end()) // one that receives the last getTIle
             {
-               //---
-               // Child was first in the chain and there are still objects.
-               // Add input or "Child" listener to the new beginning of chain.
-               //---
-               theImageChainList[0]->addListener(theChildListener);
-            }
-            else if(i == (chainSize-1)) // is it the last
-            {
-               if(chainSize > 1)
-               {
-                  ossimConnectableObject* tempObj = theImageChainList[theImageChainList.size()-1].get();
-                  if(tempObj)
-                  {
-                     tempObj->connectInputList(input);
-                  }
-               }
+               current = imageChainList().begin()+(imageChainList().size()-1);
+               (*current)->connectInputList(input);
+               theInputObjectList = (*current)->getInputList();
+               theInputListIsFixedFlag = (*current)->getInputListIsFixedFlag();
             }
-            else // must be an interior
+            else
             {
-               ossim_uint32 inIndex  = 0;
-               
-               for(inIndex = 0; inIndex < input.size(); ++inIndex)
+               // 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)
                {
-                  if(input[inIndex].valid())
-                  {
-                     input[inIndex]->disconnectAllOutputs();
-                     input[inIndex]->connectOutputList(output);
-                  }
+                  output[outIndex]->connectInputList(input);
                }
             }
-            
-            return true;
-         }
-      }
-      ++current;
-      ++i;
-   }
-   
-   current =  theImageChainList.begin();
-   
-   while(current != theImageChainList.end())
-   {
-      ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, (*current).get());
-      
-      if(child)
-      {
-         bool result = child->removeChild(object);
-         if(result)
-         {
-            return result;
          }
       }
-      ++current;
+
+      // Send an event to any listeners.
+      ossimContainerEvent event((ossimObject*)this,
+                                OSSIM_EVENT_REMOVE_OBJECT_ID);
+      event.setObjectList(object);
+      fireEvent(event);
    }
    
-   return false;
+   return result;
 }
 
 ossimConnectableObject* ossimImageChain::removeChild(const ossimId& id)
 {
-   ossimConnectableObject* obj = findObject(id, true);
-
-   removeChild(obj);
-   
+   ossimIdVisitor visitor( id,
+                           (ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS ) );
+   accept( visitor );
+   ossimConnectableObject* obj = visitor.getObject();
+   if ( obj )
+   {
+      removeChild(obj);
+   }
    return obj;
 }
 
@@ -628,9 +566,9 @@ void ossimImageChain::getChildren(vector<ossimConnectableObject*>& children,
    ossim_uint32 i = 0;
    
    vector<ossimConnectableObject*> temp;
-   for(i = 0; i < theImageChainList.size();++i)
+   for(i = 0; i < imageChainList().size();++i)
    {
-      temp.push_back(theImageChainList[i].get());
+      temp.push_back(imageChainList()[i].get());
    }
 
    for(i = 0; i < temp.size();++i)
@@ -667,20 +605,19 @@ bool ossimImageChain::add(ossimConnectableObject* source)
 //   if(PTR_CAST(ossimImageSource, source))
    {
      source->changeOwner(this);
-     if(theImageChainList.size() > 0)
+     if(imageChainList().size() > 0)
      {
         source->disconnectAllOutputs();
         theOutputListIsFixedFlag = source->getOutputListIsFixedFlag();
-        theImageChainList[0]->removeListener(theChildListener);
-        theImageChainList.insert(theImageChainList.begin(), source);
-        theImageChainList[0]->addListener(theChildListener);
+        imageChainList()[0]->removeListener(this);
+        imageChainList().insert(imageChainList().begin(), source);
+        imageChainList()[0]->addListener(this);
         source->addListener((ossimConnectableObjectListener*)this);
-        theImageChainList[0]->connectMyInputTo(theImageChainList[1].get());
+        imageChainList()[0]->connectMyInputTo(imageChainList()[1].get());
         result = true;
      }
      else
      {
-#if 1
         theInputListIsFixedFlag = false;
         theOutputListIsFixedFlag = false;
         
@@ -688,36 +625,21 @@ bool ossimImageChain::add(ossimConnectableObject* source)
         {
            source->connectInputList(getInputList());
         }
-        else
-        {
-           theInputObjectList = source->getInputList();
-        }
-        theInputListIsFixedFlag = source->getInputListIsFixedFlag();
-        theOutputObjectList      = source->getOutputList();
-        theOutputListIsFixedFlag = source->getOutputListIsFixedFlag();
-        theImageChainList.push_back(source);
-        source->addListener((ossimConnectableObjectListener*)this);
-        theImageChainList[0]->addListener(theChildListener);
-        result = true;
-#endif
-#if 0
         theInputObjectList = source->getInputList();
         theInputListIsFixedFlag = source->getInputListIsFixedFlag();
-        
-        theOutputObjectList      = source->getOutputList();
-        theOutputListIsFixedFlag = source->getOutputListIsFixedFlag();
-   
-        theImageChainList.push_back(source);
+     //   theOutputObjectList     = source->getOutputList();
+     //   theOutputListIsFixedFlag= source->getOutputListIsFixedFlag();
+        imageChainList().push_back(source);
         source->addListener((ossimConnectableObjectListener*)this);
-        theImageChainList[0]->addListener(theChildListener);
+        source->addListener(this);
         result = true;
-#endif
      }
    }
 
    if (result && source)
    {
-      ossimContainerEvent event(this, source, OSSIM_EVENT_ADD_OBJECT_ID);
+      ossimContainerEvent event(this, OSSIM_EVENT_ADD_OBJECT_ID);
+      event.setObjectList(source);
       fireEvent(event);
    }
    
@@ -727,23 +649,16 @@ bool ossimImageChain::add(ossimConnectableObject* source)
 bool ossimImageChain::insertRight(ossimConnectableObject* newObj,
                                   ossimConnectableObject* rightOfThisObj)
 {
-   if(!theImageChainList.size())
+   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(findObject(rightOfThisObj, false))
+   if(iter!=imageChainList().end())
    {
-      std::vector<ossimRefPtr<ossimConnectableObject> >::iterator iter = theImageChainList.begin();
-      while(iter != theImageChainList.end())
-      {
-         if( (*iter) == rightOfThisObj)
-         {
-            break;
-         }
-         ++iter;
-      }
-      if(rightOfThisObj == theImageChainList[0].get())
+      if(iter == imageChainList().begin())
       {
          return add(newObj);
       }
@@ -757,13 +672,11 @@ bool ossimImageChain::insertRight(ossimConnectableObject* newObj,
          newObj->connectOutputList(outputList);
          newObj->changeOwner(this);
          newObj->addListener((ossimConnectableObjectListener*)this);
-         theImageChainList.insert(iter, newObj);
-         if (newObj)
-         {
-            // Send event to any listeners.
-            ossimContainerEvent event(this, newObj, OSSIM_EVENT_ADD_OBJECT_ID);
-            fireEvent(event);
-         }
+         imageChainList().insert(iter, newObj);
+         // Send event to any listeners.
+         ossimContainerEvent event(this, OSSIM_EVENT_ADD_OBJECT_ID);
+         event.setObjectList(newObj);
+         fireEvent(event);
          return true;
       }
    }
@@ -774,6 +687,17 @@ bool ossimImageChain::insertRight(ossimConnectableObject* newObj,
 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)
    {
@@ -781,47 +705,39 @@ bool ossimImageChain::insertRight(ossimConnectableObject* newObj,
    }
 
    return false;
+#endif
 }
 
 bool ossimImageChain::insertLeft(ossimConnectableObject* newObj,
                                  ossimConnectableObject* leftOfThisObj)
 {
-   if(!theImageChainList.size())
+   if(!newObj&&!leftOfThisObj) return false;
+   if(!imageChainList().size())
    {
       return add(newObj);
    }
-   
-   if(findObject(leftOfThisObj, false))
+   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator iter = std::find(imageChainList().begin(), imageChainList().end(), leftOfThisObj);
+   if(iter!=imageChainList().end())
    {
-      std::vector<ossimRefPtr<ossimConnectableObject> >::iterator iter = theImageChainList.begin();
-
-      while(iter != theImageChainList.end())
-      {
-         if( (*iter) == leftOfThisObj)
-         {
-            break;
-         }
-         ++iter;
-      }
-      if(leftOfThisObj==theImageChainList[theImageChainList.size()-1].get())
+      if((iter+1)==imageChainList().end())
       {
          return addLast(newObj);
       }
-      else //if(PTR_CAST(ossimImageSource, newObj))
+      else
       {
          ossimConnectableObject::ConnectableObjectList inputList = leftOfThisObj->getInputList();
-         leftOfThisObj->disconnectAllInputs();
+         
          newObj->connectInputList(inputList);
+         
+         leftOfThisObj->disconnectAllInputs();
          leftOfThisObj->connectMyInputTo(newObj);
          newObj->changeOwner(this);
          newObj->addListener((ossimConnectableObjectListener*)this);
-         theImageChainList.insert(iter+1, newObj);
-         if (newObj)
-         {
-            // Send an event to any listeners.
-            ossimContainerEvent event(this, newObj, OSSIM_EVENT_ADD_OBJECT_ID);
-            fireEvent(event);
-         }
+         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;
       }
    }
@@ -830,15 +746,26 @@ bool ossimImageChain::insertLeft(ossimConnectableObject* newObj,
 }
 
 bool ossimImageChain::insertLeft(ossimConnectableObject* newObj,
-                                  const ossimId& id)
+                                 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,
@@ -847,18 +774,19 @@ bool ossimImageChain::replace(ossimConnectableObject* newObj,
    ossim_int32 idx = indexOf(oldObj);
    if(idx >= 0)
    {
-      ossimConnectableObject::ConnectableObjectList& inputList = getInputList();
+      ossimConnectableObject::ConnectableObjectList& inputList  = oldObj->getInputList();
       ossimConnectableObject::ConnectableObjectList& outputList = oldObj->getOutputList();
       oldObj->removeListener((ossimConnectableObjectListener*)this);
-      oldObj->removeListener(theChildListener);
-      theImageChainList[idx] = newObj;
+      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(theChildListener);
+         newObj->addListener(this);
       }
    }
    
@@ -869,10 +797,10 @@ ossimRefPtr<ossimImageData> ossimImageChain::getTile(
    const ossimIrect& tileRect,
    ossim_uint32 resLevel)
 {
-   if((theImageChainList.size() > 0)&&(isSourceEnabled()))
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
    {
       ossimImageSource* inputSource = PTR_CAST(ossimImageSource,
-                                             theImageChainList[0].get());
+                                             imageChainList()[0].get());
       
       if(inputSource)
       {
@@ -911,10 +839,10 @@ ossimRefPtr<ossimImageData> ossimImageChain::getTile(
 
 ossim_uint32 ossimImageChain::getNumberOfInputBands() const
 {
-   if((theImageChainList.size() > 0)&&(isSourceEnabled()))
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
    {
       ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                      theImageChainList[0].get());
+                                                      imageChainList()[0].get());
       if(interface)
       {
          return interface->getNumberOfOutputBands();
@@ -938,10 +866,10 @@ ossim_uint32 ossimImageChain::getNumberOfInputBands() const
 
 double ossimImageChain::getNullPixelValue(ossim_uint32 band)const
 {
-   if((theImageChainList.size() > 0)&&(isSourceEnabled()))
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
    {
       ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                      theImageChainList[0].get());
+                                                      imageChainList()[0].get());
       if(interface)
       {
          return interface->getNullPixelValue(band);
@@ -965,10 +893,10 @@ double ossimImageChain::getNullPixelValue(ossim_uint32 band)const
 
 double ossimImageChain::getMinPixelValue(ossim_uint32 band)const
 {
-   if((theImageChainList.size() > 0)&&(isSourceEnabled()))
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
    {
       ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                      theImageChainList[0].get());
+                                                      imageChainList()[0].get());
       if(interface)
       {
          return interface->getMinPixelValue(band);
@@ -992,10 +920,10 @@ double ossimImageChain::getMinPixelValue(ossim_uint32 band)const
 
 double ossimImageChain::getMaxPixelValue(ossim_uint32 band)const
 {
-   if((theImageChainList.size() > 0)&&(isSourceEnabled()))
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
    {
       ossimImageSource* inter = PTR_CAST(ossimImageSource,
-                                                  theImageChainList[0].get());
+                                                  imageChainList()[0].get());
       if(inter)
       {
          return inter->getMaxPixelValue(band);
@@ -1019,23 +947,24 @@ double ossimImageChain::getMaxPixelValue(ossim_uint32 band)const
 
 void ossimImageChain::getOutputBandList(std::vector<ossim_uint32>& bandList) const
 {
-   if((theImageChainList.size() > 0)&&(isSourceEnabled()))
+   if( (imageChainList().size() > 0) && isSourceEnabled() )
    {
-      ossimImageSource* inter = PTR_CAST(ossimImageSource,
-                                                  theImageChainList[0].get());
-      if(inter)
+      ossimRefPtr<const ossimImageSource> inter =
+         dynamic_cast<const ossimImageSource*>( imageChainList()[0].get() );
+      if( inter.valid() )
       {
-         return inter->getOutputBandList(bandList);
+         // cout << "cn: " << inter->getClassName() << endl;
+         inter->getOutputBandList(bandList);
       }
    }
 }
    
 ossimScalarType ossimImageChain::getOutputScalarType() const
 {
-   if((theImageChainList.size() > 0)&&(isSourceEnabled()))
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
    {
       ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                      theImageChainList[0].get());
+                                                      imageChainList()[0].get());
       if(interface)
       {
          return interface->getOutputScalarType();
@@ -1059,10 +988,10 @@ ossimScalarType ossimImageChain::getOutputScalarType() const
 
 ossim_uint32 ossimImageChain::getTileWidth()const
 {
-   if((theImageChainList.size() > 0)&&(isSourceEnabled()))
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
    {
          ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                         theImageChainList[0].get());
+                                                         imageChainList()[0].get());
          if(interface)
          {
             return interface->getTileWidth();;
@@ -1086,10 +1015,10 @@ ossim_uint32 ossimImageChain::getTileWidth()const
 
 ossim_uint32 ossimImageChain::getTileHeight()const
 {
-   if((theImageChainList.size() > 0)&&(isSourceEnabled()))
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
    {
          ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                         theImageChainList[0].get());
+                                                         imageChainList()[0].get());
          if(interface)
          {
             return interface->getTileHeight();
@@ -1113,11 +1042,11 @@ ossim_uint32 ossimImageChain::getTileHeight()const
    
 ossimIrect ossimImageChain::getBoundingRect(ossim_uint32 resLevel)const
 {
-   if((theImageChainList.size() > 0)&&(isSourceEnabled()))
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
    {
 
       ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                      theImageChainList[0].get());
+                                                      imageChainList()[0].get());
 
       if(interface)
       {
@@ -1147,10 +1076,10 @@ void ossimImageChain::getValidImageVertices(vector<ossimIpt>& validVertices,
                                             ossimVertexOrdering ordering,
                                             ossim_uint32 resLevel)const
 {
-   if((theImageChainList.size() > 0)&&(isSourceEnabled()))
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
    {
       ossimImageSource* interface =PTR_CAST(ossimImageSource,
-                                                     theImageChainList[0].get());
+                                                     imageChainList()[0].get());
 
       if(interface)
       {
@@ -1177,9 +1106,9 @@ void ossimImageChain::getValidImageVertices(vector<ossimIpt>& validVertices,
 
 ossimRefPtr<ossimImageGeometry> ossimImageChain::getImageGeometry()
 {
-   if((theImageChainList.size() > 0)&&(isSourceEnabled()))
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
    {
-      ossimImageSource* interface = PTR_CAST(ossimImageSource, theImageChainList[0].get());
+      ossimImageSource* interface = PTR_CAST(ossimImageSource, imageChainList()[0].get());
       if( interface )
       {
          return interface->getImageGeometry();
@@ -1202,10 +1131,10 @@ ossimRefPtr<ossimImageGeometry> ossimImageChain::getImageGeometry()
 void ossimImageChain::getDecimationFactor(ossim_uint32 resLevel,
                                           ossimDpt& result) const
 {
-   if((theImageChainList.size() > 0)&&(isSourceEnabled()))
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
    {
       ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                      theImageChainList[0].get());
+                                                      imageChainList()[0].get());
       if(interface)
       {
          interface->getDecimationFactor(resLevel,
@@ -1232,10 +1161,10 @@ void ossimImageChain::getDecimationFactor(ossim_uint32 resLevel,
 
 void ossimImageChain::getDecimationFactors(vector<ossimDpt>& decimations) const
 {
-   if((theImageChainList.size() > 0)&&(isSourceEnabled()))
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
    {
       ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                      theImageChainList[0].get());
+                                                      imageChainList()[0].get());
       if(interface)
       {
          interface->getDecimationFactors(decimations);
@@ -1258,10 +1187,10 @@ void ossimImageChain::getDecimationFactors(vector<ossimDpt>& decimations) const
 
 ossim_uint32 ossimImageChain::getNumberOfDecimationLevels()const
 {
-   if((theImageChainList.size() > 0)&&(isSourceEnabled()))
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
    {
       ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                      theImageChainList[0].get());
+                                                      imageChainList()[0].get());
 
       if(interface)
       {
@@ -1352,14 +1281,14 @@ bool ossimImageChain::addAllSources(map<ossimId, vector<ossimId> >& idMapping,
                // we will try to do a default connection
                //
                
-               if(theImageChainList.size())
+               if(imageChainList().size())
                {
                   if(traceDebug())
                   {
                      CLOG << "connecting " << source->getClassName() << " to "
-                          << theImageChainList[0]->getClassName() << std::endl;
+                          << imageChainList()[0]->getClassName() << std::endl;
                   }
-                  source->connectMyInputTo(0, theImageChainList[0].get());
+                  source->connectMyInputTo(0, imageChainList()[0].get());
                }
             }
             else
@@ -1385,9 +1314,9 @@ bool ossimImageChain::addAllSources(map<ossimId, vector<ossimId> >& idMapping,
       
       ++index;
    }
-   if(theImageChainList.size())
+   if(imageChainList().size())
    {
-     ossimConnectableObject* obj = theImageChainList[(ossim_int32)theImageChainList.size()-1].get();
+     ossimConnectableObject* obj = imageChainList()[(ossim_int32)imageChainList().size()-1].get();
      if(obj)
      {
         setNumberOfInputs(obj->getNumberOfInputs());
@@ -1433,26 +1362,59 @@ void ossimImageChain::findInputConnectionIds(vector<ossimId>& result,
 
 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)
                {
-                  ossimConnectableObject* inputSource = PTR_CAST(ossimConnectableObject, findObject((*iter).second[index]));
-                  currentSource->connectMyInputTo(index, inputSource);
-                  
+#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
+               else // -1 id
                {
                   currentSource->disconnectMyInput((ossim_int32)index);
                }
@@ -1467,6 +1429,7 @@ bool ossimImageChain::connectAllSources(const map<ossimId, vector<ossimId> >& id
       }
    }
 
+   // abort();
    return true;
 }
 
@@ -1481,7 +1444,7 @@ bool ossimImageChain::saveState(ossimKeywordlist& kwl,
    {
       return result;
    }
-   ossim_uint32 upper = (ossim_uint32)theImageChainList.size();
+   ossim_uint32 upper = (ossim_uint32)imageChainList().size();
    ossim_uint32 counter = 1;
 
    if (upper)
@@ -1495,7 +1458,7 @@ bool ossimImageChain::saveState(ossimKeywordlist& kwl,
          newPrefix += (ossimString("object") +
                        ossimString::toString(counter) +
                        ossimString("."));
-         result = theImageChainList[idx]->saveState(kwl, newPrefix.c_str());
+         result = imageChainList()[idx]->saveState(kwl, newPrefix.c_str());
       }
    }
 
@@ -1536,20 +1499,20 @@ void ossimImageChain::initialize()
    static const char* MODULE = "ossimImageChain::initialize()";
    if (traceDebug()) CLOG << " Entered..." << std::endl;
    
-   long upper = (ossim_uint32)theImageChainList.size();
+   long upper = (ossim_uint32)imageChainList().size();
    
    for(long index = upper - 1; index >= 0; --index)
    {
       if(traceDebug())
       {
          CLOG << "initilizing source: "
-              << theImageChainList[index]->getClassName()
+              << imageChainList()[index]->getClassName()
               << std::endl;
       }
-      if(theImageChainList[index].valid())
+      if(imageChainList()[index].valid())
       {
          ossimSource* interface =
-            PTR_CAST(ossimSource, theImageChainList[index].get());
+            PTR_CAST(ossimSource, imageChainList()[index].get());
 
          if(interface)
          {
@@ -1565,14 +1528,14 @@ void ossimImageChain::initialize()
 
 void ossimImageChain::enableSource()
 {
-   ossim_int32 upper = static_cast<ossim_int32>(theImageChainList.size());
+   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, theImageChainList[index].get());
+     ossimSource* source = PTR_CAST(ossimSource, imageChainList()[index].get());
      if(source)
      {
         source->enableSource();
@@ -1584,14 +1547,14 @@ void ossimImageChain::enableSource()
 
 void ossimImageChain::disableSource()
 {
-   long upper = (ossim_uint32)theImageChainList.size();
+   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, theImageChainList[index].get());
+     ossimSource* source = PTR_CAST(ossimSource, imageChainList()[index].get());
      if(source)
      {
         source->disableSource();
@@ -1601,73 +1564,79 @@ void ossimImageChain::disableSource()
    theEnableFlag = false;
 }
 
+void ossimImageChain::prepareForRemoval(ossimConnectableObject* connectableObject)
+{
+   if(connectableObject)
+   {
+      connectableObject->removeListener((ossimConnectableObjectListener*)this);
+      connectableObject->changeOwner(0);
+      connectableObject->disconnect();   
+   }
+}
+
 bool ossimImageChain::deleteFirst()
 {
-   if (theImageChainList.size() == 0) return false;
+   if (imageChainList().size() == 0) return false;
 
+   ossimContainerEvent event(this, OSSIM_EVENT_REMOVE_OBJECT_ID);
+   prepareForRemoval(imageChainList()[0].get());
    // Clear any listeners, memory.
-   ossim_uint32 idx = 0;
-   theImageChainList[idx]->
-      removeListener((ossimConnectableObjectListener*)this);
-   theImageChainList[idx]->removeListener(theChildListener);
-   theImageChainList[idx]->changeOwner(NULL);
-   theImageChainList[idx]->disconnect();   
-   theImageChainList[idx] = 0;
-   
+   event.setObjectList(imageChainList()[0].get());
+   imageChainList()[0] = 0;
    // Remove from the vector.
-   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator i = theImageChainList.begin();
-   theImageChainList.erase(i);
+   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator i = imageChainList().begin();
+   imageChainList().erase(i);
+   fireEvent(event);
    return true;
 }
 
 bool ossimImageChain::deleteLast()
 {
-   if (theImageChainList.size() == 0) return false;
+   if (imageChainList().size() == 0) return false;
 
-   // Clear any listeners, memory.
-   ossim_uint32 idx = (ossim_uint32)theImageChainList.size() - 1;
-   theImageChainList[idx]->
-      removeListener((ossimConnectableObjectListener*)this);
-   theImageChainList[idx]->removeListener(theChildListener);
-   theImageChainList[idx]->changeOwner(NULL);
-   theImageChainList[idx]->disconnect();   
-   theImageChainList[idx] = 0;
+   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.
-   theImageChainList.pop_back();
+   imageChainList().pop_back();
+   fireEvent(event);
    return true; 
 }
 
 void ossimImageChain::deleteList()
 {
-   ossim_uint32 upper = theImageChainList.size();
+   ossim_uint32 upper = (ossim_uint32) imageChainList().size();
    ossim_uint32 idx = 0;
+   ossimContainerEvent event(this, OSSIM_EVENT_REMOVE_OBJECT_ID);
    for(; idx < upper; ++idx)
    {
-      if(theImageChainList[idx].valid())
+      if(imageChainList()[idx].valid())
       {
-         theImageChainList[idx]->removeListener((ossimConnectableObjectListener*)this);
-         if(theChildListener)
-         {
-            theImageChainList[idx]->removeListener(theChildListener);
-         }
-         theImageChainList[idx]->disconnect();
+         event.getObjectList().push_back(imageChainList()[idx].get());
+         prepareForRemoval(imageChainList()[idx].get());
+         imageChainList()[idx] = 0;
       }
    }
-   
-   theImageChainList.clear();
+  
+   imageChainList().clear();
+   fireEvent(event);
 }
 
+
 void ossimImageChain::disconnectInputEvent(ossimConnectionEvent& event)
 {
-   if(theImageChainList.size())
+   if(imageChainList().size())
    {
       if(event.getObject()==this)
       {
-         if(theImageChainList[theImageChainList.size()-1].valid())
+         if(imageChainList()[imageChainList().size()-1].valid())
          {
             for(ossim_uint32 i = 0; i < event.getNumberOfOldObjects(); ++i)
             {
-               theImageChainList[theImageChainList.size()-1]->disconnectMyInput(event.getOldObject(i));
+               imageChainList()[imageChainList().size()-1]->disconnectMyInput(event.getOldObject(i));
             }
          }
       }
@@ -1680,26 +1649,26 @@ void ossimImageChain::disconnectOutputEvent(ossimConnectionEvent& /* event */)
 
 void ossimImageChain::connectInputEvent(ossimConnectionEvent& event)
 {
-   if(theImageChainList.size())
+   if(imageChainList().size())
    {
       if(event.getObject()==this)
       {
-         if(theImageChainList[theImageChainList.size()-1].valid())
+         if(imageChainList()[imageChainList().size()-1].valid())
          {
             for(ossim_uint32 i = 0; i < event.getNumberOfNewObjects(); ++i)
             {
                ossimConnectableObject* obj = event.getNewObject(i);
-               theImageChainList[theImageChainList.size()-1]->connectMyInputTo(findInputIndex(obj),
+               imageChainList()[imageChainList().size()-1]->connectMyInputTo(findInputIndex(obj),
                                                                                obj,
                                                                                false);
             }
          }
       }
-      else if(event.getObject() == theImageChainList[0].get())
+      else if(event.getObject() == imageChainList()[0].get())
       {
          if(!theLoadStateFlag)
          {
-//            theInputObjectList = theImageChainList[0]->getInputList();
+//            theInputObjectList = imageChainList()[0]->getInputList();
          }
       }
       initialize();
@@ -1712,7 +1681,7 @@ void ossimImageChain::connectOutputEvent(ossimConnectionEvent& /* event */)
 
 // void ossimImageChain::propertyEvent(ossimPropertyEvent& event)
 // {
-//    if(theImageChainList.size())
+//    if(imageChainList().size())
 //    {
 //       ossimConnectableObject* obj = PTR_CAST(ossimConnectableObject,
 //                                              event.getObject());
@@ -1738,7 +1707,7 @@ void ossimImageChain::objectDestructingEvent(ossimObjectDestructingEvent& event)
 {
    if(!event.getObject()) return;
 
-   if(theImageChainList.size()&&(event.getObject()!=this))
+   if(imageChainList().size()&&(event.getObject()!=this))
    {
       removeChild(PTR_CAST(ossimConnectableObject,
                            event.getObject()));
@@ -1749,12 +1718,12 @@ void ossimImageChain::propagateEventToOutputs(ossimEvent& event)
    //if(thePropagateEventFlag) return;
 
    //thePropagateEventFlag = true;
-   if(theImageChainList.size())
+   if(imageChainList().size())
    {
-      if(theImageChainList[theImageChainList.size()-1].valid())
+      if(imageChainList()[imageChainList().size()-1].valid())
       {
-         theImageChainList[theImageChainList.size()-1]->fireEvent(event);
-         theImageChainList[theImageChainList.size()-1]->propagateEventToOutputs(event);
+         imageChainList()[imageChainList().size()-1]->fireEvent(event);
+         imageChainList()[imageChainList().size()-1]->propagateEventToOutputs(event);
       }
    }
    //ossimConnectableObject::propagateEventToOutputs(event);
@@ -1765,12 +1734,12 @@ void ossimImageChain::propagateEventToInputs(ossimEvent& event)
 //   if(thePropagateEventFlag) return;
 
 //   thePropagateEventFlag = true;
-   if(theImageChainList.size())
+   if(imageChainList().size())
    {
-      if(theImageChainList[0].valid())
+      if(imageChainList()[0].valid())
       {
-         theImageChainList[0]->fireEvent(event);
-         theImageChainList[0]->propagateEventToInputs(event);
+         imageChainList()[0]->fireEvent(event);
+         imageChainList()[0]->propagateEventToInputs(event);
       }
    }
 //   thePropagateEventFlag = false;
@@ -1784,9 +1753,9 @@ ossimConnectableObject* ossimImageChain::operator[](ossim_uint32 index)
 ossimConnectableObject* ossimImageChain::getConnectableObject(
    ossim_uint32 index)
 {
-   if(theImageChainList.size() && (index < theImageChainList.size()))
+   if(imageChainList().size() && (index < imageChainList().size()))
    {
-      return theImageChainList[index].get();
+      return imageChainList()[index].get();
    }
    
    return 0; 
@@ -1796,9 +1765,9 @@ ossim_int32 ossimImageChain::indexOf(ossimConnectableObject* obj)const
 {
    ossim_uint32 idx = 0;
    
-   for(idx = 0; idx < theImageChainList.size();++idx)
+   for(idx = 0; idx < imageChainList().size();++idx)
    {
-      if(theImageChainList[idx] == obj)
+      if(imageChainList()[idx] == obj)
       {
          return (ossim_int32)idx;
       }
@@ -1809,19 +1778,19 @@ ossim_int32 ossimImageChain::indexOf(ossimConnectableObject* obj)const
 
 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
-      //
+      //---
+      // 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 = theImageChainList.rbegin();
-         while((current != theImageChainList.rend())&&!visitor.stopTraversal())
+         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);
@@ -1829,7 +1798,36 @@ void ossimImageChain::accept(ossimVisitor& visitor)
          }
       }
       visitor.setVisitorType(currentType);
+      ossimConnectableObject::accept(visitor);
    }
-   
-   ossimConnectableObject::accept(visitor);
-}
\ No newline at end of file
+}
+
+//**************************************************************************************************
+// 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/src/ossim/imaging/ossimImageCombiner.cpp b/src/ossim/imaging/ossimImageCombiner.cpp
index 4fd1605..acb8cdc 100644
--- a/src/ossim/imaging/ossimImageCombiner.cpp
+++ b/src/ossim/imaging/ossimImageCombiner.cpp
@@ -5,7 +5,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimImageCombiner.cpp 18590 2010-12-22 14:31:04Z dburken $
+// $Id: ossimImageCombiner.cpp 20382 2011-12-15 14:24:57Z dburken $
 #include <ossim/imaging/ossimImageCombiner.h>
 #include <ossim/base/ossimKeywordlist.h>
 #include <ossim/base/ossimIrect.h>
@@ -278,7 +278,7 @@ void ossimImageCombiner::initialize()
    
    theLargestNumberOfInputBands = 0;
    theComputeFullResBoundsFlag = true;
-   
+
    // now find the largest number of bands
    //
    ossim_uint32 size = getNumberOfInputs();
diff --git a/src/ossim/imaging/ossimImageData.cpp b/src/ossim/imaging/ossimImageData.cpp
index cfc8114..530846c 100644
--- a/src/ossim/imaging/ossimImageData.cpp
+++ b/src/ossim/imaging/ossimImageData.cpp
@@ -7,10 +7,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimImageData.cpp 18078 2010-09-14 14:43:09Z dburken $
-
-#include <iterator>
-#include <ostream>
+// $Id: ossimImageData.cpp 22161 2013-02-25 12:10:04Z gpotts $
 
 #include <ossim/imaging/ossimImageData.h>
 #include <ossim/base/ossimSource.h>
@@ -20,6 +17,10 @@
 #include <ossim/base/ossimHistogram.h>
 #include <ossim/base/ossimScalarTypeLut.h>
 
+#include <iterator>
+#include <ostream>
+
+
 RTTI_DEF1(ossimImageData, "ossimImageData", ossimRectilinearDataObject)
 
 ossimImageData::ossimImageData()
@@ -31,7 +32,8 @@ ossimImageData::ossimImageData()
      m_minPixelValue(0),
      m_maxPixelValue(0),
      m_alpha(0),
-     m_origin(0, 0)
+     m_origin(0, 0),
+     m_indexedFlag(false)
 {
    ossimIpt tileSize;
    ossim::defaultTileSize(tileSize);
@@ -51,7 +53,8 @@ ossimImageData::ossimImageData(ossimSource*    owner,
      m_minPixelValue(0),
      m_maxPixelValue(0),
      m_alpha(0),
-     m_origin(0, 0)
+     m_origin(0, 0),
+     m_indexedFlag(false)
 {
    ossimIpt tileSize;
    ossim::defaultTileSize(tileSize);
@@ -74,7 +77,8 @@ ossimImageData::ossimImageData(ossimSource* owner,
      m_minPixelValue(0),
      m_maxPixelValue(0),
      m_alpha(0),
-     m_origin(0, 0)
+     m_origin(0, 0),
+     m_indexedFlag(false)
 {   
    m_spatialExtents[0] = width;
    m_spatialExtents[1] = height;
@@ -87,7 +91,8 @@ ossimImageData::ossimImageData(const ossimImageData &rhs)
      m_minPixelValue(rhs.m_minPixelValue),
      m_maxPixelValue(rhs.m_maxPixelValue),
      m_alpha(rhs.m_alpha),
-     m_origin(rhs.m_origin)
+     m_origin(rhs.m_origin),
+     m_indexedFlag(rhs.m_indexedFlag)
 {
 }
 
@@ -103,7 +108,8 @@ const ossimImageData& ossimImageData::operator=(const ossimImageData& rhs)
       m_minPixelValue  = rhs.m_minPixelValue;
       m_maxPixelValue  = rhs.m_maxPixelValue;
       m_alpha          = rhs.m_alpha;
-      m_origin         = rhs.m_origin;      
+      m_origin         = rhs.m_origin;
+      m_indexedFlag    = rhs.m_indexedFlag;
    }
    return *this;
 }
@@ -394,171 +400,182 @@ void ossimImageData::getNormalizedFloat(ossim_uint32 offset,
                                         ossim_float32& result)const
 {
    // Make sure that the types and width and height are good.
-   if( (getDataObjectStatus() == OSSIM_NULL) &&
-       (bandNumber < getNumberOfDataComponents()) )
+   if( (getDataObjectStatus() != OSSIM_NULL) && (bandNumber < getNumberOfDataComponents()) )
    {
-      return;
-   }
-   
-   ossim_float32 delta =  m_maxPixelValue[bandNumber] - m_minPixelValue[bandNumber];
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         const unsigned char* sourceBuf = getUcharBuf(bandNumber);
-         result = (sourceBuf[offset] - m_minPixelValue[bandNumber])/delta;
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         const ossim_sint8* sourceBuf = static_cast<const ossim_sint8*>(getBuf(bandNumber));
-         result = (sourceBuf[offset] - m_minPixelValue[bandNumber])/delta;
-         break;
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         const ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
-         result = (sourceBuf[offset] - m_minPixelValue[bandNumber])/delta;
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         const ossim_sint16* sourceBuf = getSshortBuf(bandNumber);
-         result = (sourceBuf[offset] - m_minPixelValue[bandNumber])/delta;
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         const ossim_uint32* sourceBuf =
-            static_cast<const ossim_uint32*>(getBuf(bandNumber));
-         result = (sourceBuf[offset] - m_minPixelValue[bandNumber])/delta;
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         const ossim_sint32* sourceBuf = static_cast<const ossim_sint32*>(getBuf(bandNumber));
-         result = (sourceBuf[offset] - m_minPixelValue[bandNumber])/delta;
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
+      ossim_float32 p = 0.0;
+
+      switch (getScalarType())
       {
-         const ossim_float32* sourceBuf = getFloatBuf(bandNumber);
-         result = (sourceBuf[offset] - m_minPixelValue[bandNumber])/delta;
-         break;
-      }
-      case OSSIM_FLOAT64:
-      case OSSIM_NORMALIZED_DOUBLE:
+         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_float64* sourceBuf = getDoubleBuf(bandNumber);
-         result = (sourceBuf[offset] - m_minPixelValue[bandNumber])/delta;
-         break;
+         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;
       }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
+      else
       {
-         // Shouldn't hit this.
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageData::setNormalizedFloat Unsupported scalar type!"
-            << std::endl;
-         
-         result = 0;
+         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()) )
+   if( (getDataObjectStatus() != OSSIM_NULL) && (bandNumber < getNumberOfDataComponents()) )
    {
-      return;
-   }
-   
-   ossim_float32 delta =  m_maxPixelValue[bandNumber] - m_minPixelValue[bandNumber];
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         unsigned char* sourceBuf = getUcharBuf(bandNumber);
-         sourceBuf[offset] =
-            static_cast<ossim_uint8>(m_minPixelValue[bandNumber] +
-                                     delta*inputValue);
-         
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         ossim_sint8* sourceBuf = static_cast<ossim_sint8*>(getBuf(bandNumber));
-         sourceBuf[offset] =
-            static_cast<ossim_sint8>(m_minPixelValue[bandNumber] +
-                                     delta*inputValue);
-         break;
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
-         sourceBuf[offset] =
-            static_cast<ossim_uint16>(m_minPixelValue[bandNumber] +
-                                      delta*inputValue);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         ossim_sint16* sourceBuf = getSshortBuf(bandNumber);
-         sourceBuf[offset] =
-            static_cast<ossim_sint16>(m_minPixelValue[bandNumber] +
-                                      delta*inputValue);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         ossim_uint32* sourceBuf =
-            static_cast<ossim_uint32*>(getBuf(bandNumber));
-         sourceBuf[offset] =
-            static_cast<ossim_uint32>(m_minPixelValue[bandNumber] +
-                                      delta*inputValue);
-         break;
-      }
-      case OSSIM_SINT32:
+
+      ossim_float32 p = 0.0;
+
+      if ( inputValue )
       {
-         ossim_sint32* sourceBuf = static_cast<ossim_sint32*>(getBuf(bandNumber));
-         sourceBuf[offset] =
-            static_cast<ossim_sint32>(m_minPixelValue[bandNumber] +
-                                      delta*inputValue);
-         break;
+         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];
+         }
       }
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
+      else
       {
-         ossim_float32* sourceBuf = getFloatBuf(bandNumber);
-         sourceBuf[offset] =
-            static_cast<ossim_float32>(m_minPixelValue[bandNumber] +
-                                       delta*inputValue);
-         break;
+         p = m_nullPixelValue[bandNumber];
       }
-      case OSSIM_FLOAT64:
-      case OSSIM_NORMALIZED_DOUBLE:
+   
+      switch (getScalarType())
       {
-         ossim_float64* sourceBuf = getDoubleBuf(bandNumber);
-         sourceBuf[offset] =
-            static_cast<ossim_float64>(m_minPixelValue[bandNumber]
-                                       + delta*inputValue);
-      break;
-   }
-   case OSSIM_SCALAR_UNKNOWN:
-   default:
-      // Shouldn't hit this.
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::setNormalizedFloat Unsupported scalar type!"
-         << std::endl;
-   }
-}
+         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
 {
@@ -806,17 +823,23 @@ void ossimImageData::populateHistogram(ossimRefPtr<ossimMultiBandHistogram> hist
          for(ossim_uint32 band = 0; band < numberOfBands; ++band)
          {
             ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
-            ossim_uint8* buffer = (ossim_uint8*)getBuf(band);
-         
             if(currentHisto.valid())
             {
-               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 )
                {
-                  ossim_uint32 upperBound = getWidth()*getHeight();
                   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]);
                   }
                }
@@ -1280,6 +1303,7 @@ bool ossimImageData::write(const ossimFilename& f) const
          {
             os << "filename: " << f.c_str()
                << "\nimage_type:  general_raster_bsq"
+               << "\nindexed: " << m_indexedFlag               
                << "\ninterleave_type:  bsq"
                << "\norigin: " << m_origin
                << "\nnumber_bands: " << ossimString::toString(getNumberOfBands())
@@ -2385,6 +2409,7 @@ void ossimImageData::setNumberOfBands(ossim_uint32 bands,
       
       ossim_uint32 minBands = ossim::min(b, bands);
 
+
       vector<ossim_float64> newNull(bands);
       vector<ossim_float64> newMin(bands);
       vector<ossim_float64> newMax(bands);
@@ -2397,12 +2422,16 @@ void ossimImageData::setNumberOfBands(ossim_uint32 bands,
          newMax[i]  = m_maxPixelValue[i];
          ++i;
       }
-      while (i < bands)
+
+      if(b)
       {
-         newNull[i] = m_nullPixelValue[b-1];
-         newMin[i]  = m_minPixelValue[b-1];
-         newMax[i]  = m_maxPixelValue[b-1];
-         ++i;
+        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;
@@ -3323,9 +3352,8 @@ File %s line %d\nUnsupported scalar type for method!",
    }
 }
 
-
 void ossimImageData::computeMinMaxPix(vector<ossim_float64>& minBands,
-                                      vector<ossim_float64>& maxBands)
+                                      vector<ossim_float64>& maxBands) const
 {
    if ( (getDataObjectStatus() == OSSIM_NULL) || 
         (getDataObjectStatus() == OSSIM_EMPTY) )
@@ -3410,7 +3438,7 @@ void ossimImageData::computeMinMaxPix(vector<ossim_float64>& minBands,
 template <class T>
 void ossimImageData::computeMinMaxPix(T /* dummyValue */,
                                       vector<ossim_float64>& minBands,
-                                      vector<ossim_float64>& maxBands)
+                                      vector<ossim_float64>& maxBands) const
 {
    const ossim_uint32 BANDS = getNumberOfBands();
    const ossim_uint32 SPB   = getSizePerBand(); 
@@ -3457,6 +3485,164 @@ void ossimImageData::computeMinMaxPix(T /* dummyValue */,
    }
 }
 
+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.
+            //---
+            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,
@@ -3941,6 +4127,59 @@ File %s line %d\nUnsupported scalar type for method!",
    }
 }
 
+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
@@ -4422,6 +4661,135 @@ ossimImageData::unloadTileToBipTemplate(T, // dummy template variable
 }
 
 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,
@@ -6065,6 +6433,7 @@ std::ostream& ossimImageData::print(std::ostream& out) const
    out << "width:            " << getWidth()
        << "\nheight:           " << getHeight()
        << "\nimage rectangle:  " << getImageRectangle()
+       << "\nindexed:          " << m_indexedFlag
        << std::endl;
 
    return ossimRectilinearDataObject::print(out);
@@ -6148,6 +6517,9 @@ template <class T> void ossimImageData::stretchMinMax(T /* dummyTemplate */)
    // 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;
 
@@ -6165,24 +6537,32 @@ template <class T> void ossimImageData::stretchMinMax(T /* dummyTemplate */)
          
          for(ossim_uint32 i = 0; i < SPB; ++i)
          {
-            if (s[i] != T_NUL)
+            ossim_float64 p = s[i];
+            if ( p == T_NUL )
             {
-               ossim_float64 p = s[i];
-               if (p <= T_MIN)
-               {
-                  p = S_MIN;
-               }
-               else if (p >= T_MAX)
-               {
-                  p = S_MAX;
-               }
-               else
-               {
-                  p = (p - T_MIN + 1.0) * SPP + S_MIN - 1.0;
-               }
-               s[i] = ossim::round<T>(p);
+               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;
+         
       }
    } 
 }
@@ -6506,3 +6886,116 @@ void ossimImageData::copyLineTemplate(T /* dummyTemplate */,
    } // 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/src/ossim/imaging/ossimImageDataFactory.cpp b/src/ossim/imaging/ossimImageDataFactory.cpp
index ec4502d..6e235e7 100644
--- a/src/ossim/imaging/ossimImageDataFactory.cpp
+++ b/src/ossim/imaging/ossimImageDataFactory.cpp
@@ -8,7 +8,7 @@
 // Contributor: David A. Horner (DAH) - http://dave.thehorners.com
 // 
 //*************************************************************************
-// $Id: ossimImageDataFactory.cpp 15766 2009-10-20 12:37:09Z gpotts $
+// $Id: ossimImageDataFactory.cpp 22135 2013-02-02 16:27:24Z dburken $
 
 #include <ossim/imaging/ossimImageDataFactory.h>
 #include <ossim/imaging/ossimU8ImageData.h>
@@ -17,6 +17,7 @@
 #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>
@@ -67,15 +68,16 @@ ossimRefPtr<ossimImageData> ossimImageDataFactory::create(
 
    if (traceDebug())
    {
-      cout << "ossimImageDataFactory::create DEBUG:"
-           << "\nCaller:  "
-           << (owner ? owner->getClassName().c_str() : "unknown")
-           << "\nbands:   " << bands
-           << "\nwidth:   " << width
-           << "\nheight:  " << height
-           << "\nScalar type:  "
-           << (ossimScalarTypeLut::instance()->getEntryString(scalar))
-           << endl;
+      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;
@@ -105,6 +107,18 @@ ossimRefPtr<ossimImageData> ossimImageDataFactory::create(
       {
          // 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;
       }
    }
@@ -129,15 +143,16 @@ ossimRefPtr<ossimImageData> ossimImageDataFactory::create(
 
    if (traceDebug())
    {
-      cout << "ossimImageDataFactory::create DEBUG:"
-           << "\nCaller:  "
-           << (owner ? owner->getClassName().c_str() : "unknown")
-           << "\nbands:   " << bands
-           << "\nwidth:   " << width
-           << "\nheight:  " << height
-           << "\nScalar type:  "
-           << (ossimScalarTypeLut::instance()->getEntryString(scalar))
-           << endl;
+      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;
@@ -186,14 +201,16 @@ ossimRefPtr<ossimImageData> ossimImageDataFactory::create(
       ossimScalarType scalar = inputSource->getOutputScalarType();
       ossim_uint32 width  = inputSource->getTileWidth();
       ossim_uint32 height = inputSource->getTileHeight();
-      
+
       result = create(owner, scalar, bands, width, height);
-      
-      for(ossim_uint32 band = 0; band < bands; ++band)
+      if ( result.valid() )
       {
-         result->setMinPix(inputSource->getMinPixelValue(band),   band);
-         result->setMaxPix(inputSource->getMaxPixelValue(band),   band);
-         result->setNullPix(inputSource->getNullPixelValue(band), band);
+         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
@@ -219,14 +236,16 @@ ossimRefPtr<ossimImageData> ossimImageDataFactory::create(
       ossim_uint32 bands  = inputSource->getNumberOfOutputBands();
       ossim_uint32 width  = inputSource->getTileWidth();
       ossim_uint32 height = inputSource->getTileHeight();
-      
+
       result = create(owner, scalar, bands, width, height);
-      
-      for(ossim_uint32 band = 0; band < bands; ++band)
+      if ( result.valid() )
       {
-         result->setMinPix(inputSource->getMinPixelValue(band),   band);
-         result->setMaxPix(inputSource->getMaxPixelValue(band),   band);
-         result->setNullPix(inputSource->getNullPixelValue(band), band);
+         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
diff --git a/src/ossim/imaging/ossimImageDataHelper.cpp b/src/ossim/imaging/ossimImageDataHelper.cpp
index 5d0dcc6..1a15f4c 100644
--- a/src/ossim/imaging/ossimImageDataHelper.cpp
+++ b/src/ossim/imaging/ossimImageDataHelper.cpp
@@ -8,7 +8,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimImageDataHelper.cpp 18360 2010-11-01 15:12:12Z dburken $
+// $Id: ossimImageDataHelper.cpp 21184 2012-06-29 15:13:09Z dburken $
 #include <ossim/imaging/ossimImageDataHelper.h>
 #include <ossim/base/ossimPolyArea2d.h>
 #include <ossim/base/ossimLine.h>
@@ -358,7 +358,7 @@ void ossimImageDataHelper::copyInputToThis(const T* inputBuf,
    int x1, y1;
    int x2, y2;
    int ind1, ind2;
-   int ints;
+   // int ints;
    vector<int> polyInts;
    T* buf = reinterpret_cast<T*>(theImageData->getBuf());
    
@@ -372,7 +372,7 @@ void ossimImageDataHelper::copyInputToThis(const T* inputBuf,
    for (y = miny; (y <= maxy); y++)
    {
       polyInts.clear();
-      ints = 0;
+      // ints = 0;
       for (i = 0; (i < n); i++)
       {
          if (!i)
@@ -497,7 +497,7 @@ void ossimImageDataHelper::fill(T /* dummyVariable */,
    int x1, y1;
    int x2, y2;
    int ind1, ind2;
-   int ints;
+   // int ints;
    vector<int> polyInts;
    T* buf = reinterpret_cast<T*>(theImageData->getBuf());
    
@@ -511,7 +511,7 @@ void ossimImageDataHelper::fill(T /* dummyVariable */,
    for (y = miny; (y <= maxy); y++)
    {
       polyInts.clear();
-      ints = 0;
+      // ints = 0;
       for (i = 0; (i < n); i++)
       {
          if (!i)
diff --git a/src/ossim/imaging/ossimImageFileWriter.cpp b/src/ossim/imaging/ossimImageFileWriter.cpp
index 96991b0..8eb31ce 100644
--- a/src/ossim/imaging/ossimImageFileWriter.cpp
+++ b/src/ossim/imaging/ossimImageFileWriter.cpp
@@ -8,7 +8,7 @@
 //
 // Contains class declaration for ossimImageFileWriter.
 //*******************************************************************
-//  $Id: ossimImageFileWriter.cpp 19180 2011-03-22 17:36:33Z oscarkramer $
+//  $Id: ossimImageFileWriter.cpp 21963 2012-12-04 16:28:12Z dburken $
 
 
 #include <tiff.h> /* for tiff compression defines */
@@ -48,9 +48,10 @@
 #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 19180 2011-03-22 17:36:33Z oscarkramer $";
+static const char OSSIM_ID[] = "$Id: ossimImageFileWriter.cpp 21963 2012-12-04 16:28:12Z dburken $";
 #endif
 
 RTTI_DEF3(ossimImageFileWriter,
@@ -89,6 +90,7 @@ ossimImageFileWriter::ossimImageFileWriter(const ossimFilename& file,
      theWriteReadmeFlag(false),
      theWriteTiffWorldFileFlag(false),
      theWriteWorldFileFlag(false),
+     theAutoCreateDirectoryFlag(true),
      theLinearUnits(OSSIM_UNIT_UNKNOWN),
      thePixelType(OSSIM_PIXEL_IS_POINT)
 {
@@ -129,23 +131,41 @@ void ossimImageFileWriter::initialize()
    if(theInputConnection.valid())
    {
       theInputConnection->initialize();
-      setAreaOfInterest(theInputConnection->getBoundingRect());
+
+      //---
+      // 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) return;
-   if(theInputConnection.valid())
+   if( sequencer )
    {
-      sequencer->setAreaOfInterest(theInputConnection->getAreaOfInterest());
+      theInputConnection = sequencer;
+      theInputConnection->connectMyInputTo(0, getInput(0));
    }
-
-   theInputConnection = sequencer;
-   theInputConnection->connectMyInputTo(0, getInput(0));
 }
 
-
 bool ossimImageFileWriter::saveState(ossimKeywordlist& kwl,
                                  const char* prefix)const
 {
@@ -218,7 +238,10 @@ bool ossimImageFileWriter::saveState(ossimKeywordlist& kwl,
            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,
@@ -393,6 +416,11 @@ bool ossimImageFileWriter::loadState(const ossimKeywordlist& kwl,
       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)
    {
@@ -636,7 +664,7 @@ bool ossimImageFileWriter::writeMetaDataFiles()
 {
    bool status = true;
    
-   if(theWriteEnviHeaderFlag)
+   if(theWriteEnviHeaderFlag&&!needsAborting())
    {
       if(writeEnviHeaderFile() == false)
       {
@@ -647,7 +675,7 @@ bool ossimImageFileWriter::writeMetaDataFiles()
       }
    }
 
-   if(theWriteErsHeaderFlag)
+   if(theWriteErsHeaderFlag&&!needsAborting())
    {
       if(writeErsHeaderFile() == false)
       {
@@ -658,7 +686,7 @@ bool ossimImageFileWriter::writeMetaDataFiles()
       }
    }
 
-   if (theWriteExternalGeometryFlag)
+   if (theWriteExternalGeometryFlag&&!needsAborting())
    {
       if( writeExternalGeometryFile() == false)
       {
@@ -670,7 +698,7 @@ bool ossimImageFileWriter::writeMetaDataFiles()
          }
       }
    }
-   if(theWriteFgdcFlag)
+   if(theWriteFgdcFlag&&!needsAborting())
    {
       if(writeFgdcFile() == false)
       {
@@ -682,7 +710,7 @@ bool ossimImageFileWriter::writeMetaDataFiles()
          }
       }
    }
-   if(theWriteJpegWorldFileFlag)
+   if(theWriteJpegWorldFileFlag&&!needsAborting())
    {
       if(writeJpegWorldFile() == false)
       {
@@ -694,7 +722,7 @@ bool ossimImageFileWriter::writeMetaDataFiles()
          }
       }
    }
-   if(theWriteReadmeFlag)
+   if(theWriteReadmeFlag&&!needsAborting())
    {
       if(writeReadmeFile() == false)
       {
@@ -707,7 +735,7 @@ bool ossimImageFileWriter::writeMetaDataFiles()
          }
       }
    }
-   if(theWriteTiffWorldFileFlag)
+   if(theWriteTiffWorldFileFlag&&!needsAborting())
    {
       if(writeTiffWorldFile() == false)
       {
@@ -720,7 +748,7 @@ bool ossimImageFileWriter::writeMetaDataFiles()
       }
    }
 
-   if(theWriteWorldFileFlag)
+   if(theWriteWorldFileFlag&&!needsAborting())
    {
       if(writeWorldFile() == false)
       {
@@ -733,7 +761,7 @@ bool ossimImageFileWriter::writeMetaDataFiles()
       }
    }
    
-   if (theWriteHistogramFlag)
+   if (theWriteHistogramFlag&&!needsAborting())
    {
       if (!writeHistogramFile())
       {
@@ -751,6 +779,7 @@ bool ossimImageFileWriter::writeMetaDataFiles()
 
 bool ossimImageFileWriter::writeHistogramFile() 
 {
+   if(needsAborting()) return false;
    if(theFilename == "") return false;
 
    ossimFilename histogram_file = theFilename;
@@ -962,10 +991,20 @@ const ossimObject* ossimImageFileWriter::getObject() const
 
 void ossimImageFileWriter::setAreaOfInterest(const ossimIrect& inputRect)
 {
+   // This sets "theAreaOfInterest".
    ossimImageWriter::setAreaOfInterest(inputRect);
-   if(theInputConnection.valid())
+   
+   if( theInputConnection.valid() )
    {
-      theInputConnection->setAreaOfInterest(inputRect);
+      //---
+      // 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);
+      }
    }
 }
 
@@ -998,6 +1037,7 @@ bool ossimImageFileWriter::execute()
       return false;
    }
    
+   
    // make sure we have a region of interest
    if(theAreaOfInterest.hasNans())
    {
@@ -1043,15 +1083,21 @@ bool ossimImageFileWriter::execute()
       }
    }
 
+   ossimFilename path = theFilename.path();
+   if(!path.exists())
+   {
+      path.createDirectory(true);
+   }
    setProcessStatus(ossimProcessInterface::PROCESS_STATUS_EXECUTING);
-   setPercentComplete(0.0);
+   //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);
@@ -1060,8 +1106,8 @@ bool ossimImageFileWriter::execute()
    {
       setProcessStatus(ossimProcessInterface::PROCESS_STATUS_NOT_EXECUTING);
    }
-
-   if (theWriteOverviewFlag)
+   */
+   if (theWriteOverviewFlag&&!needsAborting())
    {
       // Writing overviews has been mpi'd so do on all processes.
       if (!writeOverviewFile(theOverviewCompressType,
@@ -1075,7 +1121,7 @@ bool ossimImageFileWriter::execute()
       }
    }
 
-   if(getProcessStatus() != ossimProcessInterface::PROCESS_STATUS_ABORTED)
+   if(!needsAborting())
    {
       // Do these only on the master process. Note left to right precedence!
       if (getSequencer() && getSequencer()->isMaster())
@@ -1104,6 +1150,15 @@ bool ossimImageFileWriter::execute()
          theInputConnection->connectMyInputTo(0, obj->getInput(0));
       }
    }
+   if(!needsAborting())
+   {
+      setProcessStatus(ossimProcessInterface::PROCESS_STATUS_NOT_EXECUTING);
+   }
+   else 
+   {
+      setProcessStatus(ossimProcessInterface::PROCESS_STATUS_ABORTED);   
+   }
+
    savedInput = 0;
    return result;
 }
@@ -1254,12 +1309,20 @@ void ossimImageFileWriter::setProperty(ossimRefPtr<ossimProperty> property)
    {
       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,
@@ -1288,6 +1351,27 @@ ossimRefPtr<ossimProperty> ossimImageFileWriter::getProperty(const ossimString&
 
       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);
@@ -1396,9 +1480,12 @@ void ossimImageFileWriter::getPropertyNames(std::vector<ossimString>& propertyNa
    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
diff --git a/src/ossim/imaging/ossimImageGaussianFilter.cpp b/src/ossim/imaging/ossimImageGaussianFilter.cpp
index 797ad1f..dc5dca4 100644
--- a/src/ossim/imaging/ossimImageGaussianFilter.cpp
+++ b/src/ossim/imaging/ossimImageGaussianFilter.cpp
@@ -4,11 +4,13 @@
 // See LICENSE.txt file in the top level directory for more details.
 // class ossimImageGaussianFilter : tile source
 //*******************************************************************
-// $Id: ossimImageGaussianFilter.cpp 15766 2009-10-20 12:37:09Z gpotts $
-#include <cmath>
+// $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);
 
diff --git a/src/ossim/imaging/ossimImageGeometry.cpp b/src/ossim/imaging/ossimImageGeometry.cpp
index d9928ea..6da0354 100644
--- a/src/ossim/imaging/ossimImageGeometry.cpp
+++ b/src/ossim/imaging/ossimImageGeometry.cpp
@@ -12,12 +12,16 @@
 // $Id$
 
 #include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimIrect.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);
 
@@ -28,12 +32,10 @@ ossimImageGeometry::ossimImageGeometry()
 :   
 m_transform (0),
 m_projection(0),
-m_gsd(),
 m_decimationFactors(0),
 m_imageSize(),
 m_targetRrds(0)
 {
-   m_gsd.makeNan();
    m_imageSize.makeNan();
 }
 
@@ -49,7 +51,6 @@ 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_gsd(copy_this.m_gsd),
 m_decimationFactors(copy_this.m_decimationFactors),
 m_imageSize(copy_this.m_imageSize),
 m_targetRrds(copy_this.m_targetRrds)
@@ -65,19 +66,11 @@ ossimImageGeometry::ossimImageGeometry(ossim2dTo2dTransform* transform, ossimPro
 ossimObject(),
 m_transform(transform),
 m_projection(proj),
-m_gsd(),
 m_decimationFactors(0),
 m_imageSize(),
 m_targetRrds(0)   
 {
    m_imageSize.makeNan();
-   m_gsd.makeNan();
-   if(m_projection.valid())
-   {
-      // If the transform is NULL (identity), then we can simply copy the input projection's GSD.
-      // Otherwise we'll need to compute a GSD specific to this geometry.
-      m_gsd = m_projection->getMetersPerPixel();
-   }
 }
 
 //**************************************************************************************************
@@ -170,54 +163,105 @@ void ossimImageGeometry::worldToRn(const ossimGpt& wpt,
 //**************************************************************************************************
 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;
-    }
+   //! 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);
+   // 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);
-    return true;
+   // 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 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.
+//! 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::worldToLocal(const ossimGpt& world_pt, ossimDpt& local_pt) const
+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())
    {
-      local_pt.makeNan();
+      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;
    
-   ossimGpt copyPt(world_pt);
-   if(isAffectedByElevation())
+   if ( m_projection.valid() )
    {
-      if(world_pt.isHgtNan())
+      const ossimEquDistCylProjection* eqProj =
+         dynamic_cast<const ossimEquDistCylProjection*>( m_projection.get() );
+      
+      ossimDpt full_image_pt;
+
+      if ( eqProj && (m_imageSize.hasNans() == false) )
       {
-         copyPt.hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(copyPt);
+         // Call specialized method to handle wrapping...
+         eqProj->worldToLineSample( world_pt, m_imageSize, full_image_pt );
       }
+      else 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;  
    }
    
-   // First Perform projection from world coordinates to full-image space:
-   ossimDpt full_image_pt;
-   m_projection->worldToLineSample(copyPt, full_image_pt);
-
-   // Then transform to local space:
-   fullToRn(full_image_pt, m_targetRrds, local_pt);
+   return result;
    
-   return true;
-}
+} // End: ossimImageGeometry::worldToLocal(const ossimGpt&, ossimDpt&)
 
 //**************************************************************************************************
 //! Sets the transform to be used for local-to-full-image coordinate transformation
@@ -225,10 +269,6 @@ bool ossimImageGeometry::worldToLocal(const ossimGpt& world_pt, ossimDpt& local_
 void ossimImageGeometry::setTransform(ossim2dTo2dTransform* transform) 
 { 
    m_transform = transform; 
-   if (m_projection.valid())
-   {
-      m_gsd.makeNan();
-   }
 }
 
 //**************************************************************************************************
@@ -237,10 +277,6 @@ void ossimImageGeometry::setTransform(ossim2dTo2dTransform* transform)
 void ossimImageGeometry::setProjection(ossimProjection* projection) 
 { 
    m_projection = projection; 
-   if (m_projection.valid())
-   {
-      m_gsd.makeNan();
-   }
 }
 
 //**************************************************************************************************
@@ -253,57 +289,100 @@ bool ossimImageGeometry::isAffectedByElevation() const
     return false;
 }
 
-const ossimDpt& ossimImageGeometry::getMetersPerPixel() const
+//*************************************************************************************************
+//! 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
 {
-   if(m_gsd.hasNans())
+   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())
    {
-      if(m_projection.valid())
-      {
-         computeGsd();
-      }
+      // 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();
    }
-   
-   return m_gsd;
 }
 
-//**************************************************************************************************
-//! When either the projection or the transform changes, this method recomputes the GSD.
-//**************************************************************************************************
-void ossimImageGeometry::computeGsd()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 ossimImageGeometry::getDegreesPerPixel() const
 {
-   //---
-   // We need to do the local-to-world but eliminating elevation effects,
-   // hence the complication:
-   //
-   // Note that by doing the rnToFull the tranform and decimation are account for.
-   //---
+   ossimDpt dpp;
+   getDegreesPerPixel(dpp);
+   return dpp;
+}
 
-   if (m_projection.valid())
+//*************************************************************************************************
+// 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))
    {
-      // Get three points in full image space.
+      // 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);
-      ossimDpt pF0;
-      ossimDpt pFx;
-      ossimDpt pFy;
-      rnToFull(pL0, 0, pF0);
-      rnToFull(pLx, 0, pFx);
-      rnToFull(pLy, 0, pFy);
-      
       ossimGpt g0, gx, gy;
-      
-      m_projection->lineSampleToWorld(pF0, g0);
-      m_projection->lineSampleHeightToWorld(pFx, g0.height(), gx);
-      m_projection->lineSampleHeightToWorld(pFy, g0.height(), gy);
-      
+
+      localToWorld(pL0, g0);
+      localToWorld(pLx, g0.height(), gx);
+      localToWorld(pLy, g0.height(), gy);
+
       // Compute horizontal distance for one pixel:
-      m_gsd.x = g0.distanceTo(gx);
-      m_gsd.y = g0.distanceTo(gy);
+      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
    {
-      m_gsd.makeNan();
+      // This object is not fully initialized:
+      dpp.makeNan();
    }
 }
 
@@ -313,26 +392,35 @@ void ossimImageGeometry::computeGsd()const
 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. ";
-    }
-    return out;
+   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;
 }
 
 //**************************************************************************************************
@@ -437,13 +525,6 @@ bool ossimImageGeometry::loadState(const ossimKeywordlist& kwl,
             m_projection = projection;
          }
 
-         // m_gsd:
-         ossimString gsd = kwl.find(prefix, "gsd");
-         if( gsd.size() )
-         {
-            m_gsd.toPoint(gsd);
-         }
-
          // m_decimationFactors:
          ossimString decimations = kwl.find(prefix, "decimations");
          if( decimations.size() )
@@ -515,11 +596,9 @@ bool ossimImageGeometry::saveState(ossimKeywordlist& kwl, const char* prefix) co
    }
 
    // m_gsd:
-   if ( m_gsd.hasNans() )
-   {
-      computeGsd(); // Attempt to compute.
-   }
-   kwl.add(prefix, "gsd", m_gsd.toString(), true);
+   ossimDpt gsd;
+   getMetersPerPixel(gsd);
+   kwl.add(prefix, "gsd", gsd.toString(), true);
 
    // m_decimationFactors:
    if(m_decimationFactors.size())
@@ -575,7 +654,6 @@ const ossimImageGeometry& ossimImageGeometry::operator=(const ossimImageGeometry
       }
       
       // the Gsd should already be solved from the source we are copying from
-      m_gsd               = copy_this.m_gsd;
       m_imageSize         = copy_this.m_imageSize;
       m_decimationFactors = copy_this.m_decimationFactors;
       m_targetRrds        = copy_this.m_targetRrds;
@@ -604,6 +682,134 @@ bool ossimImageGeometry::getCornerGpts(ossimGpt& gul, ossimGpt& gur,
    return status;
 }
 
+void ossimImageGeometry::getTiePoint(ossimGpt& tie, bool edge) const
+{
+   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);
+      
+      // Determine the direction of the image:
+      if ( gul.lat > gDown.lat ) // oriented north up
+      {
+         if ( gul.lat >= gRight.lat ) // straight up or leaning right
+         {
+            tie.lat = gul.lat;
+            tie.lon = gll.lon;
+         }
+         else // leaning left
+         {
+            tie.lat = gur.lat;
+            tie.lon = gul.lon;
+         }
+      }
+      else // south or on side
+      {
+         if ( gRight.lat >= gul.lat ) // straight down or leaning right
+         {
+            tie.lat = glr.lat;
+            tie.lon = gur.lon;
+         }
+         else // leaning left
+         {
+            tie.lat = gll.lat;
+            tie.lon = glr.lon;
+         }   
+      }
+
+      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 );
+      }
+      
+   } // if ( (m_imageSize.hasNans() == false) && m_projection.valid() )
+   else
+   { 
+      tie.lat = ossim::nan();
+      tie.lon = ossim::nan();
+   }
+}
+
+//**************************************************************************************************
+// 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,
@@ -664,3 +870,437 @@ void ossimImageGeometry::decimatePoint(const ossimDpt& inPt,
       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;
+}
+
+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::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
+            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;
+            }
+            
+            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 = 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/ossim/imaging/ossimImageGeometryFactory.cpp b/src/ossim/imaging/ossimImageGeometryFactory.cpp
index 44b359c..d7351da 100644
--- a/src/ossim/imaging/ossimImageGeometryFactory.cpp
+++ b/src/ossim/imaging/ossimImageGeometryFactory.cpp
@@ -75,7 +75,7 @@ ossimImageGeometry* ossimImageGeometryFactory::createGeometry(
 
 bool ossimImageGeometryFactory::extendGeometry(ossimImageHandler* handler)const
 {
-   bool result = true;
+   bool result = false;
    if (handler)
    {
       bool add2D = true;
diff --git a/src/ossim/imaging/ossimImageGeometryRegistry.cpp b/src/ossim/imaging/ossimImageGeometryRegistry.cpp
index 0a50b1c..19d8354 100644
--- a/src/ossim/imaging/ossimImageGeometryRegistry.cpp
+++ b/src/ossim/imaging/ossimImageGeometryRegistry.cpp
@@ -12,7 +12,7 @@
 #include <ossim/imaging/ossimImageGeometryFactory.h>
 #include <ossim/base/ossimObjectFactoryRegistry.h>
 ossimImageGeometryRegistry* ossimImageGeometryRegistry::m_instance = 0;
-RTTI_DEF1(ossimImageGeometryRegistry, "ossimImageGeometryRegistry", ossimObjectFactory);
+RTTI_DEF1(ossimImageGeometryRegistry, "ossimImageGeometryRegistry", ossimImageGeometryFactoryBase);
 ossimImageGeometryRegistry* ossimImageGeometryRegistry::instance()
 {
    if(!m_instance)
@@ -36,3 +36,39 @@ bool ossimImageGeometryRegistry::extendGeometry(ossimImageHandler* handler)const
    
    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/ossim/imaging/ossimImageHandler.cpp b/src/ossim/imaging/ossimImageHandler.cpp
index 493dddc..1321870 100644
--- a/src/ossim/imaging/ossimImageHandler.cpp
+++ b/src/ossim/imaging/ossimImageHandler.cpp
@@ -12,48 +12,48 @@
 // derive from.
 //
 //*******************************************************************
-//  $Id: ossimImageHandler.cpp 19194 2011-03-23 14:23:34Z dburken $
-
-#include <algorithm>
+//  $Id: ossimImageHandler.cpp 22228 2013-04-12 14:11:45Z 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/ossimFilename.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/ossimStringProperty.h>
 #include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimCommon.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 <ossim/support_data/ossimSupportFilesList.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 19194 2011-03-23 14:23:34Z dburken $";
+static const char OSSIM_ID[] = "$Id: ossimImageHandler.cpp 22228 2013-04-12 14:11:45Z dburken $";
 #endif
 
 // GARRETT! All of the decimation factors are scattered throughout. We want to fold that into 
@@ -74,7 +74,9 @@ theGeometry(),
 theLut(0),
 theDecimationFactors(0),
 theImageID(""),
-theStartingResLevel(0)
+theStartingResLevel(0),
+theOpenOverviewFlag(true),
+thePixelType(OSSIM_PIXEL_IS_POINT)
 {
    if (traceDebug())
    {
@@ -116,25 +118,15 @@ bool ossimImageHandler::saveState(ossimKeywordlist& kwl,
       return false;
    }
 
-   kwl.add(prefix,
-           ossimKeywordNames::FILENAME_KW,
-           theImageFile.c_str(),
-           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", theStartingResLevel, true);
-   
+   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;
 }
 
@@ -216,19 +208,26 @@ bool ossimImageHandler::loadState(const ossimKeywordlist& kwl,
    }
    
    // Check for an valid image vetices file.
-   lookup = kwl.find(prefix, "valid_vertices_file");
+   lookup = kwl.find(prefix, VALID_VERTICES_FILE_KW);
    if (lookup)
    {
       initVertices(lookup);
    }
 
    // Starting resolution level.
-   lookup = kwl.find(prefix, "start_res_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)
@@ -245,6 +244,12 @@ bool ossimImageHandler::loadState(const ossimKeywordlist& kwl,
    // 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)
@@ -710,27 +715,38 @@ ossimRefPtr<ossimImageGeometry> ossimImageHandler::getExternalImageGeometry() co
       // Open the geom file as a KWL and initialize our geometry object:
       filename = filename.expand();
       ossimKeywordlist geomKwl(filename);
-      
+
       // Try loadState with no prefix.
-      ossimString prefix = "";
-      const char* lookup = geomKwl.find(prefix.c_str(), ossimKeywordNames::TYPE_KW);
+      std::string prefix = "";
+      std::string key = ossimKeywordNames::TYPE_KW;
+      std::string value = geomKwl.findKey(prefix, key);
 
-      if (!lookup)
+      if ( value.empty() || (value != "ossimImageGeometry") )
       {
-         // Try with "image0 type prefix.
-         prefix = "image"+ossimString::toString(getCurrentEntry()) + ".";
-         lookup = geomKwl.find(prefix.c_str(), ossimKeywordNames::TYPE_KW);
+         // 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 (lookup)
+      if ( value == "ossimImageGeometry" )
       {
          geom = new ossimImageGeometry;
-         if(geom->loadState(geomKwl, prefix.c_str()))
-         {
-            // add the geom file to the support data list:
-            ossimSupportFilesList::instance()->add(filename);
-         }
-         else
+         if( !geom->loadState(geomKwl, prefix.c_str()) )
          {
             geom = 0;
          }
@@ -796,9 +812,10 @@ bool ossimImageHandler::openOverview(const ossimFilename& overview_file)
       // the overview can be told what it's starting res level is.
       //---
       ossim_uint32 overviewStartingResLevel = getNumberOfDecimationLevels();
-      
+
+
       // Try to open:
-      theOverview = ossimImageHandlerRegistry::instance()->open(overview_file);
+      theOverview = ossimImageHandlerRegistry::instance()->openOverview( overview_file );
 
       if (theOverview.valid())
       {
@@ -844,8 +861,8 @@ bool ossimImageHandler::openOverview(const ossimFilename& overview_file)
          // This is not really a container event; however, using for now.
          //---
          ossimContainerEvent event(this,
-                                   theOverview.get(),
                                    OSSIM_EVENT_ADD_OBJECT_ID);
+         event.setObjectList(theOverview.get());
          fireEvent(event);
       }
    }
@@ -889,7 +906,7 @@ bool ossimImageHandler::openOverview()
    
    if ( overviewFilename.exists() )
    {
-      status = openOverview(overviewFilename);
+      status = openOverview( overviewFilename );
    }
 
    if ( !status  && traceDebug() )
@@ -1085,6 +1102,86 @@ bool ossimImageHandler::setOutputBandList(const std::vector<ossim_uint32>& /* ba
    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());
@@ -1094,7 +1191,11 @@ void ossimImageHandler::loadMetaData()
 {
   theMetaData.clear();
 
-  ossimFilename filename = getFilenameWithThisExtension(ossimString(".omd"));
+  ossimFilename filename = getFilenameWithThisExtension(ossimString(".omd"), false);
+  if ( filename.exists() == false )
+  {
+     filename = getFilenameWithThisExtension(ossimString(".omd"), true);
+  }
   if(filename.exists())
   {
      ossimKeywordlist kwl;
@@ -1172,7 +1273,7 @@ ossimFilename ossimImageHandler::getOverviewFile()const
 
 void ossimImageHandler::getEntryList(std::vector<ossim_uint32>& entryList)const
 {
-	entryList.push_back(0);
+   entryList.push_back(0);
 }
 
 void ossimImageHandler::getEntryStringList(
@@ -1191,6 +1292,22 @@ void ossimImageHandler::getEntryStringList(
    }
 }
 
+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;
@@ -1199,11 +1316,22 @@ ossim_uint32 ossimImageHandler::getNumberOfEntries()const
    return (ossim_uint32)tempList.size();
 }
 
+void ossimImageHandler::getEntryName( ossim_uint32 /* entryIdx */, std::string& name ) const
+{
+   //---
+   // This implementation does nothing. Interface for multi entry image readers that have
+   // named entries, e.g. HDF5 data.
+   //---
+   name.clear();
+}
 
 void ossimImageHandler::completeOpen()
 {
    loadMetaData();
-   openOverview();
+   if ( theOpenOverviewFlag )
+   {
+      openOverview();
+   }
    establishDecimationFactors();
    openValidVertices();
 }
@@ -1261,6 +1389,10 @@ void ossimImageHandler::setProperty(ossimRefPtr<ossimProperty> property)
       {
          setCurrentEntry(property->valueToString().toUInt32());
       }
+      else if ( property->getName() == OPEN_OVERVIEW_FLAG_KW )
+      {
+         setOpenOverviewFlag( property->valueToString().toBool() );
+      }
       else
       {
          ossimImageSource::setProperty(property);
@@ -1288,7 +1420,42 @@ ossimRefPtr<ossimProperty> ossimImageHandler::getProperty(const ossimString& nam
 
       return stringProperty;
    }
-   if(name == "histogram_filename")
+   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());
@@ -1299,7 +1466,7 @@ ossimRefPtr<ossimProperty> ossimImageHandler::getProperty(const ossimString& nam
       return filenameProp;
       
    }
-   if(name == "geometry_filename")
+   else if(name == "geometry_filename")
    {
       ossimFilenameProperty* filenameProp =
          new ossimFilenameProperty(name, createDefaultGeometryFilename());
@@ -1310,7 +1477,7 @@ ossimRefPtr<ossimProperty> ossimImageHandler::getProperty(const ossimString& nam
       return filenameProp;
       
    }
-   if(name == "valid_vertices_filename")
+   else if(name == "valid_vertices_filename")
    {
       ossimFilenameProperty* filenameProp =
          new ossimFilenameProperty(name, createDefaultValidVerticesFilename());
@@ -1320,7 +1487,7 @@ ossimRefPtr<ossimProperty> ossimImageHandler::getProperty(const ossimString& nam
       
       return filenameProp;
    }
-   if(name == "metadata_filename")
+   else if(name == "metadata_filename")
    {
       ossimFilenameProperty* filenameProp =
          new ossimFilenameProperty(name, createDefaultMetadataFilename());
@@ -1330,7 +1497,7 @@ ossimRefPtr<ossimProperty> ossimImageHandler::getProperty(const ossimString& nam
       
       return filenameProp;
    }
-   if(name == "overview_filename")
+   else if(name == "overview_filename")
    {
       ossimFilenameProperty* filenameProp =
          new ossimFilenameProperty(name, createDefaultOverviewFilename());
@@ -1340,7 +1507,7 @@ ossimRefPtr<ossimProperty> ossimImageHandler::getProperty(const ossimString& nam
       
       return filenameProp;
    }
-   if(name == "filename")
+   else if(name == "filename")
    {
       ossimFilenameProperty* filenameProp =
          new ossimFilenameProperty(name, getFilename());
@@ -1350,6 +1517,12 @@ ossimRefPtr<ossimProperty> ossimImageHandler::getProperty(const ossimString& nam
       
       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);
 }
@@ -1358,6 +1531,12 @@ void ossimImageHandler::getPropertyNames(std::vector<ossimString>& propertyNames
 {
    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(
@@ -1429,6 +1608,11 @@ ossimRefPtr<ossimNBandLutDataObject> ossimImageHandler::getLut()const
    return theLut;
 }
 
+bool ossimImageHandler::hasLut() const
+{
+   return theLut.valid();
+}
+
 ossimFilename ossimImageHandler::createDefaultOverviewFilename() const
 {
    return getFilenameWithThisExtension("ovr");
@@ -1476,6 +1660,18 @@ 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 )
diff --git a/src/ossim/imaging/ossimImageHandlerFactory.cpp b/src/ossim/imaging/ossimImageHandlerFactory.cpp
index ceb81a3..c265bed 100644
--- a/src/ossim/imaging/ossimImageHandlerFactory.cpp
+++ b/src/ossim/imaging/ossimImageHandlerFactory.cpp
@@ -5,14 +5,20 @@
 // See LICENSE.txt file in the top level directory for more details.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimImageHandlerFactory.cpp 18693 2011-01-17 18:49:15Z dburken $
+// $Id: ossimImageHandlerFactory.cpp 22230 2013-04-12 16:34:05Z 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>
@@ -22,12 +28,14 @@
 #include <ossim/imaging/ossimGeneralRasterTileSource.h>
 #include <ossim/imaging/ossimERSTileSource.h>
 #include <ossim/imaging/ossimVpfTileSource.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimKeywordNames.h>
 #include <ossim/imaging/ossimJpegTileSource.h>
 #include <ossim/imaging/ossimRpfCacheTileSource.h>
+#include <ossim/imaging/ossimImageCacheTileSource.h>
 #include <ossim/imaging/ossimQbTileFilesHandler.h>
-#include <ossim/base/ossimRegExp.h>
+#include <ossim/imaging/ossimBitMaskTileSource.h>
+#include <ossim/imaging/ossimBandSeparateHandler.h>
+#include <ossim/parallel/ossimImageHandlerMtAdaptor.h>
+
 
 static const ossimTrace traceDebug("ossimImageHandlerFactory:debug");
 
@@ -53,14 +61,19 @@ ossimImageHandlerFactory* ossimImageHandlerFactory::instance()
    return theInstance;
 }
 
-ossimImageHandler* ossimImageHandlerFactory::open(const ossimFilename& fileName)const
+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)<<M<<"Attempting to open file <"<<fileName<<">"<<std::endl;
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "Attempting to open file: " << fileName.c_str()
+         << "\nopen overview flag: " << (openOverview?"true":"false") << "\n";
+   }
 
    ossimRefPtr<ossimImageHandler> result = 0;
    while (true)
@@ -87,58 +100,76 @@ ossimImageHandler* ossimImageHandlerFactory::open(const ossimFilename& fileName)
       // 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...";
+      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 JPEG...";
+      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...";
+      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...";
+      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...";
+      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...";
+      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...";
+      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...";
+      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...";
+      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...";
+      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...";
+      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...";
+      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...";
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying ERS...\n";
       result = new ossimERSTileSource;
+      result->setOpenOverviewFlag(openOverview);      
       if (result->open(copyFilename))  break;
 
       //---
@@ -148,25 +179,46 @@ ossimImageHandler* ossimImageHandlerFactory::open(const ossimFilename& fileName)
       //---
       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...";
+         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...";
-         result = new ossimGeneralRasterTileSource;
+         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...";
+      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...";
+      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 CCF...";
+      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;
 
@@ -194,80 +246,97 @@ ossimImageHandler* ossimImageHandlerFactory::open(const ossimKeywordlist& kwl,
    ossimRefPtr<ossimImageHandler> result = 0;
    while (true)
    {
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying adrg...";
+      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...";
+      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...";
+      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...";
+      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 DOQQ...";
+      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...";
+      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...";
+      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...";
+      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...";
+      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...";
+      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...";
+      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...";
+      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...";
+      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...";
+      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...";
+      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..."<< std::endl;
+      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..."<< std::endl;
+      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..."<<std::endl;
+      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;
+
       result = 0;
       break;
    }
@@ -283,6 +352,24 @@ ossimImageHandler* ossimImageHandlerFactory::open(const ossimKeywordlist& kwl,
    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
 {
@@ -298,14 +385,14 @@ ossimImageHandler* ossimImageHandlerFactory::openFromExtension(const ossimFilena
    while (true)
    {
       // OVR can be combined with "tif" once we get rid of ossimQuickbirdTiffTileSource
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying OVR..."<<std::endl;
+      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..."<<std::endl;
+      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
@@ -315,7 +402,7 @@ ossimImageHandler* ossimImageHandlerFactory::openFromExtension(const ossimFilena
          if(result->open(fileName)) break;
       }
 
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying NTF or NITF..."<<std::endl;
+      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
@@ -325,35 +412,38 @@ ossimImageHandler* ossimImageHandlerFactory::openFromExtension(const ossimFilena
          if(result->open(fileName)) break;
       }
 
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying RPF..."<<std::endl;
+      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..."<<std::endl;
+      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..."<<std::endl;
+      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..."<<std::endl;
+      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..."<<std::endl;
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying DTn...\n";
       if ( (ext == "dt2") || (ext == "dt1") || (ext == "dt3") ||
          (ext == "dt4") || (ext == "dt5") || (ext == "dt0") )
       {
@@ -361,49 +451,56 @@ ossimImageHandler* ossimImageHandlerFactory::openFromExtension(const ossimFilena
          if(result->open(fileName)) break;
       }
 
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying HGT..."<<std::endl;
+      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 DEM..."<<std::endl;
+      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..."<<std::endl;
+      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..."<<std::endl;
+      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..."<<std::endl;
+      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..."<<std::endl;
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying CCF...\n";
       if (ext == "ccf")
       {
          result = new ossimCcfTileSource;
          if(result->open(fileName)) break;
       }
 
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying TIL..."<<std::endl;
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying TIL...\n";
       if (ext == "til")
       {
          result = new ossimQbTileFilesHandler;
@@ -441,6 +538,10 @@ ossimObject* ossimImageHandlerFactory::createObject(const ossimString& typeName)
    {
      return new ossimRpfCacheTileSource();
    }
+   if(STATIC_TYPE_NAME(ossimImageCacheTileSource) == typeName)
+   {
+      return new ossimImageCacheTileSource();
+   }
    if(STATIC_TYPE_NAME(ossimDoqqTileSource) == typeName)
    {
       return new ossimDoqqTileSource();
@@ -449,6 +550,10 @@ ossimObject* ossimImageHandlerFactory::createObject(const ossimString& typeName)
    {
       return new ossimDtedTileSource();
    }
+   if(STATIC_TYPE_NAME(ossimEnviTileSource) == typeName)
+   {
+      return new ossimEnviTileSource();
+   }
    if(STATIC_TYPE_NAME(ossimJpegTileSource) == typeName)
    {
       return new ossimJpegTileSource();
@@ -485,7 +590,19 @@ ossimObject* ossimImageHandlerFactory::createObject(const ossimString& 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(ossimImageHandlerMtAdaptor) == typeName)
+   {
+      return new ossimImageHandlerMtAdaptor();
+   }
+   
    return (ossimObject*)0;
 }
 
@@ -513,13 +630,15 @@ void ossimImageHandlerFactory::getSupportedExtensions(ossimImageHandlerFactoryBa
    extensionList.push_back("nitf");
    extensionList.push_back("ntf");
    extensionList.push_back("til");
+   extensionList.push_back("mask");
+   extensionList.push_back("txt");
 }
 
 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..."<<std::endl;
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying OVR...\n";
    ossimString testExt = ext.downcase();
    if (testExt == "ovr")
    {
@@ -527,7 +646,7 @@ void ossimImageHandlerFactory::getImageHandlersBySuffix(ossimImageHandlerFactory
       return;
    }
    
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing TIF or TIFF..."<<std::endl;
+   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
@@ -536,7 +655,7 @@ void ossimImageHandlerFactory::getImageHandlersBySuffix(ossimImageHandlerFactory
       return;
    }
    
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing NTF or NITF..."<<std::endl;
+   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
@@ -545,35 +664,36 @@ void ossimImageHandlerFactory::getImageHandlersBySuffix(ossimImageHandlerFactory
       return;
    }
    
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing RPF..."<<std::endl;
+   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..."<<std::endl;
+   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..."<<std::endl;
+   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..."<<std::endl;
+   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..."<<std::endl;
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing DTn...\n";
    ossimString regExpStr = "dt[0-9]";
    ossimRegExp regExp(regExpStr);
    if(regExp.find(testExt))
@@ -582,54 +702,75 @@ void ossimImageHandlerFactory::getImageHandlersBySuffix(ossimImageHandlerFactory
       return;
    }
    
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing HGT..."<<std::endl;
+   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 DEM..."<<std::endl;
+   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..."<<std::endl;
+   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..."<<std::endl;
+   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..."<<std::endl;
+   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..."<<std::endl;
+   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..."<<std::endl;
+   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;
+   }
 }
 
 void ossimImageHandlerFactory::getImageHandlersByMimeType(ossimImageHandlerFactoryBase::ImageHandlerList& result, const ossimString& mimeType)const
@@ -696,7 +837,9 @@ void ossimImageHandlerFactory::getTypeNameList(std::vector<ossimString>& typeLis
    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));
@@ -710,4 +853,6 @@ void ossimImageHandlerFactory::getTypeNameList(std::vector<ossimString>& typeLis
    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(ossimImageHandlerMtAdaptor));
 }
diff --git a/src/ossim/imaging/ossimImageHandlerFactoryBase.cpp b/src/ossim/imaging/ossimImageHandlerFactoryBase.cpp
index 41f996b..fb20788 100644
--- a/src/ossim/imaging/ossimImageHandlerFactoryBase.cpp
+++ b/src/ossim/imaging/ossimImageHandlerFactoryBase.cpp
@@ -5,7 +5,7 @@
 // Author:  Garrett Potts (gpotts at imagelinks.com)
 //
 //*******************************************************************
-//  $Id: ossimImageHandlerFactoryBase.cpp 18011 2010-08-31 12:48:56Z dburken $
+//  $Id: ossimImageHandlerFactoryBase.cpp 22228 2013-04-12 14:11:45Z dburken $
 #include <ossim/imaging/ossimImageHandlerFactoryBase.h>
 
 RTTI_DEF1(ossimImageHandlerFactoryBase, "ossimImageHandlerFactoryBase", ossimObjectFactory);
@@ -19,3 +19,9 @@ void ossimImageHandlerFactoryBase::getImageHandlersByMimeType(ImageHandlerList&
                                                               const ossimString& /*mimeType*/)const
 {
 }
+
+ossimRefPtr<ossimImageHandler> ossimImageHandlerFactoryBase::openOverview(
+   const ossimFilename& file ) const
+{
+   return ossimRefPtr<ossimImageHandler>(0);
+}
diff --git a/src/ossim/imaging/ossimImageHandlerRegistry.cpp b/src/ossim/imaging/ossimImageHandlerRegistry.cpp
index 85cea8c..c1a15a8 100644
--- a/src/ossim/imaging/ossimImageHandlerRegistry.cpp
+++ b/src/ossim/imaging/ossimImageHandlerRegistry.cpp
@@ -9,15 +9,16 @@
 // Contains class definition for ImageHandlerRegistry.
 //
 //*******************************************************************
-//  $Id: ossimImageHandlerRegistry.cpp 18964 2011-02-25 18:59:50Z gpotts $
-#include <algorithm>
+//  $Id: ossimImageHandlerRegistry.cpp 22228 2013-04-12 14:11:45Z dburken $
+
 #include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageHandlerFactory.h>
-#include <ossim/imaging/ossimImageHandlerFactoryBase.h>
 #include <ossim/base/ossimFilename.h>
-#include <ossim/imaging/ossimImageHandler.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>
 using namespace std;
 
 RTTI_DEF1(ossimImageHandlerRegistry, "ossimImageHandlerRegistry", ossimObjectFactory);
@@ -54,16 +55,18 @@ ossimObject* ossimImageHandlerRegistry::createObject(const ossimKeywordlist& kwl
    return result;
 }
 
-ossimRefPtr<ossimImageHandler> ossimImageHandlerRegistry::openBySuffix(const ossimFilename& file)const
+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 = handlers.size();
+   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];
@@ -95,8 +98,8 @@ void ossimImageHandlerRegistry::getImageHandlersBySuffix(ossimImageHandlerFactor
    }
 }
 
-void ossimImageHandlerRegistry::getImageHandlersByMimeType(ossimImageHandlerFactoryBase::ImageHandlerList& result,
-                                                           const ossimString& mimeType)const
+void ossimImageHandlerRegistry::getImageHandlersByMimeType(
+   ossimImageHandlerFactoryBase::ImageHandlerList& result, const ossimString& mimeType)const
 {
    vector<ossimImageHandlerFactoryBase*>::const_iterator iter = m_factoryList.begin();
    ossimImageHandlerFactoryBase::ImageHandlerList temp;
@@ -117,7 +120,13 @@ void ossimImageHandlerRegistry::getImageHandlersByMimeType(ossimImageHandlerFact
    }
 }
 
-void ossimImageHandlerRegistry::getSupportedExtensions(ossimImageHandlerFactoryBase::UniqueStringList& extensionList)const
+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();
@@ -131,11 +140,13 @@ void ossimImageHandlerRegistry::getSupportedExtensions(ossimImageHandlerFactoryB
    
 }
 
-ossimImageHandler* ossimImageHandlerRegistry::open(const ossimFilename& fileName, bool trySuffixFirst)const
+ossimImageHandler* ossimImageHandlerRegistry::open(const ossimFilename& fileName,
+                                                   bool trySuffixFirst,
+                                                   bool openOverview)const
 {
    if(trySuffixFirst)
    {
-      ossimRefPtr<ossimImageHandler> h = openBySuffix(fileName);
+      ossimRefPtr<ossimImageHandler> h = openBySuffix(fileName, openOverview);
       if(h.valid())
       {
          return h.release();
@@ -150,7 +161,7 @@ ossimImageHandler* ossimImageHandlerRegistry::open(const ossimFilename& fileName
    factory = m_factoryList.begin();
    while((factory != m_factoryList.end()) && !result)
    {
-      result = (*factory)->open(fileName);
+      result = (*factory)->open(fileName, openOverview);
       ++factory;
    }
    
@@ -162,17 +173,81 @@ ossimImageHandler* ossimImageHandlerRegistry::open(const ossimKeywordlist& kwl,
 {
    ossimImageHandler*                   result = NULL;
    vector<ossimImageHandlerFactoryBase*>::const_iterator factory;
-
+   
    factory = m_factoryList.begin();
    while((factory != m_factoryList.end()) && !result)
    {
-     result = (*factory)->open(kwl, prefix);
-     ++factory;
+      result = (*factory)->open(kwl, prefix);
+      ++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()
diff --git a/src/ossim/imaging/ossimImageHistogramSource.cpp b/src/ossim/imaging/ossimImageHistogramSource.cpp
index 2319904..6bd879d 100644
--- a/src/ossim/imaging/ossimImageHistogramSource.cpp
+++ b/src/ossim/imaging/ossimImageHistogramSource.cpp
@@ -1,14 +1,16 @@
 //*******************************************************************
-  //
-  // License:  See LICENSE.txt file in the top level directory.
-  //
-  // Author: Garrett Potts
-  //
-  //*************************************************************************
-    // $Id: ossimImageHistogramSource.cpp 18916 2011-02-18 20:02:55Z gpotts $
+//
+// License:  See LICENSE.txt file in the top level directory.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimImageHistogramSource.cpp 21631 2012-09-06 18:10:55Z dburken $
+
 #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>
@@ -463,39 +465,27 @@ void ossimImageHistogramSource::computeFastModeHistogram()
 bool ossimImageHistogramSource::loadState(const ossimKeywordlist& kwl,
                                           const char* prefix)
 {
-   ossimHistogramSource::loadState(kwl,
-                                   prefix);  
-	setNumberOfInputs(2);
+   ossimHistogramSource::loadState(kwl, prefix);  
+   setNumberOfInputs(2);
    ossimString rect = kwl.find(prefix, "rect");
+
    if(!rect.empty())
    {
-      std::vector<ossimString> values;
-      
-      rect.split(values, ",");
-      if(values.size() == 4)
-      {
-         ossim_int32 x = ossim::round<int, double>(values[0].trim().toDouble());
-         ossim_int32 y = ossim::round<int, double>(values[1].trim().toDouble());
-         ossim_int32 w = ossim::round<int, double>(values[2].trim().toDouble());
-         ossim_int32 h = ossim::round<int, double>(values[3].trim().toDouble());
-         theAreaOfInterest = ossimIrect(x, 
-                                        y,
-                                        x+w-1,
-                                        y+h-1);
-      }
+      loadState(kwl, prefix);
    }
    else 
    {
-      ossimString newPrefix = ossimString(prefix) + "rect.";
+      ossimString newPrefix = ossimString(prefix) + "area_of_interest.";
       theAreaOfInterest.loadState(kwl, newPrefix);
    }
-	ossimString mode = kwl.find(prefix, "mode");
+   
+   ossimString mode = kwl.find(prefix, "mode");
    mode = mode.downcase();
    if(mode == "normal")
    {
       theComputationMode = OSSIM_HISTO_MODE_NORMAL;
    }
-   else if(mode = "fast")
+   else if(mode == "fast")
    {
       theComputationMode = OSSIM_HISTO_MODE_FAST;
    }
@@ -518,14 +508,11 @@ bool ossimImageHistogramSource::loadState(const ossimKeywordlist& kwl,
 bool ossimImageHistogramSource::saveState(ossimKeywordlist& kwl,
                                           const char* prefix)const
 {
-   bool result = ossimHistogramSource::saveState(kwl,
-                                                 prefix);
-   
+   bool result = ossimHistogramSource::saveState(kwl, prefix);
    if(result)
    {
-      ossimString newPrefix = ossimString(prefix) + "rect.";
+      ossimString newPrefix = ossimString(prefix) + "area_of_interest.";
       theAreaOfInterest.saveState(kwl, newPrefix);
    }
-   
    return result;
 }
diff --git a/src/ossim/imaging/ossimImageMetaData.cpp b/src/ossim/imaging/ossimImageMetaData.cpp
index 1c1fd2d..3132a06 100644
--- a/src/ossim/imaging/ossimImageMetaData.cpp
+++ b/src/ossim/imaging/ossimImageMetaData.cpp
@@ -10,14 +10,18 @@
 // Contains class definition for ossimImageMetaData.
 // 
 //*******************************************************************
-//  $Id: ossimImageMetaData.cpp 16282 2010-01-06 21:23:55Z dburken $
-#include <vector>
-#include <algorithm>
+//  $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");
 
@@ -25,7 +29,11 @@ ossimImageMetaData::ossimImageMetaData()
    :theNullPixelArray(0),
     theMinPixelArray(0),
     theMaxPixelArray(0),
+    theMinValuesValidFlag(false),
+    theMaxValuesValidFlag(false),
+    theNullValuesValidFlag(false),
     theScalarType(OSSIM_SCALAR_UNKNOWN),
+    theBytesPerPixel(0),
     theNumberOfBands(0)
 {
 }
@@ -35,7 +43,11 @@ ossimImageMetaData::ossimImageMetaData(ossimScalarType aType,
    :theNullPixelArray(0),
     theMinPixelArray(0),
     theMaxPixelArray(0),
+    theMinValuesValidFlag(false),
+    theMaxValuesValidFlag(false),
+    theNullValuesValidFlag(false),
     theScalarType(aType),
+    theBytesPerPixel(0),
     theNumberOfBands(numberOfBands)
 {
    if(theNumberOfBands)
@@ -46,40 +58,76 @@ ossimImageMetaData::ossimImageMetaData(ossimScalarType aType,
       
       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)
 {
-   assign(rhs);
+   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);
+   }
 }
 
-ossimImageMetaData::~ossimImageMetaData()
+const ossimImageMetaData& ossimImageMetaData::operator=( const ossimImageMetaData& rhs )
 {
-  clear();
+   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;
 }
 
-void ossimImageMetaData::clear()
+ossimImageMetaData::~ossimImageMetaData()
 {
-   if(theNullPixelArray)
-   {
-      delete [] theNullPixelArray;
-      theNullPixelArray = 0;
-   }
-   if(theMinPixelArray)
-   {
-      delete [] theMinPixelArray;
-      theMinPixelArray = 0;
-   }
-   if(theMaxPixelArray)
-   {
-      delete [] theMaxPixelArray;
-      theMaxPixelArray = 0;
-   }
-   theScalarType    = OSSIM_SCALAR_UNKNOWN;
-   theNumberOfBands = 0;
+  clear();
 }
 
-void ossimImageMetaData::clearBandInfo()
+void ossimImageMetaData::clear()
 {
    if(theNullPixelArray)
    {
@@ -97,6 +145,7 @@ void ossimImageMetaData::clearBandInfo()
       theMaxPixelArray = 0;
    }
    theScalarType    = OSSIM_SCALAR_UNKNOWN;
+   theBytesPerPixel = 0;
    theNumberOfBands = 0;
 }
 
@@ -142,240 +191,54 @@ void ossimImageMetaData::setNumberOfBands(ossim_uint32 numberOfBands)
    }
 }
 
-void ossimImageMetaData::assign(const ossimImageMetaData& rhs)
+bool ossimImageMetaData::loadState(const ossimKeywordlist& kwl, const char* prefix)
 {
-   if(this != &rhs)
-   {
-      clear();
-      theNumberOfBands = rhs.getNumberOfBands();
-      theScalarType    = rhs.getScalarType();
-      
-      if(theNumberOfBands)
-      {
-         theNullPixelArray = new double[theNumberOfBands];
-         theMinPixelArray  = new double[theNumberOfBands];
-         theMaxPixelArray  = new double[theNumberOfBands];
-         
-         std::copy(rhs.getNullPixelArray(),
-                   rhs.getNullPixelArray()+theNumberOfBands,
-                   theNullPixelArray);
-         std::copy(rhs.getMinPixelArray(),
-                   rhs.getMinPixelArray()+theNumberOfBands,
-                   theMinPixelArray);
-         std::copy(rhs.getMaxPixelArray(),
-                   rhs.getMaxPixelArray()+theNumberOfBands,
-                   theMaxPixelArray);
-      }
-   }
-}
-
-bool ossimImageMetaData::loadState(const ossimKeywordlist& kwl,
-				   const char* prefix)
-{
-   static const char MODULE[] = "ossimImageMetaData::loadState";
-
-   if (traceDebug())
-   {
-      CLOG << " Entered..."
-           << "\nkwl:\n" << kwl
-           << "\nprefix:  " << (prefix?prefix:"") << std::endl;
-   }
+   bool result = false; // return status
    
-   bool result = true;
+   // Clear the object:
    clear();
 
-   ossim_int32 scalar =
-      ossimScalarTypeLut::instance()->getEntryNumber(kwl, prefix);
-   if (scalar == ossimLookUpTable::NOT_FOUND)
+   std::string pfx = ( prefix ? prefix : "" );
+   
+   ossim_uint32 bands = getBandCount( kwl, pfx );
+   if ( bands )
    {
-      theScalarType = OSSIM_SCALAR_UNKNOWN;
+      result = true;
 
-      ossimString lookupStr = kwl.find( prefix, "radiometry" );
-      if ( lookupStr.empty() == false )
-      {
-         if ( lookupStr.contains("8-bit") )
-         {
-            theScalarType = OSSIM_UINT8;
-         }
-         else
-         if ( lookupStr.contains("11-bit") )
-         {
-            theScalarType = OSSIM_USHORT11;
-         }
-         else
-         if ( lookupStr.contains("16-bit unsigned") )
-         {
-            theScalarType =  OSSIM_UINT16;
-         }
-         else
-         if ( lookupStr.contains("16-bit signed") )
-         {
-            theScalarType =  OSSIM_SINT16;
-         }
-         else
-         if ( lookupStr.contains("32-bit unsigned") )
-         {
-            theScalarType =  OSSIM_UINT32;
-         }
-         else
-         if ( lookupStr.contains("float") )
-         {
-            theScalarType =  OSSIM_FLOAT32;
-         }
-         else
-         if ( lookupStr.contains("normalized float") )
-         {
-            theScalarType =  OSSIM_FLOAT32;
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE
-               << "\nERROR: Unrecognized pixel scalar type description: " 
-               <<  lookupStr
-               << std::endl;
-         }
-      }
-   }
-   else
-   {
-      theScalarType = static_cast<ossimScalarType>(scalar);
-   }
+      setNumberOfBands( bands );
+      
+      theMinValuesValidFlag  = true;
+      theMaxValuesValidFlag  = true;
+      theNullValuesValidFlag = true;
 
-   const char* kwlLookup =
-      kwl.find(prefix, ossimKeywordNames::NUMBER_BANDS_KW);
-   if (kwlLookup)
-   {
-      theNumberOfBands = ossimString(kwlLookup).toInt();
-      setNumberOfBands(theNumberOfBands);
+      updateMetaData( kwl, pfx ); // Initializes the rest of object.
    }
-  
-   loadBandInfo(kwl, prefix);
-
-   if (traceDebug())
+   else
    {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "\ntheScalarType:  " << theScalarType
-         << "\ntheNumberOfBands: " << theNumberOfBands
-         << "\ntheMinValuesValidFlag: " << theMinValuesValidFlag
-         << "\ntheMaxValuesValidFlag: " << theMaxValuesValidFlag
-         << "\ntheNullValuesValidFlag: " << theNullValuesValidFlag;
-          
-      for (ossim_uint32 band = 0; band < theNumberOfBands; ++band)
+      if (traceDebug())
       {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "\ntheMinValuesValidFlag[" << band << "]: "
-            << theMinPixelArray[band]
-            << "\ntheMaxValuesValidFlag[" << band << "]: "
-            << theMaxPixelArray[band]
-            << "\ntheNullValuesValidFlag[" << band << "]: "
-            << theNullPixelArray[band];
+         ossimNotify(ossimNotifyLevel_WARN)
+            << " ERROR:\n"
+            << "Required keyword not found:  " << ossimKeywordNames::NUMBER_BANDS_KW << std::endl;
       }
-      ossimNotify(ossimNotifyLevel_DEBUG) << std::endl;
    }
    
-
-   if(!theNumberOfBands)
-   {
-      result = false;
-   }
-   return result;
-}
-
-void ossimImageMetaData::loadBandInfo(const ossimKeywordlist& kwl,
-                                      const char* prefix)
-{
-   ossimString copyPrefix;
-   if (prefix)
+   if (traceDebug())
    {
-      copyPrefix = prefix;
+      print( ossimNotify(ossimNotifyLevel_DEBUG) );
    }
-   
-   ossimString regExpression =  ossimString("^(") + copyPrefix + "band[0-9]+.)";
-   std::vector<ossimString> keys =
-      kwl.getSubstringKeyList( regExpression );
-   
-   ossim_uint32 numberOfBands = (ossim_uint32)keys.size();
-
-   theMinValuesValidFlag  = true;
-   theMaxValuesValidFlag  = true;
-   theNullValuesValidFlag = true;
 
-   if(!numberOfBands)
-   {
-      theMinValuesValidFlag  = false;
-      theMaxValuesValidFlag  = false;
-      theNullValuesValidFlag = false;
-      return;
-   }
-   if((!theNumberOfBands)||
-      (theNumberOfBands != numberOfBands))
-   {
-      setNumberOfBands(numberOfBands);
-   }
-   
-   int offset = (int)(copyPrefix+"band").size();
-   int idx = 0;
-   std::vector<int> theNumberList(numberOfBands);
-   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("band");
-      newPrefix += ossimString::toString(theNumberList[idx]);
-      newPrefix += ossimString(".");
-
-      const char* minValue = kwl.find(newPrefix.c_str(),
-                                      ossimKeywordNames::MIN_VALUE_KW);
-      const char* maxValue = kwl.find(newPrefix.c_str(),
-                                      ossimKeywordNames::MAX_VALUE_KW);
-      const char* nullValue = kwl.find(newPrefix.c_str(),
-                                       ossimKeywordNames::NULL_VALUE_KW);
-
-      if(minValue)
-      {
-         theMinPixelArray[idx] = ossimString(minValue).toDouble();
-      }
-      else
-      {
-         theMinValuesValidFlag = false;
-         theMinPixelArray[idx] = ossim::defaultMin(theScalarType);
-      }
-      if(maxValue)
-      {
-         theMaxPixelArray[idx] = ossimString(maxValue).toDouble();
-      }
-      else
-      {
-         theMaxValuesValidFlag = false;
-         theMaxPixelArray[idx] = ossim::defaultMax(theScalarType);
-      }
-      if(nullValue)
-      {
-         theNullPixelArray[idx] = ossimString(nullValue).toDouble();
-      }
-      else
-      {
-         theNullValuesValidFlag = false;
-         theNullPixelArray[idx] = ossim::defaultNull(theScalarType);
-      }
-   }
+   return result;
 }
 
 bool ossimImageMetaData::saveState(ossimKeywordlist& kwl,
 				   const char* prefix)const
 {
-   if(theNullPixelArray&&theMinPixelArray&&theMaxPixelArray)
+   if ( theNumberOfBands )
    {
-      ossim_int32 band = 0;
+      ossim_uint32 band = 0;
       
-      for (band=0; band<(ossim_int32)theNumberOfBands; ++band)
+      for (band=0; band < theNumberOfBands; ++band)
       {
          ossimString kwMin = (ossimKeywordNames::BAND_KW +
                               ossimString::toString(band+1) + "." +
@@ -400,14 +263,17 @@ bool ossimImageMetaData::saveState(ossimKeywordlist& kwl,
                  theNullPixelArray[band],
                  true);
       }
+      // std::cout << "added bands ******************" << std::endl;
       kwl.add(prefix,
 	      ossimKeywordNames::NUMBER_BANDS_KW,
-	      (ossim_int32)theNumberOfBands,
+	      theNumberOfBands,
 	      true);
       kwl.add(prefix,
 	      ossimKeywordNames::SCALAR_TYPE_KW,
 	      (ossimScalarTypeLut::instance()->getEntryString(theScalarType)),
 	      true);
+
+      kwl.add( prefix, "bytes_per_pixel", theBytesPerPixel, true );
    }
    
    return true;
@@ -420,7 +286,8 @@ ossim_uint32 ossimImageMetaData::getNumberOfBands()const
 
 void ossimImageMetaData::setScalarType(ossimScalarType aType)
 {
-   theScalarType = aType;
+   theScalarType    = aType;
+   theBytesPerPixel = ossim::scalarSizeInBytes( aType );
 }
 
 ossimScalarType ossimImageMetaData::getScalarType()const
@@ -428,6 +295,11 @@ 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))
@@ -529,17 +401,135 @@ bool ossimImageMetaData::getNullValuesValidFlag()const
    return theNullValuesValidFlag;
 }
 
-const ossimImageMetaData& ossimImageMetaData::operator=(
-   const ossimImageMetaData& rhs)
-{
-   assign(rhs);
-   
-   return *this;
-}
-
 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/src/ossim/imaging/ossimImageRenderer.cpp b/src/ossim/imaging/ossimImageRenderer.cpp
index a50d02c..fbed875 100644
--- a/src/ossim/imaging/ossimImageRenderer.cpp
+++ b/src/ossim/imaging/ossimImageRenderer.cpp
@@ -7,10 +7,7 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimImageRenderer.cpp 18870 2011-02-04 17:01:09Z gpotts $
-
-#include <iostream>
-using namespace std;
+//  $Id: ossimImageRenderer.cpp 20352 2011-12-12 17:24:52Z dburken $
 
 #include <ossim/imaging/ossimImageRenderer.h>
 #include <ossim/base/ossimDpt.h>
@@ -37,18 +34,17 @@ using namespace std;
 #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 18870 2011-02-04 17:01:09Z gpotts $";
+static const char OSSIM_ID[] = "$Id: ossimImageRenderer.cpp 20352 2011-12-12 17:24:52Z dburken $";
 #endif
 
 static ossimTrace traceDebug("ossimImageRenderer:debug");
 
 RTTI_DEF2(ossimImageRenderer, "ossimImageRenderer", ossimImageSourceFilter, ossimViewInterface);
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::ossimRendererSubRectInfo::splitView(ossimImageViewTransform* transform,
                                                              ossimRendererSubRectInfo& ulRect,
                                                              ossimRendererSubRectInfo& urRect,
@@ -220,9 +216,6 @@ void ossimImageRenderer::ossimRendererSubRectInfo::splitView(ossimImageViewTrans
    llRect.transformViewToImage(transform);
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::ossimRendererSubRectInfo::transformImageToView(ossimImageViewTransform* transform)
 {
    ossimDpt vul;
@@ -245,26 +238,12 @@ void ossimImageRenderer::ossimRendererSubRectInfo::transformImageToView(ossimIma
    
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::ossimRendererSubRectInfo::transformViewToImage(ossimImageViewTransform* transform)
 {
-   
-   
-   ossimDpt nvul = m_Vul;
-   ossimDpt nvur = m_Vur;;
-   ossimDpt nvlr = m_Vlr;
-   ossimDpt nvll = m_Vll;
-
-   transform->viewToImage(nvul,
-                          m_Iul);
-   transform->viewToImage(nvur,
-                          m_Iur);
-   transform->viewToImage(nvlr,
-                          m_Ilr);
-   transform->viewToImage(nvll,
-                          m_Ill);
+   transform->viewToImage(m_Vul, m_Iul);
+   transform->viewToImage(m_Vur, m_Iur);
+   transform->viewToImage(m_Vlr, m_Ilr);
+   transform->viewToImage(m_Vll, m_Ill);
 
    if(imageHasNans())
    {
@@ -278,17 +257,15 @@ void ossimImageRenderer::ossimRendererSubRectInfo::transformViewToImage(ossimIma
       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 + 1)  + (bottomLen+1))*.5;
-//       double averageVert  = ((leftLen+1) + (rightLen+1))*.5;
       double averageHoriz = ((topLen)  + (bottomLen))*.5;
       double averageVert  = ((leftLen) + (rightLen))*.5;
       
-      
       ossimDpt deltaViewP1P2 = m_Vul - m_Vur;
       ossimDpt deltaViewP1P3 = m_Vul - m_Vll;
       
@@ -306,7 +283,6 @@ void ossimImageRenderer::ossimRendererSubRectInfo::transformViewToImage(ossimIma
       if(lengthViewP1P3 > FLT_EPSILON)
       {
          m_ViewToImageScale.y = averageVert/lengthViewP1P3;
-          
       }
       else
       {
@@ -325,9 +301,6 @@ void ossimImageRenderer::ossimRendererSubRectInfo::transformViewToImage(ossimIma
   }
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::ossimRendererSubRectInfo::stretchImageOut(bool enableRound)
 {
    ossimDpt topDelta    = m_Iur - m_Iul;
@@ -358,10 +331,6 @@ void ossimImageRenderer::ossimRendererSubRectInfo::stretchImageOut(bool enableRo
    }
 }
 
-
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 bool ossimImageRenderer::ossimRendererSubRectInfo::isIdentity()const
 {
 //    ossimDpt deltaP1P2 = m_Iul - m_Iur;
@@ -396,9 +365,6 @@ bool ossimImageRenderer::ossimRendererSubRectInfo::isIdentity()const
             (illDelta <= FLT_EPSILON));
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 bool ossimImageRenderer::ossimRendererSubRectInfo::canBilinearInterpolate(ossimImageViewTransform* transform,
 									  double error)const
 {
@@ -494,10 +460,6 @@ bool ossimImageRenderer::ossimRendererSubRectInfo::canBilinearInterpolate(ossimI
 	  
 }
 
-
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::ossimRendererSubRectInfo::getViewMids(ossimDpt& upperMid,
 				     ossimDpt& rightMid,
 				     ossimDpt& bottomMid,
@@ -512,9 +474,6 @@ void ossimImageRenderer::ossimRendererSubRectInfo::getViewMids(ossimDpt& upperMi
   center    = (m_Vul + m_Vur + m_Vlr + m_Vll)*.25;
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::ossimRendererSubRectInfo::getImageMids(ossimDpt& upperMid,
 				      ossimDpt& rightMid,
 				      ossimDpt& bottomMid,
@@ -539,9 +498,6 @@ void ossimImageRenderer::ossimRendererSubRectInfo::getImageMids(ossimDpt& upperM
     }
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 ossimDpt ossimImageRenderer::ossimRendererSubRectInfo::getParametricCenter(const ossimDpt& ul, const ossimDpt& ur, 
 									   const ossimDpt& lr, const ossimDpt& ll)const
 {
@@ -554,19 +510,19 @@ ossimDpt ossimImageRenderer::ossimRendererSubRectInfo::getParametricCenter(const
   return centerBottom + (centerBottom - centerTop)*.5;
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 ossimImageRenderer::ossimImageRenderer()
 :
 ossimImageSourceFilter(),
-ossimViewInterface(NULL),
-m_Resampler(NULL),
-m_BlankTile(NULL),
-m_Tile(NULL),
-m_TemporaryBuffer(NULL),
+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
@@ -574,24 +530,21 @@ m_MaxLevelsToCompute(999999) // something large so it will always compute
     ossimViewInterface::theObject = this;
     m_Resampler = new ossimFilterResampler();
     m_ImageViewTransform = new ossimImageViewProjectionTransform;
-    m_BoundingRect.makeNan();
-    //    m_InputRect.makeNan();
-    //    theOutputRect.makeNan();
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 ossimImageRenderer::ossimImageRenderer(ossimImageSource* inputSource,
                                        ossimImageViewTransform* imageViewTrans)
    : ossimImageSourceFilter(inputSource),
-     ossimViewInterface(NULL),
-     m_Resampler(NULL),
-     m_BlankTile(NULL),
-     m_Tile(NULL),
-     m_TemporaryBuffer(NULL),
+     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
@@ -604,9 +557,6 @@ ossimImageRenderer::ossimImageRenderer(ossimImageSource* inputSource,
    }
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 ossimImageRenderer::~ossimImageRenderer()
 {
   m_ImageViewTransform = 0;
@@ -614,13 +564,10 @@ ossimImageRenderer::~ossimImageRenderer()
    if(m_Resampler)
    {
       delete m_Resampler;
-      m_Resampler = NULL;
+      m_Resampler = 0;
    }
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 ossimRefPtr<ossimImageData> ossimImageRenderer::getTile(
    const  ossimIrect& tileRect,
    ossim_uint32 resLevel)
@@ -637,51 +584,52 @@ ossimRefPtr<ossimImageData> ossimImageRenderer::getTile(
    // long h = tileRect.height();
    // ossimIpt origin = tileRect.ul();
    
-   if(!m_BlankTile.valid() || !m_Tile.valid())
+   if( !m_BlankTile.valid() || !m_Tile.valid() )
    {
       allocate();
-   }
-
-   if(!m_Tile.valid())
-   {
-      if(traceDebug())
+      if ( !m_BlankTile.valid() || !m_Tile.valid() )
       {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageRenderer::getTile tile allocation failure!\n"
-            << endl;
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageRenderer::getTile tile allocation failure!\n"
+               << endl;
+         }
+         return ossimImageSourceFilter::getTile(tileRect, resLevel);
       }
-      return ossimImageSourceFilter::getTile(tileRect, resLevel);
-   }
-
-  if(m_BlankTile.valid())
-   {
-      m_BlankTile->setImageRectangle(tileRect);
    }
 
-  if(!theInputConnection)
+   m_BlankTile->setImageRectangle(tileRect);
+   
+   if(!theInputConnection)
    {
       return m_BlankTile;
    }
    
-  if ( !isSourceEnabled()||(!m_ImageViewTransform.valid())||
+   if ( !isSourceEnabled()||(!m_ImageViewTransform.valid())||
         (!m_ImageViewTransform->isValid()) )
    {
       // This tile source bypassed, return the input tile source.
       return theInputConnection->getTile(tileRect, resLevel);  
    }
 
-   if(m_BoundingViewRect.hasNans())
+   if( m_rectsDirty )
    {
-      m_BoundingViewRect = getBoundingRect();
+      initializeBoundingRects();
+
+      // We can't go on without these...
+      if ( m_rectsDirty )
+      {
+         return m_BlankTile;
+      }
    }
-   if(m_BoundingViewRect.width() < 4 &&
-      m_BoundingViewRect.height() < 4)
+   
+   if(m_viewRect.width() < 4 && m_viewRect.height() < 4)
    {
       return m_BlankTile;
    }
 
-   ossimIrect rect = m_BoundingViewRect;
-   if( !theInputConnection || !rect.intersects(tileRect) )
+   if( !theInputConnection || !m_viewRect.intersects(tileRect) )
    {
       if(traceDebug())
       {
@@ -704,13 +652,13 @@ ossimRefPtr<ossimImageData> ossimImageRenderer::getTile(
  
 #if 1
    // expand a small patch just to alleviate errors in the size of the rect when resampling
-      ossimIrect viewRectClip = tileRect.clipToRect(ossimIrect(m_BoundingViewRect.ul() + ossimIpt(-8,-8),
-                                                               m_BoundingViewRect.lr() + ossimIpt(8,8)));
-  // ossimIrect viewRectClip = tileRect.clipToRect(m_BoundingViewRect);
+      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_BoundingViewRect = " <<  m_BoundingViewRect << std::endl;
+//   std::cout << "m_viewRect = " <<  m_viewRect << std::endl;
    ossimRendererSubRectInfo subRectInfo(viewRectClip.ul(),
                                         viewRectClip.ur(),
                                         viewRectClip.lr(),
@@ -721,12 +669,20 @@ ossimRefPtr<ossimImageData> ossimImageRenderer::getTile(
                                         tileRect.lr(),
                                         tileRect.ll());
 #endif
+
    subRectInfo.transformViewToImage(m_ImageViewTransform.get());
    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 (!m_inputR0Rect.intersects(subRectInfo.getImageRect()))
+   {
+      return m_Tile;
+   }
    
    recursiveResample(m_Tile, subRectInfo, 1);
    
@@ -742,9 +698,6 @@ ossimRefPtr<ossimImageData> ossimImageRenderer::getTile(
    return m_Tile;
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::recursiveResample(ossimRefPtr<ossimImageData> outputData,
                                            const ossimRendererSubRectInfo& rectInfo,
                                            ossim_uint32 level)
@@ -872,9 +825,6 @@ void ossimImageRenderer::recursiveResample(ossimRefPtr<ossimImageData> outputDat
 
 #define RSET_SEARCH_THRESHHOLD 0.1
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::fillTile(ossimRefPtr<ossimImageData> outputData,
                                   const ossimRendererSubRectInfo& rectInfo)
 {
@@ -906,13 +856,13 @@ void ossimImageRenderer::fillTile(ossimRefPtr<ossimImageData> outputData,
    // ESH 02/2009: If requested resLevel is too high, let's lower it to one
    // that is ok.
    //---
-   const ossim_uint32 NUM_LEVELS =
-      theInputConnection->getNumberOfDecimationLevels();
+#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 
@@ -924,6 +874,7 @@ void ossimImageRenderer::fillTile(ossimRefPtr<ossimImageData> outputData,
    double requestScale = 1.0 / (1<<resLevel);
    double closestScale = decimation.hasNans() ? requestScale : decimation.x;
 
+#if 0
    double differenceTest = 0.0;
    if (closestScale != 0.0)
    {
@@ -975,7 +926,7 @@ void ossimImageRenderer::fillTile(ossimRefPtr<ossimImageData> outputData,
          }
       }
    }
-   
+#endif
    ossimDpt nul(rectInfo.m_Iul.x*closestScale,
                 rectInfo.m_Iul.y*closestScale);
    ossimDpt nll(rectInfo.m_Ill.x*closestScale,
@@ -1003,16 +954,14 @@ void ossimImageRenderer::fillTile(ossimRefPtr<ossimImageData> outputData,
    {
       status = data->getDataObjectStatus();
    }
-   if( (status == OSSIM_NULL) ||
-      (status == OSSIM_EMPTY) )
+   if( (status == OSSIM_NULL) || (status == OSSIM_EMPTY) )
    {
       return;
    }
    
-   ossimDrect bounds = m_BoundingRect;
-   
-   bounds = bounds*ossimDpt(closestScale, closestScale);
-   m_Resampler->setBoundingInputRect(bounds);
+   ossimDrect inputRect = m_inputR0Rect;
+   inputRect = inputRect*ossimDpt(closestScale, closestScale);
+   m_Resampler->setBoundingInputRect(inputRect);
    
    double denominatorY = 1.0;
    if(tile_size.y > 2)
@@ -1025,21 +974,18 @@ void ossimImageRenderer::fillTile(ossimRefPtr<ossimImageData> outputData,
    m_Resampler->setScaleFactor(newScale);
    
    m_Resampler->resample(data,
-                          outputData,
-                          vrect,
-                          nul,
-                          nur,
-                          ossimDpt( ( (nll.x - nul.x)/denominatorY ),
+                         outputData,
+                         vrect,
+                         nul,
+                         nur,
+                         ossimDpt( ( (nll.x - nul.x)/denominatorY ),
                                    ( (nll.y - nul.y)/denominatorY ) ),
-                          ossimDpt( ( (nlr.x - nur.x)/denominatorY ),
+                         ossimDpt( ( (nlr.x - nur.x)/denominatorY ),
                                    ( (nlr.y - nur.y)/denominatorY ) ),
-                          tile_size);
+                         tile_size);
    
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 long ossimImageRenderer::computeClosestResLevel(const std::vector<ossimDpt>& decimationFactors,
                                                 double scale)const
 {
@@ -1071,138 +1017,116 @@ long ossimImageRenderer::computeClosestResLevel(const std::vector<ossimDpt>& dec
    return result;
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 ossimIrect ossimImageRenderer::getBoundingRect(ossim_uint32 resLevel)const
 {
-#if 0
-   static const char* MODULE = "ossimImageRenderer::getBoundingRect()";
-   if(traceDebug())
+   //---
+   // 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() )
    {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << "entered..." << endl;
+      rect = m_viewRect;
    }
-#endif
-
-   if ( (isSourceEnabled() == false) && theInputConnection )
+   else if ( theInputConnection )
    {
-      return theInputConnection->getBoundingRect(resLevel);
+      rect = theInputConnection->getBoundingRect(resLevel);
    }
-   
-   if(!m_BoundingViewRect.hasNans())
+   else
    {
-      return m_BoundingViewRect;
+      rect.makeNan();
    }
-   
-   vector<ossimDpt> points(4);
-   
-//   if(!theOutputRect.hasNans()) return theOutputRect;
-   ossimDrect inputRect;
-   ossimIrect outputRect;
-   
-   inputRect.makeNan();
-   outputRect.makeNan();
 
-   if(theInputConnection&&m_ImageViewTransform.valid())
+#if 0 /* Please leave for debug. */
+   if(traceDebug())
    {
-      inputRect = theInputConnection->getBoundingRect(resLevel);
-      
-      if(isSourceEnabled()&&m_ImageViewTransform->isValid())
-      {
-//          inputRect = ossimDrect(inputRect.ul().x,
-//                                 inputRect.ul().y,
-//                                 inputRect.lr().x,
-//                                 inputRect.lr().y); 
-         
-// 	 m_ImageViewTransform->imageToView(inputRect.ul(), points[0]);
-//          m_ImageViewTransform->imageToView(inputRect.ur(), points[1]);
-//          m_ImageViewTransform->imageToView(inputRect.lr(), points[2]);
-//          m_ImageViewTransform->imageToView(inputRect.ll(), points[3]);
-
-         
-         ossimDrect tempRect = m_ImageViewTransform->getImageToViewBounds(inputRect);
-         
-         m_BoundingViewRect = ossimIrect(static_cast<int>(floor(tempRect.ul().x + 0.5)),
-                                          static_cast<int>(floor(tempRect.ul().y + 0.5)),
-                                          static_cast<int>(floor(tempRect.lr().x + 0.5)),
-                                          static_cast<int>(floor(tempRect.lr().y + 0.5)));
-      }
-      else
+      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_inputR0Rect = theInputConnection->getBoundingRect(0);
+   
+      if ( m_ImageViewTransform.valid() && !m_inputR0Rect.hasNans() )
       {
-         m_BoundingViewRect = inputRect;
+         // 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;
+         }
       }
    }
-   
-#if 0
-   if(traceDebug())
+
+   if ( m_rectsDirty )
    {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " bounds  = "
-         << outputRect
-         << "\n w, h    = " << outputRect.width() << ", "
-         << outputRect.height()
-         << endl;
+      m_viewRect.makeNan();
    }
+
+#if 0 /* Please leave for debug. */
+   ossimNotify(ossimNotifyLevel_DEBUG)
+      << "ossimImageRenderer::getBoundingRect(rect, resLevel) debug:\n"
+      << "\ninput rect: " << m_inputR0Rect
+      << "\nview rect:  " << m_viewRect << endl;
 #endif
-   
-   return m_BoundingViewRect;
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::initialize()
 {
    // Call the base class initialize.
    // Note:  This will reset "theInputConnection" if it changed...
    ossimImageSourceFilter::initialize();
 
-   m_BoundingViewRect.makeNan();
-   m_BoundingRect.makeNan();
-
-   if (theInputConnection)
-      m_BoundingRect = theInputConnection->getBoundingRect();
+   deallocate();
 
+   m_rectsDirty = true;
 
-   if (m_Resampler)
+   // we will only do this if we are enabled for this could be expensive
+   if (m_ImageViewTransform.valid() && !m_ImageViewTransform->isValid() && isSourceEnabled())
    {
-      m_Resampler->setBoundingInputRect(m_BoundingRect);
+      checkIVT(); // This can initialize bounding rects and clear dirty flag.
    }
-   
-   m_InputDecimationFactors.clear();
 
-   deallocate();
-   // we will only do this if we are enabled for this could be expensive
-   if (m_ImageViewTransform.valid() && !m_ImageViewTransform->isValid()&&isSourceEnabled())
-      checkIVT();
-//    if (theInputConnection && m_Tile.valid())
-//    {
-//       if ( theInputConnection->getNumberOfOutputBands() !=
-//            m_Tile->getNumberOfBands())
-//       {
-//          //---
-//          // This will wide things slick and force an allocate() call on first
-//          // getTile().
-//          //---
-//          deallocate();
-//       }
-//    }
+   if ( m_rectsDirty )
+   {
+      initializeBoundingRects();
+   }
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::deallocate()
 {
-   m_Tile            = NULL;
-   m_BlankTile       = NULL;
-   m_TemporaryBuffer = NULL;
+   m_Tile            = 0;
+   m_BlankTile       = 0;
+   m_TemporaryBuffer = 0;
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::allocate()
 {
    deallocate();
@@ -1213,13 +1137,9 @@ void ossimImageRenderer::allocate()
       m_BlankTile  = ossimImageDataFactory::instance()->create(this, this);
       
       m_Tile->initialize();
-      m_BoundingRect = theInputConnection->getBoundingRect();
    }
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 bool ossimImageRenderer::saveState(ossimKeywordlist& kwl,
                                    const char* prefix)const
 {
@@ -1241,9 +1161,6 @@ bool ossimImageRenderer::saveState(ossimKeywordlist& kwl,
    return ossimImageSource::saveState(kwl, prefix);
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 bool ossimImageRenderer::loadState(const ossimKeywordlist& kwl,
                                    const char* prefix)
 {
@@ -1260,7 +1177,6 @@ bool ossimImageRenderer::loadState(const ossimKeywordlist& kwl,
    
    ossimString newPrefix = ossimString(prefix) + ossimString("image_view_trans.");
    bool result = ossimImageSourceFilter::loadState(kwl, prefix);
-   m_InputDecimationFactors.clear();
    
    if(m_Resampler)
    {
@@ -1283,62 +1199,54 @@ bool ossimImageRenderer::loadState(const ossimKeywordlist& kwl,
    return result;
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::setImageViewTransform(ossimImageViewTransform* ivt)
 {
    m_ImageViewTransform = ivt;
-   if (!m_ImageViewTransform.valid()|| !m_ImageViewTransform->isValid())
-      checkIVT();
-
-   m_BoundingViewRect.makeNan();
+   
+   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;
-   m_BoundingViewRect.makeNan();
+   bool new_view_set = false;
    if(m_ImageViewTransform.valid())
    {
       new_view_set = m_ImageViewTransform->setView(baseObject);
 
-      getBoundingRect();
+      // If view changes reset the bounding rects.
+      initializeBoundingRects();
    }
-
    return new_view_set;
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 ossimObject* ossimImageRenderer::getView()
 {
    if(m_ImageViewTransform.valid())
    {
       return m_ImageViewTransform->getView();
    }
-   return NULL;
+   return 0;
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 const ossimObject* ossimImageRenderer::getView()const
 {
    if(m_ImageViewTransform.valid())
    {
       return m_ImageViewTransform->getView();
    }
-   return NULL;
+   return 0;
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::getValidImageVertices(vector<ossimIpt>& validVertices,
                                                ossimVertexOrdering ordering,
                                                ossim_uint32 resLevel)const
@@ -1367,10 +1275,10 @@ void ossimImageRenderer::getValidImageVertices(vector<ossimIpt>& validVertices,
    }
 }
 
-//**************************************************************************************************
-// Returns the geometry associated with the image being served out of the renderer. This corresponds
-// To the view geometry defined in theIVT.
-//**************************************************************************************************
+//*************************************************************************************************
+// 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
@@ -1388,9 +1296,6 @@ ossimRefPtr<ossimImageGeometry> ossimImageRenderer::getImageGeometry()
    return ossimRefPtr<ossimImageGeometry>();
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::connectInputEvent(ossimConnectionEvent& /* event */)
 {
    theInputConnection = PTR_CAST(ossimImageSource, getInput(0));
@@ -1399,73 +1304,60 @@ void ossimImageRenderer::connectInputEvent(ossimConnectionEvent& /* event */)
    
    checkIVT();
    initialize();
-   
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::disconnectInputEvent(ossimConnectionEvent& /* event */)
 {
    ossimImageViewProjectionTransform* ivpt = PTR_CAST(ossimImageViewProjectionTransform,
                                                       m_ImageViewTransform.get());
    if(ivpt)
-      ivpt->setImageGeometry(NULL);
+      ivpt->setImageGeometry(0);
    
-   theInputConnection = NULL;
-   m_InputDecimationFactors.clear();
+   theInputConnection = 0;
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::propertyEvent(ossimPropertyEvent& /* event */)
 {
    checkIVT();
    initialize();
 }
 
-
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::setProperty(ossimRefPtr<ossimProperty> property)
 {
-  ossimString tempName = property->getName();
-  
-  if(tempName == "Filter type")
-    {
+   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
-    {
+      {
+         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")
-    {
+   ossimString tempName = name;
+   
+   if((tempName == "Filter type")||
+      (tempName == "filter_type"))
+   {
       std::vector<ossimString> filterNames;
       m_Resampler->getFilterTypes(filterNames);
       
-      ossimStringProperty* stringProp = new ossimStringProperty("Filter type",
+      ossimStringProperty* stringProp = new ossimStringProperty("filter_type",
 								m_Resampler->getMinifyFilterTypeAsString(),
 								false,
 								filterNames);
@@ -1474,25 +1366,22 @@ ossimRefPtr<ossimProperty> ossimImageRenderer::getProperty(const ossimString& na
       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);
+   
+   return ossimImageSourceFilter::getProperty(name);
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::getPropertyNames(std::vector<ossimString>& propertyNames)const
 {
   ossimImageSourceFilter::getPropertyNames(propertyNames);
@@ -1501,13 +1390,11 @@ void ossimImageRenderer::getPropertyNames(std::vector<ossimString>& propertyName
 //  propertyNames.push_back("Blur factor");
 }
 
-
-//**************************************************************************************************
+//*************************************************************************************************
 // Insures that a proper IVT is established.
-//**************************************************************************************************
+//*************************************************************************************************
 void ossimImageRenderer::checkIVT()
 {
-   m_BoundingViewRect.makeNan();
    if(!isSourceEnabled())
       return;
 
@@ -1520,6 +1407,7 @@ void ossimImageRenderer::checkIVT()
    ossimImageViewProjectionTransform* ivpt = 
       PTR_CAST(ossimImageViewProjectionTransform, m_ImageViewTransform.get());
    ossimImageSource* inputSrc = PTR_CAST(ossimImageSource, getInput(0));
+
    if(!ivpt || !inputSrc) 
       return; // nothing to do here yet.
 
@@ -1539,6 +1427,7 @@ void ossimImageRenderer::checkIVT()
          return;
       }
       ivpt->setImageGeometry( inputGeom.get() );
+      m_rectsDirty = true;
    }
 
    // Now check the output view geometry:
@@ -1572,8 +1461,14 @@ void ossimImageRenderer::checkIVT()
          meters.y = GSD;
          if(inputProj)
          {
-            myMapProj->setUlTiePoints(inputProj->origin());
+            //---
+            // 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);
@@ -1581,94 +1476,89 @@ void ossimImageRenderer::checkIVT()
       
       // Set up our IVT with the new output geometry:
       ivpt->setViewGeometry(myOutGeom.get());
-      getBoundingRect();
-      myOutGeom->setImageSize(ossimIpt(m_BoundingViewRect.width(), m_BoundingViewRect.height()));
+
+      // 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())
-    {
+   if(isSourceEnabled())
+   {
       result = ossimDpt(1,1);
-    }
-  else
-    {
+   }
+   else
+   {
       ossimImageSourceFilter::getDecimationFactor(resLevel,
 						  result);
-    }
+   }
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 void ossimImageRenderer::getDecimationFactors(vector<ossimDpt>& decimations)const
 {
-  if(isSourceEnabled())
-    {
+   if(isSourceEnabled())
+   {
       decimations.push_back(ossimDpt(1,1));
-    }
-  else
-    {
+   }
+   else
+   {
       ossimImageSourceFilter::getDecimationFactors(decimations);
-    }
+   }
 }
 
-//**************************************************************************************************
-// 
-//**************************************************************************************************
 ossim_uint32 ossimImageRenderer::getNumberOfDecimationLevels()const
 {
-  if(isSourceEnabled())
-    {
+   if(isSourceEnabled())
+   {
       return 1;
-    }
-
-  return ossimImageSourceFilter::getNumberOfDecimationLevels();
+   }
+   
+   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;
+   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)
 {
@@ -1816,9 +1706,6 @@ ossimRefPtr<ossimImageData>  ossimImageRenderer::getTileAtResLevel(const ossimIr
                }
             }
             ++currentCount;
-            //fireProgressEvent((double)currentCount/
-            //                  (double)totalCount);
-            
          }
       }
       m_TemporaryBuffer->validate();
@@ -1828,62 +1715,53 @@ ossimRefPtr<ossimImageData>  ossimImageRenderer::getTileAtResLevel(const ossimIr
    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())
-    {
+   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)
-    {
+   }
+   
+   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 )
       {
@@ -1894,132 +1772,155 @@ void ossimImageRenderer::resampleTileToDecimation(T /* dummyVariable */,
          offsetY[i] = resultHeight-1;
       }
       offsetY[i] *= resultWidth;
-    }
-  
-  if(tile->getDataObjectStatus() == OSSIM_FULL)
-    {
+   }
+   
+   if(tile->getDataObjectStatus() == OSSIM_FULL)
+   {
       ossim_int32 numberOfBands = (ossim_int32)std::min(result->getNumberOfBands(),
-					    tile->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
-    {
+      {
+         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());
+                                                        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;
-			}
-		    }
-		}
-	    }
-	}
+      {
+         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::enableSource()
+void ossimImageRenderer::refreshEvent(ossimRefreshEvent& event)
 {
-   ossimImageSourceFilter::enableSource();
-   checkIVT();
+   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::fireProgressEvent(double percentComplete)
+void ossimImageRenderer::enableSource()
+{
+   if ( isSourceEnabled() == false )
+   {
+      setEnableFlag( true );
+   }
+}
+
+void ossimImageRenderer::disableSource()
 {
-   ossimProcessProgressEvent event(this, percentComplete);
-   fireEvent(event);
+   if ( isSourceEnabled() )
+   {
+      setEnableFlag( false );
+   }
+}
+
+void ossimImageRenderer::setEnableFlag(bool flag)
+{
+   if ( getEnableFlag() != flag )
+   {
+      ossimImageSourceFilter::setEnableFlag( flag );
+      checkIVT();
+      initialize();
+   }
 }
diff --git a/src/ossim/imaging/ossimImageSource.cpp b/src/ossim/imaging/ossimImageSource.cpp
index 951e689..9a4cc9d 100644
--- a/src/ossim/imaging/ossimImageSource.cpp
+++ b/src/ossim/imaging/ossimImageSource.cpp
@@ -7,10 +7,9 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimImageSource.cpp 17932 2010-08-19 20:34:35Z dburken $
+// $Id: ossimImageSource.cpp 21637 2012-09-06 21:17:57Z dburken $
 
 #include <ossim/imaging/ossimImageSource.h>
-#include <ossim/imaging/ossimImageData.h>
 #include <ossim/base/ossimProperty.h>
 #include <ossim/base/ossimKeywordNames.h>
 
@@ -146,8 +145,7 @@ ossim_uint32 ossimImageSource::getTileWidth()  const
 
 ossim_uint32 ossimImageSource::getTileHeight() const
 {
-   ossimImageSource* inter = PTR_CAST(ossimImageSource,
-                                               getInput(0));
+   ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput(0));
    if(inter)
    {
       return inter->getTileHeight();
@@ -161,8 +159,7 @@ ossim_uint32 ossimImageSource::getTileHeight() const
 
 ossimIrect ossimImageSource::getBoundingRect(ossim_uint32 resLevel)const
 {
-   ossimImageSource* inter = PTR_CAST(ossimImageSource,
-                                      getInput(0));
+   ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput(0));
    if(inter)
    {
       return inter->getBoundingRect(resLevel);
@@ -172,6 +169,11 @@ ossimIrect ossimImageSource::getBoundingRect(ossim_uint32 resLevel)const
    return rect;
 }
 
+void ossimImageSource::getBoundingRect(ossimIrect& rect, ossim_uint32 resLevel) const
+{
+   rect = getBoundingRect( resLevel );
+}
+
 bool ossimImageSource::saveState(ossimKeywordlist& kwl,
                                  const char* prefix)const
 {
@@ -303,11 +305,18 @@ void ossimImageSource::saveImageGeometry(const ossimFilename& geometry_file) con
 
 void ossimImageSource::getOutputBandList(std::vector<ossim_uint32>& bandList) const
 {
-   bandList.clear();
-   const ossim_uint32 BANDS = getNumberOfOutputBands();
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   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.push_back(band);
+      bandList.clear();
    }
 }
 
@@ -346,6 +355,17 @@ void ossimImageSource::getPropertyNames(std::vector<ossimString>& propertyNames)
    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() 
diff --git a/src/ossim/imaging/ossimImageSourceSequencer.cpp b/src/ossim/imaging/ossimImageSourceSequencer.cpp
index debdf1c..d18f9f1 100644
--- a/src/ossim/imaging/ossimImageSourceSequencer.cpp
+++ b/src/ossim/imaging/ossimImageSourceSequencer.cpp
@@ -10,7 +10,7 @@
 // Description:
 //
 //*******************************************************************
-//  $Id: ossimImageSourceSequencer.cpp 19002 2011-03-02 21:02:16Z oscarkramer $
+//  $Id: ossimImageSourceSequencer.cpp 20302 2011-11-29 14:21:12Z dburken $
 #include <ossim/imaging/ossimImageSourceSequencer.h>
 #include <ossim/imaging/ossimImageData.h>
 #include <ossim/base/ossimIrect.h>
@@ -44,7 +44,7 @@ ossimImageSourceSequencer::ossimImageSourceSequencer(ossimImageSource* inputSour
    if(inputSource)
    {
      connectMyInputTo(0, inputSource);
-     initialize();
+     initialize(); // Derived class depends on this initialization to happen now. DO NOT MOVE.
    }
    addListener( (ossimConnectableObjectListener*)this);
 }
@@ -156,7 +156,6 @@ bool ossimImageSourceSequencer::canConnectMyInputTo(ossim_int32 /* inputIndex */
 
 void ossimImageSourceSequencer::connectInputEvent(ossimConnectionEvent& /* event */)
 {
-  theInputConnection = PTR_CAST(ossimImageSource, getInput(0));
   initialize();
 }
 
@@ -255,36 +254,24 @@ ossimRefPtr<ossimImageData> ossimImageSourceSequencer::getTile(
    return 0;
 }
 
-ossimRefPtr<ossimImageData> ossimImageSourceSequencer::getNextTile(
-   ossim_uint32 resLevel)
+ossimRefPtr<ossimImageData> ossimImageSourceSequencer::getNextTile( ossim_uint32 resLevel )
 {
-   if(!theInputConnection)
-   {
-      return NULL;
-   }
-   ossimIpt origin;
-   if(getTileOrigin(theCurrentTileNumber, origin))
+   ossimRefPtr<ossimImageData> result = 0;
+   if ( theInputConnection )
    {
-      ++theCurrentTileNumber;
-
-      ossimIrect tileRect(origin.x,
-			  origin.y,
-			  origin.x + (theTileSize.x - 1),
-			  origin.y + (theTileSize.y - 1));
-      ossimRefPtr<ossimImageData> data = theInputConnection->getTile(tileRect,
-                                                                     resLevel);
-      if(!data.valid()||!data->getBuf())
-	  {	 
-	     theBlankTile->setImageRectangle(tileRect);
-		 	
-         return theBlankTile;
+      ossimIrect tileRect;
+      if ( getTileRect( theCurrentTileNumber, tileRect ) )
+      {
+         ++theCurrentTileNumber;
+         result = theInputConnection->getTile(tileRect, resLevel);
+         if( !result.valid() || !result->getBuf() )
+         {	 
+            theBlankTile->setImageRectangle(tileRect);
+            result = theBlankTile;
+         }
       }
-      
-      return data;
    }
-
-   
-   return ossimRefPtr<ossimImageData>();
+   return result;
 }
 
 ossimRefPtr<ossimImageData> ossimImageSourceSequencer::getTile(
@@ -295,95 +282,84 @@ ossimRefPtr<ossimImageData> ossimImageSourceSequencer::getTile(
    {
       CLOG << "entering.."<<endl;
    }
-   if(!theInputConnection)
-   {
-      if(traceDebug())
-      {
-         CLOG << "No input connection so returing NULL" << endl;
-      }
-      return NULL;
-   }
-   // if we have no tiles try to initialize.
-   if(getNumberOfTiles() == 0)
-   {
-      initialize();
-   }
-   ossimIpt origin;
-   
-   if(getTileOrigin(id, origin))
+
+   ossimRefPtr<ossimImageData> result = 0;
+
+   if(theInputConnection)
    {
-      if(traceDebug())
+      // if we have no tiles try to initialize.
+      if(getNumberOfTiles() == 0)
       {
-         CLOG << "returning tile" << endl;
+         initialize();
       }
-      ossimIrect tRect(origin.x,
-                       origin.y,
-                       origin.x + theTileSize.x - 1,
-                       origin.y + theTileSize.y - 1);
-      
-      ossimRefPtr<ossimImageData> temp = theInputConnection->getTile(tRect,
-                                                                     resLevel);
-
 
-      theBlankTile->setImageRectangle(tRect);
-      
-      if(temp.valid())
+      ossimIrect tileRect;
+      if ( getTileRect( id, tileRect ) )
       {
-         if(!temp->getBuf())
-         {
-            return theBlankTile;
+         result = theInputConnection->getTile(tileRect, resLevel);
+         if( !result.valid() || !result->getBuf() )
+         {	 
+            theBlankTile->setImageRectangle(tileRect);
+            result = theBlankTile;
          }
       }
-      else
+      else // getTileRect failed...
       {
-         return theBlankTile;
+         if(traceDebug())
+         {
+            CLOG << "was not able to get an origin for id = " << id << endl;
+         }
       }
-      return temp;
    }
-   else
+   else // no connection...
    {
       if(traceDebug())
       {
-         CLOG << "was not able to get an origin for id = " << id << endl;
+         CLOG << "No input connection so returing NULL" << endl;
       }
    }
    if(traceDebug())
    {
       CLOG << "leaving.."<<endl;
    }
-   return 0;
+   
+   return result;
 }
 
-
-bool ossimImageSourceSequencer::getTileOrigin(ossim_int32 id,
-                                              ossimIpt& origin)const
+bool ossimImageSourceSequencer::getTileOrigin(ossim_int32 id, ossimIpt& origin) const
 {
-   if(id < 0)
-   {
-      return false;
-   }
-   if((theNumberOfTilesHorizontal > 0)&&
-      (theCurrentTileNumber < getNumberOfTiles()))
+   bool result = false;
+   if( id >= 0 )
    {
-      ossim_int32 y = id/static_cast<ossim_int32>(theNumberOfTilesHorizontal);
-      ossim_int32 x = id%static_cast<ossim_int32>(theNumberOfTilesHorizontal);
-      if((x < static_cast<ossim_int32>(theNumberOfTilesHorizontal)) &&
-         (y < static_cast<ossim_int32>(theNumberOfTilesVertical)))
-      {           
-         origin.x = theAreaOfInterest.ul().x + x*theTileSize.x;
-         origin.y = theAreaOfInterest.ul().y + y*theTileSize.y;
-      }
-      else
+      if( (theNumberOfTilesHorizontal > 0) && (theCurrentTileNumber < getNumberOfTiles()) )
       {
-         return false;
+         ossim_int32 y = id/static_cast<ossim_int32>(theNumberOfTilesHorizontal);
+         ossim_int32 x = id%static_cast<ossim_int32>(theNumberOfTilesHorizontal);
+         if((x < static_cast<ossim_int32>(theNumberOfTilesHorizontal)) &&
+            (y < static_cast<ossim_int32>(theNumberOfTilesVertical)))
+         {           
+            origin.x = theAreaOfInterest.ul().x + x*theTileSize.x;
+            origin.y = theAreaOfInterest.ul().y + y*theTileSize.y;
+            result = true;
+         }
       }
    }
-   else
+   return result;
+}
+
+bool ossimImageSourceSequencer::getTileRect(ossim_uint32 tile_id, ossimIrect& tileRect) const
+{
+   // Fetch tile origin for this tile:
+   ossimIpt origin;
+   bool result = getTileOrigin(tile_id, origin);
+   if ( result )
    {
-      return false;
+      // 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 true;
+   return result;
 }
 
 double ossimImageSourceSequencer::getNullPixelValue(ossim_uint32 band)const
diff --git a/src/ossim/imaging/ossimImageStatisticsSource.cpp b/src/ossim/imaging/ossimImageStatisticsSource.cpp
index 631f564..1e9c916 100644
--- a/src/ossim/imaging/ossimImageStatisticsSource.cpp
+++ b/src/ossim/imaging/ossimImageStatisticsSource.cpp
@@ -8,10 +8,10 @@
 //
 //*************************************************************************
 #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,
@@ -96,42 +96,42 @@ void ossimImageStatisticsSource::computeStatisticsTemplate(T /* dummyVariable */
       
       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;
-				  }
-			  }
-		  }
+         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;
+               }
+            }
+         }
       }
    }
    
diff --git a/src/ossim/imaging/ossimImageToPlaneNormalFilter.cpp b/src/ossim/imaging/ossimImageToPlaneNormalFilter.cpp
index ce4fea7..2e74e81 100644
--- a/src/ossim/imaging/ossimImageToPlaneNormalFilter.cpp
+++ b/src/ossim/imaging/ossimImageToPlaneNormalFilter.cpp
@@ -8,9 +8,10 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimImageToPlaneNormalFilter.cpp 19198 2011-03-23 16:23:06Z dburken $
+// $Id: ossimImageToPlaneNormalFilter.cpp 21631 2012-09-06 18:10:55Z 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>
@@ -47,7 +48,6 @@ ossimRefPtr<ossimImageData> ossimImageToPlaneNormalFilter::getTile(
    const ossimIrect& tileRect,
    ossim_uint32 resLevel)
 {
-
    if(!isSourceEnabled()||!theInputConnection)
    {
       return ossimImageSourceFilter::getTile(tileRect, resLevel);
@@ -64,17 +64,24 @@ ossimRefPtr<ossimImageData> ossimImageToPlaneNormalFilter::getTile(
    }
 
    theTile->setImageRectangle(tileRect);
-   theBlankTile->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;
    }
 
@@ -93,8 +100,7 @@ ossimRefPtr<ossimImageData> ossimImageToPlaneNormalFilter::getTile(
       }
    }
 
-   computeNormals(input,
-                  theTile);
+   computeNormals(input, theTile);
 
    theXScale = oldScaleX;
    theYScale = oldScaleY;
@@ -104,11 +110,24 @@ ossimRefPtr<ossimImageData> ossimImageToPlaneNormalFilter::getTile(
    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();
@@ -380,7 +399,8 @@ double ossimImageToPlaneNormalFilter::getSmoothnessFactor()const
 void ossimImageToPlaneNormalFilter::setProperty(ossimRefPtr<ossimProperty> property)
 {
    ossimString name = property->getName();
-   if(name == "smoothnessFactor")
+   if((name == "smoothnessFactor")||
+      (name == "gain"))
    {
       theSmoothnessFactor = property->valueToString().toDouble();
       initialize();
@@ -408,9 +428,10 @@ void ossimImageToPlaneNormalFilter::setProperty(ossimRefPtr<ossimProperty> prope
 
 ossimRefPtr<ossimProperty> ossimImageToPlaneNormalFilter::getProperty(const ossimString& name)const
 {
-   if(name == "smoothnessFactor")
+   if((name == "smoothnessFactor")||
+      (name == "gain"))
    {
-      ossimNumericProperty* prop = new ossimNumericProperty(name, ossimString::toString(theSmoothnessFactor), .0001, 40);
+      ossimNumericProperty* prop = new ossimNumericProperty("gain", ossimString::toString(theSmoothnessFactor), .0001, 40);
       prop->setCacheRefreshBit();
       return prop;
    }
@@ -439,7 +460,7 @@ ossimRefPtr<ossimProperty> ossimImageToPlaneNormalFilter::getProperty(const ossi
 void ossimImageToPlaneNormalFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
 {
    ossimImageSourceFilter::getPropertyNames(propertyNames);
-   propertyNames.push_back("smoothnessFactor");
+   propertyNames.push_back("gain");
    propertyNames.push_back("xscale");
    propertyNames.push_back("yscale");
    propertyNames.push_back("autoTrackScaleFlag");
diff --git a/src/ossim/imaging/ossimImageWriterFactory.cpp b/src/ossim/imaging/ossimImageWriterFactory.cpp
index dce4d5c..6f491c6 100644
--- a/src/ossim/imaging/ossimImageWriterFactory.cpp
+++ b/src/ossim/imaging/ossimImageWriterFactory.cpp
@@ -8,17 +8,18 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimImageWriterFactory.cpp 18002 2010-08-30 18:01:10Z gpotts $
+// $Id: ossimImageWriterFactory.cpp 22242 2013-04-20 02:16:06Z gpotts $
 
 #include <ossim/imaging/ossimImageWriterFactory.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/base/ossimImageTypeLut.h>
 #include <ossim/base/ossimKeywordNames.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-#include <ossim/imaging/ossimJpegWriter.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/base/ossimImageTypeLut.h>
+#include <ossim/imaging/ossimPdfWriter.h>
+#include <ossim/imaging/ossimTiffWriter.h>
 
 ossimImageWriterFactory* ossimImageWriterFactory::theInstance = (ossimImageWriterFactory*)NULL;
 
@@ -28,8 +29,7 @@ ossimImageWriterFactory* ossimImageWriterFactory::instance()
    if(!theInstance)
    {
       theInstance = new ossimImageWriterFactory;
-      ossimImageWriterFactoryRegistry::instance()->
-         registerFactory(theInstance);
+      ossimImageWriterFactoryRegistry::instance()->registerFactory(theInstance);
    }
 
    return theInstance;
@@ -76,6 +76,10 @@ ossimImageFileWriter *ossimImageWriterFactory::createWriterFromExtension(
    {
       result = new ossimNitfWriter;
    }
+   else if( ext == "pdf" )
+   {
+      result = new ossimPdfWriter;
+   }
    
    return result;
 }
@@ -115,19 +119,19 @@ ossimImageWriterFactory::createWriter(const ossimKeywordlist& kwl,
 ossimImageFileWriter*
 ossimImageWriterFactory::createWriter(const ossimString& typeName)const
 {
-	ossimString mimeType = typeName;
-	mimeType = mimeType.downcase();
+   ossimString mimeType = typeName;
+   mimeType = mimeType.downcase();
 	
    // Check for tiff writer.
    ossimRefPtr<ossimImageFileWriter> writer = createFromMimeType(mimeType);
 	
-	if(writer.valid())
-	{
-		return writer.release();
-	}
+   if(writer.valid())
+   {
+      return writer.release();
+   }
  
    writer = new ossimTiffWriter;
-	
+   
    if (STATIC_TYPE_NAME(ossimTiffWriter) == typeName )
    {
       return writer.release();
@@ -141,7 +145,6 @@ ossimImageWriterFactory::createWriter(const ossimString& typeName)const
          return writer.release();
       }
    }
-   writer = 0;
 
    // Check for jpeg writer.
    writer = new ossimJpegWriter;
@@ -158,7 +161,6 @@ ossimImageWriterFactory::createWriter(const ossimString& typeName)const
          return writer.release();
       }
    }
-	writer = 0; // not a jpeg writer
 	
    // Check for general raster writer.
    writer = new ossimGeneralRasterWriter;
@@ -175,7 +177,6 @@ ossimImageWriterFactory::createWriter(const ossimString& typeName)const
          return writer.release();
       }
    }
-   writer = 0; // Not a general raster writer.   
 
    // Check for nitf writer.
    writer = new ossimNitfWriter;
@@ -192,7 +193,7 @@ ossimImageWriterFactory::createWriter(const ossimString& typeName)const
          return writer.release();
       }
    }
-   writer = 0; // Not a nitf writer.   
+
    // Check for nitf writer.
    writer = new ossimNitf20Writer;
    if ( writer->getClassName() == typeName )
@@ -208,44 +209,68 @@ ossimImageWriterFactory::createWriter(const ossimString& typeName)const
          return writer.release();
       }
    }
-   writer = 0; // Not a nitf writer.   
+
+   // 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
+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;
-	}
-	return 0;
+   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,
@@ -269,6 +294,7 @@ void ossimImageWriterFactory::getExtensions(std::vector<ossimString>& result)con
    result.push_back("tif");
    result.push_back("jpg");
    result.push_back("ntf");
+   result.push_back("pdf");
 }
 
 void ossimImageWriterFactory::getTypeNameList(std::vector<ossimString>& typeList)const
@@ -278,10 +304,11 @@ void ossimImageWriterFactory::getTypeNameList(std::vector<ossimString>& typeList
    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
+void ossimImageWriterFactory::getImageFileWritersBySuffix(
+   ossimImageWriterFactoryBase::ImageFileWriterList& result, const ossimString& ext)const
 {
    ossimString testExt = ext.downcase();
    if(testExt == "tiff" || testExt == "tif")
@@ -300,10 +327,14 @@ void ossimImageWriterFactory::getImageFileWritersBySuffix(ossimImageWriterFactor
    {
       result.push_back(new ossimGeneralRasterWriter);
    }
+   else if( testExt == "pdf" )
+   {
+      result.push_back( new ossimPdfWriter );
+   }
 }
 
-void ossimImageWriterFactory::getImageFileWritersByMimeType(ossimImageWriterFactoryBase::ImageFileWriterList& result,
-                                                            const ossimString& mimeType)const
+void ossimImageWriterFactory::getImageFileWritersByMimeType(
+   ossimImageWriterFactoryBase::ImageFileWriterList& result, const ossimString& mimeType ) const
 {
    ossimString testExt = mimeType.downcase();
    testExt = ossimString(testExt.begin()+6, testExt.end());
@@ -311,7 +342,7 @@ void ossimImageWriterFactory::getImageFileWritersByMimeType(ossimImageWriterFact
    getImageFileWritersBySuffix(result, testExt);
 }
 
-void ossimImageWriterFactory::getImageTypeList(std::vector<ossimString>& imageTypeList)const
+void ossimImageWriterFactory::getImageTypeList( std::vector<ossimString>& imageTypeList ) const
 {
    // Add the tiff writer types.
    ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter;
@@ -328,9 +359,14 @@ void ossimImageWriterFactory::getImageTypeList(std::vector<ossimString>& imageTy
    // 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/src/ossim/imaging/ossimImageWriterFactoryRegistry.cpp b/src/ossim/imaging/ossimImageWriterFactoryRegistry.cpp
index 2f86eab..39dfb71 100644
--- a/src/ossim/imaging/ossimImageWriterFactoryRegistry.cpp
+++ b/src/ossim/imaging/ossimImageWriterFactoryRegistry.cpp
@@ -8,16 +8,18 @@
 // Author: Frank Warmerdam (warmerda at home.com)
 //
 //*******************************************************************
-//  $Id: ossimImageWriterFactoryRegistry.cpp 18966 2011-02-25 19:39:58Z gpotts $
-#include <algorithm>
-#include <iterator>
-#include <ostream>
+//  $Id: ossimImageWriterFactoryRegistry.cpp 19907 2011-08-05 19:55:46Z 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;
 
@@ -49,6 +51,22 @@ ossimImageFileWriter* ossimImageWriterFactoryRegistry::createWriter(const ossimF
    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;
diff --git a/src/ossim/imaging/ossimJpegMemDest.cpp b/src/ossim/imaging/ossimJpegMemDest.cpp
new file mode 100644
index 0000000..58c6e8c
--- /dev/null
+++ b/src/ossim/imaging/ossimJpegMemDest.cpp
@@ -0,0 +1,76 @@
+//----------------------------------------------------------------------------
+//
+// 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/src/ossim/imaging/ossimJpegTileSource.cpp b/src/ossim/imaging/ossimJpegTileSource.cpp
index 07da1a9..07c928a 100644
--- a/src/ossim/imaging/ossimJpegTileSource.cpp
+++ b/src/ossim/imaging/ossimJpegTileSource.cpp
@@ -8,7 +8,7 @@
 //
 // Contains class definition for JpegTileSource.
 //*******************************************************************
-//  $Id: ossimJpegTileSource.cpp 18145 2010-09-27 14:22:32Z dburken $
+//  $Id: ossimJpegTileSource.cpp 22117 2013-01-18 21:04:23Z dburken $
 
 #if defined(__BORLANDC__)
 #  include <iostream>
@@ -25,20 +25,27 @@ extern "C"
 }
 
 #include <ossim/imaging/ossimJpegTileSource.h>
-#include <ossim/imaging/ossimJpegStdIOSrc.h>
-#include <ossim/imaging/ossimTiffTileSource.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
 #include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimContainerProperty.h>
 #include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimDrect.h>
 #include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimIrect.h>
 #include <ossim/base/ossimKeywordlist.h>
-#include <ossim/imaging/ossimU8ImageData.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimNotify.h>
 #include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimJpegStdIOSrc.h>
+#include <ossim/imaging/ossimTiffTileSource.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageGeometryRegistry.h>
+#include <ossim/imaging/ossimU8ImageData.h>
+#include <ossim/projection/ossimBilinearProjection.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/support_data/ossimXmpInfo.h>
+
 //---
 // Using windows .NET compiler there is a conflict in the libjpeg with INT32
 // in the file jmorecfg.h.  Defining XMD_H fixes this.
@@ -89,10 +96,10 @@ ossimJpegTileSource::ossimJpegTileSource()
 }
 
 //*******************************************************************
-  // Public Constructor:
-  //*******************************************************************
-  ossimJpegTileSource::ossimJpegTileSource(const ossimKeywordlist& kwl,
-                                           const char* prefix)
+// Public Constructor:
+//*******************************************************************
+ossimJpegTileSource::ossimJpegTileSource(const ossimKeywordlist& kwl,
+                                         const char* prefix)
    :
       ossimImageHandler(),
       theTile(0),
@@ -444,7 +451,6 @@ void ossimJpegTileSource::close()
    destroy();
 }
 
-
 //*******************************************************************
 // Public method:
 //*******************************************************************
@@ -692,3 +698,58 @@ void ossimJpegTileSource::restart()
 
    jpeg_start_decompress(&thePrivateData->theCinfo);
 }
+
+ossimRefPtr<ossimImageGeometry> ossimJpegTileSource::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> ossimJpegTileSource::getInternalImageGeometry() const
+{
+   ossimRefPtr<ossimImageGeometry> geom = new ossimImageGeometry();
+
+   // See if we can pull a projection from the XMP APP1 XML block if present:
+   ossimXmpInfo info;
+   if ( info.open( getFilename() ) )
+   {
+      ossimDrect imageRect = getImageRectangle( 0 );
+      ossimRefPtr<ossimProjection> proj = info.getProjection( imageRect );
+      if ( proj.valid() )
+      {
+         geom->setProjection( proj.get() );
+      }
+   }
+
+   return geom;
+}
diff --git a/src/ossim/imaging/ossimJpegWriter.cpp b/src/ossim/imaging/ossimJpegWriter.cpp
index a8c772e..c32cf21 100644
--- a/src/ossim/imaging/ossimJpegWriter.cpp
+++ b/src/ossim/imaging/ossimJpegWriter.cpp
@@ -5,7 +5,7 @@
 // Author:  David Burken
 //
 //*******************************************************************
-//  $Id: ossimJpegWriter.cpp 17815 2010-08-03 13:23:14Z dburken $
+//  $Id: ossimJpegWriter.cpp 21184 2012-06-29 15:13:09Z dburken $
 
 #include <cstdlib>
 #include <cstdio>
@@ -196,8 +196,6 @@ bool ossimJpegWriter::writeFile()
       long maxY = (long)theInputConnection->getNumberOfTilesVertical();
       long maxX = (long)theInputConnection->getNumberOfTilesHorizontal();
       
-      ossimProcessInterface::ossimProcessStatus processStatus = getProcessStatus();
-      
       double tileCount = 0.0;
       double totalTiles = theInputConnection->getNumberOfTiles();
       //
@@ -274,7 +272,6 @@ bool ossimJpegWriter::writeFile()
                << "lines_to_copy:  " << lines_to_copy << endl;
          }
          
-         processStatus = getProcessStatus();
          if(!needsAborting())
          {
             // Now copy the buffer that should be full to the jpeg file.
diff --git a/src/ossim/imaging/ossimLandsatTileSource.cpp b/src/ossim/imaging/ossimLandsatTileSource.cpp
index 36057dd..c633604 100644
--- a/src/ossim/imaging/ossimLandsatTileSource.cpp
+++ b/src/ossim/imaging/ossimLandsatTileSource.cpp
@@ -9,7 +9,7 @@
 // Contains class implementaiton for the class "ossim LandsatTileSource".
 //
 //*******************************************************************
-//  $Id: ossimLandsatTileSource.cpp 17932 2010-08-19 20:34:35Z dburken $
+//  $Id: ossimLandsatTileSource.cpp 21512 2012-08-22 11:53:57Z dburken $
 
 #include <ossim/imaging/ossimLandsatTileSource.h>
 #include <ossim/base/ossimDirectory.h>
@@ -180,7 +180,7 @@ bool ossimLandsatTileSource::open()
    theMetaData.clear();
    theMetaData.setScalarType(OSSIM_UINT8);
    theMetaData.setNumberOfBands((ossim_uint32)fileList.size());   
-   theImageData = generalRasterInfo;
+   m_rasterInfo = generalRasterInfo;
    if(initializeHandler())
    {
       theImageFile = tempFilename;
diff --git a/src/ossim/imaging/ossimLandsatTopoCorrectionFilter.cpp b/src/ossim/imaging/ossimLandsatTopoCorrectionFilter.cpp
index b62ff6b..9fe6a40 100644
--- a/src/ossim/imaging/ossimLandsatTopoCorrectionFilter.cpp
+++ b/src/ossim/imaging/ossimLandsatTopoCorrectionFilter.cpp
@@ -8,7 +8,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimLandsatTopoCorrectionFilter.cpp 15766 2009-10-20 12:37:09Z gpotts $
+// $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>
@@ -17,7 +17,7 @@
 #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);
@@ -77,21 +77,20 @@ ossimFilename ossimLandsatTopoCorrectionFilter::findLandsatHeader()
    {
       return result;
    }
-   ossimConnectableObject::ConnectableObjectList handlerList;
 
-   getInput(0)->findAllInputsOfType(handlerList,
-                                    STATIC_TYPE_INFO(ossimImageHandler),
-                                    true,
-                                    true);
+   ossimTypeNameVisitor visitor(ossimString("ossimImageHandler"),
+                                true,
+                                ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS);
+   getInput(0)->accept(visitor);
    
-   ossimImageHandler* handler = NULL;
-
-   if(handlerList.size())
+   // If there are multiple image handlers, e.g. a mosaic do not uses.
+   ossimRefPtr<ossimImageHandler> handler = 0;   
+   if ( visitor.getObjects().size() == 1 )
    {
-      handler = (ossimImageHandler*)handlerList[0].get();
+      handler = visitor.getObjectAs<ossimImageHandler>( 0 );
    }
 
-   if(handler)
+   if( handler.valid() )
    {
       ossimFilename imageFile = handler->getFilename();
       imageFile.setExtension("fst");
diff --git a/src/ossim/imaging/ossimMapCompositionSource.cpp b/src/ossim/imaging/ossimMapCompositionSource.cpp
index b4b9c7c..4b08e56 100644
--- a/src/ossim/imaging/ossimMapCompositionSource.cpp
+++ b/src/ossim/imaging/ossimMapCompositionSource.cpp
@@ -8,7 +8,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimMapCompositionSource.cpp 17932 2010-08-19 20:34:35Z dburken $
+// $Id: ossimMapCompositionSource.cpp 21631 2012-09-06 18:10:55Z dburken $
 
 #include <ossim/imaging/ossimMapCompositionSource.h>
 #include <ossim/imaging/ossimU8ImageData.h>
@@ -17,6 +17,7 @@
 #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>
diff --git a/src/ossim/imaging/ossimMaskFilter.cpp b/src/ossim/imaging/ossimMaskFilter.cpp
index d9c88cc..f91ede6 100644
--- a/src/ossim/imaging/ossimMaskFilter.cpp
+++ b/src/ossim/imaging/ossimMaskFilter.cpp
@@ -10,7 +10,7 @@
 // Description: Class definition for ossimMaskFilter.
 //
 //*************************************************************************
-// $Id: ossimMaskFilter.cpp 18653 2011-01-10 13:31:40Z dburken $
+// $Id: ossimMaskFilter.cpp 20409 2011-12-22 16:57:05Z dburken $
 
 #include <ossim/imaging/ossimMaskFilter.h>
 #include <ossim/imaging/ossimImageData.h>
@@ -23,85 +23,47 @@
 
 static const char * MASK_FILTER_MASK_TYPE_KW = "mask_type";
 
-RTTI_DEF1(ossimMaskFilter, "ossimMaskFilter", ossimImageCombiner);
+RTTI_DEF1(ossimMaskFilter, "ossimMaskFilter", ossimImageSource);
 
 ossimMaskFilter::ossimMaskFilter(ossimObject* owner)
-  :ossimImageCombiner(owner,
-                      2,
-                      0,
-                      true,
-                      false),
+   :
+   ossimImageSource(owner, 1, 1, true, false),
    theMaskType(OSSIM_MASK_TYPE_SELECT),
    theTile(0)
 {
 }
 
-ossimMaskFilter::ossimMaskFilter(ossimImageSource* imageSource,
-				 ossimImageSource* maskSource)
-  :ossimImageCombiner(0,
-                      2,
-                      0,
-                      true,
-                      false),
-   theMaskType(OSSIM_MASK_TYPE_SELECT),
-   theTile(0)
-{
-  connectMyInputTo(0, imageSource);
-  connectMyInputTo(1, maskSource);
-} 
-
-ossimMaskFilter::ossimMaskFilter(ossimObject* owner,
-				 ossimImageSource* imageSource,
-				 ossimImageSource* maskSource)
-  :ossimImageCombiner(owner,
-                      2,
-                      0,
-                      true,
-                      false),
-   theMaskType(OSSIM_MASK_TYPE_SELECT),
-   theTile(0)
-
+ossimMaskFilter::~ossimMaskFilter()
 {
-  connectMyInputTo(0, imageSource);
-  connectMyInputTo(1, maskSource);
 }
 
-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));
-   
-   // we will check to see if it's a fileMaskSource
-   //
-   ossimImageSource* maskSource = PTR_CAST(ossimImageSource, getInput(1));
-   
-   ossimRefPtr<ossimImageData> imageSourceData;
-   ossimRefPtr<ossimImageData> maskSourceData;
-   
-   if(imageSource)
+   if (!imageSource || !theMaskSource.valid())
    {
-      imageSourceData = imageSource->getTile(rect, resLevel);
+      ossimRefPtr<ossimImageData>();
+      return theTile;
    }
 
+   ossimRefPtr<ossimImageData> imageSourceData;
+   ossimRefPtr<ossimImageData> maskSourceData;
+   
+   imageSourceData = imageSource->getTile(rect, resLevel);
    if(!isSourceEnabled())
-   {
       return imageSourceData;
-   }
    
-   if(maskSource)
-   {
-      maskSourceData = maskSource->getTile(rect, resLevel);
-   }
-
    if (!theTile.valid())
-   {
       allocate();
-   }
 
+   maskSourceData = theMaskSource->getTile(rect, resLevel);
    if(!imageSourceData.valid() || !theTile.valid())
    {
       return ossimRefPtr<ossimImageData>();
@@ -138,7 +100,6 @@ bool ossimMaskFilter::canConnectMyInputTo(ossim_int32 /* index */,
 
 void ossimMaskFilter::initialize()
 {
-   ossimImageCombiner::initialize();
    if(getInput(0))
    {
       // Force an allocate on the next getTile.
@@ -148,7 +109,7 @@ void ossimMaskFilter::initialize()
 
 void ossimMaskFilter::allocate()
 {
-   if(getInput(0))
+   if(getInput())
    {
       theTile = ossimImageDataFactory::instance()->create(this, this);
       theTile->initialize();
@@ -188,6 +149,7 @@ ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilter(
    switch(theMaskType)
    {
       case OSSIM_MASK_TYPE_SELECT:
+      case OSSIM_MASK_TYPE_SELECT_CLAMP_MIN:
       {
          return executeMaskFilterSelect(theTile, maskSourceData);
       }
@@ -209,8 +171,9 @@ ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilter(
    return imageSourceData;
 }
 
-ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterSelect(ossimRefPtr<ossimImageData> imageSourceData,
-                                                                     ossimRefPtr<ossimImageData> maskSourceData)
+ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterSelect(
+   ossimRefPtr<ossimImageData> imageSourceData,
+   ossimRefPtr<ossimImageData> maskSourceData)
 {
    if(maskSourceData->getScalarType() != OSSIM_UCHAR)
    {
@@ -466,32 +429,36 @@ ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterBinary(
 }
 
 template <class inputT, class maskT>
-ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterSelection(inputT /* dummyInput */,
-                                                                        maskT  /* dummyMask */,
-                                                            ossimRefPtr<ossimImageData> imageSourceData,
-                                                            ossimRefPtr<ossimImageData> maskSourceData)
+ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterSelection(
+   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))
+   // First just check if mask is full, which means pass the image source along untouched:
+   if (maskDataStatus == OSSIM_FULL)
    {
-      theTile->makeBlank();
+      theTile = imageSourceData;
       return theTile;
-      
    }
-   if( (inputDataStatus == OSSIM_NULL)||
-       (inputDataStatus == OSSIM_EMPTY)||
-       (maskDataStatus == OSSIM_FULL))
+
+   // 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;
    }
-   if(maskDataStatus == OSSIM_FULL)
+
+   // 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)
@@ -499,20 +466,32 @@ ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterSelection(inputT /
       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);
+         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)
             {
-               *bufOut = *bufIn;
+               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 = np;
+               *bufOut = nullPix;
             }
             ++bufOut;
             ++bufIn;
@@ -535,24 +514,27 @@ ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterInvertSelection(
    ossimDataObjectStatus maskDataStatus  = maskSourceData->getDataObjectStatus();
    ossimDataObjectStatus inputDataStatus = imageSourceData->getDataObjectStatus();
 
-   if((maskDataStatus == OSSIM_NULL) ||
-      (maskDataStatus == OSSIM_EMPTY))
+   // 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;
    }
-   if( (inputDataStatus == OSSIM_NULL)||
-       (inputDataStatus == OSSIM_EMPTY))
+
+   // 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;
    }
-      
-   if(maskDataStatus == OSSIM_FULL)
+
+   // 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)
@@ -601,7 +583,6 @@ ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterWeighted(
    {
       theTile->makeBlank();
       return theTile;
-      
    }
    if( (inputDataStatus == OSSIM_NULL)||
        (inputDataStatus == OSSIM_EMPTY))
@@ -744,6 +725,10 @@ void ossimMaskFilter::setMaskType(const ossimString& type)
       {
          theMaskType = OSSIM_MASK_TYPE_BINARY_INVERSE;
       }
+      else if(maskType == "select_clamp_min")
+      {
+         theMaskType = OSSIM_MASK_TYPE_SELECT_CLAMP_MIN;
+      } 
    }
 }
 
@@ -783,28 +768,20 @@ ossimString ossimMaskFilter::getMaskTypeString() const
          maskType = "binary_inverse";
          break;
       }
+      case OSSIM_MASK_TYPE_SELECT_CLAMP_MIN:
+      {
+         maskType = "select_clamp_min";
+         break;
+      }
    }
 
    return maskType;
 }
 
-ossimIrect ossimMaskFilter::getBoundingRect(ossim_uint32 resLevel)const
-{
-   ossimIrect result;
-   result.makeNan();
-
-   ossimImageSource* imageSource = PTR_CAST(ossimImageSource, getInput(0));
-   if(imageSource)
-   {
-      result = imageSource->getBoundingRect(resLevel);
-   }
-   return result;
-}
-
 bool ossimMaskFilter::loadState(const ossimKeywordlist& kwl,
                                 const char* prefix)
 {
-   bool result = ossimImageCombiner::loadState(kwl, prefix);
+   bool result = ossimImageSource::loadState(kwl, prefix);
    
    theInputListIsFixedFlag  = true;
    theOutputListIsFixedFlag = false;
@@ -827,7 +804,7 @@ bool ossimMaskFilter::saveState(ossimKeywordlist& kwl,
            getMaskTypeString().c_str(),
            true);
    
-   return ossimImageCombiner::saveState(kwl, prefix);
+   return ossimImageSource::saveState(kwl, prefix);
 }
 
 void ossimMaskFilter::setProperty(ossimRefPtr<ossimProperty> property)
@@ -840,7 +817,7 @@ void ossimMaskFilter::setProperty(ossimRefPtr<ossimProperty> property)
       }
       else
       {
-         ossimImageCombiner::setProperty(property);
+         ossimImageSource::setProperty(property);
       }
    }
 }
@@ -864,138 +841,22 @@ ossimRefPtr<ossimProperty> ossimMaskFilter::getProperty(
    }
    else
    {
-      result = ossimImageCombiner::getProperty(name);
+      result = ossimImageSource::getProperty(name);
    }
    return result;
 }
 
-void ossimMaskFilter::getPropertyNames(
-   std::vector<ossimString>& propertyNames)const
+void ossimMaskFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
 {
-   ossimImageCombiner::getPropertyNames(propertyNames);
+   ossimImageSource::getPropertyNames(propertyNames);
    propertyNames.push_back(MASK_FILTER_MASK_TYPE_KW);
 }
 
-void ossimMaskFilter::getDecimationFactor(ossim_uint32 resLevel,
-                                          ossimDpt& result)const
-{
-   ossimImageSource* input = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(input)
-   {
-      input->getDecimationFactor(resLevel, result);
-   }
-}
-
-void ossimMaskFilter::getDecimationFactors(vector<ossimDpt>& decimations)const
-{
-   ossimImageSource* input = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(input)
-   {
-      input->getDecimationFactors(decimations);
-   }     
-}
-
-ossim_uint32 ossimMaskFilter::getNumberOfDecimationLevels()const
-{
-   ossimImageSource* input = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(input)
-   {
-      return input->getNumberOfDecimationLevels();
-   } 
-   return 0;
-}
-
-ossim_uint32 ossimMaskFilter::getNumberOfOutputBands() const
-{
-   ossimImageSource* input = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(input)
-   {
-      return input->getNumberOfOutputBands();
-   }
-   return 0;
-}
-
-ossimScalarType ossimMaskFilter::getOutputScalarType() const
-{
-   ossimImageSource* input = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(input)
-   {
-      return input->getOutputScalarType();
-   }
-   
-   return OSSIM_SCALAR_UNKNOWN;
-}
-
-void ossimMaskFilter::getValidImageVertices(
-   vector<ossimIpt>& validVertices,
-   ossimVertexOrdering ordering,
-   ossim_uint32 resLevel)const
+ossim_uint32 ossimMaskFilter::getNumberOfInputBands() const
 {
-   ossimImageSource* input = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(input)
-   {
-      input->getValidImageVertices(validVertices, ordering, resLevel);
-   }
-}
-
-ossim_uint32 ossimMaskFilter::getTileWidth() const
-{
-   ossimImageSource* input = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(input)
-   {
-      return input->getTileWidth();
-   }
-   
-   return 0;
-}
-
-ossim_uint32 ossimMaskFilter::getTileHeight() const
-{
-   ossimImageSource* input = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(input)
-   {
-      return input->getTileHeight();
-   }
+   ossimImageSource* img_source = PTR_CAST(ossimImageSource, getInput());
+   if (img_source)
+      return img_source->getNumberOfInputBands();
    return 0;
 }
 
-double ossimMaskFilter::getNullPixelValue(ossim_uint32 band)const
-{
-   ossimImageSource* input = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(input)
-   {
-      return input->getNullPixelValue(band);
-   }
-   return 0;
-}
-
-double ossimMaskFilter::getMinPixelValue(ossim_uint32 band)const
-{
-   ossimImageSource* input = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(input)
-   {
-      return input->getMinPixelValue(band);
-   }
-   return 0;
-}
-
-double ossimMaskFilter::getMaxPixelValue(ossim_uint32 band)const
-{
-   ossimImageSource* input = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(input)
-   {
-      return input->getMaxPixelValue(band);
-   }
-   return 0;
-}
diff --git a/src/ossim/imaging/ossimMaskTileSource.cpp b/src/ossim/imaging/ossimMaskTileSource.cpp
deleted file mode 100644
index 86159ce..0000000
--- a/src/ossim/imaging/ossimMaskTileSource.cpp
+++ /dev/null
@@ -1,475 +0,0 @@
-//*******************************************************************
-//
-// License:  LGPL
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Mingjie Su
-//
-// Description:
-//
-// Contains class definition for ossimMaskTileSource.
-//*******************************************************************
-//  $Id: ossimMaskTileSource.cpp 1186 2010-07-28 18:57:24Z ming.su $
-
-#include <math.h>
-
-#include <ossim/imaging/ossimMaskTileSource.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorContext.h>
-#include <ossim/base/ossimInterleaveTypeLut.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/imaging/ossimImageDataFactory.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>
-
-RTTI_DEF1_INST(ossimMaskTileSource,
-               "ossimMaskTileSource",
-               ossimImageHandler)
-
-static ossimTrace traceDebug("ossimMaskTileSource:debug");
-
-const ossim_uint32 ossimMaskTileSource::DEFAULT_CHAR_SIZE = 8; 
-
-//*******************************************************************
-// Public Constructor:
-//*******************************************************************
-ossimMaskTileSource::ossimMaskTileSource()
-   :
-      ossimImageHandler(),
-      theTile(NULL),
-      m_numberOfSamples(0),
-      m_numberOfLines(0),
-      m_buffer(NULL),
-      m_bufferSize(0)
-{}
-
-ossimMaskTileSource::~ossimMaskTileSource()
-{
-   close();
-}
-
-ossimRefPtr<ossimImageData> ossimMaskTileSource::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 ossimMaskTileSource::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->ref();  // Increment ref count.
-
-    status = true;
-
-    ossimIrect tile_rect = result->getImageRectangle();     
-
-    if (getImageRectangle().intersects(tile_rect))
-    {
-      if (!tile_rect.completely_within(getImageRectangle()) )
-      {
-        result->makeBlank();
-      }
-
-      fillTile(ossim_uint8(0), tile_rect, result, resLevel);
-    }
-    else // No intersection...
-    {
-      result->makeBlank();
-    }
-
-    result->unref();  // Decrement ref count.
-  }
-
-  return status;
-}
-
-//*******************************************************************
-// Private Method:
-//*******************************************************************
-template <class T>
-void ossimMaskTileSource::fillTile(T, // dummy template variable
-              const ossimIrect& tile_rect, 
-              ossimImageData* tile,
-              ossim_uint32 resLevel)
-{
-  T* destinationBand = static_cast<T*>(tile->getBuf(0));
-
-  ossim_uint32 startRow = tile_rect.ul().y;
-  ossim_uint32 startCol = tile_rect.ul().x;
-
-  ossim_int32  pixelOffset = 0;
-  if (resLevel > 1)
-  {
-    pixelOffset = (ossim_uint32)std::pow(2.0,(ossim_int32)(resLevel -1));
-  }
-
-  ossim_uint32 rowOffset = m_numberOfSamples * startRow + startCol;
-  ossim_uint32 sourceIndex = 0;
-  for (ossim_uint32 line = 0; line < tile_rect.height(); line++)
-  {
-    ossim_uint32 linePos = startRow + line;
-    for (ossim_uint32 sample = 0; sample < tile_rect.width(); sample++)
-    {
-      ossim_uint32 maskIndex = rowOffset + sample;
-      ossim_uint32 samplePos = startCol + sample; 
-      destinationBand[sourceIndex] = getPixelValue(maskIndex, 
-                                                   samplePos,
-                                                   linePos,
-                                                   pixelOffset);
-      sourceIndex++;
-    }
-    rowOffset += m_numberOfSamples;
-  }
-  tile->validate();
-}
-
-ossim_uint32 ossimMaskTileSource::getPixelValue(ossim_uint32 index,
-                                                ossim_uint32 samplePos,
-                                                ossim_uint32 linePos,
-                                                ossim_uint32 pixelOffset)
-{
-  if (m_buffer != NULL)
-  {
-    if (pixelOffset == 0) //means level 1
-    {
-      ossim_uint32 bufferPos = index/DEFAULT_CHAR_SIZE;
-      ossim_uint32 maskPos = index%DEFAULT_CHAR_SIZE;
-      if (bufferPos < m_bufferSize)
-      {
-        char* new_mask = new char[DEFAULT_CHAR_SIZE];
-        ossim_uint32 mask_index = 0;
-
-        new_mask[mask_index++] = (m_buffer[bufferPos] >> 7) & 1;
-        new_mask[mask_index++] = (m_buffer[bufferPos] >> 6) & 1;
-        new_mask[mask_index++] = (m_buffer[bufferPos] >> 5) & 1;
-        new_mask[mask_index++] = (m_buffer[bufferPos] >> 4) & 1;
-        new_mask[mask_index++] = (m_buffer[bufferPos] >> 3) & 1;
-        new_mask[mask_index++] = (m_buffer[bufferPos] >> 2) & 1;
-        new_mask[mask_index++] = (m_buffer[bufferPos] >> 1) & 1;
-        new_mask[mask_index++] = m_buffer[bufferPos] & 1;
-
-        if (new_mask[maskPos])
-        {
-          delete [] new_mask;
-          return 255;
-        }
-        else
-        {
-          delete [] new_mask;
-          return 0;
-        }
-      }
-    }
-    else
-    {
-      ossim_uint32 index = samplePos * pixelOffset + pixelOffset * m_numberOfSamples * linePos;
-      for (ossim_uint32 offset = 0; offset < pixelOffset; offset++)
-      {
-        ossim_uint32 bufferPos = index/DEFAULT_CHAR_SIZE;
-        ossim_uint32 maskPos = index%DEFAULT_CHAR_SIZE;
-        ossim_uint32 endMaskPos = maskPos + pixelOffset;
-        if (endMaskPos > DEFAULT_CHAR_SIZE)//make endMaskPos less than default char size
-        {
-          endMaskPos = DEFAULT_CHAR_SIZE;
-        }
-
-        if (bufferPos < m_bufferSize)
-        {
-          char* new_mask = new char[DEFAULT_CHAR_SIZE];
-          ossim_uint32 mask_index = 0;
-
-          new_mask[mask_index++] = (m_buffer[bufferPos] >> 7) & 1;
-          new_mask[mask_index++] = (m_buffer[bufferPos] >> 6) & 1;
-          new_mask[mask_index++] = (m_buffer[bufferPos] >> 5) & 1;
-          new_mask[mask_index++] = (m_buffer[bufferPos] >> 4) & 1;
-          new_mask[mask_index++] = (m_buffer[bufferPos] >> 3) & 1;
-          new_mask[mask_index++] = (m_buffer[bufferPos] >> 2) & 1;
-          new_mask[mask_index++] = (m_buffer[bufferPos] >> 1) & 1;
-          new_mask[mask_index++] = m_buffer[bufferPos] & 1;
-
-          for (ossim_uint32 pos = maskPos; pos < endMaskPos; pos++)
-          {
-            if (new_mask[pos])
-            {
-              delete [] new_mask;
-              return 255;
-            }
-          }
-          delete [] new_mask;
-          index += m_numberOfSamples;
-        }
-      }
-      return 0;
-    }
-  }
-  return 0;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossimScalarType ossimMaskTileSource::getOutputScalarType() const
-{
-   return ( theTile.valid() ? theTile->getScalarType()
-            : OSSIM_SCALAR_UNKNOWN );
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossim_uint32 ossimMaskTileSource::getTileWidth() const
-{
-   return ( theTile.valid() ? theTile->getWidth() : 0 );
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossim_uint32 ossimMaskTileSource::getTileHeight() const
-{
-   return ( theTile.valid() ? theTile->getHeight() : 0 );
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool
-ossimMaskTileSource::isValidRLevel(ossim_uint32 reduced_res_level) const
-{
-   static const char MODULE[] = "ossimMaskTileSource::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)
-         << endl;
-      return false;
-   }
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossim_uint32
-ossimMaskTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
-{
-   ossim_uint32 result = 0;
-   if (reduced_res_level == 0)
-   {
-     result = m_numberOfLines;
-   }
-   else if (theOverview.valid())
-   {
-     result = theOverview->getNumberOfLines(reduced_res_level);
-   }
-   return result;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossim_uint32 ossimMaskTileSource::getNumberOfSamples(ossim_uint32 reduced_res_level) const
-{
-  ossim_uint32 result = 0;
-  if (reduced_res_level == 0)
-  {
-    result = m_numberOfSamples;
-  }
-  else if (theOverview.valid())
-  {
-    result = theOverview->getNumberOfSamples(reduced_res_level);
-  }
-  return result;
-}
-
-double ossimMaskTileSource::getNullPixelValue(ossim_uint32 /*band*/) const
-{
-   return 0;
-}
-
-double ossimMaskTileSource::getMinPixelValue(ossim_uint32 /*band*/)const
-{
-   return 0;
-}
-
-double ossimMaskTileSource::getMaxPixelValue(ossim_uint32 /*band*/)const
-{
-   return 255;
-}
-
-bool ossimMaskTileSource::open()
-{
-  if (!isSupportedExtension())
-  {
-    close();
-    return false;
-  }
-
-  if(isOpen())
-  {
-    close();
-  }
-
-  static const char MODULE[] = "ossimMaskTileSource::open";
-  
-  if (traceDebug()) CLOG << " Entered..." << endl;
-
-  if (m_numberOfSamples == 0 && m_numberOfLines == 0)
-  {
-    return false;
-  }
-  
-  std::ifstream fileStream(theImageFile.c_str(), ios::in|ios::binary);
-
-  fileStream.seekg(0, std::ifstream::end);
-  m_bufferSize = (ossim_uint32)fileStream.tellg();
-  fileStream.seekg(0);
-
-  m_buffer = new char[m_bufferSize];
-  fileStream.read(m_buffer, m_bufferSize);
-
-  if (fileStream.fail())
-  {
-    ossimNotify(ossimNotifyLevel_FATAL)
-      << MODULE << " ERROR:"
-      << "\nInput file not open:  " << theImageFile.c_str() << std::endl;
-    setErrorStatus();
-    fileStream.close();
-    return false;
-  }
-
-  theTile = ossimImageDataFactory::instance()->create(this, this);
-
-  theTile->initialize();
-
-  completeOpen();
-
-  fileStream.close();
-
-  return true;
-}
-
-bool ossimMaskTileSource::isOpen() const
-{
-   if (m_buffer != NULL)
-   {
-     return true;
-   }
-   return false;
-}
-
-bool ossimMaskTileSource::isSupportedExtension()
-{
-  if (theImageFile.size() > 0)
-  {
-    ossimString ext = theImageFile.ext();
-    if (ext == "mask")
-    {
-      return true;
-    }
-  }
-  return false;
-}
-
-void ossimMaskTileSource::close()
-{
-   ossimImageHandler::close();  // base class
-
-   if (m_buffer != NULL)
-   {
-     delete [] m_buffer;
-   }
-
-   theTile = NULL;
-}
-
-ossim_uint32 ossimMaskTileSource::getImageTileWidth() const
-{
-   return 0;
-}
-
-ossim_uint32 ossimMaskTileSource::getImageTileHeight() const
-{
-   return 0;
-}
-
-ossimString ossimMaskTileSource::getShortName()const
-{
-   return ossimString("mask");
-}
-
-ossimString ossimMaskTileSource::getLongName()const
-{
-   return ossimString("mask reader");
-}
-
-ossim_uint32 ossimMaskTileSource::getNumberOfInputBands() const
-{
-   return 1;
-}
-
-ossim_uint32 ossimMaskTileSource::getNumberOfOutputBands() const
-{
-   return getNumberOfInputBands();
-}
-
-void ossimMaskTileSource::setImageBoundingRect(ossimIrect rect)
-{
-  ossimIpt defaultTileSize;
-  ossim::defaultTileSize(defaultTileSize);
-  ossim_uint32 tileWidth  = static_cast<ossim_uint32>(defaultTileSize.x);
-  ossim_uint32 tileHeight = static_cast<ossim_uint32>(defaultTileSize.y);
-  
-  ossim_uint32 tileWidthCount = rect.width()/tileWidth;
-  ossim_uint32 tileWidthRemain = rect.width()%tileWidth;
-  if (tileWidthRemain > 0)
-  {
-    tileWidthCount = tileWidthCount + 1;
-  }
-  m_numberOfSamples = tileWidth * tileWidthCount;
-
-  ossim_uint32 tileHeightCount = rect.height()/tileHeight;
-  ossim_uint32 tileHeightRemain = rect.height()%tileHeight;
-  if (tileHeightRemain > 0)
-  {
-    tileHeightCount = tileHeightCount + 1;
-  }
-  m_numberOfLines = tileHeight * tileHeightCount;
-}
-
diff --git a/src/ossim/imaging/ossimMaskedImageHandler.cpp b/src/ossim/imaging/ossimMaskedImageHandler.cpp
deleted file mode 100644
index 5ac2d4a..0000000
--- a/src/ossim/imaging/ossimMaskedImageHandler.cpp
+++ /dev/null
@@ -1,352 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Mingjie Su
-//
-// Description:
-//
-// Contains class implementation for the class "ossimMaskedImageHandler".
-//
-//*******************************************************************
-//  $Id: ossimMaskedImageHandler.cpp 1242 2010-08-06 20:37:21Z david.burken $
-
-#include <ossim/imaging/ossimMaskedImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimMaskTileSource.h>
-#include <ossim/base/ossimTrace.h>
-
-RTTI_DEF1(ossimMaskedImageHandler, "ossimMaskedImageHandler", ossimImageHandler);
-
-static ossimTrace traceDebug("ossimMaskedImageHandler:debug");
-
-//*******************************************************************
-// Public Constructor:
-//*******************************************************************
-ossimMaskedImageHandler::ossimMaskedImageHandler()
-   : ossimImageHandler(),
-   m_inputImageSource(0),
-   m_maskImageSource(0),
-   m_maskFilter(0)
-{
-}
-
-//*******************************************************************
-// Destructor:
-//*******************************************************************
-ossimMaskedImageHandler::~ossimMaskedImageHandler()
-{
-  close();
-}
-
-void ossimMaskedImageHandler::close()
-{
-  if (m_maskImageSource.valid())
-  {
-    m_maskImageSource = 0;
-  }
-
-  if (m_maskFilter.valid())
-  {
-    m_maskFilter = 0;
-  }
-}
-
-//*******************************************************************
-// Public Method:
-//*******************************************************************
-bool ossimMaskedImageHandler::open()
-{
-  bool result = false;
-
-  if (!isSupportedExtensions())
-  {
-    return false;
-  }
-
-  if (isOpen())
-  {
-    close();
-  }
- 
-  if (m_inputImageSource != 0)
-  {
-    m_maskImageSource = new ossimMaskTileSource;
-    m_maskImageSource->setFilename(theImageFile);
-    m_maskImageSource->setImageBoundingRect(m_inputImageSource->getImageRectangle(1));
-
-    if (m_maskImageSource->open())
-    {
-      m_maskFilter = new ossimMaskFilter(m_inputImageSource.get(), m_maskImageSource.get());
-      result = true;
-    }
-  }
-  else
-  {
-    result = false;
-  }
-
-  return result;
-}
-
-bool ossimMaskedImageHandler::open(const ossimFilename& imageFile)
-{
-  theImageFile = imageFile;
-  if (theImageFile.exists())
-  {
-    return open();
-  }
-  return false;
-}
-
-bool ossimMaskedImageHandler::isOpen()const
-{
-  if (m_maskFilter != 0 && m_maskImageSource != 0)
-  {
-    return true;
-  }
-  return false;
-}
-
-bool ossimMaskedImageHandler::isSupportedExtensions()
-{
-  ossimString ext = theImageFile.ext();
- 
-  if (ext.downcase() == "mask")
-  {
-    return true;
-  }
-  return false;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool ossimMaskedImageHandler::saveState(ossimKeywordlist& kwl,
-                                       const char* prefix) const
-{
-   if(m_maskFilter != 0)
-   {
-      m_maskFilter->saveState(kwl, prefix);
-   }
-   return ossimImageHandler::saveState(kwl, prefix);
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool ossimMaskedImageHandler::loadState(const ossimKeywordlist& kwl,
-                                       const char* prefix)
-{
-  if (m_maskFilter != 0)
-  {
-    return m_maskFilter->loadState(kwl, prefix);
-  }
-
-  if (ossimImageHandler::loadState(kwl, prefix) )
-  {
-    return open();
-  }
-
-  return false;
-}
-
-ossim_uint32 ossimMaskedImageHandler::getImageTileWidth() const
-{
-  if (m_inputImageSource != 0)
-  {
-     return m_inputImageSource->getImageTileWidth();
-  }
-  return 0;
-}
-
-ossim_uint32 ossimMaskedImageHandler::getImageTileHeight() const
-{
-  if (m_inputImageSource != 0)
-  {
-     return m_inputImageSource->getImageTileHeight();
-  }
-  return 0;
-}
-
-ossimRefPtr<ossimImageGeometry> ossimMaskedImageHandler::getImageGeometry()
-{
-  if (m_inputImageSource != 0)
-  {
-     theGeometry = m_inputImageSource->getImageGeometry();
-  }
-  return theGeometry;  
-}
-
-ossimRefPtr<ossimImageData> ossimMaskedImageHandler::getTile(
-   const ossimIrect& tileRect, ossim_uint32 resLevel)
-{
-   if (resLevel > 0)
-   {
-      return m_maskFilter->getTile(tileRect, resLevel);
-   }
-   return m_inputImageSource->getTile(tileRect, resLevel);
-}
-
-ossim_uint32 ossimMaskedImageHandler::getNumberOfInputBands() const
-{
-  if (m_maskFilter != 0)
-  {
-    return m_maskFilter->getNumberOfOutputBands();
-  }
-  return 0;
-}
-
-ossim_uint32 ossimMaskedImageHandler::getNumberOfOutputBands() const
-{
-  if (m_maskFilter != 0)
-  {
-    return m_maskFilter->getNumberOfOutputBands();
-  }
-  return 0;
-}
-
-ossim_uint32 ossimMaskedImageHandler::getNumberOfLines(ossim_uint32 reduced_res_level) const
-{
-  if (m_maskFilter != 0)
-  {
-    return m_maskFilter->getBoundingRect(reduced_res_level).height();
-  }
-  return 0;
-}
-
-ossim_uint32 ossimMaskedImageHandler::getNumberOfSamples(ossim_uint32 reduced_res_level) const
-{
-  if (m_maskFilter != 0)
-  {
-    return m_maskFilter->getBoundingRect(reduced_res_level).width();
-  }
-  return 0;
-}
-
-ossim_uint32 ossimMaskedImageHandler::getNumberOfDecimationLevels() const
-{
-  if (m_maskFilter != 0)
-  {
-    return m_maskFilter->getNumberOfDecimationLevels();
-  }
-  return 0;
-}
-
-ossimIrect ossimMaskedImageHandler::getImageRectangle(ossim_uint32 reduced_res_level) const
-{
-  if (m_inputImageSource != 0)
-  {
-    return m_inputImageSource->getImageRectangle(reduced_res_level);
-  }
-  return ossimIrect(0,0,0,0);
-}
-
-ossimScalarType ossimMaskedImageHandler::getOutputScalarType() const
-{
-   if (m_maskFilter != 0)
-   {
-      return m_maskFilter->getOutputScalarType();
-   }
-
-   return OSSIM_SCALAR_UNKNOWN;
-}
-
-ossim_uint32 ossimMaskedImageHandler::getTileWidth() const
-{
-  if (m_maskFilter != 0)
-  {
-     return m_maskFilter->getTileWidth();  
-  }
-  return 0;
-}
-
-ossim_uint32 ossimMaskedImageHandler::getTileHeight() const
-{
-  if (m_maskFilter != 0)
-  {
-    return m_maskFilter->getTileHeight();  
-  }
-  return 0;
-}
-
-double ossimMaskedImageHandler::getNullPixelValue(ossim_uint32 band)const
-{
-  if (m_maskFilter != 0)
-  {
-    return m_maskFilter->getNullPixelValue(band);
-  }
-  return 0;
-}
-
-double ossimMaskedImageHandler::getMinPixelValue(ossim_uint32 band)const
-{
-  if (m_maskFilter != 0)
-  {
-    return m_maskFilter->getMinPixelValue(band);
-  }
-  return 0;
-}
-
-double ossimMaskedImageHandler::getMaxPixelValue(ossim_uint32 band)const
-{
-  if (m_maskFilter != 0)
-  {
-    return m_maskFilter->getMaxPixelValue(band);
-  }
-  return 0;
-}
-
-void ossimMaskedImageHandler::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(m_maskFilter != 0)
-   {
-     m_maskFilter->setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimMaskedImageHandler::getProperty(const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> result = 0;
-
-   if(m_maskFilter != 0)
-   {
-     result = m_maskFilter->getProperty(name);
-   }
-   return result;
-}
-
-void ossimMaskedImageHandler::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   if(m_maskFilter != 0)
-   {
-     m_maskFilter->getPropertyNames(propertyNames); 
-   }
-}
-
-void ossimMaskedImageHandler::setInputImageSource(ossimRefPtr<ossimImageHandler> inputImageSource)
-{
-  if (m_inputImageSource.valid())
-  {
-    m_inputImageSource = 0;
-  }
-  m_inputImageSource = inputImageSource;
-}
-
-ossim_uint32 ossimMaskedImageHandler::getCurrentEntry()const
-{
-  if (m_inputImageSource != 0)
-  {
-    return m_inputImageSource->getCurrentEntry();
-  }
-  return 0;
-}
-
-bool ossimMaskedImageHandler::setCurrentEntry(ossim_uint32 entryIdx)
-{
-  if (m_inputImageSource != 0)
-  {
-    return m_inputImageSource->setCurrentEntry(entryIdx);
-  }
-  return false;
-}
diff --git a/src/ossim/imaging/ossimMeanMedianFilter.cpp b/src/ossim/imaging/ossimMeanMedianFilter.cpp
index 5244f6f..f1ced89 100644
--- a/src/ossim/imaging/ossimMeanMedianFilter.cpp
+++ b/src/ossim/imaging/ossimMeanMedianFilter.cpp
@@ -8,17 +8,18 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimMeanMedianFilter.cpp 17206 2010-04-25 23:20:40Z dburken $
+//  $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;
 
-#include <ossim/imaging/ossimMeanMedianFilter.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/base/ossimStringProperty.h>
 
 RTTI_DEF1(ossimMeanMedianFilter,
           "ossimMeanMedianFilter",
diff --git a/src/ossim/imaging/ossimMemoryImageSource.cpp b/src/ossim/imaging/ossimMemoryImageSource.cpp
index 2080477..7ca4de8 100644
--- a/src/ossim/imaging/ossimMemoryImageSource.cpp
+++ b/src/ossim/imaging/ossimMemoryImageSource.cpp
@@ -30,6 +30,7 @@ void ossimMemoryImageSource::setImage(ossimRefPtr<ossimImageData> image)
 	{
 		m_boundingRect.makeNan();
 	}
+   m_result = 0;
 }
 
 void ossimMemoryImageSource::setImage(ossimScalarType scalarType,
@@ -45,6 +46,7 @@ void ossimMemoryImageSource::setImage(ossimScalarType scalarType,
    m_image->initialize();
    
    m_boundingRect = m_image->getImageRectangle();
+   m_result = 0;
 }
 
 void ossimMemoryImageSource::setRect(ossim_uint32 ulx,
@@ -137,8 +139,7 @@ ossimIrect ossimMemoryImageSource::getBoundingRect(ossim_uint32 resLevel)const
 ossimRefPtr<ossimImageData> ossimMemoryImageSource::getTile(const ossimIrect& rect,
                                                             ossim_uint32 /* resLevel */)
 {
-   if(!m_image.valid()) return 0;
-   if(m_boundingRect.hasNans()) return 0;
+   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());
@@ -166,6 +167,7 @@ bool ossimMemoryImageSource::canConnectMyInputTo(ossim_int32 /* myInputIndex */,
    
 void ossimMemoryImageSource::initialize()
 {
+   m_result = 0;
 }
 
 ossim_uint32 ossimMemoryImageSource::getNumberOfDecimationLevels() const
@@ -197,29 +199,47 @@ void ossimMemoryImageSource::getDecimationFactors(std::vector<ossimDpt>& decimat
 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)
 {
-   ossimString boundsString     = kwl.find(prefix, "rect");
-   ossimString scalarTypeString = kwl.find(prefix, ossimKeywordNames::SCALAR_TYPE_KW);
-   ossimString nBandsString     = kwl.find(prefix, ossimKeywordNames::NUMBER_BANDS_KW);
-   
-   m_boundingRect.makeNan();
-   if(!boundsString.empty()&&!scalarTypeString.empty()&&!nBandsString.empty())
+   bool returnResult =  ossimImageSource::loadState(kwl, prefix);
+   m_geometry = 0;
+   if(returnResult)
    {
-      m_boundingRect.toRect(boundsString);
-      ossimScalarType scalarType = ossimScalarTypeLut::instance()->getScalarTypeFromString(scalarTypeString);
-      ossim_uint32 numberOfBands = nBandsString.toUInt32();
+      ossimString imagePrefix = ossimString(prefix) + "image.";
+      ossimString geomPrefix = ossimString(prefix) + "geom.";
       
-      if(scalarType!=OSSIM_SCALAR_UNKNOWN)
+      ossimString type = kwl.find(imagePrefix, "type");
+      if(!type.empty())
       {
-         m_image = new ossimImageData(0, scalarType, numberOfBands, m_boundingRect.width(), m_boundingRect.height());
-         m_image->setImageRectangle(m_boundingRect);
+         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());
+         }
       }
    }
-
-   return ossimImageSource::loadState(kwl, prefix);
+   m_result = 0;
+   return returnResult;
 }
diff --git a/src/ossim/imaging/ossimNBandToIndexFilter.cpp b/src/ossim/imaging/ossimNBandToIndexFilter.cpp
index 7833ae1..68cbf16 100644
--- a/src/ossim/imaging/ossimNBandToIndexFilter.cpp
+++ b/src/ossim/imaging/ossimNBandToIndexFilter.cpp
@@ -8,7 +8,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimNBandToIndexFilter.cpp 17815 2010-08-03 13:23:14Z dburken $
+// $Id: ossimNBandToIndexFilter.cpp 19732 2011-06-06 22:24:54Z dburken $
 
 #include <ossim/imaging/ossimNBandToIndexFilter.h>
 #include <ossim/imaging/ossimImageData.h>
@@ -260,7 +260,11 @@ ossimRefPtr<ossimImageData> ossimNBandToIndexFilter::convertInputTileToOutputTem
                bandValues[idx2] = *band[idx2];
                ++band[idx2];
             }
-            idx = theLut->findIndex(bandValues);
+            //---
+            // 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)
             {
@@ -294,7 +298,11 @@ ossimRefPtr<ossimImageData> ossimNBandToIndexFilter::convertInputTileToOutputTem
             idx = -1;
             if(!inputTile->isNull(offset))
             {
-               idx = theLut->findIndex(bandValues);
+               //---
+               // 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)
             {
@@ -333,7 +341,7 @@ ossimRefPtr<ossimImageData> ossimNBandToIndexFilter::convertInputTileToOutputTem
 }
 
 bool ossimNBandToIndexFilter::saveState(ossimKeywordlist& kwl,
-                                      const char* prefix)const
+                                        const char* prefix)const
 {
    ossimString newPrefix = prefix;
    newPrefix = newPrefix + "lut.";
diff --git a/src/ossim/imaging/ossimNitf20Writer.cpp b/src/ossim/imaging/ossimNitf20Writer.cpp
index 72c3930..907fa11 100644
--- a/src/ossim/imaging/ossimNitf20Writer.cpp
+++ b/src/ossim/imaging/ossimNitf20Writer.cpp
@@ -7,13 +7,9 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimNitfWriter.cpp 11385 2007-07-25 13:56:38Z gpotts $
+//  $Id: ossimNitf20Writer.cpp 2982 2011-10-10 21:28:55Z david.burken $
+
 
-#include <fstream>
-#include <algorithm>
-#include <sstream>
-#include <iomanip>
-#include <tiffio.h>
 #include <ossim/imaging/ossimNitf20Writer.h>
 #include <ossim/imaging/ossimNitfTileSource.h>
 #include <ossim/base/ossimDate.h>
@@ -32,6 +28,7 @@
 #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>
@@ -39,6 +36,11 @@
 #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);
 
@@ -66,6 +68,15 @@ ossimNitf20Writer::ossimNitf20Writer(const ossimFilename& filename,
    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()
@@ -73,15 +84,15 @@ ossimNitf20Writer::~ossimNitf20Writer()
    //---
    // This looks like a leak but it's not as both of these are ossimRefPtr's.
    //---
-   theFileHeader=NULL;
-   theImageHeader=NULL;
+   theFileHeader=0;
+   theImageHeader=0;
    
    close();
 }
 
 bool ossimNitf20Writer::isOpen()const
 {
-   return (theOutputStream != NULL);
+   return (theOutputStream != 0);
 }
 
 bool ossimNitf20Writer::open()
@@ -102,7 +113,7 @@ void ossimNitf20Writer::close()
    {
       theOutputStream->close();
       delete theOutputStream;
-      theOutputStream = (std::ofstream*)NULL;
+      theOutputStream = (std::ofstream*)0;
    }
 }
 
@@ -208,7 +219,7 @@ void ossimNitf20Writer::setProperty(ossimRefPtr<ossimProperty> property)
 
 ossimRefPtr<ossimProperty> ossimNitf20Writer::getProperty(const ossimString& name)const
 {
-   ossimRefPtr<ossimProperty> result = NULL;
+   ossimRefPtr<ossimProperty> result = 0;
    
    if(name == "file_header")
    {
@@ -510,7 +521,7 @@ bool ossimNitf20Writer::writeBlockBandSequential()
    int imageHeaderEnd = theOutputStream->tellp();
    int imageHeaderSize = imageHeaderEnd - imageHeaderStart;
 
-   ossimIpt ul = rect.ul();
+   // ossimIpt ul = rect.ul();
    ossimRefPtr<ossimImageData> data = theInputConnection->getNextTile();
    ossim_uint64 tileNumber = 0;
    ossimEndian endian;
@@ -617,10 +628,19 @@ void ossimNitf20Writer::addTags()
    
    if(theCopyFieldsFlag)
    {
-      ossimConnectableObject* obj = findObjectOfType("ossimImageHandler",
-                                                     ossimConnectableObject::CONNECTABLE_DIRECTION_INPUT);
-      ossimNitfTileSource* nitf = dynamic_cast<ossimNitfTileSource*>(obj);
-      if(nitf)
+      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());
diff --git a/src/ossim/imaging/ossimNitfTileSource.cpp b/src/ossim/imaging/ossimNitfTileSource.cpp
index a17f28d..8b5ce2f 100644
--- a/src/ossim/imaging/ossimNitfTileSource.cpp
+++ b/src/ossim/imaging/ossimNitfTileSource.cpp
@@ -9,11 +9,7 @@
 // Description:  Contains class definition for ossimNitfTileSource.
 // 
 //*******************************************************************
-//  $Id: ossimNitfTileSource.cpp 18621 2011-01-03 12:45:12Z gpotts $
-#include <jerror.h>
-#include <fstream>
-
-#include <algorithm> /* for std::fill */
+//  $Id: ossimNitfTileSource.cpp 22354 2013-08-02 16:22:15Z gpotts $
 
 #include <ossim/imaging/ossimNitfTileSource.h>
 #include <ossim/base/ossimConstants.h>
@@ -31,6 +27,7 @@
 #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>
@@ -47,10 +44,14 @@
 #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 18621 2011-01-03 12:45:12Z gpotts $";
+   static const char OSSIM_ID[] = "$Id: ossimNitfTileSource.cpp 22354 2013-08-02 16:22:15Z gpotts $";
 #endif
    
 //---
@@ -102,7 +103,8 @@ ossimNitfTileSource::ossimNitfTileSource()
       theCompressedBuf(0),
       theNitfBlockOffset(0),
       theNitfBlockSize(0),
-      m_isJpeg12Bit(false)
+      m_isJpeg12Bit(false),
+      m_jpegOffsetsDirty(false)
 {
    if (traceDebug())
    {
@@ -138,7 +140,7 @@ void ossimNitfTileSource::destroy()
 
    theCacheTile = 0;
    theTile      = 0;
-   theOverview = 0;
+   theOverview  = 0;
  }
 
 bool ossimNitfTileSource::isOpen()const
@@ -157,18 +159,6 @@ bool ossimNitfTileSource::open()
    
    theErrorStatus = ossimErrorCodes::OSSIM_OK;
 
-   // *** HACK *** 
-   //To get around 2 GB Files. Send "false" if file size over 2GB. 
-   //That way GDAL plugin handles the file, which is working. 
-   //TODO: Fix OSSIM to handle over 2 GB files for windows 32bit
-#if defined(WIN32)
-   const ossim_int64 TWO_GIG_MAX = 2147483647; // (2^31)-1
-   if ( theImageFile.fileSize() > TWO_GIG_MAX )
-   {
-      return false;
-   }
-#endif
-  
    if ( parseFile() )
    {
       result = allocate();
@@ -274,7 +264,7 @@ bool ossimNitfTileSource::parseFile()
 
       if( !hdr->isCompressed() )
       {
-         // Skip cloud mask images??? (drb)
+         // Skip entries tagged NODISPLAY, e.g. cloud mask entries.
          if (hdr->getRepresentation() != "NODISPLY")
          {
             theEntryList.push_back(i);
@@ -297,6 +287,15 @@ bool ossimNitfTileSource::parseFile()
          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
       {
@@ -310,11 +309,12 @@ bool ossimNitfTileSource::parseFile()
          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)
@@ -392,6 +392,11 @@ bool ossimNitfTileSource::allocate()
       theCacheId = -1;
    }
 
+   // Clear buffers:
+   theTile = 0;
+   theCacheTile = 0;
+   theCompressedBuf.clear();
+
    // Set the scalar type.
    initializeScalarType();
    if (theScalarType == OSSIM_SCALAR_UNKNOWN)
@@ -415,9 +420,6 @@ bool ossimNitfTileSource::allocate()
    {
       return false;
    }
-
-   // Set the decimation factor.
-   //establishDecimationFactors(); <-- THIS SHOULD HAVE BEEN DONE IN ossimImageHandler::completOpen()
    
    // Initialize the image rectangle. before the cache size is done
    if (initializeImageRect() == false)
@@ -449,6 +451,11 @@ bool ossimNitfTileSource::allocate()
       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.
@@ -492,12 +499,10 @@ bool ossimNitfTileSource::canUncompress(const ossimNitfImageHeader* hdr) const
          if (hdr->getBitsPerPixelPerBand() == 8)
          {
             result = true;
-            m_isJpeg12Bit = false;
          }
          else if (hdr->getBitsPerPixelPerBand() == 12)
          {
            result = true;
-           m_isJpeg12Bit = true;
          }
          else
          {
@@ -622,15 +627,23 @@ void ossimNitfTileSource::initializeScalarType()
       }
       case 11:
       {
-         theScalarType = OSSIM_USHORT11;
+         if(pixelValueType == "SI")
+         {
+            theScalarType = OSSIM_SINT16;
+         }
+         else
+         {
+            theScalarType = OSSIM_USHORT11;
+         }
          break;
       }
+      case  9:
+      case 10:
       case 12:
-      {
-         theScalarType = OSSIM_UINT16;
-         break;
-      }
-      case 16:
+      case 13:
+      case 14:
+      case 15:
+      case 16:         
       {
          if(pixelValueType == "SI")
          {
@@ -843,10 +856,11 @@ bool ossimNitfTileSource::initializeBlockSize()
       }
       case READ_JPEG_BLOCK:
       {
-         theBlockSizeInBytes    *= theNumberOfInputBands;
-         if (scanForJpegBlockOffsets() == false)
+         theBlockSizeInBytes *= theNumberOfInputBands;
+         ossimString code = hdr->getCompressionCode();
+         if (code == "C3") // jpeg
          {
-            return false;
+            m_jpegOffsetsDirty  = true;
          }
          break;
       }
@@ -887,7 +901,12 @@ void ossimNitfTileSource::establishDecimationFactors()
       hdr->getDecimationFactor(decimation);
       if ((decimation != 0.0) && !ossim::isnan(decimation))
       {
-         ossimDpt dec_2d (decimation, 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);
       }
    }
@@ -1113,6 +1132,7 @@ void ossimNitfTileSource::initializeCacheSize()
          << endl;
    }
 }
+
 void ossimNitfTileSource::initializeCacheTileInterLeaveType()
 {
    theCacheTileInterLeaveType = OSSIM_INTERLEAVE_UNKNOWN;
@@ -1219,9 +1239,14 @@ ossimRefPtr<ossimImageData> ossimNitfTileSource::getTile(
       return ossimRefPtr<ossimImageData>();
    }
 
-   if (!theTile.valid())
+   if ( !theTile.valid() )
    {
-      return theTile;
+      // First call to getTile:
+      allocateBuffers();
+      if ( !theTile.valid() )
+      {
+         return theTile;
+      }
    }
 
    // Rectangle must be set prior to getOverviewTile call.
@@ -1290,7 +1315,7 @@ ossimRefPtr<ossimImageData> ossimNitfTileSource::getTile(
       }
       else
       {
-         if (loadTile(clipRect) == true)
+         if ( loadTile(clipRect) == true )
          {
             //---
             // Validate the tile.  This will set the status to full, partial
@@ -1301,10 +1326,18 @@ ossimRefPtr<ossimImageData> ossimNitfTileSource::getTile(
          }
          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__
+               << __FILE__ << " " << __LINE__
                << " loadTile failed!"
                << std::endl;
+
             theTile->makeBlank(); // loadTile failed...
          }
       }
@@ -1521,11 +1554,11 @@ bool ossimNitfTileSource::loadBlock(ossim_uint32 x, ossim_uint32 y)
       {
          if (uncompressJpegBlock(x, y) == false)
          {
+            theCacheTile->makeBlank();
             theFileStr.clear();
             ossimNotify(ossimNotifyLevel_FATAL)
                << "ossimNitfTileSource::loadBlock Read Error!"
                << "\nReturning error..." << endl;
-            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
             return false;
          }
          break;
@@ -1809,7 +1842,6 @@ bool ossimNitfTileSource::getPosition(std::streamoff& streamPosition,
    //
    streamPosition = 0;
    
-   
    const ossimNitfImageHeader* hdr = getCurrentImageHeader();
    if (!hdr)
    {
@@ -2032,26 +2064,34 @@ ossimScalarType ossimNitfTileSource::getOutputScalarType() const
 
 ossim_uint32 ossimNitfTileSource::getTileWidth() const
 {
-   if (theTile.valid())
+   ossim_uint32 result = 0;
+   if(!theCacheSize.hasNans()&& theCacheSize.x > 0)
    {
-      return theTile->getWidth();
+      result = theCacheSize.x;
    }
-
-   ossimIpt tileSize;
-   ossim::defaultTileSize(tileSize);
-   return static_cast<ossim_uint32>(tileSize.x);
+   else
+   {
+      ossimIpt tileSize;
+      ossim::defaultTileSize(tileSize);
+      result = static_cast<ossim_uint32>(tileSize.x);
+   }
+   return result;
 }
 
 ossim_uint32 ossimNitfTileSource::getTileHeight() const
 {
-   if (theTile.valid())
+   ossim_uint32 result = 0;
+   if(!theCacheSize.hasNans()&& theCacheSize.y > 0)
    {
-      return theTile->getHeight();
+      result = theCacheSize.y;
    }
-
-   ossimIpt tileSize;
-   ossim::defaultTileSize(tileSize);
-   return static_cast<ossim_uint32>(tileSize.y);
+   else
+   {
+      ossimIpt tileSize;
+      ossim::defaultTileSize(tileSize);
+      result = static_cast<ossim_uint32>(tileSize.y);
+   }
+   return result;
 }
 
 ossim_uint32 ossimNitfTileSource::getNumberOfInputBands() const
@@ -2397,6 +2437,7 @@ ossimRefPtr<ossimProperty> ossimNitfTileSource::getProperty(const ossimString& n
             ossimRefPtr<ossimProperty> p = theNitfFile->getHeader()->getProperty(name);
             if(p.valid())
             {
+               p->setReadOnlyFlag(true);
                return p;
             }
          }
@@ -2407,6 +2448,7 @@ ossimRefPtr<ossimProperty> ossimNitfTileSource::getProperty(const ossimString& n
          ossimRefPtr<ossimProperty> p = imageHeader->getProperty(name);
          if(p.valid())
          {
+            p->setReadOnlyFlag(true);
             return p;
          }
       }
@@ -2777,11 +2819,15 @@ void ossimNitfTileSource::vqUncompressM4(
 
 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 false;
+      return allBlocksFound; // Get out...
    }
 
    theNitfBlockOffset.clear();
@@ -2801,129 +2847,203 @@ bool ossimNitfTileSource::scanForJpegBlockOffsets()
    // DHT = 0xffc4 Define Huffman Table(s)
    // DQT = 0xffdb Define Quantization Table(s)
    //---
-   char c;
 
    // Seek to the first block.
    theFileStr.seekg(hdr->getDataLocation(), ios::beg);
-   if (theFileStr.fail())
-   {
-      return false;
-   }
-   
-   // Read the first two bytes and verify it is SOI; if not, get out.
-   theFileStr.get( c );
-   if (static_cast<ossim_uint8>(c) != 0xff)
-   {
-      return false;
-   }
-   theFileStr.get(c);
-   if (static_cast<ossim_uint8>(c) != 0xd8)
+
+   if ( theFileStr.good() )
    {
-      return false;
-   }
+      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;
 
-   ossim_uint32 blockSize = 2;  // Read two bytes...
+      union
+      {
+         char c;
+         ossim_uint8 uc;
+      } ct;
 
-   // Add the first offset.
-   theNitfBlockOffset.push_back(hdr->getDataLocation());
+      std::streamoff soiOffset = 0;
+      std::streamoff eoiOffset = 0;
+      ossim_uint16   length    = 0;
 
-   // Find all the SOI markers.
-   while ( theFileStr.get(c) ) 
-   {
-      ++blockSize;
-      if (static_cast<ossim_uint8>(c) == 0xff) // Found FF byte.
+      ossimEndian* swapper = 0;
+      if ( ossim::byteOrder() == OSSIM_LITTLE_ENDIAN )
       {
-         //---
-         // Loop to skip multiple 0xff's in cases like FF FF D8
-         //---
-         while ( theFileStr.get(c) )
+         swapper = new ossimEndian();
+      }
+      
+      // Find all the SOI markers.
+      while ( theFileStr.get( ct.c ) && !allBlocksFound ) 
+      {
+         if ( ct.uc == FF ) // Found FF byte.
          {
-            ++blockSize;
-            if (static_cast<ossim_uint8>(c) != 0xff)
+            // Loop to skip multiple 0xff's in cases like FF FF D8
+            while ( theFileStr.get( ct.c ) )
             {
-               break;
+               if ( ct.uc != FF)
+               {
+                  break;
+               }
             }
-         }
          
-         if (static_cast<ossim_uint8>(c) == 0xd8) 
-         {
-            // At SOI 0xFFD8 marker...
-            std::streamoff pos = theFileStr.tellg();
-            theNitfBlockOffset.push_back(pos-2);
-         }
-         else if (static_cast<ossim_uint8>(c) == 0xd9)
-         {
-            // At EOI 0xD9marker...
-            theNitfBlockSize.push_back(blockSize);
-            blockSize = 0;
-         }
+            if ( ct.uc == SOI ) 
+            {
+               // At SOI 0xFFD8 marker... SOI marker offset is two bytes back.
+               soiOffset = ((std::streamoff)theFileStr.tellg()) - 2;
 
-         //---
-         // 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) &&
-              (theNitfBlockSize.size()   == total_blocks) )
-         {
-            break;
-         }
+               // 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 (theNitfBlockOffset.size() != total_blocks)
+
+#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)
    {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "DEBUG:"
-            << "\nBlock offset count wrong!"
-            << "\nblocks:  " << total_blocks
-            << "\noffsets:  " << theNitfBlockOffset.size()
-            << std::endl;
-      }
-      
-      return false;
+      cout << "theNitfBlockOffset[" << i << "]: " << theNitfBlockOffset[i]
+           << "\nrealative_offset[" << i << "]:   " << (theNitfBlockOffset[i] - startOfData)
+           << "\ntheNitfBlockSize[" << i << "]:   " << theNitfBlockSize[i]
+           << "\n";
    }
-   if (theNitfBlockSize.size() != total_blocks)
+#endif
+   
+   if ( !allBlocksFound )
    {
       if (traceDebug())
       {
          ossimNotify(ossimNotifyLevel_WARN)
             << "DEBUG:"
-            << "\nBlock size count wrong!"
-            << "\nblocks:  " << total_blocks
-            << "\nblock size array:  " << theNitfBlockSize.size()
+            << "\nBlock offset count wrong!"
+            << "\nexpected blocks:        " << total_blocks
+            << "\noffset array count:     " << theNitfBlockOffset.size()
+            << "\nblock size array count: " << theNitfBlockSize.size()
             << std::endl;
       }
-
-      return false;
+      theNitfBlockOffset.clear();
+      theNitfBlockSize.clear();
    }
 
-#if 0 /* Please leave for debug. (drb) */
-   ossimNotify(ossimNotifyLevel_WARN) << "current entry: " << theCurrentEntry << "\n";
-   for (ossim_uint32 i = 0; i < total_blocks; ++i)
-   {
-      cout << "theNitfBlockOffset[" << i << "]: " << theNitfBlockOffset[i]
-           << "\ntheNitfBlockSize[" << i << "]: " << theNitfBlockSize[i]
-           << "\n";
-   }
-#endif
-
-   return true;
+   return allBlocksFound;
 }
 
 bool ossimNitfTileSource::uncompressJpegBlock(ossim_uint32 x, ossim_uint32 y)
 {
-   ossim_uint32 blockNumber = getBlockNumber(ossimIpt(x,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;
@@ -2941,14 +3061,13 @@ bool ossimNitfTileSource::uncompressJpegBlock(ossim_uint32 x, ossim_uint32 y)
       ossimNotify(ossimNotifyLevel_FATAL)
          << "ossimNitfTileSource::uncompressJpegBlock Read Error!"
          << "\nReturning error..." << endl;
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
       return false;
    }
-
+   
    if (m_isJpeg12Bit)
    {
 #if defined(JPEG_DUAL_MODE_8_12)
-     return ossimNitfTileSource_12::uncompressJpeg12Block(x,y,theCacheTile, 
+      return ossimNitfTileSource_12::uncompressJpeg12Block(x,y,theCacheTile, 
        getCurrentImageHeader(), theCacheSize, compressedBuf, theReadBlockSizeInBytes, 
        theNumberOfOutputBands);
 #endif  
@@ -2962,13 +3081,13 @@ bool ossimNitfTileSource::uncompressJpegBlock(ossim_uint32 x, ossim_uint32 y)
     * 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. */
diff --git a/src/ossim/imaging/ossimNitfWriter.cpp b/src/ossim/imaging/ossimNitfWriter.cpp
index 6b92fa5..5c4d1b3 100644
--- a/src/ossim/imaging/ossimNitfWriter.cpp
+++ b/src/ossim/imaging/ossimNitfWriter.cpp
@@ -7,19 +7,13 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimNitfWriter.cpp 18674 2011-01-11 16:24:12Z dburken $
+//  $Id: ossimNitfWriter.cpp 21631 2012-09-06 18:10:55Z dburken $
 
-#include <fstream>
-#include <algorithm>
-#include <sstream>
-#include <iomanip>
-#include <tiffio.h>
 #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/ossimPreferences.h>
 #include <ossim/base/ossimProperty.h>
 #include <ossim/base/ossimRefPtr.h>
 #include <ossim/base/ossimStringProperty.h>
@@ -29,6 +23,7 @@
 #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>
@@ -37,6 +32,11 @@
 #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(ossimNitfWriter, "ossimNitfWriter", ossimNitfWriterBase);
 
@@ -71,6 +71,15 @@ ossimNitfWriter::ossimNitfWriter(const ossimFilename& filename,
    // 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()
@@ -523,7 +532,7 @@ bool ossimNitfWriter::writeBlockBandSequential()
    int imageHeaderEnd = m_outputStream->tellp();
    int imageHeaderSize = imageHeaderEnd - imageHeaderStart;
 
-   ossimIpt ul = rect.ul();
+   // ossimIpt ul = rect.ul();
 
    // Start the sequence through tiles:
    theInputConnection->setToStartOfSequence();
diff --git a/src/ossim/imaging/ossimNitfWriterBase.cpp b/src/ossim/imaging/ossimNitfWriterBase.cpp
index 73af153..7de480d 100644
--- a/src/ossim/imaging/ossimNitfWriterBase.cpp
+++ b/src/ossim/imaging/ossimNitfWriterBase.cpp
@@ -9,16 +9,18 @@
 // Description: OSSIM Kakadu based nitf writer.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimKakaduNitfWriter.cpp 15073 2009-08-13 19:55:34Z dburken $
+// $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>
@@ -338,3 +340,21 @@ 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/src/ossim/imaging/ossimNullPixelFlip.cpp b/src/ossim/imaging/ossimNullPixelFlip.cpp
index fdd79e7..ecfe2b6 100644
--- a/src/ossim/imaging/ossimNullPixelFlip.cpp
+++ b/src/ossim/imaging/ossimNullPixelFlip.cpp
@@ -9,7 +9,9 @@
 // 
 //*******************************************************************
 //  $Id$
+
 #include <ossim/imaging/ossimNullPixelFlip.h>
+#include <ossim/imaging/ossimImageData.h>
 
 RTTI_DEF1(ossimNullPixelFlip, "ossimNullPixelFlip", ossimImageSourceFilter);
 ossimNullPixelFlip::ossimNullPixelFlip()
diff --git a/src/ossim/imaging/ossimOrthoImageMosaic.cpp b/src/ossim/imaging/ossimOrthoImageMosaic.cpp
index 0c8aedc..b28db87 100644
--- a/src/ossim/imaging/ossimOrthoImageMosaic.cpp
+++ b/src/ossim/imaging/ossimOrthoImageMosaic.cpp
@@ -5,10 +5,12 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimOrthoImageMosaic.cpp 17932 2010-08-19 20:34:35Z dburken $
+//  $Id: ossimOrthoImageMosaic.cpp 21631 2012-09-06 18:10:55Z dburken $
 #include <ossim/imaging/ossimOrthoImageMosaic.h>
 #include <ossim/base/ossimKeywordNames.h>
 #include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageGeometry.h>
 #include <ossim/projection/ossimMapProjection.h>
 #include <ossim/projection/ossimProjectionFactoryRegistry.h>
 
diff --git a/src/ossim/imaging/ossimOverviewBuilderBase.cpp b/src/ossim/imaging/ossimOverviewBuilderBase.cpp
index b4f8f7a..4ab67ab 100644
--- a/src/ossim/imaging/ossimOverviewBuilderBase.cpp
+++ b/src/ossim/imaging/ossimOverviewBuilderBase.cpp
@@ -7,7 +7,7 @@
 // Description:  Interface class for overview builders.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimOverviewBuilderBase.cpp 17932 2010-08-19 20:34:35Z dburken $
+// $Id: ossimOverviewBuilderBase.cpp 21745 2012-09-16 15:21:53Z dburken $
 
 #include <ossim/imaging/ossimOverviewBuilderBase.h>
 #include <ossim/base/ossimIpt.h>
@@ -20,17 +20,30 @@ RTTI_DEF3(ossimOverviewBuilderBase,
           ossimSource,
           ossimProcessInterface,
           ossimConnectableObjectListener)
+
+static const std::string SCAN_FLOAT_DATA_KW = "overview_builder.scan_for_min_max_null_if_float";
    
 ossimOverviewBuilderBase::ossimOverviewBuilderBase()
    : m_overviewStopDimension(0),
      m_histoMode(OSSIM_HISTO_MODE_UNKNOWN),
-     m_maskBuildFlag(false)
+     m_bitMaskSpec(),
+     m_imageHandler(0),
+     m_originalBandList(0),
+     m_maskWriter(0),
+     m_maskFilter(0),
+     m_outputFile(ossimFilename::NIL),
+     m_scanForMinMax(false),
+     m_scanForMinMaxNull(false),
+     m_scanFloatData(false)
 {
-   m_overviewStopDimension = getDefaultStopDimension();
+   initializePreferenceSettings();
 }
 
 ossimOverviewBuilderBase::~ossimOverviewBuilderBase()
 {
+   m_imageHandler = 0;
+   m_maskWriter = 0;
+   m_maskFilter = 0;
 }
 
 bool ossimOverviewBuilderBase::setOutputWriter(ossimImageFileWriter* /* outputWriter */)
@@ -38,6 +51,34 @@ bool ossimOverviewBuilderBase::setOutputWriter(ossimImageFileWriter* /* outputWr
    return false;
 }
 
+bool ossimOverviewBuilderBase::setInputSource(ossimImageHandler* imageSource)
+{
+   bool result = false;
+   if ( imageSource )
+   {
+      if ( imageSource->getErrorStatus() == ossimErrorCodes::OSSIM_OK )
+      {
+         m_imageHandler = imageSource;
+
+         // Check handler to see if it's filtering bands.
+         if ( m_imageHandler->isBandSelector() )
+         { 
+            // Capture for finalize method.
+            m_imageHandler->getOutputBandList( m_originalBandList );
+            
+            // Set output list to input.
+            m_imageHandler->setOutputToInputBandList();
+         }
+
+         // This will set the flag to scan for min, max, nulls if needed.
+         initializeScanOptions();
+         
+         result = true;
+      }
+   }
+   return result;
+}
+
 bool ossimOverviewBuilderBase::hasOverviewType(const ossimString& type) const
 {
    std::vector<ossimString> typeList;
@@ -98,24 +139,73 @@ void ossimOverviewBuilderBase::setHistogramMode(ossimHistogramMode mode)
    m_histoMode = mode;
 }
 
-ossim_uint32 ossimOverviewBuilderBase::getDefaultStopDimension() const
+void ossimOverviewBuilderBase::finalize()
 {
-   ossim_uint32 result = 0;
-   
-     // Get the stop dimension from ossim preferences.
+   if ( m_imageHandler.valid() && m_imageHandler->isBandSelector() && m_originalBandList.size() )
+   {
+      m_imageHandler->setOutputBandList( m_originalBandList );
+   }
+}
+
+void ossimOverviewBuilderBase::setBitMaskSpec(const ossimKeywordlist& bit_mask_spec)
+{
+   m_bitMaskSpec = bit_mask_spec;
+}
+
+void ossimOverviewBuilderBase::setScanForMinMax(bool flag)
+{
+   m_scanForMinMax  = flag;
+}
+
+bool ossimOverviewBuilderBase::getScanForMinMax() const
+{
+   return m_scanForMinMax;
+}
+
+void ossimOverviewBuilderBase::setScanForMinMaxNull(bool flag)
+{
+   m_scanForMinMaxNull = flag;
+}
+
+bool ossimOverviewBuilderBase::getScanForMinMaxNull() const
+{
+   return m_scanForMinMaxNull;
+}
+
+void ossimOverviewBuilderBase::initializePreferenceSettings()
+{
+   // Get the stop dimension from ossim preferences.
    const char* lookup = ossimPreferences::instance()->
       findPreference(ossimKeywordNames::OVERVIEW_STOP_DIMENSION_KW);
    if (lookup)
    {
-      result = ossimString(lookup).toUInt32();
+     m_overviewStopDimension = ossimString(lookup).toUInt32();
    }
 
-   if (result == 0)
+   if ( m_overviewStopDimension == 0 )
    {
       // Use the smallest default tile size.
       ossimIpt tileSize;
       ossim::defaultTileSize(tileSize);
-      result  = tileSize.x < tileSize.y ? tileSize.x : tileSize.y;
+      m_overviewStopDimension = tileSize.x < tileSize.y ? tileSize.x : tileSize.y;
+   }
+
+   // Look for overview_builder.scan_for_min_max_null_if_float:
+   lookup = ossimPreferences::instance()->findPreference(SCAN_FLOAT_DATA_KW.c_str());
+   if ( lookup )
+   {
+      m_scanFloatData = ossimString(lookup).toBool();
+   }
+}
+
+void ossimOverviewBuilderBase::initializeScanOptions()
+{
+   if ( m_scanFloatData && m_imageHandler.valid())
+   {
+      ossimScalarType scalar = m_imageHandler->getOutputScalarType();
+      if ( ( scalar == OSSIM_FLOAT32 ) || ( scalar == OSSIM_FLOAT64 ) )
+      {
+         setScanForMinMaxNull(true);
+      }
    }
-   return result;
 }
diff --git a/src/ossim/imaging/ossimOverviewBuilderFactoryRegistry.cpp b/src/ossim/imaging/ossimOverviewBuilderFactoryRegistry.cpp
index 40e2566..111b9a2 100644
--- a/src/ossim/imaging/ossimOverviewBuilderFactoryRegistry.cpp
+++ b/src/ossim/imaging/ossimOverviewBuilderFactoryRegistry.cpp
@@ -7,22 +7,18 @@
 // Description: The factory registry for overview builders.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimOverviewBuilderFactoryRegistry.cpp 19184 2011-03-23 11:59:03Z gpotts $
-
-#include <cstddef>   /* for NULL */
-#include <algorithm> /* for std::find */
+// $Id: ossimOverviewBuilderFactoryRegistry.cpp 19907 2011-08-05 19:55:46Z dburken $
 
 #include <ossim/imaging/ossimOverviewBuilderFactoryRegistry.h>
 #include <ossim/imaging/ossimOverviewBuilderFactoryBase.h>
 #include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <algorithm> /* for std::find */
 
-ossimOverviewBuilderFactoryRegistry*
-ossimOverviewBuilderFactoryRegistry::m_instance = 0;
+ossimOverviewBuilderFactoryRegistry* ossimOverviewBuilderFactoryRegistry::m_instance = 0;
 
-ossimOverviewBuilderFactoryRegistry*
-ossimOverviewBuilderFactoryRegistry::instance()
+ossimOverviewBuilderFactoryRegistry* ossimOverviewBuilderFactoryRegistry::instance()
 {
-   if ( m_instance == NULL )
+   if ( m_instance == 0 )
    {
       m_instance = new ossimOverviewBuilderFactoryRegistry();
       ossimObjectFactoryRegistry::instance()->registerFactory(m_instance);
@@ -30,6 +26,11 @@ ossimOverviewBuilderFactoryRegistry::instance()
    return m_instance;
 }
 
+ossimObject* ossimOverviewBuilderFactoryRegistry::createObject(const ossimString& typeName)const
+{
+   return createObjectFromRegistry(typeName);
+}
+
 ossimObject* ossimOverviewBuilderFactoryRegistry::createObject(const ossimKeywordlist& kwl,
                                                                const char* prefix)const
 {
@@ -71,6 +72,10 @@ ossimOverviewBuilderFactoryRegistry::createBuilder(
    return result;
 }
 
+void ossimOverviewBuilderFactoryRegistry::getTypeNameList(std::vector<ossimString>& typeList)const
+{
+   getAllTypeNamesFromRegistry(typeList);
+}
 
 ossimOverviewBuilderFactoryRegistry::ossimOverviewBuilderFactoryRegistry()
 {
diff --git a/src/ossim/imaging/ossimOverviewSequencer.cpp b/src/ossim/imaging/ossimOverviewSequencer.cpp
index 316508e..9f04820 100644
--- a/src/ossim/imaging/ossimOverviewSequencer.cpp
+++ b/src/ossim/imaging/ossimOverviewSequencer.cpp
@@ -7,7 +7,7 @@
 // Description: Sequencer for building overview files.
 // 
 //----------------------------------------------------------------------------
-// $Id: ossimOverviewSequencer.cpp 17928 2010-08-19 18:43:53Z gpotts $
+// $Id: ossimOverviewSequencer.cpp 22149 2013-02-11 21:36:10Z dburken $
 
 #include <ossim/imaging/ossimOverviewSequencer.h>
 #include <ossim/base/ossimIpt.h>
@@ -18,11 +18,12 @@
 #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 17928 2010-08-19 18:43:53Z gpotts $";
+static const char OSSIM_ID[] = "$Id: ossimOverviewSequencer.cpp 22149 2013-02-11 21:36:10Z dburken $";
 #endif
 
 static ossimTrace traceDebug("ossimOverviewSequencer:debug");
@@ -30,7 +31,10 @@ 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),
@@ -43,7 +47,12 @@ ossimOverviewSequencer::ossimOverviewSequencer()
    m_resampleType(ossimFilterResampler::ossimFilterResampler_BOX),
    m_histogram(0),
    m_histoMode(OSSIM_HISTO_MODE_UNKNOWN),
-   m_histoTileIndex(1)
+   m_histoTileIndex(1),
+   m_scanForMinMax(false),
+   m_scanForMinMaxNull(false),
+   m_minValues(0),
+   m_maxValues(0),
+   m_nulValues(0)
 {
    m_areaOfInterest.makeNan();
 
@@ -63,6 +72,8 @@ ossimOverviewSequencer::ossimOverviewSequencer()
 ossimOverviewSequencer::~ossimOverviewSequencer()
 {
    m_imageHandler = 0;
+   m_maskFilter   = 0;
+   m_maskWriter   = 0;
    m_tile         = 0;
    m_histogram    = 0;
 
@@ -125,6 +136,9 @@ 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)
@@ -177,6 +191,10 @@ void ossimOverviewSequencer::initialize()
       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() )
    {
@@ -186,8 +204,8 @@ void ossimOverviewSequencer::initialize()
    // Check the tile size and set from image if needed.
    if ( m_tileSize.hasNans() )
    {
-      m_tileSize.x = m_imageHandler->getTileWidth();
-      m_tileSize.y = m_imageHandler->getTileHeight();
+      m_tileSize.x = imageSource->getTileWidth();
+      m_tileSize.y = imageSource->getTileHeight();
    }
 
    // Update m_numberOfTilesHorizontal and m_numberOfTilesVertical.
@@ -198,7 +216,7 @@ void ossimOverviewSequencer::initialize()
 
    // Use this factory constructor as it copies the min/max/nulls from the image handler.
    m_tile = ossimImageDataFactory::instance()->
-      create( 0, m_imageHandler->getNumberOfOutputBands(), m_imageHandler.get());
+      create( 0, imageSource->getNumberOfOutputBands(), imageSource);
    
    if(m_tile.valid())
    {
@@ -213,7 +231,7 @@ void ossimOverviewSequencer::initialize()
    {
       m_histogram = new ossimMultiBandHistogram;
       
-      m_histogram->create(m_imageHandler.get());
+      m_histogram->create(imageSource);
 
       if (m_histoMode == OSSIM_HISTO_MODE_NORMAL)
       {
@@ -245,20 +263,33 @@ void ossimOverviewSequencer::initialize()
    {
       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
-         << "\nhisto mode:         " << m_histoMode << "\n";
+         << "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)
@@ -294,37 +325,80 @@ ossimRefPtr<ossimImageData> ossimOverviewSequencer::getNextTile()
    m_tile->makeBlank();
 
    // Grab the input tile.
-   ossimRefPtr<ossimImageData> inputTile =
-      m_imageHandler->getTile(inputRect, m_sourceResLevel);
-   if (inputTile.valid() == false)
+   ossimRefPtr<ossimImageData> inputTile;
+   if (m_maskFilter.valid())
    {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimOverviewSequencer::getNextTile DEBUG:"
-         << "\nRequest failed for input rect: " << inputRect
-         << "\nRes level:  " << m_sourceResLevel << std::endl;
-   }
+      inputTile = m_maskFilter->getTile(inputRect, m_sourceResLevel);
 
-   if ( ( m_histoMode != OSSIM_HISTO_MODE_UNKNOWN ) &&
-        ( (m_currentTileNumber % m_histoTileIndex) == 0 ) )
+      // Check for errors reading tile and set our error status for callers.
+      if ( m_maskFilter->hasError() )
+      {
+         setErrorStatus();
+      }
+   }
+   else
    {
-      if (traceDebug())
+      inputTile = m_imageHandler->getTile(inputRect, m_sourceResLevel);
+
+      // Check for errors reading tile and set our error status for callers.
+      if ( m_imageHandler->hasError() )
       {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimOverviewSequencer::getNextTile DEBUG:"
-            << "\npopulating histogram for tile: " << m_currentTileNumber
-            << "\n";
+         setErrorStatus();
       }
-      inputTile->populateHistogram(m_histogram);
    }
 
-   if ( (inputTile->getDataObjectStatus() == OSSIM_PARTIAL) ||
-        (inputTile->getDataObjectStatus() == OSSIM_FULL ) )
+   if ( hasError() )
    {
-      // Resample the tile.
-      resampleTile(inputTile.get());
-
-      // Set the tile status.
-      m_tile->validate();
+      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.
@@ -360,6 +434,340 @@ void ossimOverviewSequencer::setResampleType(
    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_NUL = ossim::defaultNull(SCALAR);
+      const ossim_float64 FALLBACK_NULL = -32767; // This is my arbitrary pick. (drb)
+
+      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_NUL )
+                     {
+                        if ( m_nulValues[band] < m_minValues[band] )
+                        {
+                           m_minValues[band] = m_nulValues[band];
+                        }
+                        m_nulValues[band] = DEFAULT_NUL;
+                     }
+                  }
+                  break;
+               }
+               case OSSIM_SINT16:
+               {
+                  for (ossim_uint32 band = 0; band < BANDS; ++band)
+                  {
+                     if ( ( m_nulValues[band] != DEFAULT_NUL ) && // -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] = FALLBACK_NULL;
+                     }
+                  }
+                  break;
+               }
+               case OSSIM_SINT32:
+               {
+                  for (ossim_uint32 band = 0; band < BANDS; ++band)
+                  {
+                     if ( ( m_nulValues[band] != DEFAULT_NUL ) &&
+                          ( 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] = FALLBACK_NULL;
+                     } 
+                  }
+                  break;
+               }
+               case OSSIM_FLOAT32:
+               case OSSIM_FLOAT64: 
+               {
+                  for (ossim_uint32 band = 0; band < BANDS; ++band)
+                  {
+                     if ( ( m_nulValues[band] != DEFAULT_NUL ) &&
+                          ( 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] = FALLBACK_NULL;
+                     } 
+                  }
+                  break;
+               }
+               case OSSIM_NORMALIZED_FLOAT:
+               case OSSIM_NORMALIZED_DOUBLE:
+               {
+                  for (ossim_uint32 band = 0; band < BANDS; ++band)
+                  {
+                     if ( ( m_nulValues[band] != DEFAULT_NUL ) &&
+                          ( 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;
@@ -633,3 +1041,10 @@ void  ossimOverviewSequencer::resampleTile(const ossimImageData* inputTile, T  /
       } // 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/ossim/imaging/ossimPdfWriter.cpp b/src/ossim/imaging/ossimPdfWriter.cpp
new file mode 100644
index 0000000..1c6106f
--- /dev/null
+++ b/src/ossim/imaging/ossimPdfWriter.cpp
@@ -0,0 +1,1875 @@
+//----------------------------------------------------------------------------
+//
+// 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 );
+      }
+
+      // Write the image:
+      writeImage( m_str );
+
+      close();
+
+      // Set the status:
+      result = true;
+
+      // 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/ossim/imaging/ossimPixelFlipper.cpp b/src/ossim/imaging/ossimPixelFlipper.cpp
index 23a0b6d..68f58b7 100644
--- a/src/ossim/imaging/ossimPixelFlipper.cpp
+++ b/src/ossim/imaging/ossimPixelFlipper.cpp
@@ -9,39 +9,50 @@
 // Filter to toggle pixel values.
 //
 //*************************************************************************
-// $Id: ossimPixelFlipper.cpp 17206 2010-04-25 23:20:40Z dburken $
+// $Id: ossimPixelFlipper.cpp 21631 2012-09-06 18:10:55Z dburken $
+
 
-#include <cstdlib>
 #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");
 
-static const char TARGET_VALUE_KW[]      = "target_value";
-static const char REPLACEMENT_VALUE_KW[] = "replacement_value";
-static const char CLAMP_VALUE_KW[]       = "clamp_value";
-static const char REPLACEMENT_MODE_KW[]  = "replacement_mode";
-static const char CLIP_MODE_KW[]  = "clip_mode";
+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 17206 2010-04-25 23:20:40Z dburken $";
+static const char OSSIM_ID[] = "$Id: ossimPixelFlipper.cpp 21631 2012-09-06 18:10:55Z dburken $";
 #endif
 
 ossimPixelFlipper::ossimPixelFlipper(ossimObject* owner)
    :
       ossimImageSourceFilter(owner),
-      theTargetValue(0.0),
+      theTargetValueLo(0.0),
+      theTargetValueHi(0.0),
       theReplacementValue(1.0),
-      theClampValue(0.0),
-      theReplacementMode(ossimPixelFlipper::REPLACE_ALL_TARGETS),
-      theClipMode(ossimPixelFlipper::ossimPixelFlipperClipMode_NONE)
+      theReplacementMode(ossimPixelFlipper::REPLACE_BAND_IF_TARGET),
+      theClampValueLo(ossim::nan()),
+      theClampValueHi(ossim::nan()),
+      theClampingMode(DISABLED),
+      theClipMode(NONE)
 {
    if (traceDebug())
    {
@@ -135,6 +146,7 @@ ossimRefPtr<ossimImageData> ossimPixelFlipper::getTile(
       }
    }
    
+   inputTile->validate();
    return inputTile;
 }
 
@@ -145,442 +157,260 @@ void ossimPixelFlipper::flipPixels(T /* dummy */,
 {
    if (!inputTile) return;
 
-   T target      = static_cast<T>(theTargetValue);
+   T targetLo    = static_cast<T>(theTargetValueLo);
+   T targetHi    = static_cast<T>(theTargetValueHi);
    T replacement = static_cast<T>(theReplacementValue);
-   T clamp       = static_cast<T>(theClampValue);
-   ossim_uint32 size   = inputTile->getSizePerBand();
-   ossim_uint32 bands  = inputTile->getNumberOfBands();
-   ossim_uint32 band;
-
-   bool do_clamp = (clamp > 0) ? true : false;
+   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 origin = ul;
-   ossim_uint32 x=0;
-   ossim_uint32 y=0;
-   ossim_uint32 w = rect.width();
-   ossim_uint32 h = rect.height();
-   ossim_uint32 i = 0;   
-   bool replace = false;
+   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;
-   switch(theClipMode)
+   if ((theClipMode == BOUNDING_RECT) && (resLevel < theBoundingRects.size()))
    {
-      case  ossimPixelFlipperClipMode_BOUNDING_RECT:
-      {
-         if(resLevel < theBoundingRects.size())
-         {
-            if(!rect.intersects(theBoundingRects[resLevel]))
-            {
-               delete [] buf;
-               return;
-            }
-            else
-            {
-               needsTesting = !rect.completely_within(theBoundingRects[resLevel]);
-            }
-         }
-         break;
-      }
-      case  ossimPixelFlipperClipMode_VALID_VERTICES:
+      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)
       {
-         if(resLevel < theValidVertices.size())
+         // First consider if we need to test the pixel for border clipping:
+         if (needsTesting)
          {
-            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))
-            {
-               delete [] buf;
-               return; // none of the tile is inside so return
-            }
-            else
+            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)
             {
-               needsTesting = !(ulFlag&&urFlag&&lrFlag&&llFlag);
+               // 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; 
             }
          }
-         break;
-      }
-      default:
-      {
-         break;
-      }
-   }
-   
-   switch (theReplacementMode)
-   {
-      case ossimPixelFlipper::REPLACE_PARTIAL_TARGETS:
-      {
-         i = 0;
-         if((theClipMode == ossimPixelFlipperClipMode_NONE)||(!needsTesting))
+
+         // If clamping specified, the target replacement function is disabled:
+         if (theClampingMode)
          {
-            for (i=0; i<size; ++i)
+            switch (theReplacementMode)
             {
-               // At least one band must NOT have target for replace to = true;
-               replace = false;
+            case REPLACE_BAND_IF_TARGET:
+            case REPLACE_ALL_BANDS_IF_ANY_TARGET:
                for (band=0; band<bands; ++band)
                {
-                  if (buf[band][i] != target)
-                  {
-                     replace = true;
-                     break;
-                  }
+                  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;
                }
-               if (replace)
+               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)
                {
-                  for (band=0; band<bands; ++band)
-                  {
-                     if (buf[band][i] == target) buf[band][i] = replacement;
-                  }
+                  if ((!ossim::isnan(theClampValueLo) && (buf[band][i] < clampLo)) ||
+                     (!ossim::isnan(theClampValueHi) && (buf[band][i] > clampHi)))
+                     found_candidate = true;
+                  else
+                     can_replace = true;
                }
-            }
-         }
-         else
-         {
-            bool active;
-            origin.y = ul.y;
-            for(y = 0; y < h; ++y)
-            {
-               origin.x = ul.x;
-               for(x =0; x < w; ++x)
+               if (can_replace && found_candidate)
                {
-                  active = true;
-                  switch(theClipMode)
-                  {
-                     case  ossimPixelFlipperClipMode_BOUNDING_RECT:
-                     {
-                        if(resLevel < theBoundingRects.size())
-                        {
-                           active = theBoundingRects[resLevel].pointWithin(origin);
-                        }
-                        break;
-                     }
-                     case  ossimPixelFlipperClipMode_VALID_VERTICES:
-                     {
-                        if(resLevel < theValidVertices.size())
-                        {
-                           active = theValidVertices[resLevel].isPointWithin(origin);
-                        }
-                        break;
-                     }
-                     default:
-                     {
-                        break;
-                     }
-                  }
-                  replace = false;
-                  if(active)
-                  {
-                     for (band=0; band<bands; ++band)
-                     {
-                        if (buf[band][i] != target)
-                        {
-                           replace = true;
-                           break;
-                        }
-                     }
-                  }
-                  if (replace)
+                  // 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)
                   {
-                     for (band=0; band<bands; ++band)
-                     {
-                        if (buf[band][i] == target) buf[band][i] = replacement;
-                     }
+                     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;
                   }
-                  
-                  ++i;
-                  ++origin.x;
                }
-               ++origin.y;
-            }
-         }
-         break;
-      }
-      case ossimPixelFlipper::REPLACE_PARTIAL_TARGETS_ALL_BANDS:
-      {
-         i = 0;
-         if((theClipMode == ossimPixelFlipperClipMode_NONE)||(!needsTesting))
-         {
-            for (i=0; i<size; ++i)
-            {
-               // Must be at least one target but not all to replace all bands.
-               bool has_a_target = false;
-               replace      = false;
-               for (band=0; band<bands; ++band)
+               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 (buf[band][i] == target)
-                  {
-                     has_a_target = true;
-                     break;
-                  }
+                  if ((ossim::isnan(theClampValueLo) || (buf[band][i] >= clampLo)) &&
+                      (ossim::isnan(theClampValueHi) || (buf[band][i] <= clampHi)))
+                     can_replace = false;
                }
-               if (has_a_target)
+               if (can_replace)
                {
+                  // Map all pixels to replacement value: 
                   for (band=0; band<bands; ++band)
                   {
-                     if (buf[band][i] != target)
-                     {
-                        replace = true;
-                        break;
-                     }
-                  }
-                  if (replace)
-                  {
-                     for (band=0; band<bands; ++band)
-                     {
-                        buf[band][i] = replacement;
-                     }
+                     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; 
          }
-         else
+
+         // 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)
          {
-            bool active = true;
-            origin.y = ul.y;
-            for(y = 0; y < h; ++y)
+         case REPLACE_BAND_IF_TARGET:
+            for (band=0; band<bands; ++band)
             {
-               origin.x = ul.x;
-               for(x =0; x < w; ++x)
-               {
-                  switch(theClipMode)
-                  {
-                     case  ossimPixelFlipperClipMode_BOUNDING_RECT:
-                     {
-                        if(resLevel < theBoundingRects.size())
-                        {
-                           active = theBoundingRects[resLevel].pointWithin(origin);
-                        }
-                        break;
-                     }
-                     case  ossimPixelFlipperClipMode_VALID_VERTICES:
-                     {
-                        if(resLevel < theValidVertices.size())
-                        {
-                           active = theValidVertices[resLevel].isPointWithin(origin);
-                        }
-                        break;
-                     }
-                     default:
-                     {
-                        break;
-                     }
-                  }
-                  bool has_a_target = false;
-                  replace      = false;
-                  if(active)
-                  {
-                     for (band=0; band<bands; ++band)
-                     {
-                        if (buf[band][i] == target)
-                        {
-                           has_a_target = true;
-                           break;
-                        }
-                     }
-                  }
-                  if (has_a_target)
-                  {
-                     for (band=0; band<bands; ++band)
-                     {
-                        if (buf[band][i] != target)
-                        {
-                           replace = true;
-                           break;
-                        }
-                     }
-                     if (replace)
-                     {
-                        for (band=0; band<bands; ++band)
-                        {
-                           buf[band][i] = replacement;
-                        }
-                     }
-                  }
-                  
-                  ++i;
-                  ++origin.x;
-               }
-               ++origin.y;
+               if ((buf[band][i] >= targetLo) && (buf[band][i] <=targetHi)) 
+                  buf[band][i] = theReplacementValue;
             }
-         }
-         break;
-      }
-      case ossimPixelFlipper::REPLACE_FULL_TARGETS:
-      {
-         i = 0;
-         if((theClipMode == ossimPixelFlipperClipMode_NONE)||(!needsTesting))
-         {
-            for (i=0; i<size; ++i)
+            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)
             {
-               // All bands must have target for replace to = true.
-               replace = true;
-               
+               //  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] != target)
-                  {
-                     replace = false;
-                     break;
-                  }
-               }
-               if (replace)
-               {
-                  for (band=0; band<bands; ++band)
-                  {
-                     buf[band][i] = replacement;
-                  }
+                  if ((buf[band][i] >= targetLo) && (buf[band][i] <= targetHi)) 
+                     buf[band][i] = theReplacementValue;
                }
             }
-         }
-         else
-         {
-            origin.y = ul.y;
-            for(y = 0; y < h; ++y)
+            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)
             {
-               origin.x = ul.x;
-               for(x =0; x < w; ++x)
-               {
-                  replace = true;
-                  switch(theClipMode)
-                  {
-                     case  ossimPixelFlipperClipMode_BOUNDING_RECT:
-                     {
-                        if(resLevel < theBoundingRects.size())
-                        {
-                           replace = theBoundingRects[resLevel].pointWithin(origin);
-                        }
-                        break;
-                     }
-                     case  ossimPixelFlipperClipMode_VALID_VERTICES:
-                     {
-                        if(resLevel < theValidVertices.size())
-                        {
-                           replace = theValidVertices[resLevel].isPointWithin(origin);
-                        }
-                        break;
-                     }
-                     default:
-                     {
-                        break;
-                     }
-                  }
-                  if(replace)
-                  {
-                     for (band=0; band<bands; ++band)
-                     {
-                        if (buf[band][i] != target)
-                        {
-                           replace = false;
-                           break;
-                        }
-                     }
-                  }
-                  
-                  if (replace)
-                  {
-                     for (band=0; band<bands; ++band)
-                     {
-                        buf[band][i] = replacement;
-                     }
-                  }
-                  ++i;
-                  ++origin.x;
-               }
-               ++origin.y;
+               // check for target range replacement qualification:
+               if ((buf[band][i] < targetLo) || (buf[band][i] > targetHi))
+                  can_replace = true;
+               else
+                  found_candidate = true;
             }
-         }
-            
-         break;
-      }
-      default:  // REPLACE_ALL_TARGETS
-      {
-         i = 0;
-         if((theClipMode == ossimPixelFlipperClipMode_NONE)||(!needsTesting))
-         {
-            for(i = 0; i < size;++i)
+            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)
-               {
-                  if (buf[band][i] == target) buf[band][i] = replacement;
-               }
+                  buf[band][i] = theReplacementValue;
             }
-         }
-         else
-         {
-            origin.y = ul.y;
-            for(y = 0; y < h; ++y)
+            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)
             {
-               origin.x = ul.x;
-               for(x =0; x < w; ++x)
-               {
-                  replace = true;
-                  
-                  switch(theClipMode)
-                  {
-                     case  ossimPixelFlipperClipMode_BOUNDING_RECT:
-                     {
-                        if(resLevel < theBoundingRects.size())
-                        {
-                           replace = theBoundingRects[resLevel].pointWithin(origin);
-                        }
-                        break;
-                     }
-                     case  ossimPixelFlipperClipMode_VALID_VERTICES:
-                     {
-                        if(resLevel < theValidVertices.size())
-                        {
-                           replace = theValidVertices[resLevel].isPointWithin(origin);
-                        }
-                        break;
-                     }
-                     default:
-                     {
-                        break;
-                     }
-                  }
-                  if(replace)
-                  {
-                     for (band=0; band<bands; ++band)
-                     {
-                        if (buf[band][i] == target) buf[band][i] = replacement;
-                     }
-                  }
-                  ++i;
-                  ++origin.x;
-               }
-               ++origin.y;
+               // check for target range replacement qualification:
+               if ((buf[band][i] < targetLo) || (buf[band][i] > targetHi))
+                  can_replace = false;
             }
-         }
-         break;
-      }
+            if (can_replace)
+            {
+               // Map all pixels to replacement value: 
+               for (band=0; band<bands; ++band)
+                  buf[band][i] = theReplacementValue;
+            }
+            break;
 
-      if (do_clamp)
-      {
-         for (i=0; i<size; ++i)
-         { 
-            for (band=0; band<bands; ++band)
+         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)
             {
-               if (buf[band][i] > clamp)
-               {
-                  buf[band][i] = clamp;
-               }
+               // 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();
@@ -590,7 +420,7 @@ template <class T> void ossimPixelFlipper::clipTile(T /* dummy */,
                                                     ossimImageData* inputTile,
                                                     ossim_uint32 resLevel)
 {
-   if(theClipMode == ossimPixelFlipperClipMode_NONE)
+   if(theClipMode == NONE)
    {
       theClipTileBuffer = 0;
       return;
@@ -613,11 +443,11 @@ template <class T> void ossimPixelFlipper::clipTile(T /* dummy */,
       
       switch(theClipMode)
       {
-         case ossimPixelFlipperClipMode_NONE:
+         case NONE:
          {
             break;
          }
-         case ossimPixelFlipperClipMode_BOUNDING_RECT:
+         case BOUNDING_RECT:
          {
             if(resLevel < theBoundingRects.size())
             {
@@ -647,7 +477,7 @@ template <class T> void ossimPixelFlipper::clipTile(T /* dummy */,
             }
             break;
          }
-         case ossimPixelFlipperClipMode_VALID_VERTICES:
+         case VALID_VERTICES:
          {
             if(resLevel < theValidVertices.size())
             {
@@ -687,7 +517,6 @@ template <class T> void ossimPixelFlipper::clipTile(T /* dummy */,
                      origin.x = ul.x;
                      for(x = 0; x < w; ++x)
                      {
-                        
                         if(!p.isPointWithin(origin))
                         {
                            inputTile->setNull(offset);
@@ -772,7 +601,7 @@ ossimScalarType ossimPixelFlipper::getOutputScalarType() const
    {
       ossimScalarType scalar = theInputConnection->getOutputScalarType();
       {
-         if (scalar == OSSIM_USHORT16 && theClampValue == 2047.0)
+         if (scalar == OSSIM_USHORT16 && theClampValueHi == 2047.0)
          {
             //---
             // Special case:
@@ -792,44 +621,76 @@ ossim_float64 ossimPixelFlipper::getMaxPixelValue (ossim_uint32 band) const
    const ossim_float64 MIN = ossimImageSourceFilter::getMinPixelValue(band);
    const ossim_float64 MAX = ossimImageSourceFilter::getMaxPixelValue(band);
 
-   if (theClampValue > MIN && theClampValue < MAX)
-   {
-      return theClampValue;
-   }
+   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* prefix)
 {
    const char* lookupReturn;
    
-   lookupReturn = kwl.find(prefix, TARGET_VALUE_KW);
+   lookupReturn = kwl.find(prefix, PF_TARGET_VALUE_KW);
    if(lookupReturn)
    {
       setTargetValue(atof(lookupReturn));
    }
 
-   lookupReturn = kwl.find(prefix, REPLACEMENT_VALUE_KW);
+   lookupReturn = kwl.find(prefix, PF_TARGET_RANGE_KW);
    if(lookupReturn)
    {
-      setReplacementValue(atof(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, CLAMP_VALUE_KW);
+   lookupReturn = kwl.find(prefix, PF_REPLACEMENT_VALUE_KW);
    if(lookupReturn)
    {
-      setClampValue(atof(lookupReturn));
+      setReplacementValue(atof(lookupReturn));
    }
 
-   lookupReturn = kwl.find(prefix, REPLACEMENT_MODE_KW);
+   lookupReturn = kwl.find(prefix, PF_REPLACEMENT_MODE_KW);
    if(lookupReturn)
    {
       ossimString modeString = lookupReturn;
       setReplacementMode(modeString);
    }
-   lookupReturn = kwl.find(prefix, CLIP_MODE_KW);
+
+   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;
@@ -852,12 +713,26 @@ bool ossimPixelFlipper::saveState(ossimKeywordlist& kwl,
    // Call the base class saveState.
    ossimImageSourceFilter::saveState(kwl, prefix);
 
-   kwl.add(prefix, TARGET_VALUE_KW,      theTargetValue);
-   kwl.add(prefix, REPLACEMENT_VALUE_KW, theReplacementValue);
-   kwl.add(prefix, CLAMP_VALUE_KW,       theClampValue);
-   kwl.add(prefix, REPLACEMENT_MODE_KW,  getReplacementModeString().c_str());
-   kwl.add(prefix, CLIP_MODE_KW,  getClipModeString().c_str());
-   
+   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;
 }
 
@@ -868,9 +743,23 @@ void ossimPixelFlipper::setTargetValue(ossim_float64 target_value)
    // 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);
+   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);
 
-   theTargetValue = target_value;
+   theTargetValueLo = target_min;
+   theTargetValueHi = target_max; 
 }
 
 void ossimPixelFlipper::setReplacementValue(ossim_float64 replacement_value)
@@ -884,55 +773,76 @@ void ossimPixelFlipper::setReplacementValue(ossim_float64 replacement_value)
    }
 }
 
-void ossimPixelFlipper::setClampValue(ossim_float64 clamp_value)
+void ossimPixelFlipper::setClampValue(ossim_float64 clamp_value, bool clamp_max_value)
 {
-	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
-   
+   OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
+
    if (inRange(clamp_value))
    {
-      theClampValue = 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)
+void ossimPixelFlipper::setReplacementMode(ossimPixelFlipper::ReplacementMode mode)
 {
 	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
    theReplacementMode = mode;
 }
 
-void ossimPixelFlipper::setReplacementMode(const ossimString& modeString)
+bool ossimPixelFlipper::setReplacementMode(const ossimString& modeString)
 {
 	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
 
    ossimString mode = modeString;
-   mode.downcase();
-   if (mode == "replace_partial_targets")
+   mode.upcase();
+   if (mode == "REPLACE_BAND_IF_TARGET")
    {
-      theReplacementMode = ossimPixelFlipper::REPLACE_PARTIAL_TARGETS;
+      theReplacementMode = REPLACE_BAND_IF_TARGET;
    }
-   else if (mode == "replace_partial_targets_all_bands")
+   else if (mode == "REPLACE_BAND_IF_PARTIAL_TARGET")
    {
-      theReplacementMode =
-         ossimPixelFlipper::REPLACE_PARTIAL_TARGETS_ALL_BANDS;
+      theReplacementMode = REPLACE_BAND_IF_PARTIAL_TARGET;
    }
-   else if (mode == "replace_full_targets")
+   else if (mode == "REPLACE_ALL_BANDS_IF_PARTIAL_TARGET")
    {
-      theReplacementMode = ossimPixelFlipper::REPLACE_FULL_TARGETS;
+      theReplacementMode = REPLACE_ALL_BANDS_IF_PARTIAL_TARGET;
    }
-   else if (mode == "replace_all_targets")
+   else if (mode == "REPLACE_ONLY_FULL_TARGETS")
    {
-      theReplacementMode = ossimPixelFlipper::REPLACE_ALL_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"
-         << "Invalide mode:  " << modeString
+         << "Invalid mode:  " << modeString
          << endl;
+      return false;
    }
-
+   return true;
 }
 
 void ossimPixelFlipper::setClipMode(ossimPixelFlipper::ClipMode mode)
@@ -947,35 +857,29 @@ void ossimPixelFlipper::setClipMode(const ossimString& modeString)
    mode.downcase();
    if (mode == "none")
    {
-      setClipMode(ossimPixelFlipperClipMode_NONE);
+      setClipMode(NONE);
    }
    else if (mode == "bounding_rect")
    {
-      setClipMode(ossimPixelFlipperClipMode_BOUNDING_RECT);
+      setClipMode(BOUNDING_RECT);
    }
    else if (mode == "valid_vertices")
    {
-      setClipMode(ossimPixelFlipperClipMode_VALID_VERTICES);
+      setClipMode(VALID_VERTICES);
    }
    else
    {
       ossimNotify(ossimNotifyLevel_WARN)
          << "ossimPixelFlipper::setClipMode warning:\n"
-         << "Invalide mode:  " << modeString
+         << "Invalid mode:  " << modeString
          << endl;
    }
 }
 
-ossim_float64 ossimPixelFlipper::getClampValue() const
-{
-   return theClampValue;
-}
-
-
-ossim_float64 ossimPixelFlipper::getTargetValue() const
-{
-   return theTargetValue;
-}
+//ossim_float64 ossimPixelFlipper::getTargetValue() const
+//{
+//   return theTargetValueLo;
+//}
 
 ossim_float64 ossimPixelFlipper::getReplacementValue() const
 {
@@ -991,14 +895,16 @@ ossimString ossimPixelFlipper::getReplacementModeString()  const
 {
    switch(theReplacementMode)
    {
-      case REPLACE_ALL_TARGETS:
-         return ossimString("replace_all_targets");
-      case REPLACE_PARTIAL_TARGETS:
-         return ossimString("replace_partial_targets");
-      case REPLACE_PARTIAL_TARGETS_ALL_BANDS:
-         return ossimString("replace_partial_targets_all_bands");
-      case REPLACE_FULL_TARGETS:
-         return ossimString("replace_full_targets");
+      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;
    }
@@ -1008,25 +914,11 @@ ossimString ossimPixelFlipper::getReplacementModeString()  const
 
 ossimString ossimPixelFlipper::getClipModeString()  const
 {
-   switch(theClipMode)
-   {
-      case ossimPixelFlipperClipMode_NONE:
-      {
-         return ossimString("none");
-      }
-      case ossimPixelFlipperClipMode_BOUNDING_RECT:
-      {
-         return ossimString("bounding_rect");
-      }
-      case REPLACE_PARTIAL_TARGETS_ALL_BANDS:
-      {
-         return ossimString("valid_vertices");
-      }
-      default:
-      {
-         break;
-      }
-   }
+   if (theClipMode == BOUNDING_RECT)
+      return ossimString("bounding_rect");
+
+   if (theClipMode == VALID_VERTICES)
+      return ossimString("valid_vertices");
 
    return ossimString("none");
 }
@@ -1039,9 +931,11 @@ ossimPixelFlipper::ClipMode ossimPixelFlipper::getClipMode() const
 std::ostream& ossimPixelFlipper::print(std::ostream& out) const
 {
    out << "ossimPixelFlipper::print:"
-       << "\ntarget value:       " << theTargetValue
+       << "\ntarget value Lo:    " << theTargetValueLo
+       << "\ntarget value Hi:    " << theTargetValueHi
        << "\nreplacement value:  " << theReplacementValue
-       << "\nclamp value:        " << theClampValue
+       << "\nclamp value Lo:     " << theClampValueLo
+       << "\nclamp value Hi:     " << theClampValueHi
        << "\nreplacement mode:   " << getReplacementModeString().c_str()
        << "\nclip_mode:          " << getClipModeString().c_str()
       << endl;
@@ -1054,15 +948,31 @@ ossimRefPtr<ossimProperty> ossimPixelFlipper::getProperty(
    // Lock for the length of this method.
 	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
 
-   if (name == TARGET_VALUE_KW)
+   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(theTargetValue));
+         ossimString::toString(theTargetValueLo));
       p->setCacheRefreshBit();
       return ossimRefPtr<ossimProperty>(p);
    }
-   else if (name == REPLACEMENT_VALUE_KW)
+   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,
@@ -1070,20 +980,28 @@ ossimRefPtr<ossimProperty> ossimPixelFlipper::getProperty(
        p->setCacheRefreshBit();
       return ossimRefPtr<ossimProperty>(p);
    }
-   else if (name == CLAMP_VALUE_KW)
+   else if (name == PF_CLAMP_VALUE_LO_KW)
    {
       ossimProperty* p =
-         new ossimNumericProperty(name, ossimString::toString(theClampValue));
-       p->setCacheRefreshBit();
+         new ossimNumericProperty(name, ossimString::toString(theClampValueLo));
+      p->setCacheRefreshBit();
       return ossimRefPtr<ossimProperty>(p);
    }
-   else if (name == REPLACEMENT_MODE_KW)
+   else if (name == PF_CLAMP_VALUE_HI_KW)
    {
-      vector<ossimString> constraintList(4);
-      constraintList[0] = "replace_all_targets";
-      constraintList[1] = "replace_partial_targets";
-      constraintList[2] = "replace_partial_targets_all_bands";
-      constraintList[3] = "replace_full_targets";
+      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,
@@ -1093,7 +1011,7 @@ ossimRefPtr<ossimProperty> ossimPixelFlipper::getProperty(
       p->setCacheRefreshBit();
       return ossimRefPtr<ossimProperty>(p);
    }
-   else if (name == CLIP_MODE_KW)
+   else if (name == PF_CLIP_MODE_KW)
    {
       vector<ossimString> constraintList(3);
       constraintList[0] = "none";
@@ -1132,23 +1050,35 @@ void ossimPixelFlipper::setProperty(ossimRefPtr<ossimProperty> property)
    ossimString os = property->valueToString();
    
    ossimString name = property->getName();
-   if (name == TARGET_VALUE_KW)
+   if (name == PF_TARGET_VALUE_KW)
    {
       setTargetValue(os.toDouble());
    }
-   else if  (name == REPLACEMENT_VALUE_KW)
+   if (name == TARGET_LOWER_LIMIT_PROP_NAME)
    {
-      setReplacementValue(os.toDouble());
+      setTargetRange(os.toDouble(), theTargetValueHi);
+   }
+   if (name == TARGET_UPPER_LIMIT_PROP_NAME)
+   {
+      setTargetRange(theTargetValueLo, os.toDouble());
    }
-   else if  (name == CLAMP_VALUE_KW)
+   else if  (name == PF_REPLACEMENT_VALUE_KW)
    {
-      setClampValue(os.toDouble());
+      setReplacementValue(os.toDouble());
    }
-   else if  (name == REPLACEMENT_MODE_KW)
+   else if  (name == PF_REPLACEMENT_MODE_KW)
    {
       setReplacementMode(os);
    }
-   else if  (name == CLIP_MODE_KW)
+   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);
    }
@@ -1161,11 +1091,14 @@ void ossimPixelFlipper::setProperty(ossimRefPtr<ossimProperty> property)
 void ossimPixelFlipper::getPropertyNames(
    std::vector<ossimString>& propertyNames)const
 {
-   propertyNames.push_back(TARGET_VALUE_KW);
-   propertyNames.push_back(REPLACEMENT_VALUE_KW);
-   propertyNames.push_back(CLAMP_VALUE_KW);
-   propertyNames.push_back(REPLACEMENT_MODE_KW);
-   propertyNames.push_back(CLIP_MODE_KW);
+   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);
 }
diff --git a/src/ossim/imaging/ossimPolyCutter.cpp b/src/ossim/imaging/ossimPolyCutter.cpp
index 3a1e5f1..6db4813 100644
--- a/src/ossim/imaging/ossimPolyCutter.cpp
+++ b/src/ossim/imaging/ossimPolyCutter.cpp
@@ -8,7 +8,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimPolyCutter.cpp 13660 2008-10-02 14:00:48Z gpotts $
+// $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>
@@ -23,7 +23,8 @@ RTTI_DEF1(ossimPolyCutter, "ossimPolyCutter", ossimImageSourceFilter)
 ossimPolyCutter::ossimPolyCutter()
    : ossimImageSourceFilter(),
      theTile(NULL),
-     theCutType(OSSIM_POLY_NULL_OUTSIDE)
+     theCutType(OSSIM_POLY_NULL_OUTSIDE),
+     m_boundingOverwrite(false)
 {
    thePolygonList.push_back(ossimPolygon());
    theBoundingRect.makeNan();
@@ -35,7 +36,8 @@ ossimPolyCutter::ossimPolyCutter(ossimImageSource* inputSource,
                                  const ossimPolygon& polygon)
    : ossimImageSourceFilter(inputSource),
      theTile(NULL),
-     theCutType(OSSIM_POLY_NULL_INSIDE)
+     theCutType(OSSIM_POLY_NULL_INSIDE),
+     m_boundingOverwrite(false)
 {
    thePolygonList.push_back(polygon);
    computeBoundingRect();
@@ -108,7 +110,7 @@ ossimRefPtr<ossimImageData> ossimPolyCutter::getTile(const ossimIrect& tileRect,
 //       ossimActiveEdgeTable aet;
       
       
-      if((theCutType == OSSIM_POLY_NULL_OUTSIDE))
+      if(theCutType == OSSIM_POLY_NULL_OUTSIDE)
       {
          if(boundingRect.intersects(tileRect))
          {
@@ -278,7 +280,6 @@ bool ossimPolyCutter::loadState(const ossimKeywordlist& kwl,
    return ossimImageSourceFilter::loadState(kwl, prefix);
 }
 
-
 void ossimPolyCutter::setPolygon(const vector<ossimDpt>& polygon,
                                  ossim_uint32 index)
 {
@@ -355,7 +356,7 @@ void ossimPolyCutter::computeBoundingRect()
 {
    ossimIrect bounds;
    theBoundingRect.makeNan();
-   
+
    for(int i = 0; i < (int)thePolygonList.size(); ++i)
    {
       thePolygonList[i].getBoundingRect(bounds);
@@ -373,6 +374,18 @@ void ossimPolyCutter::computeBoundingRect()
       }
    }
 }
+
+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)
diff --git a/src/ossim/imaging/ossimQbTileFilesHandler.cpp b/src/ossim/imaging/ossimQbTileFilesHandler.cpp
index 7490261..626b2d5 100644
--- a/src/ossim/imaging/ossimQbTileFilesHandler.cpp
+++ b/src/ossim/imaging/ossimQbTileFilesHandler.cpp
@@ -6,19 +6,12 @@
 //
 // 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.
+// Description: Image handler used for tiled Quickbird imagery. 
 //
 //*************************************************************************************************
-//  $Id$
-
-#include <algorithm>
+//  $Id: ossimQbTileFilesHandler.cpp 2814 2011-07-05 13:40:16Z oscar.kramer $
 
 #include <ossim/imaging/ossimQbTileFilesHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
 #include <ossim/base/ossimFilename.h>
 #include <ossim/base/ossimRegExp.h>
 #include <ossim/base/ossimRefPtr.h>
@@ -29,12 +22,15 @@
 #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", ossimImageHandler)
+RTTI_DEF1(ossimQbTileFilesHandler, "ossimQbTileFilesHandler", ossimTiledImageHandler)
 
 // Static trace for debugging
 static ossimTrace traceDebug("ossimQbTileFilesHandler:debug");
@@ -43,15 +39,6 @@ static ossimTrace traceDebug("ossimQbTileFilesHandler:debug");
 //!  Constructor (default):
 //*************************************************************************************************
 ossimQbTileFilesHandler::ossimQbTileFilesHandler()
-   : m_tileFiles(0),
-     m_tile(0),
-     m_fullImgRect(),
-#if USING_SUB_OVRS
-     m_startOvrResLevel(-1),
-     m_lockSubOvrs(false)
-#else
-     m_startOvrResLevel(1)
-#endif
 {
 }
 
@@ -60,7 +47,6 @@ ossimQbTileFilesHandler::ossimQbTileFilesHandler()
 //*************************************************************************************************
 ossimQbTileFilesHandler::~ossimQbTileFilesHandler()
 {
-   close();
 }
 
 //*************************************************************************************************
@@ -74,11 +60,17 @@ bool ossimQbTileFilesHandler::open()
    static const char* MODULE = "ossimQbTileFilesHandler::open() -- ";
    if (traceDebug())
    {
-      ossimNotify(ossimNotifyLevel_INFO)<<MODULE<<"Entering..."<<std::endl;
+      ossimNotify(ossimNotifyLevel_INFO)
+         <<MODULE << "Entering...\nimage: " << theImageFile << "\n";
    }
-
+   
    // Test for extension: image.til
-   ossimString ext = theImageFile.ext();
+   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() ) )
    {
@@ -101,6 +93,7 @@ bool ossimQbTileFilesHandler::open()
    // 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();
@@ -138,10 +131,31 @@ bool ossimQbTileFilesHandler::open()
                "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;
 
@@ -164,373 +178,6 @@ bool ossimQbTileFilesHandler::open()
 }
 
 //*************************************************************************************************
-//! Deletes the overview and clears the valid image vertices.  Derived
-//! classes should implement.
-//*************************************************************************************************
-void ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::isOpen()const
-{
-   if (m_tileFiles.size() > 0)
-      return true;
-
-   return false;
-}
-
-//*************************************************************************************************
-//! Initialize tile buffer to natch image datatype
-//*************************************************************************************************
-void ossimQbTileFilesHandler::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) << "ossimQbTileFilesHandler::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> ossimQbTileFilesHandler::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;
-}
-
-#if USING_SUB_OVRS
-//*************************************************************************************************
-// Overrides base class
-//*************************************************************************************************
-void ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::getNumberOfDecimationLevels() const
-{
-   return (ossim_uint32) theDecimationFactors.size();
-}
-
-#endif /* #if USING_SUB_OVRS */
-
-//*************************************************************************************************
 //! Fetch the tile-files common RPC data file and create the projection for this image
 //*************************************************************************************************
 ossimRefPtr<ossimImageGeometry> ossimQbTileFilesHandler::getImageGeometry()
@@ -556,135 +203,88 @@ ossimRefPtr<ossimImageGeometry> ossimQbTileFilesHandler::getImageGeometry()
 }
 
 //*************************************************************************************************
-//! @param resLevel Reduced resolution level to return lines of.
-//! Default = 0
-//! @return The number of lines for specified reduced resolution level.
+//! Initializes tile image rects by considering adjacent row/col offsets. Called when TIL
+//! doesn't contain the info. Returns true if successful.
 //*************************************************************************************************
-ossim_uint32 ossimQbTileFilesHandler::getNumberOfLines(ossim_uint32 resLevel) const
+bool ossimQbTileFilesHandler::computeImageRects()
 {
-   if (m_fullImgRect.hasNans())
-      return 0;
-
-   // Using simple decimation by powers of 2:
-   ossim_uint32 numlines = m_fullImgRect.height() >> resLevel;
-   return numlines;
-}
+   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;
+      }
 
-//*************************************************************************************************
-//! @param resLevel Reduced resolution level to return samples of.
-//! Default = 0
-//! @return The number of samples for specified reduced resolution level.
-//*************************************************************************************************
-ossim_uint32 ossimQbTileFilesHandler::getNumberOfSamples(ossim_uint32 resLevel) const
-{
-   if (m_fullImgRect.hasNans())
-      return 0;
+      // 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;
+         }
+      }
 
-   // Using simple decimation by powers of 2:
-   ossim_uint32 numsamps = m_fullImgRect.width() >> resLevel;
-   return numsamps;
-}
+      // 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);
 
-//*************************************************************************************************
-//! Method to save the state of an object to a keyword list.
-//! Return true if ok or false on error.
-//*************************************************************************************************
-bool ossimQbTileFilesHandler::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-  return ossimImageHandler::saveState(kwl, prefix);
-}
+         // 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;
 
-//*************************************************************************************************
-//! Method to the load (recreate) the state of an object from a keyword
-//! list.  Return true if ok or false on error.
-//*************************************************************************************************
-bool ossimQbTileFilesHandler::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   if (!ossimImageHandler::loadState(kwl, prefix))
+         m_tileFiles[i].subImageRects[0].set_lr(lr);
+      }
+   }
+   
+   catch (...)
+   {
+      // Could not establish the rectangles:
       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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::getImageRectangle(ossim_uint32 resLevel) const
-{
-   if (resLevel == 0)
-      return m_fullImgRect;
-
-   ossimDpt decimation;
-   getDecimationFactor(resLevel, decimation);
-
-   return m_fullImgRect*decimation;
-}
-
diff --git a/src/ossim/imaging/ossimQuickbirdNitfTileSource.cpp b/src/ossim/imaging/ossimQuickbirdNitfTileSource.cpp
index 64b1448..406cf40 100644
--- a/src/ossim/imaging/ossimQuickbirdNitfTileSource.cpp
+++ b/src/ossim/imaging/ossimQuickbirdNitfTileSource.cpp
@@ -10,12 +10,13 @@
 // Description:
 //
 //*******************************************************************
-//  $Id: ossimQuickbirdNitfTileSource.cpp 17932 2010-08-19 20:34:35Z dburken $
+//  $Id: ossimQuickbirdNitfTileSource.cpp 21631 2012-09-06 18:10:55Z 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);
diff --git a/src/ossim/imaging/ossimQuickbirdTiffTileSource.cpp b/src/ossim/imaging/ossimQuickbirdTiffTileSource.cpp
index 9aed1f4..846b587 100644
--- a/src/ossim/imaging/ossimQuickbirdTiffTileSource.cpp
+++ b/src/ossim/imaging/ossimQuickbirdTiffTileSource.cpp
@@ -13,9 +13,10 @@
 // Quick Bird ".TIL" files.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimQuickbirdTiffTileSource.cpp 17932 2010-08-19 20:34:35Z dburken $
+// $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>
@@ -32,26 +33,38 @@ static const ossimTrace traceDebug("ossimQuickbirdTiffTileSource:debug");
 //*************************************************************************************************
 bool ossimQuickbirdTiffTileSource::open()
 {
+   static const char M[] = "ossimQuickbirdTiffTileSource::open()";
+   
+   bool result = false;
+   
    if(traceDebug())
    {
-      ossimNotify(ossimNotifyLevel_DEBUG)<<"ossimQuickbirdTiffTileSource::open() -- ENTERED ..."
-         << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " ENTERED ..." << std::endl;
    }
-   
-   m_tileInfoFilename = theImageFile.noExtension().replaceAllThatMatch("_R[0-9]+C[0-9]+");
 
+   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())
+
+   if ( !m_tileInfoFilename.exists() )
    {
       m_tileInfoFilename.setExtension("til");
-      if (!m_tileInfoFilename.exists())  return false;
    }
 
-   // Call the base class open...
-   if (!ossimTiffTileSource::open())  return false;
+   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 true;
+   return result;
 }
 
 //*************************************************************************************************
@@ -63,66 +76,78 @@ bool ossimQuickbirdTiffTileSource::open()
 //*************************************************************************************************
 ossimRefPtr<ossimImageGeometry> ossimQuickbirdTiffTileSource::getImageGeometry()
 {
-   // Always try external geometry file first:
-   getExternalImageGeometry();
-   if (theGeometry.valid() && theGeometry->getTransform() && theGeometry->getProjection())
-      return theGeometry;
-
-   // Fetch the tile info for this particular image:
-   if (m_tileInfoFilename.empty())  
-      return ossimRefPtr<ossimImageGeometry>();
-   ossimQuickbirdTile tileFile;
-   if (!tileFile.open(m_tileInfoFilename)) 
-      return ossimRefPtr<ossimImageGeometry>();
-
-   ossimQuickbirdTileInfo info;
-   if(!tileFile.getInfo(info, theImageFile.file().upcase()))
+   if ( !theGeometry )
    {
-      if(!tileFile.getInfo(info, theImageFile.file().downcase()))
-         return ossimRefPtr<ossimImageGeometry>();
-   }
+      //---
+      // 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());
+               }
 
-   // 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 ( 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;
+                  }
 
-   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);
 
-   // Create the transform and set it in the geometry object:
-   ossimRefPtr<ossim2dTo2dTransform> transform = new ossim2dTo2dShiftTransform(shift);
-   theGeometry = new ossimImageGeometry;
-   theGeometry->setTransform(transform.get());
+                  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());
-   }
+                  // 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() );
-      
-   // Only return this geometry if a projection was successfully established:
-   if (theGeometry->getProjection())
-      return theGeometry;
+               // Set image things the geometry object should know about.
+               initImageParameters( theGeometry.get() );
+            }
+         }
+      }
+   }
 
-   return ossimRefPtr<ossimImageGeometry>();
+   return theGeometry;
 }
 
+
diff --git a/src/ossim/imaging/ossimRLevelFilter.cpp b/src/ossim/imaging/ossimRLevelFilter.cpp
index 8334c5e..d046497 100644
--- a/src/ossim/imaging/ossimRLevelFilter.cpp
+++ b/src/ossim/imaging/ossimRLevelFilter.cpp
@@ -8,8 +8,10 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimRLevelFilter.cpp 17932 2010-08-19 20:34:35Z dburken $
+// $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>
@@ -183,7 +185,7 @@ ossimRefPtr<ossimImageData> ossimRLevelFilter::getTile(
 {
    if(!theInputConnection)
    {
-      return NULL;
+      return 0;
    }
 
    if(!isSourceEnabled())
diff --git a/src/ossim/imaging/ossimReadmeFileWriter.cpp b/src/ossim/imaging/ossimReadmeFileWriter.cpp
index 68be314..60b5146 100644
--- a/src/ossim/imaging/ossimReadmeFileWriter.cpp
+++ b/src/ossim/imaging/ossimReadmeFileWriter.cpp
@@ -8,10 +8,7 @@
 // Author:  Kenneth Melero (kmelero at sanz.com)
 //
 //*******************************************************************
-//  $Id: ossimReadmeFileWriter.cpp 17932 2010-08-19 20:34:35Z dburken $
-
-#include <iostream>
-using namespace std;
+//  $Id: ossimReadmeFileWriter.cpp 21631 2012-09-06 18:10:55Z dburken $
 
 #include <ossim/imaging/ossimReadmeFileWriter.h>
 #include <ossim/base/ossimKeywordNames.h>
@@ -20,9 +17,12 @@ using namespace std;
 #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",
diff --git a/src/ossim/imaging/ossimRectangleCutFilter.cpp b/src/ossim/imaging/ossimRectangleCutFilter.cpp
index 5492ed2..16168fa 100644
--- a/src/ossim/imaging/ossimRectangleCutFilter.cpp
+++ b/src/ossim/imaging/ossimRectangleCutFilter.cpp
@@ -8,11 +8,13 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimRectangleCutFilter.cpp 18938 2011-02-22 17:57:10Z gpotts $
+// $Id: ossimRectangleCutFilter.cpp 21631 2012-09-06 18:10:55Z 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");
 
diff --git a/src/ossim/imaging/ossimResampler.cpp b/src/ossim/imaging/ossimResampler.cpp
index f52f050..df7a111 100644
--- a/src/ossim/imaging/ossimResampler.cpp
+++ b/src/ossim/imaging/ossimResampler.cpp
@@ -10,7 +10,7 @@
 // Contains class definition for ossimResampler.
 // 
 //*******************************************************************
-//  $Id: ossimResampler.cpp 15766 2009-10-20 12:37:09Z gpotts $
+//  $Id: ossimResampler.cpp 20204 2011-11-04 15:12:28Z dburken $
 
 
 #include <iostream>
@@ -531,7 +531,6 @@ void ossimResampler::resamplePartialTile(T,// not used
             }
             else
             {
-               double lastValue = ossim::nan();
                for (l = 0; l < theKernelWidth; l++)
                {
                   ossim_int32 index = Lx[m] + l + kernelHorizontalShift;
@@ -539,7 +538,6 @@ void ossimResampler::resamplePartialTile(T,// not used
                   {
                      if(ossim::isnan(h[index]) == false)
                      {
-                        lastValue = h[index];
                         x += h[index] * theWeightTableX[theKernelWidth - l-1][indexMod];
                      }
 
diff --git a/src/ossim/imaging/ossimRgbImage.cpp b/src/ossim/imaging/ossimRgbImage.cpp
index 437db1b..ebc543a 100644
--- a/src/ossim/imaging/ossimRgbImage.cpp
+++ b/src/ossim/imaging/ossimRgbImage.cpp
@@ -58,7 +58,7 @@
      
 // END OF COPYRIGHT STATEMENT
 //*************************************************************************
-// $Id: ossimRgbImage.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
+// $Id: ossimRgbImage.cpp 21184 2012-06-29 15:13:09Z dburken $
 
 #include <cstdlib>
 #include <cmath>
@@ -1066,7 +1066,7 @@ void ossimRgbImage::drawFilledArc (int cx,
    ossimIpt pts[3];
    int i;
    int lx = 0, ly = 0;
-   int fx, fy;
+   // int fx, fy;
    int w2, h2;
    w2 = w / 2;
    h2 = h / 2;
@@ -1090,11 +1090,11 @@ void ossimRgbImage::drawFilledArc (int cx,
          pts[2].y = cy;
          drawFilledPolygon (pts, 3);
       }
-      else
-      {
-         fx = x;
-         fy = y;
-      }
+      // else
+      // {
+      //   fx = x;
+      //   fy = y;
+      // }
       lx = x;
       ly = y;
    }
@@ -1113,7 +1113,7 @@ void ossimRgbImage::drawArc (int cx,
    }
    int i;
    int lx = 0, ly = 0;
-   int fx, fy;
+   // int fx, fy;
    int w2, h2;
    w2 = w / 2;
    h2 = h / 2;
@@ -1130,11 +1130,11 @@ void ossimRgbImage::drawArc (int cx,
       {
          drawLine (lx, ly, x, y);
       }
-      else
-      {
-         fx = x;
-         fy = y;
-      }
+      // else
+      //       {
+      //          fx = x;
+      //          fy = y;
+      //       }
       lx = x;
       ly = y;
    }
diff --git a/src/ossim/imaging/ossimRgbToGreyFilter.cpp b/src/ossim/imaging/ossimRgbToGreyFilter.cpp
index 44810c7..141dca5 100644
--- a/src/ossim/imaging/ossimRgbToGreyFilter.cpp
+++ b/src/ossim/imaging/ossimRgbToGreyFilter.cpp
@@ -8,7 +8,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimRgbToGreyFilter.cpp 11347 2007-07-23 13:01:59Z gpotts $
+// $Id: ossimRgbToGreyFilter.cpp 19223 2011-03-24 13:38:21Z dburken $
 
 #include <ossim/imaging/ossimRgbToGreyFilter.h>
 #include <ossim/imaging/ossimU8ImageData.h>
@@ -198,21 +198,20 @@ void ossimRgbToGreyFilter::runUcharTransformation(ossimRefPtr<ossimImageData>& t
       bandSrc[1]  = static_cast<unsigned char*>(tile->getBuf(1));
       bandSrc[2]  = static_cast<unsigned char*>(tile->getBuf(1));      
    }
-   else if(tile->getNumberOfBands() == 3)
+   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());
    
-   long offset;
+   ossim_int32 offset;
 
-   long upperBound = tile->getWidth()*tile->getHeight();
+   ossim_int32 upperBound = tile->getWidth()*tile->getHeight();
    for(offset = 0; offset < upperBound; ++offset)
    {
-      long value;
+      ossim_int32 value;
       
       value = ossim::round<int>(theC1*(bandSrc[0][offset]) +
                     theC2*(bandSrc[1][offset]) +
@@ -223,7 +222,6 @@ void ossimRgbToGreyFilter::runUcharTransformation(ossimRefPtr<ossimImageData>& t
 
       bandDest[offset] = value;
    }
-   
 
    delete [] bandSrc;
 }
diff --git a/src/ossim/imaging/ossimRpfCacheTileSource.cpp b/src/ossim/imaging/ossimRpfCacheTileSource.cpp
index e04030e..f631f55 100644
--- a/src/ossim/imaging/ossimRpfCacheTileSource.cpp
+++ b/src/ossim/imaging/ossimRpfCacheTileSource.cpp
@@ -1237,14 +1237,14 @@ void ossimRpfCacheTileSource::populateLut()
    theLut = 0;
    if(m_fileNames.size() > 0)
    {
-      bool found = false;
+      // bool found = false;
       ossimRpfFrameEntry tempEntry;
       ossimRpfFrame aFrame;
       ossimFilename fileName = m_fileNames[0].split("|")[0];
-      if (fileName.exists())
-      {
-         found = true;
-      }
+      // if (fileName.exists())
+      // {
+      //    found = true;
+      // }
 
       if(aFrame.parseFile(fileName)
          == ossimErrorCodes::OSSIM_OK)
diff --git a/src/ossim/imaging/ossimSFIMFusion.cpp b/src/ossim/imaging/ossimSFIMFusion.cpp
index 1ee15df..c63979a 100644
--- a/src/ossim/imaging/ossimSFIMFusion.cpp
+++ b/src/ossim/imaging/ossimSFIMFusion.cpp
@@ -6,7 +6,7 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimSFIMFusion.cpp 17603 2010-06-21 11:39:37Z gpotts $
+//  $Id: ossimSFIMFusion.cpp 20061 2011-09-07 16:46:16Z gpotts $
 #include <ossim/imaging/ossimSFIMFusion.h>
 #include <ossim/matrix/newmat.h>
 #include <ossim/matrix/newmatio.h>
@@ -14,7 +14,10 @@
 #include <ossim/base/ossim2dLinearRegression.h>
 #include <ossim/base/ossimNormRgbVector.h>
 #include <ossim/base/ossimHsiVector.h>
+#include <ossim/base/ossimVisitor.h>
+#include <ossim/imaging/ossimImageGeometry.h>
 #include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimBooleanProperty.h>
 
 RTTI_DEF2(ossimSFIMFusion, "ossimSFIMFusion", ossimFusionCombiner, ossimAdjustableParameterInterface);
 
@@ -27,6 +30,7 @@ ossimSFIMFusion::ossimSFIMFusion()
    :theLowPassKernelWidth(1.5),
     theHighPassKernelWidth(3)
 {
+   theAutoAdjustScales = true;
    theLowPassFilter  = new ossimImageGaussianFilter;
    theHighPassFilter = new ossimConvolutionSource;
 
@@ -202,9 +206,48 @@ void ossimSFIMFusion::initialize()
                                                      theIntensityConnection->getObject()));
       theHighPassFilter->connectMyInputTo(0, PTR_CAST(ossimConnectableObject,
                                                       theIntensityConnection->getObject()));
+      adjustableParametersChanged();
       setFilters();
       theLowPassFilter->initialize();
       theHighPassFilter->initialize();
+      if(theAutoAdjustScales)
+      {
+         if(theInputConnection && theIntensityConnection)
+         {
+            ossimTypeNameVisitor visitor("ossimImageRenderer", true);
+            
+            theInputConnection->accept(visitor);
+            ossimRefPtr<ossimConnectableObject> inputColor = visitor.getObjectAs<ossimConnectableObject>();
+            visitor.reset();
+            theIntensityConnection->accept(visitor);
+            ossimRefPtr<ossimConnectableObject> inputPan = visitor.getObjectAs<ossimConnectableObject>();
+            
+            
+            if(inputColor.valid()&&inputPan.valid())
+            {
+               ossimImageSource* inputColorSource = dynamic_cast<ossimImageSource*> (inputColor->getInput());
+               ossimImageSource* inputPanSource = dynamic_cast<ossimImageSource*> (inputPan->getInput());
+               
+               if(inputColorSource&&inputPanSource)
+               {
+                  ossimRefPtr<ossimImageGeometry> colorGeom     = inputColorSource->getImageGeometry();
+                  ossimRefPtr<ossimImageGeometry> intensityGeom = inputPanSource->getImageGeometry();
+                  if(colorGeom.valid()&&intensityGeom.valid())
+                  {
+                     ossimDpt gsdIntensity = intensityGeom->getMetersPerPixel();
+                     ossimDpt gsdColor     = colorGeom->getMetersPerPixel();
+                     if(!gsdColor.hasNans()&&!gsdIntensity.hasNans())
+                     {
+                        double scaleChange = gsdColor.length()/gsdIntensity.length();
+                        if(scaleChange < 1.0) scaleChange = 1.0;
+                        setParameterOffset(LOW_PASS_WIDTH_OFFSET,
+                                           scaleChange);
+                     }
+                  }
+               }
+            }
+         }
+      }
    }
 }
 
@@ -276,18 +319,22 @@ void ossimSFIMFusion::adjustableParametersChanged()
 void ossimSFIMFusion::setProperty(ossimRefPtr<ossimProperty> property)
 {
    ossimString name = property->getName();
-   if(name=="lowPassKernelWidth")
+   if(name=="low_pass_kernel_width")
    {
       setParameterOffset(LOW_PASS_WIDTH_OFFSET,
                          property->valueToString().toDouble(),
                          true);
    }
-   else if(name=="highPassGain")
+   else if(name=="high_pass_gain")
    {
       setParameterOffset(HIGH_PASS_GAIN_OFFSET,
                          property->valueToString().toDouble(),
                          true);
    }
+   else if(name=="auto_adjust_scales")
+   {
+      theAutoAdjustScales =  property->valueToString().toBool();
+   }
    else
    {
       ossimFusionCombiner::setProperty(property);
@@ -296,19 +343,29 @@ void ossimSFIMFusion::setProperty(ossimRefPtr<ossimProperty> property)
 
 ossimRefPtr<ossimProperty> ossimSFIMFusion::getProperty(const ossimString& name)const
 {
-   if(name == "lowPassKernelWidth")
+   if(name == "low_pass_kernel_width")
    {
-      return new ossimNumericProperty(name, 
+      ossimNumericProperty* prop =  new ossimNumericProperty(name, 
                                       ossimString::toString(computeParameterOffset(LOW_PASS_WIDTH_OFFSET)),
                                       getParameterCenter(LOW_PASS_WIDTH_OFFSET)-getParameterSigma(LOW_PASS_WIDTH_OFFSET),
                                       getParameterCenter(LOW_PASS_WIDTH_OFFSET)+getParameterSigma(LOW_PASS_WIDTH_OFFSET));
+      prop->setCacheRefreshBit();
+      return prop;
    }
-   else if(name == "highPassGain")
+   else if(name == "high_pass_gain")
    {
-      return new ossimNumericProperty(name, 
+      ossimNumericProperty* prop =  new ossimNumericProperty(name, 
                                       ossimString::toString(computeParameterOffset(HIGH_PASS_GAIN_OFFSET)),
                                       getParameterCenter(HIGH_PASS_GAIN_OFFSET)-getParameterSigma(HIGH_PASS_GAIN_OFFSET),
                                       getParameterCenter(HIGH_PASS_GAIN_OFFSET)+getParameterSigma(HIGH_PASS_GAIN_OFFSET));
+      prop->setCacheRefreshBit();
+      return prop;
+   }
+   else if(name=="auto_adjust_scales")
+   {
+      ossimBooleanProperty* prop = new ossimBooleanProperty(name,theAutoAdjustScales);
+      prop->setCacheRefreshBit();
+      return prop;
    }
    
    return ossimFusionCombiner::getProperty(name);
@@ -317,8 +374,9 @@ ossimRefPtr<ossimProperty> ossimSFIMFusion::getProperty(const ossimString& name)
 void ossimSFIMFusion::getPropertyNames(std::vector<ossimString>& propertyNames)const
 {
    ossimFusionCombiner::getPropertyNames(propertyNames);
-   propertyNames.push_back("lowPassKernelWidth");
-   propertyNames.push_back("highPassGain");
+   propertyNames.push_back("low_pass_kernel_width");
+   propertyNames.push_back("high_pass_gain");
+   propertyNames.push_back("auto_adjust_scales");
 }
 
 bool ossimSFIMFusion::saveState(ossimKeywordlist& kwl,
@@ -326,7 +384,11 @@ bool ossimSFIMFusion::saveState(ossimKeywordlist& kwl,
 {
    ossimFusionCombiner::saveState(kwl, prefix);
    saveAdjustments(kwl, prefix);
-
+   kwl.add(prefix,
+           "auto_adjust_scales",
+           theAutoAdjustScales,
+           true);
+   
    return true;
 }
 
@@ -336,6 +398,11 @@ bool ossimSFIMFusion::loadState(const ossimKeywordlist& kwl,
    ossimFusionCombiner::loadState(kwl, prefix);
    loadAdjustments(kwl, prefix);
    adjustableParametersChanged();
-   
+   ossimString autoAdjustScales = kwl.find(prefix, "auto_adjust_scales");
+                                    
+   if(!autoAdjustScales.empty())
+   {
+      theAutoAdjustScales = autoAdjustScales.toBool();
+   }
    return true;
 }
diff --git a/src/ossim/imaging/ossimScalarRemapper.cpp b/src/ossim/imaging/ossimScalarRemapper.cpp
index a6b4613..4ea5be7 100644
--- a/src/ossim/imaging/ossimScalarRemapper.cpp
+++ b/src/ossim/imaging/ossimScalarRemapper.cpp
@@ -11,7 +11,7 @@
 // This class is used to remap image data from one scalar type to another.
 //
 //*******************************************************************
-//  $Id: ossimScalarRemapper.cpp 17495 2010-06-01 23:21:42Z gpotts $
+//  $Id: ossimScalarRemapper.cpp 22135 2013-02-02 16:27:24Z dburken $
 
 #include <iostream>
 
@@ -168,25 +168,26 @@ ossimRefPtr<ossimImageData> ossimScalarRemapper::getTile(
       case OSSIM_NORMALIZED_DOUBLE:
       {
          // Un-normalize and copy the buffer to the destination tile.
-         theTile->copyNormalizedBufferToTile(static_cast<double*>(
-                                                inputTile->getBuf()));
+         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()));
+         theTile->copyNormalizedBufferToTile(
+            static_cast<float*>( inputTile->getBuf() ) );
          break;
       }
-      case OSSIM_SINT16:
-      case OSSIM_UINT16:
-      case OSSIM_SINT32:
+      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();
+         // inputTile->stretchMinMax();
 
          // Normalize and copy the source tile to a buffer.
          inputTile->copyTileToNormalizedBuffer(theNormBuf);
@@ -196,16 +197,6 @@ ossimRefPtr<ossimImageData> ossimScalarRemapper::getTile(
 
          break;
       }
-      default:
-      {
-         // 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();
diff --git a/src/ossim/imaging/ossimScaleFilter.cpp b/src/ossim/imaging/ossimScaleFilter.cpp
index 0da8c12..e0b753d 100644
--- a/src/ossim/imaging/ossimScaleFilter.cpp
+++ b/src/ossim/imaging/ossimScaleFilter.cpp
@@ -8,9 +8,10 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimScaleFilter.cpp 17932 2010-08-19 20:34:35Z dburken $
+// $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>
diff --git a/src/ossim/imaging/ossimSingleImageChain.cpp b/src/ossim/imaging/ossimSingleImageChain.cpp
index 94a70e6..48d8bf5 100644
--- a/src/ossim/imaging/ossimSingleImageChain.cpp
+++ b/src/ossim/imaging/ossimSingleImageChain.cpp
@@ -63,7 +63,6 @@ ossimSingleImageChain::ossimSingleImageChain(bool addHistogramFlag,
 
 ossimSingleImageChain::~ossimSingleImageChain()
 {
-   close();
 }
 
 void ossimSingleImageChain::reset()
@@ -110,9 +109,9 @@ ossimFilename ossimSingleImageChain::getFilename() const
    return result;
 }
 
-bool ossimSingleImageChain::open(const ossimFilename& file)
+bool ossimSingleImageChain::open(const ossimFilename& file, bool openOverview)
 {
-   return addImageHandler(file);
+   return addImageHandler(file, openOverview);
 }
 
 bool ossimSingleImageChain::isOpen() const
@@ -295,13 +294,13 @@ void ossimSingleImageChain::createRenderedChain(const ossimSrcRecord& src)
 
 }
 
-bool ossimSingleImageChain::addImageHandler(const ossimFilename& file)
+bool ossimSingleImageChain::addImageHandler(const ossimFilename& file, bool openOverview)
 {
    bool result = false;
 
    close();
    
-   m_handler = ossimImageHandlerRegistry::instance()->open(file);
+   m_handler = ossimImageHandlerRegistry::instance()->open(file, true, openOverview);
    
    if ( m_handler.valid() )
    {
@@ -740,3 +739,28 @@ ossimScalarType ossimSingleImageChain::getImageHandlerScalarType() const
    }
    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/src/ossim/imaging/ossimSrtmTileSource.cpp b/src/ossim/imaging/ossimSrtmTileSource.cpp
index 09d9b3a..b00166d 100644
--- a/src/ossim/imaging/ossimSrtmTileSource.cpp
+++ b/src/ossim/imaging/ossimSrtmTileSource.cpp
@@ -9,12 +9,13 @@
 // Image handler class for a Shuttle Radar Topography Mission (SRTM) file.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimSrtmTileSource.cpp 17932 2010-08-19 20:34:35Z dburken $
+// $Id: ossimSrtmTileSource.cpp 21631 2012-09-06 18:10:55Z dburken $
 
 #include <ossim/imaging/ossimSrtmTileSource.h>
 #include <ossim/base/ossimDirectory.h>
 #include <ossim/base/ossimStringProperty.h>
 #include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageGeometry.h>
 #include <ossim/support_data/ossimSrtmSupportData.h>
 
 RTTI_DEF1(ossimSrtmTileSource,
@@ -66,13 +67,14 @@ bool ossimSrtmTileSource::open()
    ossimGeneralRasterInfo generalRasterInfo;
    bool result = generalRasterInfo.loadState(kwl);
    
-   theMetaData.loadState(kwl);
-   
+   // theMetaData.loadState(kwl);
+   theMetaData = generalRasterInfo.getImageMetaData();
+
    if(result)
    {
        result =  ossimGeneralRasterTileSource::open(generalRasterInfo);
    }
-   
+
    if (traceDebug())
    {
       CLOG << " Exited with " << (result?"true":"false") << " ..."
diff --git a/src/ossim/imaging/ossimTableRemapper.cpp b/src/ossim/imaging/ossimTableRemapper.cpp
index 34584d7..e238515 100644
--- a/src/ossim/imaging/ossimTableRemapper.cpp
+++ b/src/ossim/imaging/ossimTableRemapper.cpp
@@ -16,7 +16,7 @@
 // uses a normalized remap table (more scalar independent).
 //
 //*************************************************************************
-// $Id: ossimTableRemapper.cpp 17495 2010-06-01 23:21:42Z gpotts $
+// $Id: ossimTableRemapper.cpp 21787 2012-09-30 21:27:09Z gpotts $
 
 #include <ossim/imaging/ossimTableRemapper.h>
 #include <ossim/base/ossimTrace.h>
@@ -72,6 +72,7 @@ void ossimTableRemapper::initialize()
    // Note:  This will reset "theInputConnection" if it changed...
    //---
    ossimImageSourceFilter::initialize();
+   destroy();
    if (theInputConnection)
    {
       // Since we override "getOutputScalarType" make sure something's set.
@@ -82,12 +83,12 @@ void ossimTableRemapper::initialize()
 
       if (theTile.valid())
       {
-         if ( theTile->getNumberOfBands() !=
-              theInputConnection->getNumberOfOutputBands() )
-         {
+         //if ( theTile->getNumberOfBands() !=
+         //     theInputConnection->getNumberOfOutputBands() )
+        // {
             // Wipe everything slick. The next getTile will call allocate.
-            destroy();
-         }
+        //    destroy();
+        // }
       }
    }
 
@@ -107,16 +108,18 @@ void ossimTableRemapper::allocate(const ossimIrect& rect)
       ossim_uint32 width  = rect.width();
       ossim_uint32 height = rect.height();
       theInputScalarType  = theInputConnection->getOutputScalarType();
-      
-      theTile =
-         ossimImageDataFactory::instance()->create(this,
-                                                   getOutputScalarType(),
-                                                   getNumberOfOutputBands(),
-                                                   width,
-                                                   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)
       {
@@ -131,7 +134,9 @@ void ossimTableRemapper::allocate(const ossimIrect& rect)
                                                      getNumberOfOutputBands(),
                                                      width,
                                                      height);
+         theTmpTile->setMinPix(theTile->getMinPix(), theTile->getNumberOfBands());
          theTmpTile->initialize();
+
       }
 
       if (theTableType == ossimTableRemapper::NORMALIZED ||
@@ -309,21 +314,21 @@ template <class T> void ossimTableRemapper::remapFromNativeTable(
             // 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 >=0) && (table_index < theTableBinCount))
+            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(table_index < 0)
+//            {
+//               if(theTableBinCount > 1)
+//               {
+//                  d[pixel] = rt[1];
+//               }
+//               else
+//               {
+//                  d[pixel] = table_index;
+ //              }
+ //           }
             else
             {
                if(theTableBinCount>0)
@@ -382,18 +387,18 @@ void ossimTableRemapper::remapFromNormalizedTable(
       for (ossim_uint32 pixel = 0; pixel < PPB; ++pixel)
       {
          // Get the source pixel...
-         ossim_uint32 index
+         ossim_uint32 idx
             = static_cast<ossim_uint32>(buf[pixel]*theTableBinCount+0.5);
 
-         if((index < theTableBinCount) && (index >=0))
+         if((idx < theTableBinCount))
          {
             // If within range use to index the remap table; else, null.
-            p = (index < theTableBinCount) ? rt[index] : 0.0;
-         }
-         else if(index < 0)
-         {
-            p = 0.0;
+            p = (idx < theTableBinCount) ? rt[idx] : 0.0;
          }
+//         else if(idx < 0)
+//         {
+//            p = 0.0;
+//         }
          else 
          {
             p = 1.0;
diff --git a/src/ossim/imaging/ossimTiffOverviewBuilder.cpp b/src/ossim/imaging/ossimTiffOverviewBuilder.cpp
index c29b09f..c01dc82 100644
--- a/src/ossim/imaging/ossimTiffOverviewBuilder.cpp
+++ b/src/ossim/imaging/ossimTiffOverviewBuilder.cpp
@@ -11,15 +11,7 @@
 // Contains class definition for TiffOverviewBuilder
 // 
 //*******************************************************************
-//  $Id: ossimTiffOverviewBuilder.cpp 19044 2011-03-10 15:33:12Z dburken $
-
-#include <algorithm> /* for std::fill */
-// #include <cstring>
-#include <sstream>
-using namespace std;
-#include <xtiffio.h>
-
-#include <ossim/imaging/ossimTiffOverviewBuilder.h>
+//  $Id: ossimTiffOverviewBuilder.cpp 22366 2013-08-09 12:13:24Z gpotts $
 
 #include <ossim/imaging/ossimTiffOverviewBuilder.h>
 #include <ossim/parallel/ossimMpi.h>
@@ -35,17 +27,22 @@ using namespace std;
 #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/ossimImageMetaData.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)
@@ -53,10 +50,11 @@ RTTI_DEF1(ossimTiffOverviewBuilder,
 static ossimTrace traceDebug("ossimTiffOverviewBuilder:degug");
 
 // Property keywords.
-static const char COPY_ALL_KW[] = "copy_all_flag";
+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 19044 2011-03-10 15:33:12Z dburken $";
+static const char OSSIM_ID[] = "$Id: ossimTiffOverviewBuilder.cpp 22366 2013-08-09 12:13:24Z gpotts $";
 #endif
 
 
@@ -66,8 +64,6 @@ static const char OSSIM_ID[] = "$Id: ossimTiffOverviewBuilder.cpp 19044 2011-03-
 ossimTiffOverviewBuilder::ossimTiffOverviewBuilder()
    :
       ossimOverviewBuilderBase(),
-      m_imageHandler(0),
-      m_outputFile(ossimFilename::NIL),
       m_nullDataBuffer(0),
       m_bytesPerPixel(1),
       m_bitsPerSample(8),
@@ -81,7 +77,8 @@ ossimTiffOverviewBuilder::ossimTiffOverviewBuilder()
       m_resampleType(ossimFilterResampler::ossimFilterResampler_BOX),
       m_nullPixelValues(),
       m_copyAllFlag(false),
-      m_outputTileSizeSetFlag(false)
+      m_outputTileSizeSetFlag(false),
+      m_internalOverviewsFlag(false)
 {
    if (traceDebug())
    {
@@ -101,8 +98,6 @@ ossimTiffOverviewBuilder::ossimTiffOverviewBuilder()
 
 ossimTiffOverviewBuilder::~ossimTiffOverviewBuilder()
 {
-   m_imageHandler = 0;
-   m_alphaMask.clear();
 }
 
 void ossimTiffOverviewBuilder::setResampleType(
@@ -111,8 +106,7 @@ void ossimTiffOverviewBuilder::setResampleType(
    m_resampleType = resampleType;
 }
 
-bool ossimTiffOverviewBuilder::buildOverview(
-   const ossimFilename& overview_file, bool copy_all)
+bool ossimTiffOverviewBuilder::buildOverview(const ossimFilename& overview_file, bool copy_all)
 {
    if (traceDebug())
    {
@@ -144,8 +138,9 @@ bool ossimTiffOverviewBuilder::execute()
       return false;
    }
 
-   if ( !m_imageHandler )
+   if ( !m_imageHandler || m_imageHandler->hasError() )
    {
+      setErrorStatus();
       return false;
    }
 
@@ -156,7 +151,7 @@ bool ossimTiffOverviewBuilder::execute()
    }
 
    // Check the file.  Disallow same file overview building.
-   if (m_imageHandler->getFilename() == m_outputFile)
+   if ( !buildInternalOverviews() && (m_imageHandler->getFilename() == m_outputFile) )
    {
       ossimNotify(ossimNotifyLevel_WARN)
          << "Source image file and overview file cannot be the same!"
@@ -164,15 +159,20 @@ bool ossimTiffOverviewBuilder::execute()
       return false;
    }
 
-   // Add .tmp in case process gets aborted to avoid leaving bad .ovr file.
-   ossimFilename outputFileTemp = m_outputFile + ".tmp";
+   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 (!m_copyAllFlag)
+   if ( !copyR0() )
    {
       startingResLevel = m_imageHandler->getNumberOfDecimationLevels();
    }
@@ -195,9 +195,33 @@ bool ossimTiffOverviewBuilder::execute()
          << MODULE << " NOTICE:"
          << "\nImage has required reduced resolution data sets.\nReturning..."
          << std::endl;
-      return false;
+      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.
 
@@ -206,47 +230,18 @@ bool ossimTiffOverviewBuilder::execute()
 
    if (ossimMpi::instance()->getRank() == 0 )
    {
-      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())));
-      ossimString openMode = "w";
-      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";
-         }
-      }
-      
       //---
       // See if the file can be opened for writing.
       // Note:  If this file existed previously it will be overwritten.
       //---
-      tif = openTiff(outputFileTemp, openMode);
+      tif = openTiff(outputFileTemp);
       if (!tif)
       {
          // Set the error...
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_OPEN_FILE_ERROR,
-                       "%s file %s line %d\nCannot open file:  %s",
-                       MODULE,
-                       __FILE__,
-                       __LINE__,
-                       outputFileTemp.c_str());      
+         setErrorStatus();
+         ossimNotify(ossimNotifyLevel_WARN)
+            << __FILE__ << " " << __LINE__ << " " << MODULE
+            << "\nCannot open file: " << outputFileTemp << std::endl;
          return false;
       } 
 
@@ -266,11 +261,11 @@ bool ossimTiffOverviewBuilder::execute()
          if (!writeR0(tif))
          {
             // Set the error...
-            ossimSetError(getClassName(),
-                          ossimErrorCodes::OSSIM_ERROR,
-                          "File %s line %d\nError copying image!",
-                          __FILE__,
-                          __LINE__);
+            setErrorStatus();
+            ossimNotify(ossimNotifyLevel_WARN)
+               << __FILE__ << " " << __LINE__
+               << "\nError copying image!" << std::endl;
+
             closeTiff(tif);
             if (progressListener)
             {
@@ -278,6 +273,11 @@ bool ossimTiffOverviewBuilder::execute()
                delete progressListener;
                progressListener = 0;
             }
+            
+            if ( outputFileTemp.exists() && !buildInternalOverviews() )
+            {
+               ossimFilename::remove( outputFileTemp );
+            }
             return false;
          }
 
@@ -306,6 +306,7 @@ bool ossimTiffOverviewBuilder::execute()
       {
          TIFFFlush(tif);
       }
+
       // Sync all processes...
       ossimMpi::instance()->barrier();
       
@@ -315,7 +316,7 @@ bool ossimTiffOverviewBuilder::execute()
       // If we copied r0 to the overview file use it instead of the
       // original image handler as it is probably faster.
       //---
-      if ( i <= m_imageHandler->getNumberOfDecimationLevels())
+      if ( !copyR0() && (i <= m_imageHandler->getNumberOfDecimationLevels()) ) 
       {
          ih = m_imageHandler;
       }
@@ -325,45 +326,70 @@ bool ossimTiffOverviewBuilder::execute()
          ih = new ossimTiffTileSource;
          if ( ih->open(outputFileTemp) == false )
          {
+            ih = 0;
+            
             // Set the error...
-            ossimSetError(getClassName(),
-                          ossimErrorCodes::OSSIM_OPEN_FILE_ERROR,
-                          "%s file %s line %d\nCannot open file:  %s",
-                          MODULE,
-                          __FILE__,
-                          __LINE__,
-                          outputFileTemp.c_str());   
+            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 ( !writeRn( ih.get(), tif, i, (i==startingResLevel) ) )
+      // 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...
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_WRITE_FILE_ERROR,
-                       "\
-%s file %s line %d\nError creating reduced res set!",
-                       MODULE,
-                       __FILE__,
-                       __LINE__);
+         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)
          {
@@ -379,6 +405,11 @@ bool ossimTiffOverviewBuilder::execute()
          return false;
       }
       
+      if (m_bitMaskSpec.getSize() > 0)
+      {
+         m_maskFilter->disconnectMyInput(0);
+         m_maskWriter->disconnectAllInputs();
+      }
       ih = 0;
    }
 
@@ -389,6 +420,14 @@ bool ossimTiffOverviewBuilder::execute()
          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)
       {
@@ -396,39 +435,23 @@ bool ossimTiffOverviewBuilder::execute()
          delete progressListener;
          progressListener = 0;
       }
+
+      if ( !buildInternalOverviews() )
+      {
+         outputFileTemp.rename(m_outputFile);
+      }
       
-      outputFileTemp.rename(m_outputFile);
       if(traceDebug())
       {
          ossimNotify(ossimNotifyLevel_INFO)
             << "Wrote file:  " << m_outputFile.c_str() << std::endl;
       }
-      ossimFilename file=m_outputFile;
-      file = file.setExtension("omd");
-      ossimKeywordlist kwl;
-      if(file.exists())
-      {
-         kwl.addFile(file.c_str());
-         
-      }
-      ossimImageMetaData metaData(m_imageHandler->getOutputScalarType(),
-                                  m_imageHandler->getNumberOfInputBands());
-      
-      uint32 i= 0;
-      
-      for(i = 0; i < metaData.getNumberOfBands(); ++i)
-      {
-         metaData.setMinPix(i,  m_imageHandler->getMinPixelValue(i));
-         metaData.setMaxPix(i,  m_imageHandler->getMaxPixelValue(i));
-         metaData.setNullPix(i, m_imageHandler->getNullPixelValue(i));
-      }
-      metaData.saveState(kwl);
-      kwl.write(file.c_str());
      
       setCurrentMessage(ossimString("Finished..."));
    }
-
    
+   finalize();  // Reset band list if a band selector.
+
    return true;
 }
 
@@ -440,8 +463,8 @@ bool ossimTiffOverviewBuilder::writeR0(TIFF* tif)
 
    if (!setTags(tif, rect, 0))
    {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " Error writing tags!" << std::endl;
+      closeTiff(tif);
+      ossimNotify(ossimNotifyLevel_WARN) << MODULE << " Error writing tags!" << std::endl;
       return false;
    }
    
@@ -502,12 +525,24 @@ bool ossimTiffOverviewBuilder::writeR0(TIFF* tif)
                                                 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->getNumberOfInputBands();
+              band < m_imageHandler->getNumberOfOutputBands();
               ++band)
          {
             tdata_t data;
@@ -578,11 +613,21 @@ bool ossimTiffOverviewBuilder::writeR0(TIFF* tif)
    return true;
 }
 
-bool ossimTiffOverviewBuilder::writeRn(ossimImageHandler* imageHandler,
-                                       TIFF* tif,
-                                       ossim_uint32 resLevel,
-                                       bool firstResLevel)
+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.
@@ -604,27 +649,49 @@ bool ossimTiffOverviewBuilder::writeRn(ossimImageHandler* imageHandler,
    {
       sequencer = new ossimOverviewSequencer();
    }
-
+   
    sequencer->setImageHandler(imageHandler);
 
-   ossim_uint32 sourceResLevel = imageHandler->getNumberOfDecimationLevels() - 1;
+   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 && ( getHistogramMode() != OSSIM_HISTO_MODE_UNKNOWN) )
+   if ( firstResLevel )
    {
-      // Accumulate a histogram.  Can't do with mpi/multi-process.
-      if(ossimMpi::instance()->getNumberOfProcessors() == 1)
+      // Set up things that are only performed on first scan through tiles.
+      
+      if ( getHistogramMode() != OSSIM_HISTO_MODE_UNKNOWN )
       {
-         sequencer->setHistogramMode(getHistogramMode());
+         // 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);
       }
-      //---
-      // else{} Not sure if we want an error thrown here.  For now will handle at the
-      // application level.
-      //---
    }
+
+   // Note sequence setup must be performed before intialize. 
    sequencer->initialize();
 
    // If we are a slave process start the resampling of tiles.
@@ -653,13 +720,14 @@ bool ossimTiffOverviewBuilder::writeRn(ossimImageHandler* imageHandler,
 
    if (!setTags(tif, rect, resLevel))
    {
+      setErrorStatus();
       closeTiff(tif);
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " Error writing tags!" << std::endl;
+      tif = 0;
+      ossimNotify(ossimNotifyLevel_WARN) << MODULE << " Error writing tags!" << std::endl;
       return false;
    }
 
-   if ( !m_copyAllFlag && (resLevel == 1) )
+   if ( !buildInternalOverviews() && !copyR0() && (resLevel == 1) )
    {
       //---
       // Set the geotif tags for the first layer.
@@ -696,12 +764,6 @@ bool ossimTiffOverviewBuilder::writeRn(ossimImageHandler* imageHandler,
    // Tile loop in the line direction.
    ossim_uint32 y = 0;
 
-   if (resLevel == 1 && m_maskBuildFlag)
-   {
-      m_alphaMask.clear();
-      openMaskFile();
-   }
-
    for(ossim_uint32 i = 0; i < outputTilesHigh; ++i)
    {
       // Tile loop in the sample (width) direction.
@@ -710,7 +772,17 @@ bool ossimTiffOverviewBuilder::writeRn(ossimImageHandler* imageHandler,
       {
          // Grab the resampled tile.
          ossimRefPtr<ossimImageData> t = sequencer->getNextTile();
-         if (t.valid() && ( t->getDataObjectStatus() != OSSIM_NULL ) )
+
+         // 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)
@@ -737,12 +809,6 @@ bool ossimTiffOverviewBuilder::writeRn(ossimImageHandler* imageHandler,
                   return false;
                }
             }
-            if (resLevel == 1 && m_maskBuildFlag)
-            {
-              t->computeAlphaChannel();
-              ossim_uint8* alphaValues = t->getAlphaBuf();
-              packAlphaValues(alphaValues, t->getImageRectangle(), rect.width());
-            }
          }
          x += m_tileWidth; // Increment x for next TIFFWriteTile.
          ++tileNumber;      // Increment tile number for percent complete.
@@ -765,29 +831,36 @@ bool ossimTiffOverviewBuilder::writeRn(ossimImageHandler* imageHandler,
 
    } // End of tile loop in the line (height) direction.
 
-   if (resLevel == 1 && m_maskBuildFlag)
-   {
-     closeMaskFile();
-   }
-
    //---
    // Write the current dirctory.
    //---
-   if (!TIFFWriteDirectory(tif))
+   if (!TIFFFlush(tif))
    {
+      setErrorStatus();
       ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " Error writing directory!" << std::endl;
+         << MODULE << " Error writing to TIF file!" << std::endl;
       return false;
    }
 
-   if ( firstResLevel && ( getHistogramMode() != OSSIM_HISTO_MODE_UNKNOWN) )
+   if ( firstResLevel )
    {
-      // Write the histogram.
-      if(ossimMpi::instance()->getNumberOfProcessors() == 1)
+      if ( ossimMpi::instance()->getNumberOfProcessors() == 1 )
       {
-         ossimFilename histoFilename = getOutputFile();
-         histoFilename.setExtension("his");
-         sequencer->writeHistogram(histoFilename);
+         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);
+         }
       }
    }
 
@@ -844,12 +917,37 @@ bool ossimTiffOverviewBuilder::setTags(TIFF* tif,
    
    TIFFSetField( tif, TIFFTAG_TILEWIDTH,  m_tileWidth  );
    TIFFSetField( tif, TIFFTAG_TILELENGTH, m_tileHeight );
-   
-   // Set the compression related tags...
-   TIFFSetField( tif, TIFFTAG_COMPRESSION, m_tiffCompressType );
-   if (m_tiffCompressType == COMPRESSION_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.
+   //---
+   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
    {
-      TIFFSetField( tif, TIFFTAG_JPEGQUALITY,  m_jpegCompressQuality);
+      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.
@@ -915,34 +1013,55 @@ bool ossimTiffOverviewBuilder::setGeotiffTags(const ossimImageGeometry* geom,
    return result;
 }
 
-TIFF* ossimTiffOverviewBuilder::openTiff(const ossimString& filename,
-                                         const ossimString& openMode)
+TIFF* ossimTiffOverviewBuilder::openTiff(const ossimString& filename) const
 {
-// #ifdef OSSIM_HAS_GEOTIFF
-// #  if OSSIM_HAS_GEOTIFF
+   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() );
-// #  else
-//    return TIFFOpen( filename.c_str(), openMode.c_str() );
-// #  endif
-// #else
-//    return TIFFOpen( filename.c_str(), openMode.c_str() );
-// #endif
 }
 
 void ossimTiffOverviewBuilder::closeTiff(TIFF* tif)
 {
-// #ifdef OSSIM_HAS_GEOTIFF
-// #  if OSSIM_HAS_GEOTIFF 
-      XTIFFClose( tif );
-// #  else
-//       TIFFClose( tif );
-// #  endif
-// #else
-//       TIFFClose( tif );   
-// #endif
+   XTIFFClose( tif );
 }
 
-
 void ossimTiffOverviewBuilder::setCompressionType(ossim_uint16 compression_type)
 {
    switch (compression_type)
@@ -957,14 +1076,11 @@ void ossimTiffOverviewBuilder::setCompressionType(ossim_uint16 compression_type)
       m_tiffCompressType = COMPRESSION_NONE;
       if (traceDebug())
       {
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_WARNING,
-                       "\
-ossimTiffOverviewBuilder::setCompressionType\nfile %s line %d\n\
-Unsupported compression type: %d  Defaulting to none.",
-                       __FILE__,
-                       __LINE__,
-                       compression_type);
+         ossimNotify(ossimNotifyLevel_WARN)
+            << __FILE__ << " " << __LINE__
+            << "\nossimTiffOverviewBuilder::setCompressionType Unsupported compression type: "
+            << compression_type << "\nDefaulting to none."
+            << std::endl;
       }
       break;
    }
@@ -980,15 +1096,11 @@ void ossimTiffOverviewBuilder::setJpegCompressionQuality(ossim_int32 quality)
    {
       m_jpegCompressQuality = DEFAULT_COMPRESS_QUALITY;
 
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_WARNING,
-                    "\
-ossimTiffOverviewBuilder::setJpegCompressionQuality\n%s file %s \
-line %d Compression quality of %d is out of range!\nis out of range!\n\
-Range is 100 to 1.  Current quality set to default of 75.",
-                    __FILE__,
-                    __LINE__,
-                    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;
    }
 }
 
@@ -1002,6 +1114,16 @@ 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;
@@ -1019,16 +1141,28 @@ void ossimTiffOverviewBuilder::setOutputFile(const ossimFilename& file)
 
 ossimFilename ossimTiffOverviewBuilder::getOutputFile() const
 {
-   ossimFilename result = m_outputFile;
+   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())
+      if ( m_imageHandler.valid() )
       {
          bool usePrefix = (m_imageHandler->getNumberOfEntries()>1?true:false);
          result = m_imageHandler->
             getFilenameWithThisExtension(ossimString("ovr"), usePrefix);
       }
    }
+   
    return result;
 }
 
@@ -1041,156 +1175,123 @@ void ossimTiffOverviewBuilder::setOutputTileSize(const ossimIpt& tileSize)
 
 bool ossimTiffOverviewBuilder::setInputSource(ossimImageHandler* imageSource)
 {
-   static const char MODULE[] =
-      "ossimTiffOverviewBuilder::initializeFromHandler";
-
-   m_imageHandler         = imageSource;
+   static const char MODULE[] = "ossimTiffOverviewBuilder::initializeFromHandler";
 
-   if (!m_imageHandler)
+   bool result = ossimOverviewBuilderBase::setInputSource( imageSource );
+   
+   if ( result )
    {
-      // Set the error...
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " ERROR:"
-         << "\nNull image handler pointer passed to constructor! Returning..."
-         << std::endl;
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "%s File %s line %d\nNULL pointer passed to constructor!",
-                    MODULE,
-                    __FILE__,
-                    __LINE__);
-      return false;
+      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 if (m_imageHandler->getErrorStatus() ==
-            ossimErrorCodes::OSSIM_ERROR)
+   else
    {
       // Set the error...
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+      setErrorStatus();
       ossimNotify(ossimNotifyLevel_WARN)
          << MODULE << " ERROR:"
-         << "\nError detected in image handler!  Returning..."
+         << "\nSetting image handler as input failed!"
          << std::endl;
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "%s file %s line %d\nImageHandler error detected!",
-                    MODULE,
-                    __FILE__,
-                    __LINE__);
-      return false;
-   }
-
-   if(!m_outputTileSizeSetFlag)
-   {
-   // Note:  Need a default overview tile size in preferences...
-      ossimIpt tileSize;
-      ossim::defaultTileSize(tileSize);
-//       if(m_imageHandler->isImageTiled())
-//       {
-//          if(m_imageHandler->getBoundingRect().width() != m_imageHandler->getImageTileWidth())
-//          {
-//             tileSize = ossimIpt(m_imageHandler->getImageTileWidth(),
-//                                 m_imageHandler->getImageTileHeight());
-//          }
-//       }
-
-      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...
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " ERROR:"
-            << "\nUnknow pixel type:  "
-            << (ossimScalarTypeLut::instance()->
-                getEntryString(m_imageHandler->getOutputScalarType()))
-            << std::endl;
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "Unknown pixel type!",
-                       __FILE__,
-                       __LINE__);
-         return false;
    }
 
-   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);
+   return result;
 
-   return true;
-}
+} // End: ossimTiffOverviewBuilder::setInputSource(ossimImageHandler* imageSource)
 
 bool ossimTiffOverviewBuilder::setOverviewType(const ossimString& type)
 {
@@ -1242,36 +1343,39 @@ void ossimTiffOverviewBuilder::setProperty(ossimRefPtr<ossimProperty> property)
       }
       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;
-      }
+         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() ==
-              ossimKeywordNames::OVERVIEW_STOP_DIMENSION_KW)
+      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();
       }
@@ -1291,6 +1395,7 @@ void ossimTiffOverviewBuilder::getPropertyNames(std::vector<ossimString>& proper
    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);
 }
 
@@ -1307,160 +1412,27 @@ bool ossimTiffOverviewBuilder::canConnectMyInputTo(
    return false;
 }
 
-void ossimTiffOverviewBuilder::packAlphaValues(ossim_uint8* alphaValues, 
-                                               ossimIrect rect,
-                                               ossim_uint32 maskWidth)
+bool ossimTiffOverviewBuilder::buildInternalOverviews() const
 {
-   ossim_uint32 tileCount = std::ceil((double)maskWidth/(double)rect.width());
-   maskWidth = rect.width() * tileCount;
-
-   ossim_uint32 rowNum = rect.ul().y;
-   ossim_uint32 index = 0;
-   bool isMaskWidth = false;
-   for (ossim_uint32 line = 0; line < rect.height(); ++line)
+   bool result = false;
+   if ( m_internalOverviewsFlag &&  m_imageHandler.valid() )
    {
-      std::vector<ossim_uint8> pixelValues;
-      pixelValues.reserve(rect.width());
-      for (ossim_uint32 sample = 0; sample < rect.width(); ++sample)
-      {
-         if (alphaValues[index+sample] == 255)
-         {
-            pixelValues.push_back(1);
-         }
-         else
-         {
-            pixelValues.push_back(0);
-         }
-      }
-      index += rect.width();
-
-      std::map<ossim_uint32, std::vector<ossim_uint8> >::iterator it = m_alphaMask.find(rowNum);
-      if (it != m_alphaMask.end())
+      if ( m_imageHandler->getClassName() == "ossimTiffTileSource" )
       {
-         std::vector<ossim_uint8> fullVector;
-         fullVector.reserve(it->second.size() + pixelValues.size());
-         fullVector.insert(fullVector.end(), it->second.begin(), it->second.end());
-         fullVector.insert(fullVector.end(), pixelValues.begin(), pixelValues.end());
-         m_alphaMask[rowNum] = fullVector;
-         if (fullVector.size() == maskWidth)
-         {
-            isMaskWidth = true;
-         }
-         fullVector.clear();
+         result = true;
       }
       else
       {
-         m_alphaMask[rowNum] = pixelValues;
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "Internal overviews opton not supported for class: "
+            << m_imageHandler->getClassName()
+            << std::endl;
       }
-
-      pixelValues.clear();
-      rowNum++;
    }
-
-   if (isMaskWidth)
-   {
-      writeMaskStrip();
-   }
-}
-
-bool ossimTiffOverviewBuilder::openMaskFile()
-{
-   const char* M = "ossimTiffOverviewBuilder::openMaskFile() -- ";
-
-   // Open new mask file:
-   setErrorStatus();
-   ossimFilename file = m_outputFile;
-   file.setExtension("mask");
-   m_maskFileStream.open(file.chars(), ios::out | ios::binary);
-   if(!m_maskFileStream.is_open())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)<<M<<"Error encountered trying to create mask file <"<<
-         file<<">. Cannot write mask.";
-      return false;
-   }
-   clearErrorStatus();
-   return true;
-}
-
-bool ossimTiffOverviewBuilder::closeMaskFile()
-{
-   if (m_maskFileStream.is_open())
-   {
-      m_maskFileStream.flush();
-      m_maskFileStream.close();
-   }
-   m_maskFileStream.clear();
-   return true;
+   return result;
 }
 
-bool ossimTiffOverviewBuilder::writeMaskStrip()
+bool ossimTiffOverviewBuilder::copyR0() const
 {
-   const char* M = "ossimTiffOverviewBuilder::writeMaskStrip() -- ";
-
-   if (!m_maskFileStream.is_open())
-   {
-      return false;
-   }
-
-   std::map<ossim_uint32, std::vector<ossim_uint8> >::iterator it = m_alphaMask.begin();
-   while (it != m_alphaMask.end())
-   {
-      std::vector<ossim_uint8> bitPixels = it->second; 
-      ossim_uint32 rowSize = (ossim_uint32)bitPixels.size();
-      
-      //Calculate the buffer size
-      ossim_uint32 bufferSize = rowSize/8;
-      ossim_uint32 remainPixels = bufferSize%8;
-      if (remainPixels > 0)
-      {
-         bufferSize = bufferSize + 1;
-      }
-      
-      char* mask = new char[rowSize];
-      char* buffer = new char[bufferSize];
-      
-      for (ossim_uint32 i = 0; i < bitPixels.size(); i++)
-      {
-         mask[i] = bitPixels[i];
-      }
-      it++;
-      
-      // Fill buffer byte with 8 pixels worth of mask data, starting from first pixel:
-      ossim_uint32 mask_index = 0;
-      for (ossim_uint32 i = 0; i < bufferSize; i++)
-      {
-         if (mask_index > rowSize)//make index equal to mask size if it is bigger
-         {
-            mask_index = rowSize;
-         }
-         
-         buffer[i] = 0;
-         buffer[i] |= mask[mask_index++] << 7;
-         buffer[i] |= mask[mask_index++] << 6;
-         buffer[i] |= mask[mask_index++] << 5;
-         buffer[i] |= mask[mask_index++] << 4;
-         buffer[i] |= mask[mask_index++] << 3;
-         buffer[i] |= mask[mask_index++] << 2;
-         buffer[i] |= mask[mask_index++] << 1;
-         buffer[i] |= mask[mask_index++];
-      }
-      
-      // Write the alpha mask to general raster:
-      m_maskFileStream.write(buffer, bufferSize);
-      
-      if (m_maskFileStream.fail())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)<<M<<"ERROR encountered writing mask file!";
-         delete [] mask;
-         delete [] buffer;
-         return false;
-      }
-      
-      delete [] mask;
-      delete [] buffer;
-   }
-   
-   m_alphaMask.clear();
-   
-   return true;
+   return ( m_copyAllFlag && !buildInternalOverviews());
 }
diff --git a/src/ossim/imaging/ossimTiffTileSource.cpp b/src/ossim/imaging/ossimTiffTileSource.cpp
index 6d7cae0..e53064f 100644
--- a/src/ossim/imaging/ossimTiffTileSource.cpp
+++ b/src/ossim/imaging/ossimTiffTileSource.cpp
@@ -12,14 +12,15 @@
 // Contains class definition for TiffTileSource.
 //
 //*******************************************************************
-//  $Id: ossimTiffTileSource.cpp 18441 2010-11-22 16:09:36Z gpotts $
+//  $Id: ossimTiffTileSource.cpp 22282 2013-06-09 14:57:06Z dburken $
 
-#include <cstdlib> /* for abs(int) */
 #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>
@@ -33,6 +34,8 @@
 #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)
 
@@ -89,7 +92,11 @@ ossimTiffTileSource::ossimTiffTileSource()
       thePhotometric(0),
       theRowsPerStrip(0),
       theImageTileWidth(0),
-      theImageTileLength(0)
+      theImageTileLength(0),
+      theImageDirectoryList(0),
+      theCurrentTiffRlevel(0),
+      theCompressionType(0),
+      theOutputBandList(0)
 {}
 
 ossimTiffTileSource::~ossimTiffTileSource()
@@ -98,10 +105,14 @@ ossimTiffTileSource::~ossimTiffTileSource()
 }
 
 ossimRefPtr<ossimImageData> ossimTiffTileSource::getTile(
-   const  ossimIrect& tile_rect,
-   ossim_uint32 resLevel)
+   const ossimIrect& tile_rect, ossim_uint32 resLevel )
 {
-   if (theTile.valid())
+   if ( theTile.valid() == false )
+   {
+      allocateTile(); // First time through...
+   }
+   
+   if ( theTile.valid() )
    {
       // Image rectangle must be set prior to calling getTile.
       theTile->setImageRectangle(tile_rect);
@@ -121,10 +132,10 @@ ossimRefPtr<ossimImageData> ossimTiffTileSource::getTile(
 bool ossimTiffTileSource::getTile(ossimImageData* result,
                                   ossim_uint32 resLevel)
 {
-   static const char MODULE[] ="ossimTiffTileSource::getTile(rect, res)";
+   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.
@@ -167,28 +178,16 @@ bool ossimTiffTileSource::getTile(ossimImageData* result,
             }
          }
 
-         //---
-         // 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.
          // Note passed the non adjusted resLevel by design.
          //---
-         ossimIrect zeroBasedTileRect = tile_rect;
-
-         //---
-         // 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 ( zeroBasedTileRect.intersects(image_rect) )
+         if ( tile_rect.intersects(image_rect) )
          {
             // Initialize the tile if needed as we're going to stuff it.
             if (result->getDataObjectStatus() == OSSIM_NULL)
@@ -221,12 +220,15 @@ bool ossimTiffTileSource::getTile(ossimImageData* result,
                if (reallocateBuffer)
                {
                   // NOTE: Using this buffer will be a thread issue. (drb) 
-                  allocateBuffer();
+                  status = allocateBuffer();
                }
+            }
+
+            if ( status )
+            {  
+               ossimIrect clip_rect = tile_rect.clipToRect( image_rect );
                
-               ossimIrect clip_rect = zeroBasedTileRect.clipToRect(image_rect);
-               
-               if ( !zeroBasedTileRect.completely_within(clip_rect) )
+               if ( !tile_rect.completely_within( clip_rect ) )
                {
                   //---
                   // We're not going to fill the whole tile so start with a
@@ -236,7 +238,7 @@ bool ossimTiffTileSource::getTile(ossimImageData* result,
                }
                
                // Load the tile buffer with data from the tif.
-               if ( loadTile(zeroBasedTileRect, clip_rect, result) )
+               if ( loadTile( tile_rect, clip_rect, result ) )
                {
                   result->validate();
                   status = true;
@@ -280,12 +282,31 @@ bool ossimTiffTileSource::getTile(ossimImageData* result,
 bool ossimTiffTileSource::saveState(ossimKeywordlist& kwl,
                                     const char* prefix) const
 {
-   kwl.add(prefix,
-           "apply_color_palette_flag",
-           theApplyColorPaletteFlag,
-           true);
-   // Currently nothing to do here.
-   return ossimImageHandler::saveState(kwl, prefix);
+   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;
 }
 
 //*******************************************************************
@@ -294,23 +315,39 @@ bool ossimTiffTileSource::saveState(ossimKeywordlist& kwl,
 bool ossimTiffTileSource::loadState(const ossimKeywordlist& kwl,
                                     const char* prefix)
 {
+   bool result = false;
+   theOutputBandList.clear();
+
    if (ossimImageHandler::loadState(kwl, prefix))
    {
-      ossimString flag = kwl.find(prefix,
-                                  "apply_color_palette_flag");
-      if(flag != "")
+      std::string pfx = ( prefix ? prefix : "" );
+      std::string key = "apply_color_palette_flag";
+      ossimString value;
+      
+      value.string() = kwl.findKey( pfx, key );
+      if ( value.size() )
       {
-         theApplyColorPaletteFlag = flag.toBool();
+         theApplyColorPaletteFlag = value.toBool();
       }
       else
       {
          theApplyColorPaletteFlag = true;
       }
+
+      key = ossimKeywordNames::BANDS_KW;
+      value.string() = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         ossim::toSimpleVector( theOutputBandList, value );
+      }
       
-     return open();
+      if ( open() ) 
+      {
+         // Set the band list after open so that the overview also gets set.
+         result = true;
+      }
    }
-
-   return false;
+   return result;
 }
 
 bool ossimTiffTileSource::open(const ossimFilename& image_file)
@@ -384,7 +421,9 @@ bool ossimTiffTileSource::open()
        && (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.
    //---
@@ -400,10 +439,15 @@ bool ossimTiffTileSource::open()
       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.
@@ -503,7 +547,6 @@ bool ossimTiffTileSource::open()
    // Current dir.
    theCurrentDirectory = TIFFCurrentDirectory(theTiffPtr);
 
-   
    theImageWidth.resize(theNumberOfDirectories);
    theImageLength.resize(theNumberOfDirectories);
    theReadMethod.resize(theNumberOfDirectories);
@@ -512,12 +555,37 @@ bool ossimTiffTileSource::open()
    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 ,
@@ -525,15 +593,32 @@ bool ossimTiffTileSource::open()
       {
          sub_file_type = 0;
       }
+
       if (sub_file_type == FILETYPE_REDUCEDIMAGE)
       {
-         if(dir!=0)
+         //---
+         // 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 )
          {
-            theImageDirectoryList.push_back(dir);
+            bool acceptAsRrdsLayer = true;
+            if ( ( theNumberOfDirectories == 2 ) && ( dir == 1 ) )
+            {
+               acceptAsRrdsLayer = isPowerOfTwoDecimation(dir);
+            }
+
+            if ( acceptAsRrdsLayer )
+            {
+               theImageDirectoryList.push_back(dir);
+            }
          }
       }
       
-      
       if( !TIFFGetField( theTiffPtr, TIFFTAG_PLANARCONFIG,
                          &(thePlanarConfig[dir]) ) )
       {
@@ -586,6 +671,7 @@ bool ossimTiffTileSource::open()
       }
       else
       {
+         // Strip tiff:
          theImageTileWidth[dir]  = 0;
          theImageTileLength[dir] = 0;
          if( !TIFFGetField( theTiffPtr, TIFFTAG_ROWSPERSTRIP,
@@ -593,29 +679,37 @@ bool ossimTiffTileSource::open()
          {
             theRowsPerStrip[dir] = 1;
          }
-      }
-      
-      if ( !TIFFGetField( theTiffPtr,
-                          TIFFTAG_IMAGELENGTH,
-                          &theImageLength[dir] ) )
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " Cannot determine image length."
-            << endl;
-      }
+         
+         theImageTileWidth[dir]  = theImageWidth[dir];
+         theImageTileLength[dir] = theRowsPerStrip[dir];
 
-      if ( !TIFFGetField( theTiffPtr,
-                          TIFFTAG_IMAGEWIDTH,
-                          &theImageWidth[dir] ) )
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " Cannot determine image width."
-            << endl;
+         //---
+         // 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++)"
+   } // End of "for (ossim_uint32 dir=0; dir<theNumberOfDirectories; dir++)"
    
    // Reset the directory back to "0".
    if (setTiffDirectory(0) == false)
@@ -716,20 +810,38 @@ bool ossimTiffTileSource::open()
       
       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();
 
-   // ESH 05/2009 -- If memory allocations failed, then
-   // let's bail out of this driver and hope another one
-   // can handle the image ok. I.e. InitializeBuffers()
-   // was changed to return a boolean success/fail flag.
-   bool bSuccess = initializeBuffers();
+   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())
    {
@@ -738,15 +850,13 @@ bool ossimTiffTileSource::open()
    }
    
    // Finished...
-   return bSuccess;
+   return true;
 }
    
-ossim_uint32 ossimTiffTileSource::getNumberOfLines(
-   ossim_uint32 resLevel) const
+ossim_uint32 ossimTiffTileSource::getNumberOfLines( ossim_uint32 resLevel ) const
 {
    ossim_uint32 result = 0;
-   if(!theImageDirectoryList.size()) return result;
-   if ( theTiffPtr && isValidRLevel(resLevel) )
+   if ( theImageDirectoryList.size() && theTiffPtr && isValidRLevel(resLevel) )
    {
       //---
       // If we have r0 our reslevels are the same as the callers so
@@ -786,12 +896,10 @@ ossim_uint32 ossimTiffTileSource::getNumberOfLines(
    return result;
 }
 
-ossim_uint32 ossimTiffTileSource::getNumberOfSamples(
-   ossim_uint32 resLevel) const
+ossim_uint32 ossimTiffTileSource::getNumberOfSamples( ossim_uint32 resLevel ) const
 {
    ossim_uint32 result = 0;
-   if(!theImageDirectoryList.size()) return result;
-   if ( theTiffPtr && isValidRLevel(resLevel) )
+   if ( theImageDirectoryList.size() && theTiffPtr && isValidRLevel(resLevel) )
    {
       //---
       // If we have r0 our reslevels are the same as the callers so
@@ -824,20 +932,20 @@ ossim_uint32 ossimTiffTileSource::getNumberOfSamples(
          }
       }
    }
-   
    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;
    }
-   if (theOverview.valid())
+   else if (theOverview.valid())
    {
       result += theOverview->getNumberOfDecimationLevels();
    }
@@ -859,35 +967,47 @@ bool ossimTiffTileSource::loadTile(const ossimIrect& tile_rect,
 {
    static const char MODULE[] = "ossimTiffTileSource::loadTile";
 
-   bool status = false;
-   
-   switch(theReadMethod[theCurrentDirectory])
+   bool status = true;
+
+   if ( !theBuffer )
    {
-      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;
-         
-      default:
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " Unsupported tiff type!" << endl;
-         status = false;
-         break;
+      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;
@@ -900,7 +1020,7 @@ bool ossimTiffTileSource::loadFromScanLine(const ossimIrect& clip_rect,
    ossimInterleaveType type =
       (thePlanarConfig[theCurrentDirectory] == PLANARCONFIG_CONTIG) ?
        OSSIM_BIP : OSSIM_BIL;
-   
+
    if ( theBufferRLevel != getCurrentTiffRLevel() ||
         !clip_rect.completely_within(theBufferRect) )
    {
@@ -990,17 +1110,15 @@ 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);
-   ossimInterleaveType type =
-   (thePlanarConfig[theCurrentDirectory] == PLANARCONFIG_CONTIG) ?
-   OSSIM_BIP : OSSIM_BIL;
    ossimIpt ulTilePt       = tileOrigin;
 //   ossimIpt subImageOffset = getSubImageOffset(getCurrentTiffRLevel()+theStartingResLevel);
 
@@ -1060,7 +1178,7 @@ bool ossimTiffTileSource::loadFromTile(const ossimIrect& clip_rect,
                   result->loadTile(theBuffer,
                                   bufRectWithOffset,
                                   clipRectWithOffset,
-                                  type);
+                                  OSSIM_BIP);
                }
                else if(tileSizeRead < 0)
                {
@@ -1076,21 +1194,29 @@ bool ossimTiffTileSource::loadFromTile(const ossimIrect& clip_rect,
             }
             else
             {
+               if ( theOutputBandList.empty() )
+               {
+                  // This will set to identity.
+                  ossimImageSource::getOutputBandList( theOutputBandList );
+               }
+               
                // band separate tiles...
-               for (ossim_uint32 band=0; band<theSamplesPerPixel; ++band)
+               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,
-                                              band);
+                  tileSizeRead = TIFFReadTile( theTiffPtr,
+                                               theBuffer,
+                                               ulTilePt.x,
+                                               ulTilePt.y,
+                                               0,
+                                               (*bandIter) );
                   if(tileSizeRead > 0)
                   {
-                     result->loadBand(theBuffer,
-                                     bufRectWithOffset,
-                                     clipRectWithOffset,
-                                     band);
+                     result->loadBand( theBuffer,
+                                       bufRectWithOffset,
+                                       clipRectWithOffset,
+                                       destinationBand );
                   }
                   else if (tileSizeRead < 0)
                   {
@@ -1103,6 +1229,8 @@ bool ossimTiffTileSource::loadFromTile(const ossimIrect& clip_rect,
                      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
                      return false;
                   }
+                  ++bandIter; // Next band...
+                  ++destinationBand;
                }
             }
 
@@ -1183,9 +1311,9 @@ bool ossimTiffTileSource::loadFromRgbaU8Tile(const ossimIrect& tile_rect,
                          theImageTileWidth[theCurrentDirectory]  - 1,
                          ulTilePt.y +
                          theImageTileLength[theCurrentDirectory] - 1);
-         
+
          if ( getCurrentTiffRLevel() != theBufferRLevel ||
-              tiff_tile_rect     != theBufferRect)
+              tiff_tile_rect != theBufferRect)
          {
             // Need to grab a new tile.
             // Read a tile into the buffer.
@@ -1304,20 +1432,16 @@ bool ossimTiffTileSource::loadFromRgbaU8Strip(const ossimIrect& tile_rect,
                                 OUTPUT_TILE_WIDTH + clip_rect.ul().x -
                                 tile_rect.ul().x;
 
-#if 0
-   if (traceDebug())
-   {
-      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;
-   }
+#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
    
    //***
@@ -1336,16 +1460,30 @@ bool ossimTiffTileSource::loadFromRgbaU8Strip(const ossimIrect& tile_rect,
    // 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
+      if ( (theBufferRLevel != theCurrentDirectory) ||
+           ( clip_rect.completely_within( theBufferRect ) == false ) )
       {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " Error reading strip!" <<endl;
-         delete [] d;
-         return 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.
@@ -1378,8 +1516,8 @@ bool ossimTiffTileSource::loadFromRgbaU8Strip(const ossimIrect& tile_rect,
             // 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));
+            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;
@@ -1549,7 +1687,103 @@ bool ossimTiffTileSource::loadFromRgbaU8aStrip(const ossimIrect& tile_rect,
    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
 {
@@ -1612,120 +1846,34 @@ ossim_uint32 ossimTiffTileSource::getCurrentTiffRLevel() const
 
 ossimString ossimTiffTileSource::getReadMethod(ossim_uint32 directory) const
 {
-   switch (theReadMethod[directory])
+   ossimString result = "UNKNOWN";
+   if ( directory < theReadMethod.size() )
    {
-      case READ_RGBA_U8_TILE:
-         return ossimString("READ_RGBA_U8_TILE");
-      case READ_RGBA_U8_STRIP:
-         return ossimString("READ_RGBA_U8_STRIP");
-      case READ_RGBA_U8A_STRIP:
-         return ossimString("READ_RGBA_U8A_STRIP");
-      case READ_SCAN_LINE:
-         return ossimString("READ_SCAN_LINE");
-      case READ_TILE:
-         return ossimString("READ_TILE");
-      case UNKNOWN:
-      default:
-         return ossimString("UNKNOWN");
+      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;
 }      
 
-bool ossimTiffTileSource::allocateBuffer()
-{
-   //***
-   // 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_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));
-         return false;
-         break;
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimTiffTileSource::allocateBuffer DEBUG:"
-         << "\nbuffer_size:  " << buffer_size
-         << endl;
-   }
-
-   theBufferRect.makeNan();
-   theBufferRLevel = theCurrentDirectory;
-
-   bool bSuccess = true;
-   if (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;
-}
-
 ossim_uint32 ossimTiffTileSource::getNumberOfDirectories() const
 {
    return theNumberOfDirectories;
@@ -1800,7 +1948,12 @@ void ossimTiffTileSource::setApplyColorPaletteFlag(bool flag)
       
       setReadMethod();
 
-      initializeBuffers();
+      theTile = 0;
+      if (theBuffer)
+      {
+         delete [] theBuffer;
+         theBuffer = 0;
+      }
    }
 }
 
@@ -1816,10 +1969,9 @@ ossimString ossimTiffTileSource::getLongName()const
 
 ossimString ossimTiffTileSource::getShortName()const
 {
-   return ossimString("TIFF Image Handler");
+   return ossimString("ossim_tiff");
 }
 
-
 std::ostream& ossimTiffTileSource::print(std::ostream& os) const
 {
    //***
@@ -1882,7 +2034,67 @@ ossim_uint32 ossimTiffTileSource::getNumberOfInputBands() const
 
 ossim_uint32 ossimTiffTileSource::getNumberOfOutputBands () const
 {
-   return getNumberOfInputBands();
+   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
@@ -1924,13 +2136,18 @@ ossim_float64 ossimTiffTileSource::getNullPixelValue(ossim_uint32 band)const
 
 bool ossimTiffTileSource::isColorMapped() const
 {
-   uint16* red;
-   uint16* green;
-   uint16* blue;
-   
-   return static_cast<bool>(TIFFGetField(theTiffPtr,
-                                         TIFFTAG_COLORMAP,
-                                         &red, &green, &blue));
+   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()
@@ -1968,6 +2185,14 @@ void ossimTiffTileSource::setReadMethod()
          {
             theReadMethod[dir] = READ_RGBA_U8_STRIP;
          }
+         else if ( ( theBitsPerSample == 16 ) &&
+                   ( theRowsPerStrip[dir] > 1 ) &&
+                   ( thePlanarConfig[dir] == PLANARCONFIG_SEPARATE ) &&
+                   ( theCompressionType == COMPRESSION_NONE ) )
+         {
+            // Buffer a strip of bands.
+            theReadMethod[dir] = READ_U16_STRIP;
+         }
          else if (theSamplesPerPixel <= 3 && theBitsPerSample == 1)
          {
             //---
@@ -1977,10 +2202,21 @@ void ossimTiffTileSource::setReadMethod()
             //---
             theReadMethod[dir] = READ_RGBA_U8A_STRIP;
          }
-         else
+         else if((theCompressionType == COMPRESSION_NONE)||
+                 (theRowsPerStrip[dir]==1))
          {
             theReadMethod[dir] = READ_SCAN_LINE;
          }
+         else if((theCompressionType!=COMPRESSION_NONE)&&
+                 (theSamplesPerPixel <= 3) &&
+                 (theBitsPerSample   <= 8) )
+         {
+            theReadMethod[dir] = READ_RGBA_U8_STRIP;
+         }
+         else
+         {
+            theReadMethod[dir] = UNKNOWN;
+         }
       }
       
    } // End of loop through directories.
@@ -1989,35 +2225,6 @@ void ossimTiffTileSource::setReadMethod()
    setTiffDirectory(0);
 }
 
-bool ossimTiffTileSource::initializeBuffers()
-{
-   if(theBuffer)
-   {
-      delete [] theBuffer;
-      theBuffer = 0;
-   }
-
-   ossimImageDataFactory* idf = ossimImageDataFactory::instance();
-
-   theTile = idf->create(this,
-                         this);
-   
-   //
-   // Tiles are constructed with no buffer storage.  Call initialize for
-   // "theTile" to allocate memory.  Leave "theBlankTile" with a
-   // ossimDataObjectStatus of OSSIM_NULL since no data will ever be
-   // stuffed in it.
-   //
-   theTile->initialize();
-
-   // The width and height mus be set prior to call to allocateBuffer.
-   theCurrentTileWidth  = theTile->getWidth();
-   theCurrentTileHeight = theTile->getHeight();
-   
-   return allocateBuffer();
-}
-
-
 void ossimTiffTileSource::setProperty(ossimRefPtr<ossimProperty> property)
 {
    if(!property.valid())
@@ -2056,12 +2263,8 @@ ossimRefPtr<ossimProperty> ossimTiffTileSource::getProperty(const ossimString& n
 void ossimTiffTileSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
 {
    ossimImageHandler::getPropertyNames(propertyNames);
-	propertyNames.push_back("file_type");
-   // Assuming first directory...
-   if(isColorMapped())
-   {
-      propertyNames.push_back("apply_color_palette_flag");
-   }
+   propertyNames.push_back("file_type");
+   propertyNames.push_back("apply_color_palette_flag");
 }
 
 bool ossimTiffTileSource::setTiffDirectory(ossim_uint16 directory)
@@ -2077,9 +2280,12 @@ bool ossimTiffTileSource::setTiffDirectory(ossim_uint16 directory)
       }
       else
       {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimTiffTileSource::setTiffDirectory ERROR setting directory "
-            << directory << "!" << endl;
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimTiffTileSource::setTiffDirectory ERROR setting directory "
+               << directory << "!" << endl;
+         }
       }
    }
    
@@ -2154,7 +2360,7 @@ void ossimTiffTileSource::validateMinMaxNull()
 
    if (theScalarType == OSSIM_FLOAT32)
    {
-      std::ifstream inStr(theImageFile, std::ios::in|std::ios::binary);
+      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.
@@ -2332,3 +2538,154 @@ ossimImageGeometry* ossimTiffTileSource::getImageGeometry()
    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:
+      {
+         buffer_size = theImageWidth[0]*theRowsPerStrip[theCurrentDirectory]*
+            theBytesPerPixel*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/ossim/imaging/ossimTiffWriter.cpp b/src/ossim/imaging/ossimTiffWriter.cpp
index d85523f..ddf3342 100644
--- a/src/ossim/imaging/ossimTiffWriter.cpp
+++ b/src/ossim/imaging/ossimTiffWriter.cpp
@@ -5,14 +5,9 @@
 // Author:  Frank Warmerdam (warmerda at home.com)
 //
 //*******************************************************************
-//  $Id: ossimTiffWriter.cpp 18949 2011-02-23 15:28:08Z gpotts $
-
-#include <algorithm>
-#include <sstream>
-#include <tiffio.h>
+//  $Id: ossimTiffWriter.cpp 22235 2013-04-16 22:37:08Z dburken $
 
 #include <ossim/ossimConfig.h>
-
 #include <ossim/imaging/ossimTiffWriter.h>
 #include <ossim/base/ossimKeywordNames.h>
 #include <ossim/base/ossimKeywordlist.h>
@@ -39,8 +34,7 @@
 #include <ossim/imaging/ossimMemoryImageSource.h>
 #include <ossim/imaging/ossimScalarRemapper.h>
 
-static ossimTrace traceDebug("ossimTiffWriter:debug");
-
+#include <tiffio.h>
 #ifdef OSSIM_HAS_GEOTIFF
 #  if OSSIM_HAS_GEOTIFF
 #    include <xtiffio.h>
@@ -50,6 +44,10 @@ static ossimTrace traceDebug("ossimTiffWriter:debug");
 #  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;
@@ -58,7 +56,7 @@ static const long  DEFAULT_JPEG_QUALITY = 75;
 RTTI_DEF1(ossimTiffWriter, "ossimTiffWriter", ossimImageFileWriter);
 
 #ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimTiffWriter.cpp 18949 2011-02-23 15:28:08Z gpotts $";
+static const char OSSIM_ID[] = "$Id: ossimTiffWriter.cpp 22235 2013-04-16 22:37:08Z dburken $";
 #endif
 
 ossimTiffWriter::ossimTiffWriter()
@@ -68,7 +66,6 @@ ossimTiffWriter::ossimTiffWriter()
       theCompressionType("none"),
       theJpegQuality(DEFAULT_JPEG_QUALITY),
       theOutputGeotiffTagsFlag(true),
-      theImagineNad27Flag(false),
       theColorLutFlag(false),
       theProjectionInfo(NULL),
       theOutputTileSize(OSSIM_DEFAULT_TILE_WIDTH, OSSIM_DEFAULT_TILE_HEIGHT),
@@ -100,76 +97,66 @@ bool ossimTiffWriter::openTiff()
 {
    static const char* MODULE = "ossimTiffWriter::openTiff()";
 
-   if (theTif) // Close the existing file pointer.
-   {
-      
-#ifdef OSSIM_HAS_GEOTIFF
-#  if OSSIM_HAS_GEOTIFF 
-      XTIFFClose( (TIFF*)theTif );
-#  else
-      TIFFClose( (TIFF*)theTif );
-#  endif
-#else
-      TIFFClose( (TIFF*)theTif );   
-#endif
-
-   }
+   bool status = false;
+   
+   // Close the existing file pointer.
+   closeTiff();
 
    // Check for empty file name.
-   if (theFilename.empty())
-   {
-      return false;
-   }
-
-   ossimString openMode = "w";
-   if(theBigTiffFlag||theForceBigTiffFlag)
+   if ( theFilename.size() )
    {
-      openMode += "8";
-   }
-   // Open the new file.
-#ifdef OSSIM_HAS_GEOTIFF
-#  if OSSIM_HAS_GEOTIFF
-   theTif = XTIFFOpen( theFilename.c_str(), openMode.c_str() );
-#  else
-   theTif = TIFFOpen( theFilename.c_str(), openMode.c_str() );
-#  endif
-#else
-   theTif = TIFFOpen( theFilename.c_str(), openMode.c_str() );
-#endif
-
-   if (!theTif)
-   {
-      setErrorStatus(); // base class
-      ossimSetError(getClassName().c_str(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "File %s line %d Module %s Error:\n\
+      //---
+      // 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 false;
+                       __FILE__,
+                       __LINE__,
+                       MODULE,
+                       theFilename.c_str());
+      }
    }
-   return true;
+   return status;
 }
 
 bool ossimTiffWriter::closeTiff()
 {
    if (theTif)
    {
-#ifdef OSSIM_HAS_GEOTIFF
-#  if OSSIM_HAS_GEOTIFF
       XTIFFClose( (TIFF*)theTif );
-#  else
-      TIFFClose( (TIFF*)theTif );
-#  endif
-#else
-      TIFFClose( (TIFF*)theTif );
-#endif
       theTif = NULL;
    }
-
    return true;
 }
 
@@ -371,7 +358,7 @@ bool ossimTiffWriter::writeGeotiffTags(ossimRefPtr<ossimMapProjectionInfo> proje
    {
       if ( projectionInfo.valid() )
       {
-         result = ossimGeoTiff::writeTags(tiffPtr, projectionInfo, theImagineNad27Flag);
+         result = ossimGeoTiff::writeTags(tiffPtr, projectionInfo);
       }
    }
    return result;
@@ -509,31 +496,6 @@ bool ossimTiffWriter::writeFile()
       return true;
    }
 
-   // this might be called from writeFile(projection infoamrtion) method
-   // we will check to see if the tiff is open.  If not then call the open.
-   //
-   if(isOpen())
-   {
-      close();
-   }
-   ossim_uint64 threeGigs = (static_cast<ossim_uint64>(1024)*
-                            static_cast<ossim_uint64>(1024)*
-                            static_cast<ossim_uint64>(1024)*
-                            static_cast<ossim_uint64>(3));
-   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 > threeGigs)
-   {
-      theBigTiffFlag = true;
-   }
-   else
-   {
-      theBigTiffFlag = false;
-   }
    open();
 
    if (!isOpen())
@@ -806,19 +768,12 @@ bool ossimTiffWriter::loadState(const ossimKeywordlist& kwl,
       setFilename(ossimFilename(value));
    }
 
-   const char* flag              = kwl.find(prefix, "output_geotiff_flag");
-   const char* img_nad27_flag    = kwl.find(prefix, "imagine_nad27_flag");
-
+   const char* flag = kwl.find(prefix, "output_geotiff_flag");
    if(flag)
    {
       theOutputGeotiffTagsFlag = ossimString(flag).toBool();
    }
 
-   if(img_nad27_flag)
-   {
-      theImagineNad27Flag = ossimString(img_nad27_flag).toBool();
-   }
-
    ossimString newPrefix = ossimString(prefix) + "lut.";
 
    const char* colorLutFlag = kwl.find(prefix, "color_lut_flag");
@@ -910,13 +865,13 @@ bool ossimTiffWriter::writeToTiles()
    ossim_uint32 tileNumber = 0;
    vector<ossim_float64> minBands;
    vector<ossim_float64> maxBands;
-   for(ossim_uint32 i = 0; i < tilesHigh; i++)
+   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; j++)
+      for(ossim_uint32 j = 0; ((j < tilesWide)&&!needsAborting()); j++)
       {
          origin.x = j * tileWidth;
 
@@ -948,7 +903,7 @@ bool ossimTiffWriter::writeToTiles()
                            id->getImageRectangle(),
                            OSSIM_BIP);
             tempTile->setDataObjectStatus(id->getDataObjectStatus());
-            if(!theColorLutFlag)
+            if(!theColorLutFlag&&!needsAborting())
             {
                id->computeMinMaxPix(minBands, maxBands);
             }
@@ -990,7 +945,7 @@ bool ossimTiffWriter::writeToTiles()
 
    } // End of tile loop in the line (height) direction.
 
-   if(!theColorLutFlag)
+   if(!theColorLutFlag&&!needsAborting())
    {
       writeMinMaxTags(minBands, maxBands);
    }
@@ -1041,7 +996,7 @@ bool ossimTiffWriter::writeToTilesBandSep()
       //---
       // Tile loop in the sample (width) direction.
       //---
-      for(ossim_uint32 j = 0; ((j < tilesWide)&!needsAborting()); ++j)
+      for(ossim_uint32 j = 0; ((j < tilesWide)&&!needsAborting()); ++j)
       {
          origin.x = j * tileWidth;
 
@@ -1080,7 +1035,7 @@ bool ossimTiffWriter::writeToTilesBandSep()
                                             (ossim_uint32)0,        // z
                                             (tsample_t)band);    // sample
             }
-            if (bytesWritten != tileSizeInBytes)
+            if ( ( bytesWritten != tileSizeInBytes ) && !needsAborting() )
             {
                if(traceDebug())
                {
@@ -1111,7 +1066,7 @@ bool ossimTiffWriter::writeToTilesBandSep()
 
    } // End of tile loop in the line (height) direction.
 
-   if(!theColorLutFlag)
+   if(!theColorLutFlag&&!needsAborting())
    {
       writeMinMaxTags(minBands, maxBands);
    }
@@ -1178,7 +1133,7 @@ bool ossimTiffWriter::writeToStrips()
             return false;
          }
          id->unloadTile(buffer, bufferRect, OSSIM_BIP);
-         if(!theColorLutFlag)
+         if(!theColorLutFlag&&!needsAborting())
          {
             id->computeMinMaxPix(minBands, maxBands);
          }
@@ -1488,36 +1443,35 @@ void ossimTiffWriter::setProperty(ossimRefPtr<ossimProperty> property)
 
 ossimRefPtr<ossimProperty> ossimTiffWriter::getProperty(const ossimString& name)const
 {
-   if(name == "Filename")
+   ossimRefPtr<ossimProperty> prop = 0;
+   
+   if (name == "Filename")
    {
-      ossimRefPtr<ossimProperty> tempProp = ossimImageFileWriter::getProperty(name);
-      if(tempProp.valid())
+      prop = ossimImageFileWriter::getProperty(name);
+      if ( prop.valid() )
       {
-         ossimFilenameProperty* filenameProp = PTR_CAST(ossimFilenameProperty,
-                                                        tempProp.get());
-
-         if(filenameProp)
+         ossimRefPtr<ossimFilenameProperty> filenameProp = PTR_CAST(ossimFilenameProperty,
+                                                                    prop.get());
+         if ( filenameProp.valid() )
          {
             filenameProp->addFilter("*.tif");
          }
-
-         return tempProp;
+         prop = filenameProp.get();
       }
    }
    else if (name == ossimKeywordNames::COMPRESSION_QUALITY_KW)
    {
-      ossimNumericProperty* numericProp =
+      ossimRefPtr<ossimNumericProperty> numericProp =
          new ossimNumericProperty(name,
                                   ossimString::toString(theJpegQuality),
                                   1.0,
                                   100.0);
-      numericProp->
-         setNumericType(ossimNumericProperty::ossimNumericPropertyType_INT);
-      return numericProp;
+      numericProp->setNumericType(ossimNumericProperty::ossimNumericPropertyType_INT);
+      prop = numericProp.get();
    }
    else if (name == ossimKeywordNames::COMPRESSION_TYPE_KW)
    {
-      ossimStringProperty* stringProp =
+      ossimRefPtr<ossimStringProperty> stringProp =
          new ossimStringProperty(name,
                                  getCompressionType(),
                                  false); // editable flag
@@ -1526,30 +1480,27 @@ ossimRefPtr<ossimProperty> ossimTiffWriter::getProperty(const ossimString& name)
       stringProp->addConstraint(ossimString("packbits"));
       stringProp->addConstraint(ossimString("deflate"));
       stringProp->addConstraint(ossimString("zip"));      
-      return stringProp;
+      prop = stringProp.get();
    }
    else if (name == "lut_file")
    {
-      ossimFilenameProperty* property = new ossimFilenameProperty(name, theLutFilename);
+      ossimRefPtr<ossimFilenameProperty> property =
+         new ossimFilenameProperty(name, theLutFilename);
       property->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
-
-      return property;
+      
+      prop = property.get();
    }
    else if (name == "color_lut_flag")
    {
-      ossimBooleanProperty* boolProperty = new ossimBooleanProperty(name,
-                                                                    theColorLutFlag);
-      return boolProperty;
+      prop = new ossimBooleanProperty(name, theColorLutFlag);
    }
    else if(name == "big_tiff_flag")
    {
-       ossimBooleanProperty* boolProperty = new ossimBooleanProperty(name,
-                                                                    theForceBigTiffFlag);
-      return boolProperty;     
+       prop = new ossimBooleanProperty(name, theForceBigTiffFlag);
    }
-   else if(name == "output_tile_size")
+   else if( name == ossimKeywordNames::OUTPUT_TILE_SIZE_KW )
    {
-      ossimStringProperty* stringProp =
+      ossimRefPtr<ossimStringProperty> stringProp =
          new ossimStringProperty(name,
                                  ossimString::toString(theOutputTileSize.x),
                                  false); // editable flag
@@ -1560,11 +1511,14 @@ ossimRefPtr<ossimProperty> ossimTiffWriter::getProperty(const ossimString& name)
       stringProp->addConstraint(ossimString("256"));      
       stringProp->addConstraint(ossimString("512"));      
       stringProp->addConstraint(ossimString("1024"));      
-      stringProp->addConstraint(ossimString("2048"));      
-      return stringProp;
-     
+      stringProp->addConstraint(ossimString("2048"));
+      prop = stringProp.get();
+   }
+   else
+   {
+      prop = ossimImageFileWriter::getProperty(name);
    }
-   return ossimImageFileWriter::getProperty(name);
+   return prop;
 }
 
 void ossimTiffWriter::getPropertyNames(std::vector<ossimString>& propertyNames)const
@@ -1576,7 +1530,7 @@ void ossimTiffWriter::getPropertyNames(std::vector<ossimString>& propertyNames)c
    propertyNames.push_back(ossimString("lut_file"));
    propertyNames.push_back(ossimString("color_lut_flag"));
    propertyNames.push_back(ossimString("big_tiff_flag"));
-   propertyNames.push_back(ossimString("output_tile_size"));
+   propertyNames.push_back(ossimString(ossimKeywordNames::OUTPUT_TILE_SIZE_KW));
   
    ossimImageFileWriter::getPropertyNames(propertyNames);
 }
diff --git a/src/ossim/imaging/ossimQbTileFilesHandler.cpp b/src/ossim/imaging/ossimTiledImageHandler.cpp
similarity index 76%
copy from src/ossim/imaging/ossimQbTileFilesHandler.cpp
copy to src/ossim/imaging/ossimTiledImageHandler.cpp
index 7490261..9129345 100644
--- a/src/ossim/imaging/ossimQbTileFilesHandler.cpp
+++ b/src/ossim/imaging/ossimTiledImageHandler.cpp
@@ -13,11 +13,11 @@
 // but only "spatially-separate" schemes.
 //
 //*************************************************************************************************
-//  $Id$
+//  $Id: ossimTiledImageHandler.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
 
 #include <algorithm>
 
-#include <ossim/imaging/ossimQbTileFilesHandler.h>
+#include <ossim/imaging/ossimTiledImageHandler.h>
 #include <ossim/imaging/ossimImageHandlerRegistry.h>
 #include <ossim/base/ossimFilename.h>
 #include <ossim/base/ossimRegExp.h>
@@ -31,18 +31,16 @@
 #include <ossim/base/ossimTrace.h>
 #include <ossim/imaging/ossimTiffOverviewBuilder.h>
 #include <ossim/imaging/ossimTiffTileSource.h>
-#include <ossim/support_data/ossimQuickbirdTile.h>
-#include <ossim/projection/ossimQuickbirdRpcModel.h>
 
-RTTI_DEF1(ossimQbTileFilesHandler, "ossimQbTileFilesHandler", ossimImageHandler)
+RTTI_DEF1(ossimTiledImageHandler, "ossimTiledImageHandler", ossimImageHandler)
 
 // Static trace for debugging
-static ossimTrace traceDebug("ossimQbTileFilesHandler:debug");
+static ossimTrace traceDebug("ossimTiledImageHandler:debug");
 
 //*************************************************************************************************
 //!  Constructor (default):
 //*************************************************************************************************
-ossimQbTileFilesHandler::ossimQbTileFilesHandler()
+ossimTiledImageHandler::ossimTiledImageHandler()
    : m_tileFiles(0),
      m_tile(0),
      m_fullImgRect(),
@@ -58,116 +56,16 @@ ossimQbTileFilesHandler::ossimQbTileFilesHandler()
 //*************************************************************************************************
 //! Destructor:
 //*************************************************************************************************
-ossimQbTileFilesHandler::~ossimQbTileFilesHandler()
+ossimTiledImageHandler::~ossimTiledImageHandler()
 {
    close();
 }
 
 //*************************************************************************************************
-//! 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..."<<std::endl;
-   }
-
-   // Test for extension: image.til
-   ossimString ext = theImageFile.ext();
-   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;
-         }
-      }
-   
-      ++qbt_iter;   
-   }
-
-   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;
-}
-
-//*************************************************************************************************
 //! Deletes the overview and clears the valid image vertices.  Derived
 //! classes should implement.
 //*************************************************************************************************
-void ossimQbTileFilesHandler::close()
+void ossimTiledImageHandler::close()
 {
    vector<ossimTileFile>::iterator iter = m_tileFiles.begin();
    while (iter != m_tileFiles.end())
@@ -182,7 +80,7 @@ void ossimQbTileFilesHandler::close()
 //! Derived classes must implement this method to be concrete.
 //! @return true if open, false if not.
 //*************************************************************************************************
-bool ossimQbTileFilesHandler::isOpen()const
+bool ossimTiledImageHandler::isOpen()const
 {
    if (m_tileFiles.size() > 0)
       return true;
@@ -193,7 +91,7 @@ bool ossimQbTileFilesHandler::isOpen()const
 //*************************************************************************************************
 //! Initialize tile buffer to natch image datatype
 //*************************************************************************************************
-void ossimQbTileFilesHandler::allocate()
+void ossimTiledImageHandler::allocate()
 {
    m_tile = 0;
    if ((m_tileFiles.size() == 0))
@@ -206,7 +104,7 @@ void ossimQbTileFilesHandler::allocate()
    ossimRefPtr<ossimImageData> source_tile = m_tileFiles[0].imageHandler->getTile(rect);
    if (!source_tile.valid())
    {
-      ossimNotify(ossimNotifyLevel_FATAL) << "ossimQbTileFilesHandler::allocate() -- Could not"
+      ossimNotify(ossimNotifyLevel_FATAL) << "ossimTiledImageHandler::allocate() -- Could not"
          "determine file-tile image data for allocating image tile. Aborting."<<endl;
       return;
    }
@@ -217,7 +115,7 @@ void ossimQbTileFilesHandler::allocate()
 //*************************************************************************************************
 //! Fills the requested tile by pulling pixels from multiple file tiles as needed.
 //*************************************************************************************************
-ossimRefPtr<ossimImageData> ossimQbTileFilesHandler::getTile(const ossimIrect& tile_rect, 
+ossimRefPtr<ossimImageData> ossimTiledImageHandler::getTile(const ossimIrect& tile_rect, 
                                                              ossim_uint32 resLevel)
 {
    // First verify that there are file-tiles available:
@@ -307,11 +205,145 @@ ossimRefPtr<ossimImageData> ossimQbTileFilesHandler::getTile(const ossimIrect& t
    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 ossimQbTileFilesHandler::completeOpen()
+void ossimTiledImageHandler::completeOpen()
 {
    openOverview();
    openValidVertices();
@@ -322,7 +354,7 @@ void ossimQbTileFilesHandler::completeOpen()
 //! @param includeFullResFlag if true the full resolution layer will also
 //! be put in the overview format.  This is handy for inefficient formats.
 //*************************************************************************************************
-bool ossimQbTileFilesHandler::buildOverview(ossimImageHandlerOverviewCompressionType ctype, 
+bool ossimTiledImageHandler::buildOverview(ossimImageHandlerOverviewCompressionType ctype, 
                                             ossim_uint32 qual,
                                             ossimFilterResampler::ossimFilterResamplerType rtype,
                                             bool ifr_flag)
@@ -383,7 +415,7 @@ bool ossimQbTileFilesHandler::buildOverview(ossimImageHandlerOverviewCompression
 // their individual overviews, so this method only verifies the fact and initializes the 
 // associated subimage rects at all decimation levels.
 //*************************************************************************************************
-bool ossimQbTileFilesHandler::openOverview()
+bool ossimTiledImageHandler::openOverview()
 {
    if (m_tileFiles.size() == 0)
       return false;
@@ -485,7 +517,7 @@ bool ossimQbTileFilesHandler::openOverview()
 //*************************************************************************************************
 //! Will close all tile files' overviews.
 //*************************************************************************************************
-void ossimQbTileFilesHandler::closeOverview()
+void ossimTiledImageHandler::closeOverview()
 {
    if (theOverview.valid())
       theOverview = 0;
@@ -506,7 +538,7 @@ void ossimQbTileFilesHandler::closeOverview()
 //*************************************************************************************************
 //! Will return TRUE if all tile files have overviews.
 //*************************************************************************************************
-bool ossimQbTileFilesHandler::hasOverviews() const
+bool ossimTiledImageHandler::hasOverviews() const
 {
    bool all_have_ovrs = true;
    vector<ossimTileFile>::const_iterator iter = m_tileFiles.begin();
@@ -523,168 +555,10 @@ bool ossimQbTileFilesHandler::hasOverviews() const
 //! Returns the number of decimation (resolution) levels. This is the minimum number
 //! among all sub-image tile-files.
 //*************************************************************************************************
-ossim_uint32 ossimQbTileFilesHandler::getNumberOfDecimationLevels() const
+ossim_uint32 ossimTiledImageHandler::getNumberOfDecimationLevels() const
 {
    return (ossim_uint32) theDecimationFactors.size();
 }
 
 #endif /* #if USING_SUB_OVRS */
 
-//*************************************************************************************************
-//! 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>();
-}
-
-//*************************************************************************************************
-//! @param resLevel Reduced resolution level to return lines of.
-//! Default = 0
-//! @return The number of lines for specified reduced resolution level.
-//*************************************************************************************************
-ossim_uint32 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::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 ossimQbTileFilesHandler::getImageRectangle(ossim_uint32 resLevel) const
-{
-   if (resLevel == 0)
-      return m_fullImgRect;
-
-   ossimDpt decimation;
-   getDecimationFactor(resLevel, decimation);
-
-   return m_fullImgRect*decimation;
-}
-
diff --git a/src/ossim/imaging/ossimTiling.cpp b/src/ossim/imaging/ossimTiling.cpp
index 8fffd48..8b35f7c 100644
--- a/src/ossim/imaging/ossimTiling.cpp
+++ b/src/ossim/imaging/ossimTiling.cpp
@@ -10,7 +10,7 @@
 // Description: implementation for image generator
 //
 //*************************************************************************
-// $Id: ossimTiling.cpp 17170 2010-04-20 13:51:55Z gpotts $
+// $Id: ossimTiling.cpp 20103 2011-09-17 16:10:42Z dburken $
 
 #include <sstream>
 #include <iomanip>
@@ -40,7 +40,8 @@ ossimTiling::ossimTiling()
        theTotalHorizontalTiles(0),
        theTotalVerticalTiles(0),
        theTotalTiles(0),
-       theTileNameMask()
+       theTileNameMask(),
+       theEdgeToEdgeFlag(false)
 {
 }
 
@@ -233,16 +234,37 @@ bool ossimTiling::next(ossimRefPtr<ossimMapProjection>& resultProjection,
 
          if(theMapProjection->isGeographic())
          {
-            theMapProjection->setUlTiePoints(
-               ossimGpt(origin.lat,
-                        origin.lon,
-                        0.0,
-                        theMapProjection->origin().datum()));
+            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
          {
-            theMapProjection->setUlTiePoints(ossimDpt(origin.x, origin.y));
+            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,
@@ -725,6 +747,12 @@ bool ossimTiling::saveState(ossimKeywordlist& kwl,
               theNumberOfBytesPerPixelPerBand,
               true);
    }
+
+   kwl.add(prefix,
+           "edge_to_edge",
+           ossimString::toString(theEdgeToEdgeFlag),
+           true);
+   
    
    return true;
 }
@@ -866,7 +894,12 @@ bool ossimTiling::loadState(const ossimKeywordlist& kwl,
          theDeltaType = ossimTilingDeltaType_PER_PIXEL;
       }
    }
-      
+   
+   lookup = kwl.find(prefix, "edge_to_edge");
+   if ( lookup )
+   {
+      theEdgeToEdgeFlag = ossimString::toBool(lookup);
+   }
       
    if (traceDebug())
    {
@@ -893,7 +926,9 @@ std::ostream& ossimTiling::print(std::ostream& out) const
        << "\ntheOutputSizeInBytes:            " << theOutputSizeInBytes
        << "\ntheNumberOfBands:                " << theNumberOfBands
        << "\ntheNumberOfBytesPerPixelPerBand: " <<
-      theNumberOfBytesPerPixelPerBand << endl;
+      theNumberOfBytesPerPixelPerBand
+       << "\ntheEdgeToEdgeFlag:               " << theEdgeToEdgeFlag
+       << "\n";
 
    if (theMapProjection.valid())
    {
diff --git a/src/ossim/imaging/ossimTilingPoly.cpp b/src/ossim/imaging/ossimTilingPoly.cpp
new file mode 100644
index 0000000..61ddc56
--- /dev/null
+++ b/src/ossim/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/ossim/imaging/ossimTilingRect.cpp b/src/ossim/imaging/ossimTilingRect.cpp
new file mode 100644
index 0000000..941692e
--- /dev/null
+++ b/src/ossim/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/ossim/imaging/ossimTopographicCorrectionFilter.cpp b/src/ossim/imaging/ossimTopographicCorrectionFilter.cpp
index de4b517..6ca1849 100644
--- a/src/ossim/imaging/ossimTopographicCorrectionFilter.cpp
+++ b/src/ossim/imaging/ossimTopographicCorrectionFilter.cpp
@@ -8,7 +8,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimTopographicCorrectionFilter.cpp 17206 2010-04-25 23:20:40Z dburken $
+// $Id: ossimTopographicCorrectionFilter.cpp 21184 2012-06-29 15:13:09Z dburken $
 #include <algorithm>
 #include <sstream>
 #include <ossim/imaging/ossimTopographicCorrectionFilter.h>
@@ -345,9 +345,9 @@ void ossimTopographicCorrectionFilter::executeTopographicCorrectionTemplate(
    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 outputDelta = 0;;
+   // ossim_float64 outputMin = 0;
+   // ossim_float64 outputMax = 0;
    ossim_float64 outputNp;
    double  normalNp = normalData->getNullPix(0);
    double  LPrime = 0.0;
@@ -369,9 +369,9 @@ void ossimTopographicCorrectionFilter::executeTopographicCorrectionTemplate(
       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;
+      // 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));
@@ -457,9 +457,9 @@ void ossimTopographicCorrectionFilter::executeTopographicCorrectionMinnaertTempl
    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 outputDelta = 0;;
+   // ossim_float64 outputMin = 0;
+   // ossim_float64 outputMax = 0;
    ossim_float64 outputNp;
    double  normalNp = normalData->getNullPix(0);
    double  LPrime = 0.0;
@@ -480,9 +480,9 @@ void ossimTopographicCorrectionFilter::executeTopographicCorrectionMinnaertTempl
       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;
+      // 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));
diff --git a/src/ossim/imaging/ossimTwoColorView.cpp b/src/ossim/imaging/ossimTwoColorView.cpp
index 91059a9..92f61c1 100644
--- a/src/ossim/imaging/ossimTwoColorView.cpp
+++ b/src/ossim/imaging/ossimTwoColorView.cpp
@@ -5,6 +5,7 @@
 //
 //-------------------------------------------------------------------
 //  $Id$
+
 #include <ossim/imaging/ossimTwoColorView.h>
 #include <ossim/imaging/ossimImageDataFactory.h>
 
@@ -13,19 +14,23 @@ RTTI_DEF1(ossimTwoColorView,
           ossimImageCombiner);
 
 ossimTwoColorView::ossimTwoColorView()
-:ossimImageCombiner(0, 2, 0, true, false) ,
-theByPassFlag(true),
-theNativeFlag(false),
-theNewInput(0),
-theOldInput(0),
-theNewBufferDestinationIndex(2),
-theOldBufferDestinationIndex(0),
-theMinBufferDestinationIndex(1){
+   :
+   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(theByPassFlag||!isSourceEnabled())
+   if(m_byPassFlag||!isSourceEnabled())
    {
       return ossimImageCombiner::getNumberOfOutputBands();
    }
@@ -34,42 +39,30 @@ ossim_uint32 ossimTwoColorView::getNumberOfOutputBands() const
 
 ossimScalarType ossimTwoColorView::getOutputScalarType() const
 {
-   if(theByPassFlag||!isSourceEnabled())
+   if(m_byPassFlag||!isSourceEnabled())
    {
       return ossimImageCombiner::getOutputScalarType();
    }
    return OSSIM_UINT8;
 }
 
-void ossimTwoColorView::setIndexMapping(ossim_uint32 newIndex,
-                                        ossim_uint32 oldIndex)
+void ossimTwoColorView::setBandIndexMapping(
+   ossim_uint32 oldInputBandIndex,
+   ossim_uint32 newInputBandIndex,
+   ossimTwoColorMultiViewOutputSource redOutputSource,
+   ossimTwoColorMultiViewOutputSource grnOutputSource,
+   ossimTwoColorMultiViewOutputSource bluOutputSource)
 {
-   if(((newIndex < 3)&&(oldIndex < 3))&&
-      (newIndex != oldIndex))
-   {
-      theNewBufferDestinationIndex = newIndex;
-      theOldBufferDestinationIndex = oldIndex;
-      if((theNewBufferDestinationIndex != 0)&&
-         (theOldBufferDestinationIndex != 0))
-      {
-         theMinBufferDestinationIndex = 0;
-      }
-      else if((theNewBufferDestinationIndex != 1)&&
-              (theOldBufferDestinationIndex != 1))
-      {
-         theMinBufferDestinationIndex = 1;
-      }
-      else if((theNewBufferDestinationIndex != 2)&&
-              (theOldBufferDestinationIndex != 2))
-      {
-         theMinBufferDestinationIndex = 2;
-      }
-   }
+   m_oldInputBandIndex = oldInputBandIndex;
+   m_newInputBandIndex = newInputBandIndex;
+   m_redSource = redOutputSource;
+   m_grnSource = grnOutputSource;
+   m_bluSource = bluOutputSource;
 }
 
 double ossimTwoColorView::getNullPixelValue(ossim_uint32 band)const
 {
-   if(theByPassFlag||!isSourceEnabled())
+   if(m_byPassFlag||!isSourceEnabled())
    {
       return ossimImageCombiner::getNullPixelValue(band);
    }
@@ -78,7 +71,7 @@ double ossimTwoColorView::getNullPixelValue(ossim_uint32 band)const
 
 double ossimTwoColorView::getMinPixelValue(ossim_uint32 band)const
 {
-   if(theByPassFlag||!isSourceEnabled())
+   if(m_byPassFlag||!isSourceEnabled())
    {
       return ossimImageCombiner::getMinPixelValue(band);
    }
@@ -87,7 +80,7 @@ double ossimTwoColorView::getMinPixelValue(ossim_uint32 band)const
 
 double ossimTwoColorView::getMaxPixelValue(ossim_uint32 band)const
 {
-   if(theByPassFlag||!isSourceEnabled())
+   if(m_byPassFlag||!isSourceEnabled())
    {
       return ossimImageCombiner::getMaxPixelValue(band);
    }
@@ -98,168 +91,33 @@ ossimRefPtr<ossimImageData> ossimTwoColorView::getTile(const ossimIrect& rect,
                                                        ossim_uint32 resLevel)
 {
    ossim_uint32 tileIdx = 0;
-   if(theByPassFlag||!isSourceEnabled())
+   if(m_byPassFlag||!isSourceEnabled())
    {
       return getNextTile(tileIdx, 0, rect, resLevel);
    }
-   if(!theTwoColorTile.valid())
+   if(!m_twoColorTile.valid())
    {
       allocate();
    }
-   if(!theTwoColorTile.valid())
+   if(!m_twoColorTile.valid())
    {
-      return theTwoColorTile;
+      return m_twoColorTile;
    }
-   theTwoColorTile->setImageRectangle(rect);
-   theTwoColorTile->makeBlank();
+   m_twoColorTile->setImageRectangle(rect);
+   m_twoColorTile->makeBlank();
    
-   ossimRefPtr<ossimImageData> newData = theNewInput->getTile(rect, resLevel);
-   ossimRefPtr<ossimImageData> oldData = theOldInput->getTile(rect, resLevel);
+   ossimRefPtr<ossimImageData> newData = m_newInput->getTile(rect, resLevel);
+   ossimRefPtr<ossimImageData> oldData = m_oldInput->getTile(rect, resLevel);
+
    runAlgorithm(newData.get(), oldData.get());
-   
-#if 0
-   // do the new band first
-   ossimRefPtr<ossimImageData> newData = getNextNormTile(tileIdx, 0, rect, resLevel);
-   newData = newData.valid()?(ossimImageData*)newData->dup():(ossimImageData*)0;
-   ossimRefPtr<ossimImageData> oldData = getNextNormTile(tileIdx,rect, resLevel);
-   oldData = oldData.valid()?(ossimImageData*)oldData->dup():(ossimImageData*)0;
-   
-   ossim_float32 newNullPix = 0.0;
-   ossim_float32 oldNullPix = 0.0;
-   const ossim_float32* newBuf = 0;
-   const ossim_float32* oldBuf = 0;
-   ossim_float32 tempValue = 0.0;
-   ossim_uint32 idx = 0;
-   ossim_uint32 maxIdx = theTwoColorTile->getWidth()*theTwoColorTile->getHeight();
-   ossim_uint8* newDestBuf = static_cast<ossim_uint8*>(theTwoColorTile->getBuf(theNewBufferDestinationIndex));
-   ossim_uint8* oldDestBuf = static_cast<ossim_uint8*>(theTwoColorTile->getBuf(theOldBufferDestinationIndex));
-   ossim_uint8* minDestBuf = static_cast<ossim_uint8*>(theTwoColorTile->getBuf(theMinBufferDestinationIndex));
-   
-   
-   if(newData.valid())
-   {
-      newBuf     = static_cast<ossim_float32*>(newData->getBuf(0));
-      newNullPix = static_cast<ossim_float32>(newData->getNullPix(0));
-   }
-   if(oldData.valid())
-   {
-      oldBuf = static_cast<ossim_float32*>(oldData->getBuf(0));   
-      oldNullPix    = static_cast<ossim_float32>(oldData->getNullPix(0));
-   }
-   
-   if(!newBuf&&!oldBuf)
-   {
-      return theTwoColorTile;
-   }
-   if(newBuf&&oldBuf)
-   {
-      
-      for(idx = 0; idx < maxIdx;++idx)
-      {
-         if((*newBuf == newNullPix)&&
-            (*oldBuf == oldNullPix))
-         {
-            *newDestBuf = 0;
-            *oldDestBuf = 0;
-            *minDestBuf = 0;
-         }
-         else
-         {
-            if(*newBuf == newNullPix)
-            {
-               *newDestBuf = 1;
-            }
-            else
-            {
-               tempValue = (*newBuf)*255;
-               if(tempValue < 1) tempValue = 1;
-               else if(tempValue > 255) tempValue = 255;
-               
-               *newDestBuf = (ossim_uint8)(tempValue);
-            }
-            if(*oldBuf == oldNullPix)
-            {
-               *oldDestBuf = 1;
-            }
-            else
-            {
-               // do old buffer channel
-               tempValue = (*oldBuf)*255;
-               if(tempValue < 1) tempValue = 1;
-               else if(tempValue > 255) tempValue = 255;
-               
-               *oldDestBuf = (ossim_uint8)(tempValue);
-            }
-            *minDestBuf = 1;
-         }
-         ++newBuf;
-         ++oldBuf;
-         ++minDestBuf;
-         ++newDestBuf;
-         ++oldDestBuf;
-      }
-   }
-   else if(newBuf)
-   {
-      for(idx = 0; idx < maxIdx;++idx)
-      {
-         if(*newBuf == newNullPix)
-         {
-            *newDestBuf = 0;
-            *oldDestBuf = 0;
-            *minDestBuf = 0;
-         }
-         else
-         {
-            tempValue = (*newBuf)*255;
-            if(tempValue < 1) tempValue = 1;
-            else if(tempValue > 255) tempValue = 255;
-            
-            *newDestBuf = (ossim_uint8)(tempValue);
-            *oldDestBuf = 1;
-            *minDestBuf = 1;
-         }
-         ++newBuf;
-         ++minDestBuf;
-         ++newDestBuf;
-         ++oldDestBuf;
-      }
-   }
-   else if(oldBuf)
-   {
-      for(idx = 0; idx < maxIdx;++idx)
-      {
-         if(*oldBuf == oldNullPix)
-         {
-            *newDestBuf = 0;
-            *oldDestBuf = 0;
-            *minDestBuf = 0;
-         }
-         else
-         {
-            tempValue = (*oldBuf)*255;
-            if(tempValue < 1) tempValue = 1;
-            else if(tempValue > 255) tempValue = 255;
-            
-            *oldDestBuf = (ossim_uint8)(tempValue);
-            *newDestBuf = 1;
-            *minDestBuf = 1;
-         }
-         ++oldBuf;
-         ++minDestBuf;
-         ++newDestBuf;
-         ++oldDestBuf;
-      }
-   }
-   
-#endif
-   theTwoColorTile->validate();
-   return theTwoColorTile;
-   
+
+   m_twoColorTile->validate();
+
+   return m_twoColorTile;
 }
 void ossimTwoColorView::runAlgorithm(ossimImageData* newData, ossimImageData* oldData)
 {
-   if(theNativeFlag)
+   if(m_nativeFlag)
    {
       runNative8(newData, oldData);
    }
@@ -271,258 +129,239 @@ void ossimTwoColorView::runAlgorithm(ossimImageData* newData, ossimImageData* ol
 
 void ossimTwoColorView::runNative8(ossimImageData* newData, ossimImageData* oldData)
 {
-   // do the new band first
-   ossim_uint8 newNullPix = 0;
-   ossim_uint8 oldNullPix = 0;
-   const ossim_uint8* newBuf = 0;
-   const ossim_uint8* oldBuf = 0;
-   ossim_uint32 idx = 0;
-   ossim_uint32 maxIdx = theTwoColorTile->getWidth()*theTwoColorTile->getHeight();
-   ossim_uint8* newDestBuf = static_cast<ossim_uint8*>(theTwoColorTile->getBuf(theNewBufferDestinationIndex));
-   ossim_uint8* oldDestBuf = static_cast<ossim_uint8*>(theTwoColorTile->getBuf(theOldBufferDestinationIndex));
-   ossim_uint8* minDestBuf = static_cast<ossim_uint8*>(theTwoColorTile->getBuf(theMinBufferDestinationIndex));
-   
-   if(newData)
-   {
-      newBuf     = static_cast<ossim_uint8*>(newData->getBuf(0));
-      newNullPix = static_cast<ossim_uint8>(newData->getNullPix(0));
-      
-   }
-   if(oldData)
-   {
-      oldBuf = static_cast<ossim_uint8*>(oldData->getBuf(0));   
-      oldNullPix    = static_cast<ossim_uint8>(oldData->getNullPix(0));
-   }
-   if(!newBuf&&!oldBuf)
-   {
-      return;
-   }
-   if(newBuf&&oldBuf)
-   {
-      for(idx = 0; idx < maxIdx;++idx)
+   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 )
       {
-         if((*newBuf == newNullPix)&&
-            (*oldBuf == oldNullPix))
-         {
-            *newDestBuf = 0;
-            *oldDestBuf = 0;
-            *minDestBuf = 0;
-         }
-         else
+         // 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(*newBuf == newNullPix)
-            {
-               *newDestBuf = 1;
-            }
-            else
-            {
-               *newDestBuf = *newBuf;
-            }
-            if(*oldBuf == oldNullPix)
+            if( ( *n == NP ) && ( *o == NP ) )
             {
-               *oldDestBuf = 1;
+               // Both inputs null, set all outputs null.
+               *r = NP;
+               *b = NP;
+               *g = NP;
             }
-            else
+            else 
             {
-               *oldDestBuf = *oldBuf;
+               // 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;
+               }
             }
-            *minDestBuf = 1;
-         }
-         ++newBuf;
-         ++oldBuf;
-         ++minDestBuf;
-         ++newDestBuf;
-         ++oldDestBuf;
-      }
-   }
-   else if(newBuf)
-   {
-      for(idx = 0; idx < maxIdx;++idx)
-      {
-         if(*newBuf == newNullPix)
-         {
-            *newDestBuf = 0;
-            *oldDestBuf = 0;
-            *minDestBuf = 0;
-         }
-         else
-         {
-            *newDestBuf = *newBuf;
-            *oldDestBuf = 1;
-            *minDestBuf = 1;
-         }
-         ++newBuf;
-         ++minDestBuf;
-         ++newDestBuf;
-         ++oldDestBuf;
-      }
-   }
-   else if(oldBuf)
-   {
-      for(idx = 0; idx < maxIdx;++idx)
-      {
-         if(*oldBuf == oldNullPix)
-         {
-            *newDestBuf = 0;
-            *oldDestBuf = 0;
-            *minDestBuf = 0;
-         }
-         else
-         {
-            *oldDestBuf = *oldBuf;
-            *newDestBuf = 1;
-            *minDestBuf = 1;
+
+            // Next pixel:
+            ++n;
+            ++o;
+            ++r;
+            ++g;
+            ++b;
          }
-         ++oldBuf;
-         ++minDestBuf;
-         ++newDestBuf;
-         ++oldDestBuf;
       }
    }
 }
 
 void ossimTwoColorView::runNorm(ossimImageData* newData, ossimImageData* oldData)
 {
-   // do the new band first
-   ossim_float32 tempValue=0.0;
-   ossim_uint8 newNullPix = 0;
-   ossim_uint8 oldNullPix = 0;
-   std::vector<ossim_float32> newDataBuffer;
-   std::vector<ossim_float32> oldDataBuffer;
-   
-   ossim_float32* newBuf = 0;
-   ossim_float32* oldBuf = 0;
-   ossim_uint32 idx = 0;
-   ossim_uint32 maxIdx = theTwoColorTile->getWidth()*theTwoColorTile->getHeight();
-   ossim_uint8* newDestBuf = static_cast<ossim_uint8*>(theTwoColorTile->getBuf(theNewBufferDestinationIndex));
-   ossim_uint8* oldDestBuf = static_cast<ossim_uint8*>(theTwoColorTile->getBuf(theOldBufferDestinationIndex));
-   ossim_uint8* minDestBuf = static_cast<ossim_uint8*>(theTwoColorTile->getBuf(theMinBufferDestinationIndex));
-
-   if(newData&&newData->getBuf())
-   {
-      newDataBuffer.resize(theTwoColorTile->getWidth()*theTwoColorTile->getHeight());
-      newBuf     = &newDataBuffer.front();
-      newData->copyTileBandToNormalizedBuffer(0, newBuf);
-      newNullPix = 0;
-   }
-   if(oldData&&oldData->getBuf())
-   {
-      oldDataBuffer.resize(theTwoColorTile->getWidth()*theTwoColorTile->getHeight());
-      oldBuf     = &oldDataBuffer.front();
-      oldData->copyTileBandToNormalizedBuffer(0, oldBuf);
-      oldNullPix = 0;
-   }
-   if(!newBuf&&!oldBuf)
-   {
-      return;
-   }
-   if(newBuf&&oldBuf)
+   if ( newData && oldData && m_twoColorTile.valid() &&
+        ( m_twoColorTile->getNumberOfBands() == 3 ) )
    {
-      for(idx = 0; idx < maxIdx;++idx)
+      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 )
       {
-         if((*newBuf == newNullPix)&&
-            (*oldBuf == oldNullPix))
-         {
-            *newDestBuf = 0;
-            *oldDestBuf = 0;
-            *minDestBuf = 0;
-         }
-         else
+         // 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(*newBuf == newNullPix)
+            if( ( *n == NP ) && ( *o == NP ) )
             {
-               *newDestBuf = 1;
+               // Both inputs null, set all outputs null.
+               *r = NP;
+               *b = NP;
+               *g = NP;
             }
-            else
+            else 
             {
-               tempValue = (*newBuf)*255;
-               if(tempValue < 1) tempValue = 1;
-               else if(tempValue > 255) tempValue = 255;
+               // At least one input is not null.
                
-               *newDestBuf = (ossim_uint8)(tempValue);
-            }
-            if(*oldBuf == oldNullPix)
-            {
-               *oldDestBuf = 1;
-            }
-            else
-            {
-               // do old buffer channel
-               tempValue = (*oldBuf)*255;
-               if(tempValue < 1) tempValue = 1;
-               else if(tempValue > 255) tempValue = 255;
-               
-               *oldDestBuf = (ossim_uint8)(tempValue);
+               // 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;
+               }
             }
-            *minDestBuf = 1;
-         }
-         ++newBuf;
-         ++oldBuf;
-         ++minDestBuf;
-         ++newDestBuf;
-         ++oldDestBuf;
-      }
-   }
-   else if(newBuf)
-   {
-      for(idx = 0; idx < maxIdx;++idx)
-      {
-         if(*newBuf == newNullPix)
-         {
-            *newDestBuf = 0;
-            *oldDestBuf = 0;
-            *minDestBuf = 0;
-         }
-         else
-         {
-            tempValue = (*newBuf)*255;
-            if(tempValue < 1) tempValue = 1;
-            else if(tempValue > 255) tempValue = 255;
-            
-            *newDestBuf = (ossim_uint8)(tempValue);
-            *oldDestBuf = 1;
-            *minDestBuf = 1;
-         }
-         ++newBuf;
-         ++minDestBuf;
-         ++newDestBuf;
-         ++oldDestBuf;
-      }
-   }
-   else if(oldBuf)
-   {
-      for(idx = 0; idx < maxIdx;++idx)
-      {
-         if(*oldBuf == oldNullPix)
-         {
-            *newDestBuf = 0;
-            *oldDestBuf = 0;
-            *minDestBuf = 0;
-         }
-         else
-         {
-            tempValue = (*oldBuf)*255;
-            if(tempValue < 1) tempValue = 1;
-            else if(tempValue > 255) tempValue = 255;
-            
-            *oldDestBuf = (ossim_uint8)(tempValue);
-            *newDestBuf = 1;
-            *minDestBuf = 1;
+
+            // Next pixel:
+            ++n;
+            ++o;
+            ++r;
+            ++g;
+            ++b;
          }
-         ++oldBuf;
-         ++minDestBuf;
-         ++newDestBuf;
-         ++oldDestBuf;
       }
    }
 }
 
 void ossimTwoColorView::allocate()
 {
-   theTwoColorTile = ossimImageDataFactory::instance()->create(this, this);
-   if(theTwoColorTile.valid())
+   m_twoColorTile = ossimImageDataFactory::instance()->create(this, this);
+   if(m_twoColorTile.valid())
    {
-      theTwoColorTile->initialize();
+      m_twoColorTile->initialize();
    }
 }
 
@@ -530,29 +369,51 @@ void ossimTwoColorView::allocate()
 void ossimTwoColorView::initialize()
 {
    ossimImageCombiner::initialize();
-   theNewInput = 0;
-   theOldInput = 0;
-   theTwoColorTile = 0;
-   theNativeFlag = false;
-   theByPassFlag = false;
+   m_newInput = 0;
+   m_oldInput = 0;
+   m_twoColorTile = 0;
+   m_nativeFlag = false;
+   m_byPassFlag = false;
+
    if(getNumberOfInputs() < 2)
    {
-      theByPassFlag = true;
+      m_byPassFlag = true;
    }
    else 
    {
-      theNewInput = PTR_CAST(ossimImageSource, getInput(0));
-      theOldInput = PTR_CAST(ossimImageSource, getInput(1));
-      if(!theNewInput||!theOldInput)
+      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)
       {
-         theByPassFlag = true;
+         m_byPassFlag = true;
       }
       else
       {
-         if((theNewInput->getOutputScalarType() == OSSIM_UINT8)&&
-            (theOldInput->getOutputScalarType() == OSSIM_UINT8))
+         if((m_newInput->getOutputScalarType() == OSSIM_UINT8)&&
+            (m_oldInput->getOutputScalarType() == OSSIM_UINT8))
          {
-            theNativeFlag = true;
+            m_nativeFlag = true;
          }
       }
    }
diff --git a/src/ossim/imaging/ossimUsgsDemTileSource.cpp b/src/ossim/imaging/ossimUsgsDemTileSource.cpp
index c2543f6..75ed1a8 100644
--- a/src/ossim/imaging/ossimUsgsDemTileSource.cpp
+++ b/src/ossim/imaging/ossimUsgsDemTileSource.cpp
@@ -9,7 +9,7 @@
 // Contains class declaration for ossimUsgsDemTileSource.
 //
 //********************************************************************
-// $Id: ossimUsgsDemTileSource.cpp 17932 2010-08-19 20:34:35Z dburken $
+// $Id: ossimUsgsDemTileSource.cpp 19640 2011-05-25 15:58:00Z oscarkramer $
 
 #include <iostream>
 #include <fstream>
@@ -29,6 +29,7 @@
 #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)
 
@@ -365,6 +366,43 @@ bool ossimUsgsDemTileSource::loadState(const ossimKeywordlist& kwl,
    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();
diff --git a/src/ossim/imaging/ossimVertexExtractor.cpp b/src/ossim/imaging/ossimVertexExtractor.cpp
index e2be390..190213e 100644
--- a/src/ossim/imaging/ossimVertexExtractor.cpp
+++ b/src/ossim/imaging/ossimVertexExtractor.cpp
@@ -6,7 +6,7 @@
 // TR # 136 kminear      Fix extractVertices method
 //
 //*************************************************************************
-// $Id: ossimVertexExtractor.cpp 15836 2009-10-30 12:29:09Z dburken $
+// $Id: ossimVertexExtractor.cpp 21184 2012-06-29 15:13:09Z dburken $
 
 #include <fstream>
 using namespace std;
@@ -597,12 +597,12 @@ bool ossimVertexExtractor::extractVertices()
          ossim_int32 line1_pt1 = (line1_pt2 + line1_pt0)/2;
          ossim_int32 line1_pt3 = (line1_pt2 + line1_pt4)/2;
          
-         double line1RegPtsSamples[] = {theRightEdge[line1_pt1],
-                                        theRightEdge[line1_pt2],
-                                        theRightEdge[line1_pt3]};
-         double line1RegPtsLines[] = {-line1_pt1,
-                                      -line1_pt2,
-                                      -line1_pt3};
+         double line1RegPtsSamples[] = { static_cast<double>(theRightEdge[line1_pt1]),
+                                         static_cast<double>(theRightEdge[line1_pt2]),
+                                         static_cast<double>(theRightEdge[line1_pt3]) };
+         double line1RegPtsLines[] = { static_cast<double>(-line1_pt1),
+                                       static_cast<double>(-line1_pt2),
+                                       static_cast<double>(-line1_pt3) };
          
          double sum_xy_line1 = 0.0;
          double sum_x_line1 = 0.0;
@@ -681,311 +681,310 @@ bool ossimVertexExtractor::extractVertices()
                         minValuePt3, minOffsetPt3 );
          line2_pt3 = line2_pt3-100 + minOffsetPt3;
          
-         //***
-            // Find the line within 100 lines of line2_ptx that has the
-            // minimum sample.  This will cut off the 'fringe'
-            //***
-            
-            double line2RegPtsSamples[] = {theRightEdge[line2_pt1],
-                                           theRightEdge[line2_pt2],
-                                           theRightEdge[line2_pt3]};
-            double line2RegPtsLines[] = {-line2_pt1,
-                                         -line2_pt2,
-                                         -line2_pt3};
-            
-            double sum_xy_line2 = 0.0;
-            double sum_x_line2 = 0.0;
-            double sum_y_line2 = 0.0;
-            double mean_x_line2 = 0.0;
-            double mean_y_line2 = 0.0;
-            double sum_x_squared_line2 = 0.0;
-            double sum_squared_x_line2 = 0.0;   
-            double b_line2;
-            double a_line2;
-            double num_elements_line2 = 3.0;
+         //---
+         // Find the line within 100 lines of line2_ptx that has the
+         // minimum sample.  This will cut off the 'fringe'
+         //---
+         double line2RegPtsSamples[] = { static_cast<double>(theRightEdge[line2_pt1]),
+                                         static_cast<double>(theRightEdge[line2_pt2]),
+                                         static_cast<double>(theRightEdge[line2_pt3]) };
+         double line2RegPtsLines[] = { static_cast<double>(-line2_pt1),
+                                       static_cast<double>(-line2_pt2),
+                                       static_cast<double>(-line2_pt3) };
          
-            for(ossim_int32 i = 0; i < num_elements_line2; ++i)
-            {
-               sum_xy_line2 = sum_xy_line2
-                  + (line2RegPtsSamples[i]*line2RegPtsLines[i]);
+         double sum_xy_line2 = 0.0;
+         double sum_x_line2 = 0.0;
+         double sum_y_line2 = 0.0;
+         double mean_x_line2 = 0.0;
+         double mean_y_line2 = 0.0;
+         double sum_x_squared_line2 = 0.0;
+         double sum_squared_x_line2 = 0.0;   
+         double b_line2;
+         double a_line2;
+         double num_elements_line2 = 3.0;
+         
+         for(ossim_int32 i = 0; i < num_elements_line2; ++i)
+         {
+            sum_xy_line2 = sum_xy_line2
+               + (line2RegPtsSamples[i]*line2RegPtsLines[i]);
             
-               sum_x_line2 = sum_x_line2 + line2RegPtsSamples[i];
-               sum_y_line2 = sum_y_line2 + line2RegPtsLines[i];
+            sum_x_line2 = sum_x_line2 + line2RegPtsSamples[i];
+            sum_y_line2 = sum_y_line2 + line2RegPtsLines[i];
             
-               sum_squared_x_line2 = sum_squared_x_line2
-                  + line2RegPtsSamples[i]*line2RegPtsSamples[i];
-            }
+            sum_squared_x_line2 = sum_squared_x_line2
+               + line2RegPtsSamples[i]*line2RegPtsSamples[i];
+         }
 
-            sum_x_squared_line2 = sum_x_line2*sum_x_line2; 
-            mean_y_line2 = sum_y_line2/num_elements_line2;
-            mean_x_line2 = sum_x_line2/num_elements_line2;
-            b_line2 = (sum_xy_line2 - (sum_x_line2*sum_y_line2)/num_elements_line2)
-               / (sum_squared_x_line2 - (sum_x_squared_line2/num_elements_line2));
-            a_line2 = mean_y_line2 - b_line2*mean_x_line2;
+         sum_x_squared_line2 = sum_x_line2*sum_x_line2; 
+         mean_y_line2 = sum_y_line2/num_elements_line2;
+         mean_x_line2 = sum_x_line2/num_elements_line2;
+         b_line2 = (sum_xy_line2 - (sum_x_line2*sum_y_line2)/num_elements_line2)
+            / (sum_squared_x_line2 - (sum_x_squared_line2/num_elements_line2));
+         a_line2 = mean_y_line2 - b_line2*mean_x_line2;
 
-            if(traceDebug())
+         if(traceDebug())
+         {
+            for(ossim_int32 i = 0; i < num_elements_line2; ++i)
             {
-               for(ossim_int32 i = 0; i < num_elements_line2; ++i)
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG) << setprecision(15) << "line2RegPtsLines[" << i << "]:  "
-                                                      <<line2RegPtsLines[i]
-                                                      << "\nline2RegPtsSamples[" << i << "]:  "
-                                                      <<line2RegPtsSamples[i]
-                                                      <<std::endl;
-               }
-               ossimNotify(ossimNotifyLevel_DEBUG) << "\na_line2:  " << a_line2
-                                                   << "\nb_line2:  " << b_line2 << std::endl;
-               
+               ossimNotify(ossimNotifyLevel_DEBUG) << setprecision(15) << "line2RegPtsLines[" << i << "]:  "
+                                                   <<line2RegPtsLines[i]
+                                                   << "\nline2RegPtsSamples[" << i << "]:  "
+                                                   <<line2RegPtsSamples[i]
+                                                   <<std::endl;
             }
+            ossimNotify(ossimNotifyLevel_DEBUG) << "\na_line2:  " << a_line2
+                                                << "\nb_line2:  " << b_line2 << std::endl;
+               
+         }
          
-            //End regression line2
+         //End regression line2
             
-            //Intersect lines 1 and 2 to get the ur corner vertex
+         //Intersect lines 1 and 2 to get the ur corner vertex
 
-            double ur_x = (a_line1 - a_line2)/(b_line2 - b_line1);
-            double ur_y = -(a_line1 + b_line1*ur_x);
+         double ur_x = (a_line1 - a_line2)/(b_line2 - b_line1);
+         double ur_y = -(a_line1 + b_line1*ur_x);
             
-            //Regression Line 3
+         //Regression Line 3
             
-            ossim_int32 line3_pt0 = leftMostSampleLine;
-            ossim_int32 line3_pt4 = bottomLine;
-            ossim_int32 line3_pt2 = (line3_pt0 + line3_pt4)/2;
-            ossim_int32 line3_pt1 = (line3_pt2 + line3_pt0)/2;
-            ossim_int32 line3_pt3 = (line3_pt2 + line3_pt4)/2;
+         ossim_int32 line3_pt0 = leftMostSampleLine;
+         ossim_int32 line3_pt4 = bottomLine;
+         ossim_int32 line3_pt2 = (line3_pt0 + line3_pt4)/2;
+         ossim_int32 line3_pt1 = (line3_pt2 + line3_pt0)/2;
+         ossim_int32 line3_pt3 = (line3_pt2 + line3_pt4)/2;
             
-            double line3RegPtsSamples[] = {theLeftEdge[line3_pt1],
-                                           theLeftEdge[line3_pt2],
-                                           theLeftEdge[line3_pt3]};
-            double line3RegPtsLines[] = {-line3_pt1,
-                                         -line3_pt2,
-                                         -line3_pt3};
+         double line3RegPtsSamples[] = { static_cast<double>(theLeftEdge[line3_pt1]),
+                                         static_cast<double>(theLeftEdge[line3_pt2]),
+                                         static_cast<double>(theLeftEdge[line3_pt3]) };
+         double line3RegPtsLines[] = { static_cast<double>(-line3_pt1),
+                                       static_cast<double>(-line3_pt2),
+                                       static_cast<double>(-line3_pt3) };
             
-            double sum_xy_line3 = 0.0;
-            double sum_x_line3 = 0.0;
-            double sum_y_line3 = 0.0;
-            double mean_x_line3 = 0.0;
-            double mean_y_line3 = 0.0;
-            double sum_x_squared_line3 = 0.0;
-            double sum_squared_x_line3 = 0.0;   
-            double b_line3;
-            double a_line3;
-            double num_elements_line3 = 3.0;
+         double sum_xy_line3 = 0.0;
+         double sum_x_line3 = 0.0;
+         double sum_y_line3 = 0.0;
+         double mean_x_line3 = 0.0;
+         double mean_y_line3 = 0.0;
+         double sum_x_squared_line3 = 0.0;
+         double sum_squared_x_line3 = 0.0;   
+         double b_line3;
+         double a_line3;
+         double num_elements_line3 = 3.0;
             
-            for(ossim_int32 i = 0; i < num_elements_line3; ++i)
-            {
-               sum_xy_line3 = sum_xy_line3
-                  + (line3RegPtsSamples[i]*line3RegPtsLines[i]);
+         for(ossim_int32 i = 0; i < num_elements_line3; ++i)
+         {
+            sum_xy_line3 = sum_xy_line3
+               + (line3RegPtsSamples[i]*line3RegPtsLines[i]);
                
-               sum_x_line3 = sum_x_line3 + line3RegPtsSamples[i];
-               sum_y_line3 = sum_y_line3 + line3RegPtsLines[i];
+            sum_x_line3 = sum_x_line3 + line3RegPtsSamples[i];
+            sum_y_line3 = sum_y_line3 + line3RegPtsLines[i];
                
-               sum_squared_x_line3 = sum_squared_x_line3
-                  + line3RegPtsSamples[i]*line3RegPtsSamples[i];
+            sum_squared_x_line3 = sum_squared_x_line3
+               + line3RegPtsSamples[i]*line3RegPtsSamples[i];
                
-            }
+         }
             
-            sum_x_squared_line3 = sum_x_line3*sum_x_line3; 
-            mean_y_line3 = sum_y_line3/num_elements_line3;
-            mean_x_line3 = sum_x_line3/num_elements_line3;
-            b_line3 = (sum_xy_line3 - (sum_x_line3*sum_y_line3)/num_elements_line3)
-               / (sum_squared_x_line3 - (sum_x_squared_line3/num_elements_line3));
-            a_line3 = mean_y_line3 - b_line3*mean_x_line3;
+         sum_x_squared_line3 = sum_x_line3*sum_x_line3; 
+         mean_y_line3 = sum_y_line3/num_elements_line3;
+         mean_x_line3 = sum_x_line3/num_elements_line3;
+         b_line3 = (sum_xy_line3 - (sum_x_line3*sum_y_line3)/num_elements_line3)
+            / (sum_squared_x_line3 - (sum_x_squared_line3/num_elements_line3));
+         a_line3 = mean_y_line3 - b_line3*mean_x_line3;
             
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG) << "\n\n a_line3:  " << a_line3 <<std::endl;
-               ossimNotify(ossimNotifyLevel_DEBUG) << " b_line3:  " << b_line3 <<std::endl;
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << "\n\n a_line3:  " << a_line3 <<std::endl;
+            ossimNotify(ossimNotifyLevel_DEBUG) << " b_line3:  " << b_line3 <<std::endl;
                
                
-               for(ossim_int32 i = 0; i < num_elements_line3; ++i)
-               {
+            for(ossim_int32 i = 0; i < num_elements_line3; ++i)
+            {
                   
-                  ossimNotify(ossimNotifyLevel_DEBUG) << setprecision(15) << "line3RegPtsLines[" << i << "]:  "
-                                                      <<line3RegPtsLines[i]
-                                                      << "\nline3RegPtsSamples[" << i << "]:  "
-                                                      <<line3RegPtsSamples[i]
-                                                      << std::endl;
-               }
+               ossimNotify(ossimNotifyLevel_DEBUG) << setprecision(15) << "line3RegPtsLines[" << i << "]:  "
+                                                   <<line3RegPtsLines[i]
+                                                   << "\nline3RegPtsSamples[" << i << "]:  "
+                                                   <<line3RegPtsSamples[i]
+                                                   << std::endl;
             }
-            //End regression line3
+         }
+         //End regression line3
             
-            //Intersect lines 2 and 3 to get the lr corner vertex
+         //Intersect lines 2 and 3 to get the lr corner vertex
             
-            double lr_x = (a_line3 - a_line2)/(b_line2 - b_line3);
-            double lr_y = -(a_line3 + b_line3*lr_x);
+         double lr_x = (a_line3 - a_line2)/(b_line2 - b_line3);
+         double lr_y = -(a_line3 + b_line3*lr_x);
             
-            //End Regression Line3
+         //End Regression Line3
             
-            //Regression Line 4
+         //Regression Line 4
             
-            ossim_int32 line4_pt0 = leftMostSampleLine;
-            ossim_int32 line4_pt4 = topLine;
-            ossim_int32 line4_pt2 = (line4_pt0 + line4_pt4)/2;
-            ossim_int32 line4_pt1 = (line4_pt2 + line4_pt0)/2;
-            ossim_int32 line4_pt3 = (line4_pt2 + line4_pt4)/2;
+         ossim_int32 line4_pt0 = leftMostSampleLine;
+         ossim_int32 line4_pt4 = topLine;
+         ossim_int32 line4_pt2 = (line4_pt0 + line4_pt4)/2;
+         ossim_int32 line4_pt1 = (line4_pt2 + line4_pt0)/2;
+         ossim_int32 line4_pt3 = (line4_pt2 + line4_pt4)/2;
             
 //             //***
 //                // Find the line within 100 lines of line2_ptx that has the maximum
 //                // sample.  This will cut off the 'fringe'.
 //                //***
             
-            ossim_int32 maxValueLine4Pt1;
-            ossim_int32 maxOffsetLine4Pt1;
-            getMaxAndIndex(&theLeftEdge[line4_pt1-100],&theLeftEdge[line4_pt1+100],
-                           maxValueLine4Pt1, maxOffsetLine4Pt1 );
-            line4_pt1 = line4_pt1-100 + maxOffsetLine4Pt1;
+         ossim_int32 maxValueLine4Pt1;
+         ossim_int32 maxOffsetLine4Pt1;
+         getMaxAndIndex(&theLeftEdge[line4_pt1-100],&theLeftEdge[line4_pt1+100],
+                        maxValueLine4Pt1, maxOffsetLine4Pt1 );
+         line4_pt1 = line4_pt1-100 + maxOffsetLine4Pt1;
             
             
-            ossim_int32 maxValueLine4Pt2;
-            ossim_int32 maxOffsetLine4Pt2;
-            getMaxAndIndex(&theLeftEdge[line4_pt2-100],&theLeftEdge[line4_pt2+100],
-                           maxValueLine4Pt2, maxOffsetLine4Pt2 );
-            line4_pt2 = line4_pt2-100 + maxOffsetLine4Pt2;
+         ossim_int32 maxValueLine4Pt2;
+         ossim_int32 maxOffsetLine4Pt2;
+         getMaxAndIndex(&theLeftEdge[line4_pt2-100],&theLeftEdge[line4_pt2+100],
+                        maxValueLine4Pt2, maxOffsetLine4Pt2 );
+         line4_pt2 = line4_pt2-100 + maxOffsetLine4Pt2;
             
             
-            ossim_int32 maxValueLine4Pt3;
-            ossim_int32 maxOffsetLine4Pt3;
-            getMaxAndIndex(&theLeftEdge[line4_pt3-100],&theLeftEdge[line4_pt3+100],
-                           maxValueLine4Pt3, maxOffsetLine4Pt3 );
-            line4_pt3 = line4_pt3-100 + maxOffsetLine4Pt3;
+         ossim_int32 maxValueLine4Pt3;
+         ossim_int32 maxOffsetLine4Pt3;
+         getMaxAndIndex(&theLeftEdge[line4_pt3-100],&theLeftEdge[line4_pt3+100],
+                        maxValueLine4Pt3, maxOffsetLine4Pt3 );
+         line4_pt3 = line4_pt3-100 + maxOffsetLine4Pt3;
             
             
             
             
-            double line4RegPtsSamples[] = {theLeftEdge[line4_pt1],
-                                           theLeftEdge[line4_pt2],
-                                           theLeftEdge[line4_pt3]};
-            double line4RegPtsLines[] = {-line4_pt1,
-                                         -line4_pt2,
-                                         -line4_pt3};
+         double line4RegPtsSamples[] = { static_cast<double>(theLeftEdge[line4_pt1]),
+                                         static_cast<double>(theLeftEdge[line4_pt2]),
+                                         static_cast<double>(theLeftEdge[line4_pt3]) };
+         double line4RegPtsLines[] = { static_cast<double>(-line4_pt1),
+                                       static_cast<double>(-line4_pt2),
+                                       static_cast<double>(-line4_pt3) };
             
-            double sum_xy_line4 = 0.0;
-            double sum_x_line4 = 0.0;
-            double sum_y_line4 = 0.0;
-            double mean_x_line4 = 0.0;
-            double mean_y_line4 = 0.0;
-            double sum_x_squared_line4 = 0.0;
-            double sum_squared_x_line4 = 0.0;   
-            double b_line4;
-            double a_line4;
-            double num_elements_line4 = 3.0;
-            for(ossim_int32 i = 0; i < num_elements_line4; ++i)
-            {
-               sum_xy_line4 = sum_xy_line4
-                  + (line4RegPtsSamples[i]*line4RegPtsLines[i]);
+         double sum_xy_line4 = 0.0;
+         double sum_x_line4 = 0.0;
+         double sum_y_line4 = 0.0;
+         double mean_x_line4 = 0.0;
+         double mean_y_line4 = 0.0;
+         double sum_x_squared_line4 = 0.0;
+         double sum_squared_x_line4 = 0.0;   
+         double b_line4;
+         double a_line4;
+         double num_elements_line4 = 3.0;
+         for(ossim_int32 i = 0; i < num_elements_line4; ++i)
+         {
+            sum_xy_line4 = sum_xy_line4
+               + (line4RegPtsSamples[i]*line4RegPtsLines[i]);
                
-               sum_x_line4 = sum_x_line4 + line4RegPtsSamples[i];
-               sum_y_line4 = sum_y_line4 + line4RegPtsLines[i];
+            sum_x_line4 = sum_x_line4 + line4RegPtsSamples[i];
+            sum_y_line4 = sum_y_line4 + line4RegPtsLines[i];
                
-               sum_squared_x_line4 = sum_squared_x_line4
-                  + line4RegPtsSamples[i]*line4RegPtsSamples[i];
+            sum_squared_x_line4 = sum_squared_x_line4
+               + line4RegPtsSamples[i]*line4RegPtsSamples[i];
                
                
-            }
+         }
             
-            sum_x_squared_line4 = sum_x_line4*sum_x_line4; 
-            mean_y_line4 = sum_y_line4/num_elements_line4;
-            mean_x_line4 = sum_x_line4/num_elements_line4;
-            b_line4 = (sum_xy_line4 - (sum_x_line4*sum_y_line4)/num_elements_line4)
-               / (sum_squared_x_line4 - (sum_x_squared_line4/num_elements_line4));
-            a_line4 = mean_y_line4 - b_line4*mean_x_line4;
+         sum_x_squared_line4 = sum_x_line4*sum_x_line4; 
+         mean_y_line4 = sum_y_line4/num_elements_line4;
+         mean_x_line4 = sum_x_line4/num_elements_line4;
+         b_line4 = (sum_xy_line4 - (sum_x_line4*sum_y_line4)/num_elements_line4)
+            / (sum_squared_x_line4 - (sum_x_squared_line4/num_elements_line4));
+         a_line4 = mean_y_line4 - b_line4*mean_x_line4;
             
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)<<"\na_line4:  "<< a_line4
-                                                  <<"\nb_line4:  "<< b_line4 <<std::endl;
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)<<"\na_line4:  "<< a_line4
+                                               <<"\nb_line4:  "<< b_line4 <<std::endl;
                
-               for(ossim_int32 i = 0; i < num_elements_line4; ++i)
-               {
+            for(ossim_int32 i = 0; i < num_elements_line4; ++i)
+            {
                   
-                  ossimNotify(ossimNotifyLevel_DEBUG) << setprecision(15) << "line4RegPtsLines[" << i << "]:  "
-                                                      <<line4RegPtsLines[i]
-                                                      << "\nline4RegPtsSamples[" << i << "]:  "
-                                                      <<line4RegPtsSamples[i]
-                                                      << std::endl;  
+               ossimNotify(ossimNotifyLevel_DEBUG) << setprecision(15) << "line4RegPtsLines[" << i << "]:  "
+                                                   <<line4RegPtsLines[i]
+                                                   << "\nline4RegPtsSamples[" << i << "]:  "
+                                                   <<line4RegPtsSamples[i]
+                                                   << std::endl;  
                   
-               }
             }
-            //End regression line4
+         }
+         //End regression line4
             
-            //Intersect lines 3 and 4 to get the ll corner vertex
+         //Intersect lines 3 and 4 to get the ll corner vertex
             
-            double ll_x = (a_line4 - a_line3)/(b_line3 - b_line4);
-            double ll_y = -(a_line4 + b_line4*ll_x);
+         double ll_x = (a_line4 - a_line3)/(b_line3 - b_line4);
+         double ll_y = -(a_line4 + b_line4*ll_x);
             
-            //End Regression Line4
+         //End Regression Line4
             
-            //Intersect lines 4 and 1 to get the ul corner vertex
+         //Intersect lines 4 and 1 to get the ul corner vertex
             
-            double ul_x = (a_line4 - a_line1)/(b_line1 - b_line4);
-            double ul_y = -(a_line4 + b_line4*ul_x);
+         double ul_x = (a_line4 - a_line1)/(b_line1 - b_line4);
+         double ul_y = -(a_line4 + b_line4*ul_x);
             
-            if (traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)<<"\n\nInitial corners for tilted right:   "
-                                                  <<"\ncorner0:  ("<<ul_x<<", "<<ul_y<<")"
-                                                  <<"\ncorner1:  ("<<ur_x<<", "<<ur_y<<")"
-                                                  <<"\ncorner2:  ("<<lr_x<<", "<<lr_y<<")"
-                                                  <<"\ncorner3:  ("<<ll_x<<", "<<ll_y<<")"<<std::endl<<std::endl;
-            }
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n\nInitial corners for tilted right:   "
+                                               <<"\ncorner0:  ("<<ul_x<<", "<<ul_y<<")"
+                                               <<"\ncorner1:  ("<<ur_x<<", "<<ur_y<<")"
+                                               <<"\ncorner2:  ("<<lr_x<<", "<<lr_y<<")"
+                                               <<"\ncorner3:  ("<<ll_x<<", "<<ll_y<<")"<<std::endl<<std::endl;
+         }
             
-            leftCornerLine_A = (ossim_int32)ul_y;
-            leftCorner_A = (ossim_int32)ul_x; //0
+         leftCornerLine_A = (ossim_int32)ul_y;
+         leftCorner_A = (ossim_int32)ul_x; //0
             
-            rightCornerLine_A = (ossim_int32)ur_y;
-            rightCorner_A = (ossim_int32)ur_x; //1
+         rightCornerLine_A = (ossim_int32)ur_y;
+         rightCorner_A = (ossim_int32)ur_x; //1
             
-            rightCornerLine_B = (ossim_int32)lr_y;
-            rightCorner_B =(ossim_int32)lr_x; //2
+         rightCornerLine_B = (ossim_int32)lr_y;
+         rightCorner_B =(ossim_int32)lr_x; //2
             
-            leftCornerLine_B = (ossim_int32)ll_y;
-            leftCorner_B =(ossim_int32)ll_x; //3
+         leftCornerLine_B = (ossim_int32)ll_y;
+         leftCorner_B =(ossim_int32)ll_x; //3
             
             
-            // Check for bad corner points due to irregular shape image
+         // Check for bad corner points due to irregular shape image
             
-            //for corner 0 (ul), sample should be between left and right most samples
-            //                   line can go negative due to jagged edges 
+         //for corner 0 (ul), sample should be between left and right most samples
+         //                   line can go negative due to jagged edges 
             
-            //for corner 1 (ur), sample can go > than num samples
-            //                   line should be between top and bottom lines
+         //for corner 1 (ur), sample can go > than num samples
+         //                   line should be between top and bottom lines
             
-            //for corner 2 (lr), line should be between top and bottom line + 200
-            //                   sample should be between left and right most sample
+         //for corner 2 (lr), line should be between top and bottom line + 200
+         //                   sample should be between left and right most sample
             
-            //for corner 3 (ll), line should be between top and bottom line
-            //                   sample should can go negative due to jagged edges
+         //for corner 3 (ll), line should be between top and bottom line
+         //                   sample should can go negative due to jagged edges
             
-            if(        (leftCornerLine_A < (topLine - 300))
-                       || (leftCornerLine_A > total_lines)
-                       || (leftCorner_A > rightMostSample)
-                       || (leftCorner_A < leftMostSample)
+         if(        (leftCornerLine_A < (topLine - 300))
+                    || (leftCornerLine_A > total_lines)
+                    || (leftCorner_A > rightMostSample)
+                    || (leftCorner_A < leftMostSample)
                        
-                       || (rightCornerLine_A < topLine)
-                       || (rightCornerLine_A > bottomLine)
-                       || (rightCorner_A < leftMostSample)
-                       || (rightCorner_A > (rightMostSample + 200))
+                    || (rightCornerLine_A < topLine)
+                    || (rightCornerLine_A > bottomLine)
+                    || (rightCorner_A < leftMostSample)
+                    || (rightCorner_A > (rightMostSample + 200))
                        
                        
-                       || (rightCornerLine_B < topLine)
-                       || (rightCornerLine_B > (bottomLine + 200))
-                       || (rightCorner_B < leftMostSample)
-                       || (rightCorner_B > rightMostSample)
+                    || (rightCornerLine_B < topLine)
+                    || (rightCornerLine_B > (bottomLine + 200))
+                    || (rightCorner_B < leftMostSample)
+                    || (rightCorner_B > rightMostSample)
                        
-                       || (leftCornerLine_B > bottomLine)   
-                       || (leftCornerLine_B < topLine)
-                       || (leftCorner_B > rightMostSample)   
-                       || (leftCorner_B < (leftMostSample - 200))    )
+                    || (leftCornerLine_B > bottomLine)   
+                    || (leftCornerLine_B < topLine)
+                    || (leftCorner_B > rightMostSample)   
+                    || (leftCorner_B < (leftMostSample - 200))    )
                
                
                
+         {
+            right = false;
+            if (traceDebug())
             {
-               right = false;
-               if (traceDebug())
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG) <<"\n\n***Case = NOT TILTED RIGHT...***"<<std::endl;
-               }
+               ossimNotify(ossimNotifyLevel_DEBUG) <<"\n\n***Case = NOT TILTED RIGHT...***"<<std::endl;
             }
+         }
       }           
       
       //tilted left
@@ -1058,12 +1057,12 @@ bool ossimVertexExtractor::extractVertices()
                                                 <<"   minValueLine1Pt3:  "<<minValueLine1Pt3<<std::endl<<std::endl;
          }
          
-         double line1RegPtsSamples[] = {theRightEdge[line1_pt1],
-                                        theRightEdge[line1_pt2],
-                                        theRightEdge[line1_pt3]};
-         double line1RegPtsLines[] = {-line1_pt1,
-                                      -line1_pt2,
-                                      -line1_pt3};
+         double line1RegPtsSamples[] = { static_cast<double>(theRightEdge[line1_pt1]),
+                                         static_cast<double>(theRightEdge[line1_pt2]),
+                                         static_cast<double>(theRightEdge[line1_pt3])};
+         double line1RegPtsLines[] = { static_cast<double>(-line1_pt1),
+                                       static_cast<double>(-line1_pt2),
+                                       static_cast<double>(-line1_pt3) };
          
          double sum_xy_line1 = 0.0;
          double sum_x_line1 = 0.0;
@@ -1122,12 +1121,12 @@ bool ossimVertexExtractor::extractVertices()
          ossim_int32 line2_pt1 = (line2_pt2 + line2_pt0)/2;
          ossim_int32 line2_pt3 = (line2_pt2 + line2_pt4)/2;
       
-         double line2RegPtsSamples[] = {theRightEdge[line2_pt1],
-                                        theRightEdge[line2_pt2],
-                                        theRightEdge[line2_pt3]};
-         double line2RegPtsLines[] = {-line2_pt1,
-                                      -line2_pt2,
-                                      -line2_pt3};
+         double line2RegPtsSamples[] = { static_cast<double>(theRightEdge[line2_pt1]),
+                                         static_cast<double>(theRightEdge[line2_pt2]),
+                                         static_cast<double>(theRightEdge[line2_pt3]) };
+         double line2RegPtsLines[] = { static_cast<double>(-line2_pt1),
+                                       static_cast<double>(-line2_pt2),
+                                       static_cast<double>(-line2_pt3) };
       
          double sum_xy_line2 = 0.0;
          double sum_x_line2 = 0.0;
@@ -1209,12 +1208,12 @@ bool ossimVertexExtractor::extractVertices()
          line3_pt3 = line3_pt3-100 + maxOffsetLine3Pt3;
       
       
-         double line3RegPtsSamples[] = {theLeftEdge[line3_pt1],
-                                        theLeftEdge[line3_pt2],
-                                        theLeftEdge[line3_pt3]};
-         double line3RegPtsLines[] = {-line3_pt1,
-                                      -line3_pt2,
-                                      -line3_pt3};
+         double line3RegPtsSamples[] = { static_cast<double>(theLeftEdge[line3_pt1]),
+                                         static_cast<double>(theLeftEdge[line3_pt2]),
+                                         static_cast<double>(theLeftEdge[line3_pt3]) };
+         double line3RegPtsLines[] = { static_cast<double>(-line3_pt1),
+                                       static_cast<double>(-line3_pt2),
+                                       static_cast<double>(-line3_pt3) };
       
          double sum_xy_line3 = 0.0;
          double sum_x_line3 = 0.0;
@@ -1279,12 +1278,12 @@ bool ossimVertexExtractor::extractVertices()
          ossim_int32 line4_pt3 = (line4_pt2 + line4_pt4)/2;
       
       
-         double line4RegPtsSamples[] = {theLeftEdge[line4_pt1],
-                                        theLeftEdge[line4_pt2],
-                                        theLeftEdge[line4_pt3]};
-         double line4RegPtsLines[] = {-line4_pt1,
-                                      -line4_pt2,
-                                      -line4_pt3};
+         double line4RegPtsSamples[] = { static_cast<double>(theLeftEdge[line4_pt1]),
+                                         static_cast<double>(theLeftEdge[line4_pt2]),
+                                         static_cast<double>(theLeftEdge[line4_pt3])};
+         double line4RegPtsLines[] = { static_cast<double>(-line4_pt1),
+                                       static_cast<double>(-line4_pt2),
+                                       static_cast<double>(-line4_pt3) };
       
          double sum_xy_line4 = 0.0;
          double sum_x_line4 = 0.0;
@@ -1515,8 +1514,8 @@ bool ossimVertexExtractor::extractVertices()
          rightCorner_A = (rightMostSample); //1
 
       }
-         //Look for non-null starting at topLine and going down
-         //Starting at right most samp and moving left 
+      //Look for non-null starting at topLine and going down
+      //Starting at right most samp and moving left 
          
       bool foundURcornera = false;
       bool foundURcornerb = false;
diff --git a/src/ossim/imaging/ossimVpfAnnotationFeatureInfo.cpp b/src/ossim/imaging/ossimVpfAnnotationFeatureInfo.cpp
index 46aea5c..b452979 100644
--- a/src/ossim/imaging/ossimVpfAnnotationFeatureInfo.cpp
+++ b/src/ossim/imaging/ossimVpfAnnotationFeatureInfo.cpp
@@ -566,7 +566,7 @@ void ossimVpfAnnotationFeatureInfo::buildTxtFeature(const ossimFilename& tableNa
 	    }
 	  row_type row = read_row( columnValues[idx].toInt(), 
 				   *primitiveTable.getVpfTableData());
-	  long count = 0;
+	  ossim_int32 count = 0;
 	  ossimDpt* ptArray = getXy(*primitiveTable.getVpfTableData(),
 				    row,
 				    shapeLinePosition,
@@ -752,7 +752,7 @@ void ossimVpfAnnotationFeatureInfo::buildPointFeature(const ossimString& primiti
 	  row_type row = read_row( columnValues[idx].toInt(), 
 				   *primitiveTable.getVpfTableData());
 
-	  long count = 0;
+	  ossim_int32 count = 0;
 	  ossimDpt* ptArray = getXy(*primitiveTable.getVpfTableData(),
 				    row,
 				    coordinateValuePosition,
@@ -793,180 +793,180 @@ void ossimVpfAnnotationFeatureInfo::buildFaceFeature(const ossimFilename& tableN
 						     const ossimFilename& /* primitive */, //face
 						     const ossimString&   /* primitiveKey */) // id
 {
-  ossimFilename tableFileName      = theCoverage.getPath().dirCat(tableName);
-  ossimFilename primitiveTableName;
-  ossimFilename rngTableName;
-  ossimFilename edgTableName;
-  ossimVpfTable table;
-  ossimVpfTable primitiveTable;
-  ossimVpfTable rngTable;
-  ossimVpfTable edgTable;
-  vector<ossimGeoPolygon> thePolyList;
+   ossimFilename tableFileName      = theCoverage.getPath().dirCat(tableName);
+   ossimFilename primitiveTableName;
+   ossimFilename rngTableName;
+   ossimFilename edgTableName;
+   ossimVpfTable table;
+   ossimVpfTable primitiveTable;
+   ossimVpfTable rngTable;
+   ossimVpfTable edgTable;
+   vector<ossimGeoPolygon> thePolyList;
   
-  if(table.openTable(tableFileName))
-    {
+   if(table.openTable(tableFileName))
+   {
       vector<ossimString> columnValues = table.getColumnValues(tableKey.trim()); // fac_id
       vector<ossimString> tileIds;
       bool isTiled = false;
       if(table.getColumnPosition("tile_id") >= 0)
-	{
-	  tileIds = table.getColumnValues("tile_id");
-	  isTiled = true;
-	}
-      ossim_int32 coordinateValuePosition = 0;
+      {
+         tileIds = table.getColumnValues("tile_id");
+         isTiled = true;
+      }
+      // ossim_int32 coordinateValuePosition = 0;
       ossim_int32 startEdgePosition = 0;
       ossim_int32 rngPtrPosition = 0;
       if(!isTiled)
-	{
-	  primitiveTableName = theCoverage.getPath().dirCat("fac");
-	  rngTableName = theCoverage.getPath().dirCat("rng");
-	  edgTableName = theCoverage.getPath().dirCat("edg");
-	  if(!primitiveTable.openTable(primitiveTableName)||
-	     !rngTable.openTable(rngTableName)||
-	     !edgTable.openTable(edgTableName))
-	    {
-	      return;
-	    }
-	  coordinateValuePosition = edgTable.getColumnPosition("coordinates");
-	  startEdgePosition = rngTable.getColumnPosition("start_edge");
-	  rngPtrPosition = primitiveTable.getColumnPosition("ring_ptr");
-	} // else will get for each face in loop below
+      {
+         primitiveTableName = theCoverage.getPath().dirCat("fac");
+         rngTableName = theCoverage.getPath().dirCat("rng");
+         edgTableName = theCoverage.getPath().dirCat("edg");
+         if(!primitiveTable.openTable(primitiveTableName)||
+            !rngTable.openTable(rngTableName)||
+            !edgTable.openTable(edgTableName))
+         {
+            return;
+         }
+         // coordinateValuePosition = edgTable.getColumnPosition("coordinates");
+         startEdgePosition = rngTable.getColumnPosition("start_edge");
+         rngPtrPosition = primitiveTable.getColumnPosition("ring_ptr");
+      } // else will get for each face in loop below
 
       ossim_int32 tileId = -1;
 
       for(ossim_uint32 idx = 0; idx < columnValues.size();++idx) // for each face feature
-	{
-	  if(isTiled)		// then get table names because we didn't get them above
-	    {
-	      if((tileId != tileIds[idx].toInt())||
-		 (tileId < 0))
-		{
-		  tileId = tileIds[idx].toInt();
-		  ossimFilename filename = theCoverage.getLibrary()->getTileName(tileIds[idx].toInt());
-		  if(theCoverage.getPath().dirCat(filename).dirCat("fac").exists())
-		    {
-		      primitiveTableName = theCoverage.getPath().dirCat(filename).dirCat("fac");
-		      rngTableName = theCoverage.getPath().dirCat(filename).dirCat("rng");
-		      edgTableName = theCoverage.getPath().dirCat(filename).dirCat("edg");
-		    }
-		  else if(theCoverage.getPath().dirCat(filename.downcase()).dirCat("fac").exists())
-		    {
-		      primitiveTableName = theCoverage.getPath().dirCat(filename.downcase()).dirCat("fac");
-		      rngTableName = theCoverage.getPath().dirCat(filename.downcase()).dirCat("rng");
-		      edgTableName = theCoverage.getPath().dirCat(filename.downcase()).dirCat("edg");
-		    }
-		  if(!primitiveTable.openTable(primitiveTableName)||
-		     !rngTable.openTable(rngTableName)||
-		     !edgTable.openTable(edgTableName))
-		    {
-		      return;
-		    }
-		  coordinateValuePosition = edgTable.getColumnPosition("coordinates");
-		  startEdgePosition = rngTable.getColumnPosition("start_edge");
-		  rngPtrPosition = primitiveTable.getColumnPosition("ring_ptr");
-		}
-	    } // if(isTiled)
+      {
+         if(isTiled)		// then get table names because we didn't get them above
+         {
+            if((tileId != tileIds[idx].toInt())||
+               (tileId < 0))
+            {
+               tileId = tileIds[idx].toInt();
+               ossimFilename filename = theCoverage.getLibrary()->getTileName(tileIds[idx].toInt());
+               if(theCoverage.getPath().dirCat(filename).dirCat("fac").exists())
+               {
+                  primitiveTableName = theCoverage.getPath().dirCat(filename).dirCat("fac");
+                  rngTableName = theCoverage.getPath().dirCat(filename).dirCat("rng");
+                  edgTableName = theCoverage.getPath().dirCat(filename).dirCat("edg");
+               }
+               else if(theCoverage.getPath().dirCat(filename.downcase()).dirCat("fac").exists())
+               {
+                  primitiveTableName = theCoverage.getPath().dirCat(filename.downcase()).dirCat("fac");
+                  rngTableName = theCoverage.getPath().dirCat(filename.downcase()).dirCat("rng");
+                  edgTableName = theCoverage.getPath().dirCat(filename.downcase()).dirCat("edg");
+               }
+               if(!primitiveTable.openTable(primitiveTableName)||
+                  !rngTable.openTable(rngTableName)||
+                  !edgTable.openTable(edgTableName))
+               {
+                  return;
+               }
+               // coordinateValuePosition = edgTable.getColumnPosition("coordinates");
+               startEdgePosition = rngTable.getColumnPosition("start_edge");
+               rngPtrPosition = primitiveTable.getColumnPosition("ring_ptr");
+            }
+         } // if(isTiled)
 
-	  // get the outer ring id for this face
-	  int thisFaceId = columnValues[idx].toInt();
-	  int rngId = -1;
+         // get the outer ring id for this face
+         int thisFaceId = columnValues[idx].toInt();
+         int rngId = -1;
 
-	  if (thisFaceId <= primitiveTable.getNumberOfRows())
+         if (thisFaceId <= primitiveTable.getNumberOfRows())
 	    rngId = readRngId(thisFaceId,
 			      rngPtrPosition,
 			      primitiveTable);           // face table
-	  else
-             if(traceDebug())
-             {
-                ossimNotify(ossimNotifyLevel_DEBUG) << "not getting face " << thisFaceId << " from tile " << tileId << " " << primitiveTableName <<
-                   " bacause it has only " << primitiveTable.getNumberOfRows() << " rows" << endl;
-             }
+         else
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG) << "not getting face " << thisFaceId << " from tile " << tileId << " " << primitiveTableName <<
+                  " bacause it has only " << primitiveTable.getNumberOfRows() << " rows" << endl;
+            }
 
-	  if(rngId > 0)
-	    {
-	      int startEdge = readStartEdgeId(rngId,
-					      startEdgePosition,
-					      rngTable);
-	      int outerStartEdge = startEdge;
-	      if(startEdge > 0 )
-              {
-                 ossimGeoPolygon polygon;
+         if(rngId > 0)
+         {
+            int startEdge = readStartEdgeId(rngId,
+                                            startEdgePosition,
+                                            rngTable);
+            int outerStartEdge = startEdge;
+            if(startEdge > 0 )
+            {
+               ossimGeoPolygon polygon;
                  
-                 myFaceCount ++;
+               myFaceCount ++;
                  
-                 int ringTableFaceIdColumn = rngTable.getColumnPosition("face_id");
-                 int ringFaceId = readTableCellAsInt(rngId, ringTableFaceIdColumn, rngTable);
+               int ringTableFaceIdColumn = rngTable.getColumnPosition("face_id");
+               int ringFaceId = readTableCellAsInt(rngId, ringTableFaceIdColumn, rngTable);
                  
-                 if (thisFaceId != ringFaceId) {
-		    // as of Mon Dec 20 2004, this has not been observed in vmap0 or vmap1
-                    if(traceDebug())
-                    {
-                       ossimNotify(ossimNotifyLevel_DEBUG) << "rejecting face " << thisFaceId << " from " << tableFileName <<
-                       " because it's ring (" << rngId << ") has face " << ringFaceId << " and startEdgeId " << startEdge << endl;
-                    }
-                 } else {
-		    readGeoPolygon( polygon,
-				    thisFaceId,
-				    startEdge,
-				    edgTable );
+               if (thisFaceId != ringFaceId) {
+                  // as of Mon Dec 20 2004, this has not been observed in vmap0 or vmap1
+                  if(traceDebug())
+                  {
+                     ossimNotify(ossimNotifyLevel_DEBUG) << "rejecting face " << thisFaceId << " from " << tableFileName <<
+                        " because it's ring (" << rngId << ") has face " << ringFaceId << " and startEdgeId " << startEdge << endl;
+                  }
+               } else {
+                  readGeoPolygon( polygon,
+                                  thisFaceId,
+                                  startEdge,
+                                  edgTable );
                     
-		    // get the inner rings (holes)
-		    int faceIdPosition = rngTable.getColumnPosition("face_id");
-		    int innerRingOffset = 1;
-		    int rowFaceId = -1;
-		    if (rngId + innerRingOffset <= rngTable.getNumberOfRows())
-		      rowFaceId = rngTable.getColumnValueAsString( rngId + innerRingOffset, faceIdPosition ).toInt();
-		    while (rowFaceId == thisFaceId && rngId + innerRingOffset <= rngTable.getNumberOfRows()) {	// while there are more inner rings
-		      startEdge = readStartEdgeId(rngId + innerRingOffset, startEdgePosition, rngTable);
-
-		      if (startEdge == outerStartEdge) {
+                  // get the inner rings (holes)
+                  int faceIdPosition = rngTable.getColumnPosition("face_id");
+                  int innerRingOffset = 1;
+                  int rowFaceId = -1;
+                  if (rngId + innerRingOffset <= rngTable.getNumberOfRows())
+                     rowFaceId = rngTable.getColumnValueAsString( rngId + innerRingOffset, faceIdPosition ).toInt();
+                  while (rowFaceId == thisFaceId && rngId + innerRingOffset <= rngTable.getNumberOfRows()) {	// while there are more inner rings
+                     startEdge = readStartEdgeId(rngId + innerRingOffset, startEdgePosition, rngTable);
+
+                     if (startEdge == outerStartEdge) {
 			// as of Mon Dec 20 2004, this has not been observed in vmap0 or vmap1
-                         if(traceDebug())
-                         {
-                            ossimNotify(ossimNotifyLevel_DEBUG) << "rejecting hole in face "
-                                                                << thisFaceId << " because inner ring "
-                                                                << rngId + innerRingOffset
-                                                                << " touches outer ring " << rngId << endl;
-                         }
+                        if(traceDebug())
+                        {
+                           ossimNotify(ossimNotifyLevel_DEBUG) << "rejecting hole in face "
+                                                               << thisFaceId << " because inner ring "
+                                                               << rngId + innerRingOffset
+                                                               << " touches outer ring " << rngId << endl;
+                        }
 
 			innerRingOffset ++;
 			rowFaceId = rngTable.getColumnValueAsString( rngId + innerRingOffset, faceIdPosition ).toInt();
 			continue;
-		      }
+                     }
 
-		      if(startEdge > 0 )
-			{
-			  ossimGeoPolygon holePolygon;
+                     if(startEdge > 0 )
+                     {
+                        ossimGeoPolygon holePolygon;
 		  
-			  readGeoPolygon( holePolygon,
-					  thisFaceId,
-					  startEdge,
-					  edgTable );
-			  if(holePolygon.size())
-			    polygon.addHole( holePolygon );
-			}
-
-		      innerRingOffset ++;
-		    if (rngId + innerRingOffset <= rngTable.getNumberOfRows())
-		      rowFaceId = rngTable.getColumnValueAsString( rngId + innerRingOffset, faceIdPosition ).toInt();
-		    }
-
-		    readAttributes(polygon, table, idx + 1); // third parm is one-based row
-
-		    thePolyList.push_back(polygon);
-		  }
-		}
-	    }
-	} // each fac_id
-    }
-  ossimGeoAnnotationMultiPolyObject* annotation = new ossimGeoAnnotationMultiPolyObject(thePolyList);
-  annotation->setColor(thePenColor.getR(),
-                       thePenColor.getG(),
-                       thePenColor.getB());
-  annotation->setThickness(theThickness);
-  annotation->setFillFlag(theFillEnabledFlag);
+                        readGeoPolygon( holePolygon,
+                                        thisFaceId,
+                                        startEdge,
+                                        edgTable );
+                        if(holePolygon.size())
+                           polygon.addHole( holePolygon );
+                     }
+
+                     innerRingOffset ++;
+                     if (rngId + innerRingOffset <= rngTable.getNumberOfRows())
+                        rowFaceId = rngTable.getColumnValueAsString( rngId + innerRingOffset, faceIdPosition ).toInt();
+                  }
+
+                  readAttributes(polygon, table, idx + 1); // third parm is one-based row
+
+                  thePolyList.push_back(polygon);
+               }
+            }
+         }
+      } // each fac_id
+   }
+   ossimGeoAnnotationMultiPolyObject* annotation = new ossimGeoAnnotationMultiPolyObject(thePolyList);
+   annotation->setColor(thePenColor.getR(),
+                        thePenColor.getG(),
+                        thePenColor.getB());
+   annotation->setThickness(theThickness);
+   annotation->setFillFlag(theFillEnabledFlag);
   
-  theAnnotationArray.push_back(annotation);
+   theAnnotationArray.push_back(annotation);
 }
 
 void ossimVpfAnnotationFeatureInfo::readAttributes(ossimGeoPolygon& polygon, ossimVpfTable& table, int row) {
@@ -982,10 +982,10 @@ void ossimVpfAnnotationFeatureInfo::readAttributes(ossimGeoPolygon& polygon, oss
 /*****************************************************************************/
 ossimDpt *ossimVpfAnnotationFeatureInfo::getXy(vpf_table_type table, 
 					       row_type row, 
-					       long pos, 
-					       long *count)
+					       ossim_int32 pos, 
+					       ossim_int32 *count)
 {
-   long i;
+   ossim_int32 i;
    ossimDpt *coord = 0;
   
    switch (table.header[pos].type)
@@ -1143,7 +1143,7 @@ int ossimVpfAnnotationFeatureInfo::readStartEdgeId(int rowNumber,
 
 int ossimVpfAnnotationFeatureInfo::getEdgeKeyId (vpf_table_type& table, row_type& row, int col) {
     id_triplet_type key;
-    long keyCount;
+    ossim_int32 keyCount;
     get_table_element( col,
 		       row,
 		       table,
@@ -1372,7 +1372,7 @@ void ossimVpfAnnotationFeatureInfo::readGeoPolygon(ossimGeoPolygon& polygon,
   }
 
   for (vector< int >::iterator i = edges.begin(); i != edges.end(); i++) {
-    long count = 0;
+    ossim_int32 count = 0;
     free_row(row,  *edgTable.getVpfTableData());
     row = read_row( *i, *edgTable.getVpfTableData() );
     ossimDpt* ptArray = getXy(*edgTable.getVpfTableData(),
@@ -1421,7 +1421,7 @@ void ossimVpfAnnotationFeatureInfo::readEdge(ossimPolyLine& polyLine,
   row_type row = read_row( rowNumber, 
 			   *edgeTable.getVpfTableData());
 
-  long count = 0;
+  ossim_int32 count = 0;
   ossimDpt* ptArray = getXy(*edgeTable.getVpfTableData(),
 			    row,
 			    colPosition,
diff --git a/src/ossim/imaging/ossimWorldFileWriter.cpp b/src/ossim/imaging/ossimWorldFileWriter.cpp
index ae3f8a3..3b78e13 100644
--- a/src/ossim/imaging/ossimWorldFileWriter.cpp
+++ b/src/ossim/imaging/ossimWorldFileWriter.cpp
@@ -6,7 +6,7 @@
 // Author:  Kenneth Melero (kmelero at sanz.com)
 //
 //*******************************************************************
-//  $Id: ossimWorldFileWriter.cpp 17932 2010-08-19 20:34:35Z dburken $
+//  $Id: ossimWorldFileWriter.cpp 21631 2012-09-06 18:10:55Z dburken $
 
 #include <ossim/imaging/ossimWorldFileWriter.h>
 #include <ossim/base/ossimKeywordNames.h>
@@ -19,8 +19,10 @@
 // #include <ossim/projection/ossimStatePlaneProjectionFactory.h>
 #include <ossim/base/ossimUnitConversionTool.h>
 #include <ossim/base/ossimUnitTypeLut.h>
+#include <ossim/imaging/ossimImageGeometry.h>
 #include <ossim/imaging/ossimImageSource.h>
 
+
 RTTI_DEF1(ossimWorldFileWriter,
           "ossimWorldFileWriter",
           ossimMetadataFileWriter)
diff --git a/src/ossim/init/ossimInit.cpp b/src/ossim/init/ossimInit.cpp
index bb3ed9d..bae6d84 100644
--- a/src/ossim/init/ossimInit.cpp
+++ b/src/ossim/init/ossimInit.cpp
@@ -1,7 +1,9 @@
 //*****************************************************************************
 // FILE: ossimInit.cpp
 //
-// License:  See top level LICENSE.txt file.
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
 //
 // DESCRIPTION:
 //   Contains implementation of class ossimInit. This object handles all
@@ -16,7 +18,7 @@
 //   24Apr2001  Oscar Kramer
 //              Initial coding.
 //*****************************************************************************
-// $Id: ossimInit.cpp 19216 2011-03-24 12:29:53Z gpotts $
+// $Id: ossimInit.cpp 22278 2013-06-08 01:19:14Z gpotts $
 
 
 #include <ossim/init/ossimInit.h>
@@ -82,6 +84,8 @@ ossimInit::ossimInit()
 
 ossimInit* ossimInit::instance()
 {
+   static OpenThreads::Mutex m;
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m);
    if (!theInstance)
    {
       theInstance = new ossimInit();
@@ -110,7 +114,9 @@ void ossimInit::addOptions(ossimArgumentParser& parser)
  *****************************************************************************/
 void ossimInit::initialize(int& argc, char** argv)
 {
-   if( !theInitializedFlag )
+    static OpenThreads::Mutex m;
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m);
+  if( !theInitializedFlag )
    {
       ossimArgumentParser argumentParser(&argc, argv);
       theInstance->initialize(argumentParser);
@@ -119,6 +125,8 @@ void ossimInit::initialize(int& argc, char** argv)
 
 void ossimInit::initialize(ossimArgumentParser& parser)
 {
+   static OpenThreads::Mutex m;
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m);
    if(theInitializedFlag)
    {
       if (traceDebug())
@@ -139,18 +147,17 @@ void ossimInit::initialize(ossimArgumentParser& parser)
    theInstance->parseOptions(parser);
 
    theInstance->initializeDefaultFactories();
-   theInstance->initializeElevation();
-   theInstance->initializeLogFile();
    
-   if(thePluginLoaderEnabledFlag)
+   if ( theElevEnabledFlag )
    {
-      theInstance->initializePlugins();
+      theInstance->initializeElevation();
    }
 
-   if(!theElevEnabledFlag)
+   theInstance->initializeLogFile();
+   
+   if(thePluginLoaderEnabledFlag)
    {
-//      ossimElevManager::instance()->disableSource();
-//      ossimElevManager::instance()->disableAutoLoad();
+      theInstance->initializePlugins();
    }
    
    if (traceDebug())
@@ -163,17 +170,18 @@ void ossimInit::initialize(ossimArgumentParser& parser)
    }
    
    theInitializedFlag = true;
-   return;
 }
 
 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;
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG ossimInit::initialize(): Already initialized, returning......" << std::endl;
       }
       return;
    }
@@ -181,7 +189,12 @@ void ossimInit::initialize()
    theInstance->theAppName  = "";
    theInstance->thePreferences = ossimPreferences::instance();
    theInstance->initializeDefaultFactories();
-   theInstance->initializeElevation();
+   
+   if ( theElevEnabledFlag )
+   {
+      theInstance->initializeElevation();
+   }
+
    theInstance->initializeLogFile();
 
    //---
@@ -238,6 +251,16 @@ void ossimInit::usage()
    return;
 }
 
+bool ossimInit::getElevEnabledFlag() const
+{
+   return theElevEnabledFlag;
+}
+
+void ossimInit::setElevEnabledFlag(bool flag)
+{
+   theElevEnabledFlag = flag; 
+}
+
 void ossimInit::setPluginLoaderEnabledFlag(bool flag)
 {
    thePluginLoaderEnabledFlag = flag;  
@@ -457,22 +480,7 @@ void ossimInit::initializeDefaultFactories()
 }
 
 void ossimInit::initializePlugins()
-{
-   // check for plugins in the current directory
-   // and load them
-   ossimDirectory currentDir(theAppName.path());
-   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]);
-	   }
-   }
-
+{      
    ossimString regExpressionDir =  ossimString("^(") + "plugin.dir[0-9]+)";
    ossimString regExpressionFile =  ossimString("^(") + "plugin.file[0-9]+)";
 
@@ -485,16 +493,11 @@ void ossimInit::initializePlugins()
    int idx = 0;
    
    std::vector<int> numberList(numberOfDirs);
-
-
-   
-//   ossimFilename installedPluginDir = ossimEnvironmentUtility::instance()->getInstalledOssimPluginDir();
-//   loadPlugins(installedPluginDir);
    
    // register user plugins first
    ossimFilename userPluginDir = ossimEnvironmentUtility::instance()->getUserOssimPluginDir();
    loadPlugins(userPluginDir);
-   
+
    if(numberList.size()>0)
    {
       for(idx = 0; idx < (int)numberList.size();++idx)
@@ -582,6 +585,35 @@ void ossimInit::initializePlugins()
          }
       }
    }
+
+   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()
@@ -672,6 +704,11 @@ ossimString ossimInit::version() const
    return versionString;
 }
 
+ossimFilename ossimInit::appName()const
+{
+   return theAppName;
+}
+
 ossimInit::ossimInit(const ossimInit& /* obj */ )
 {}       
 
diff --git a/src/ossim/kbool/node.cpp b/src/ossim/kbool/node.cpp
index b727533..5e14b3c 100644
--- a/src/ossim/kbool/node.cpp
+++ b/src/ossim/kbool/node.cpp
@@ -6,7 +6,7 @@
 
     Licence: wxWidgets Licence
 
-    RCS-ID: $Id: node.cpp 12630 2008-04-07 17:19:58Z dburken $
+    RCS-ID: $Id: node.cpp 19473 2011-05-03 15:04:19Z gpotts $
 */
 #ifdef __GNUG__
 #pragma implementation 
@@ -22,21 +22,21 @@
 //with NOLIST constructor
 //TDLI<KBoolLink> 	Node::_linkiter=TDLI<KBoolLink>(_GC);
 
-Node::Node(Bool_Engine* GC) : LPoint(0,0)
+Node::Node(Bool_Engine* /*GC*/) : LPoint(0,0)
 {
 //     _GC=GC;
 	_linklist=new DL_List<void*>();
 }
 
 
-Node::Node(B_INT const X, B_INT const Y, Bool_Engine* GC) : LPoint(X,Y)
+Node::Node(B_INT const X, B_INT const Y, Bool_Engine* /*GC*/) : LPoint(X,Y)
 {
 //     _GC=GC;
 	_linklist=new DL_List<void*>();
 }
 
 
-Node::Node(LPoint* const a_point, Bool_Engine* GC) : LPoint(a_point)
+Node::Node(LPoint* const a_point, Bool_Engine* /*GC*/) : LPoint(a_point)
 {
 //     _GC=GC;
 	_linklist=new DL_List<void*>();
@@ -44,7 +44,7 @@ Node::Node(LPoint* const a_point, Bool_Engine* GC) : LPoint(a_point)
 
 
 //Node::Node(Node * const other) : LPoint(other)
-Node::Node(Node * const other, Bool_Engine* GC)
+Node::Node(Node * const other, Bool_Engine* /*GC*/)
 {
 //     _GC=GC;
 	_x = other->_x;
diff --git a/src/ossim/parallel/ossimIgen.cpp b/src/ossim/parallel/ossimIgen.cpp
index 46ba41e..bc38e26 100644
--- a/src/ossim/parallel/ossimIgen.cpp
+++ b/src/ossim/parallel/ossimIgen.cpp
@@ -7,11 +7,7 @@
 // Description: implementation for image generator
 //
 //*************************************************************************
-// $Id: ossimIgen.cpp 17815 2010-08-03 13:23:14Z dburken $
-
-#include <iterator>
-#include <sstream>
-#include <exception>
+// $Id: ossimIgen.cpp 21850 2012-10-21 20:09:55Z dburken $
 
 #include <ossim/ossimConfig.h> /* To pick up define OSSIM_HAS_MPI. */
 
@@ -26,13 +22,21 @@
 #include <ossim/base/ossimKeywordNames.h>
 #include <ossim/base/ossimTrace.h>
 #include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimVisitor.h>
 #include <ossim/projection/ossimMapProjection.h>
 #include <ossim/projection/ossimProjectionFactoryRegistry.h>
 #include <ossim/imaging/ossimImageChain.h>
 #include <ossim/imaging/ossimRectangleCutFilter.h>
+#include <ossim/imaging/ossimGeoPolyCutter.h>
 #include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/imaging/ossimTilingRect.h>
+#include <ossim/imaging/ossimTilingPoly.h>
 #include <ossim/base/ossimPreferences.h>
 #include <ossim/parallel/ossimMpi.h>
+#include <ossim/parallel/ossimMultiThreadSequencer.h>
+#include <ossim/parallel/ossimMtDebug.h> //### For debug/performance eval
+#include <iterator>
+#include <sstream>
 
 static ossimTrace traceDebug(ossimString("ossimIgen:debug"));
 static ossimTrace traceLog(ossimString("ossimIgen:log"));
@@ -41,14 +45,17 @@ ossimIgen::ossimIgen()
 :
 theContainer(new ossimConnectableContainer()),
 theProductProjection(0),
+theProductChain(0),
+theTiling(new ossimTiling),
+theOutputRect(),
 theBuildThumbnailFlag(false),
 theThumbnailSize(0, 0),
 theNumberOfTilesToBuffer(2),
 theKwl(),
 theTilingEnabled(false),
-theTiling(),
 theProgressFlag(true),
-theStdoutFlag(false)
+theStdoutFlag(false),
+theThreadCount(9999) // Default no threading
 {
    theOutputRect.makeNan();
 }
@@ -56,6 +63,7 @@ theStdoutFlag(false)
 ossimIgen::~ossimIgen()
 {
    theProductProjection = 0;
+   theTiling = 0;
    theContainer->disconnect();
    theContainer->deleteAllChildren();
    theContainer = 0;
@@ -144,7 +152,7 @@ void ossimIgen::initializeAttributes()
    if(tilingKw)
    {
       theTilingEnabled = true;
-      if(!theTiling.loadState(theKwl, "igen.tiling."))
+      if(!theTiling->loadState(theKwl, "igen.tiling."))
       {
          theTilingEnabled = false;
       }
@@ -311,17 +319,31 @@ bool ossimIgen::loadProductSpec()
    theContainer->loadState(theKwl);
 
    // There should be a product chain defined in the container:
-   ossimConnectableObject* obj = 
-      theContainer->findFirstObjectOfType(STATIC_TYPE_NAME(ossimImageChain), false);
-   theProductChain = PTR_CAST(ossimImageChain, obj);
+   // ossimConnectableObject* obj = 
+   //   theContainer->findFirstObjectOfType(STATIC_TYPE_NAME(ossimImageChain), false);
+   // theProductChain = PTR_CAST(ossimImageChain, obj);
+
+   ossimTypeNameVisitor visitor( ossimString("ossimImageChain"),
+                                 true, // firstofTypeFlag
+                                 (ossimVisitor::VISIT_INPUTS |
+                                  ossimVisitor::VISIT_CHILDREN) );
+   theContainer->accept( visitor );
+   theProductChain = visitor.getObjectAs<ossimImageChain>(0);
+   
    if (!theProductChain.valid())
    {
       // Search for a connectable container specified that contains the entire product chain:
-      ossimConnectableObject* obj2 = 
-         theContainer->findFirstObjectOfType(STATIC_TYPE_NAME(ossimImageFileWriter), true);
-      ossimImageFileWriter* writer = PTR_CAST(ossimImageFileWriter, obj2);
-      if (writer)
-         theProductChain = PTR_CAST(ossimImageChain, writer->getInput());
+      // ossimConnectableObject* obj2 = 
+      //    theContainer->findFirstObjectOfType(STATIC_TYPE_NAME(ossimImageFileWriter), true);
+      // ossimImageFileWriter* writer = PTR_CAST(ossimImageFileWriter, obj2);
+      visitor.reset();
+      visitor.setTypeName( ossimString( "ossimImageFileWriter" ) );
+      theContainer->accept( visitor );
+      ossimRefPtr<ossimImageFileWriter> writer = visitor.getObjectAs<ossimImageFileWriter>(0);
+      if ( writer.valid() )
+      {
+         theProductChain = dynamic_cast<ossimImageChain*>( writer->getInput() );
+      }
 
       if (!theProductChain.valid())
       {
@@ -333,8 +355,8 @@ bool ossimIgen::loadProductSpec()
 
    // The output projection is specified separately in the KWL:
    ossimString prefix = "product.projection.";
-   theProductProjection = PTR_CAST(ossimMapProjection, 
-      ossimProjectionFactoryRegistry::instance()->createProjection(theKwl, prefix));
+   theProductProjection = dynamic_cast<ossimMapProjection*>( 
+      ossimProjectionFactoryRegistry::instance()->createProjection(theKwl, prefix) );
 
    const char* lookup = theKwl.find("igen.write_to_stdout");
    if (lookup && ossimString(lookup).toBool())
@@ -386,14 +408,28 @@ void ossimIgen::outputProduct()
 #endif
 
    // we will just load a serial connection if MPI is not supported.
+   // Threading?
+   if (!sequencer.valid() && (theThreadCount != 9999))
+      sequencer = new ossimMultiThreadSequencer(0, theThreadCount);
+
    if (!sequencer.valid())
       sequencer = new ossimImageSourceSequencer(0);
 
+
    // Look for the first writer (should be the only writer) in our list of objects:
-   ossimRefPtr<ossimImageFileWriter> writer  = 0;
-   ossimConnectableObject::ConnectableObjectList imageWriters =
-      theContainer->findAllObjectsOfType(STATIC_TYPE_INFO(ossimImageFileWriter), false);
-   if (imageWriters.size() == 0)
+
+   // ossimRefPtr<ossimImageFileWriter> writer  = 0;
+   // ossimConnectableObject::ConnectableObjectList imageWriters =
+   //    theContainer->findAllObjectsOfType(STATIC_TYPE_INFO(ossimImageFileWriter), false);
+
+   ossimTypeNameVisitor visitor( ossimString("ossimImageFileWriter"),
+                                 true, // firstofTypeFlag
+                                 (ossimVisitor::VISIT_INPUTS |
+                                  ossimVisitor::VISIT_CHILDREN) );
+   theContainer->accept( visitor );
+   ossimRefPtr<ossimImageFileWriter> writer = visitor.getObjectAs<ossimImageFileWriter>(0);
+   
+   if ( !writer.valid() )
    {
       sequencer = 0;
       std::string err = "ossimIgen::outputProduct() ERROR:  No image writer object was found in "
@@ -401,7 +437,7 @@ void ossimIgen::outputProduct()
       throw(ossimException(err));
    }
 
-   writer = PTR_CAST(ossimImageFileWriter, imageWriters[0].get());
+   // writer = PTR_CAST(ossimImageFileWriter, imageWriters[0].get());
    writer->changeSequencer(sequencer.get());
    writer->connectMyInputTo(theProductChain.get());
    
@@ -416,14 +452,36 @@ void ossimIgen::outputProduct()
          throw(ossimException(err));
       }
    }
+   
    writer->initialize();
 
+   if ( theBuildThumbnailFlag )
+   {
+      //---
+      // Use theOutputRect as it has been clamped to be within the requested thumbnail size.
+      // 
+      // Relying of the bounding rectangle of the scaled product chain has given us off by
+      // one rectangles, i.e., a width of 513 instead of 512.
+      // 
+      // NOTE: This must be called after the writer->initialize() as
+      // ossimImageFileWriter::initialize incorrectly resets theAreaOfInterest
+      // back to the bounding rect.
+      //---
+      writer->setAreaOfInterest( ossimIrect(theOutputRect) );
+   }
+
    // If multi-file tiled output is not desired perform simple output, handle special:
    if(theTilingEnabled && theProductProjection.valid())
    {
-      theTiling.initialize(*(theProductProjection.get()), theOutputRect);
-      ossimRectangleCutFilter* cut = new ossimRectangleCutFilter;
-      theProductChain->addFirst(cut);
+      theTiling->initialize(*(theProductProjection.get()), theOutputRect);
+
+      ossimRectangleCutFilter* cut = NULL;
+      ossimTilingPoly* tilingPoly = dynamic_cast<ossimTilingPoly*>( theTiling.get() );
+      if (tilingPoly == NULL)
+      {
+         cut = new ossimRectangleCutFilter;
+         theProductChain->addFirst(cut);
+      }
       
       ossimFilename tempFile = writer->getFilename();
       if(!tempFile.isDir())
@@ -434,10 +492,45 @@ void ossimIgen::outputProduct()
 
       // 'next' method modifies the mapProj which is the same instance as theProductProjection,
       // so this data member is modified here, then later accessed by setView:
-      while(theTiling.next(theProductProjection, clipRect, tileName))
+      while(theTiling->next(theProductProjection, clipRect, tileName))
       {
-         setView();
-         cut->setRectangle(clipRect);
+         if (cut && tilingPoly == NULL)//use ossimTiling or ossimTilingRect
+         {
+            setView();
+            cut->setRectangle(clipRect);
+         }
+         else //otherwise use ossimTilingPoly
+         {
+            if (tilingPoly != NULL)
+            {
+               if (!tilingPoly->isFeatureBoundingIntersect())//if clip rect does not intersect with output rect, do nothing
+               {
+                  continue;
+               }
+               if (tilingPoly->useMbr())//if use_mbr flag is set to true, all pixels within the MBR will be preserved
+               {
+                  if (cut == NULL)
+                  {
+                      cut = new ossimRectangleCutFilter;
+                      theProductChain->addFirst(cut);
+                  }
+                  setView();
+                  cut->setRectangle(clipRect);
+               }
+               else
+               {
+                  if ( tilingPoly->hasExteriorCut() )
+                  {
+                     theProductChain->addFirst( tilingPoly->getExteriorCut().get() );
+                  }
+                  if ( tilingPoly->hasInteriorCut() )
+                  {
+                     theProductChain->addFirst( tilingPoly->getInteriorCut().get() );
+                  }
+               }
+            }
+         }
+         
          initializeChain();
          writer->disconnect();
          writer->connectMyInputTo(theProductChain.get());
@@ -453,6 +546,30 @@ void ossimIgen::outputProduct()
       // No multi-file tiling, just conventional write to single file:
       writeToFile(writer.get());
    }
+
+   //########## DEBUG CODE FOR TIMING MULTI THREAD LOCKS ##############
+   if (sequencer.valid() && (theThreadCount != 9999))
+   {
+      ossimMultiThreadSequencer* mts = dynamic_cast<ossimMultiThreadSequencer*>(sequencer.get());
+      if (mts != NULL)
+      {
+
+         double jgtt = mts->d_jobGetTileT;
+         ossim_uint32 num_threads = mts->getNumberOfThreads();
+         double jgttpj = jgtt/num_threads;
+         cout<<setprecision(3)<<endl;
+         cout << "Multi-threading metrics ---"<<endl;
+         cout << "   Number of threads:      " << num_threads<< endl;
+         cout << "   Max cache used:         "<< mts->d_maxCacheUsed << endl;
+         cout << "   Cache emptied count:    "<< ossimString::toString(mts->d_cacheEmptyCount) << endl;
+         cout << "   Time waiting on jobs:   "<<mts->d_idleTime2<<" s"<<endl;
+         cout << "   Time waiting on cache:  "<<mts->d_idleTime5<<" s"<<endl;
+         cout << "   Handler getTile T:      "<<mts->handlerGetTileT()<<" s"<<endl;
+         cout << "   Job getTile T:          "<<jgtt<<" s"<<endl;
+         cout << "   Average getTile T/job:  "<<jgttpj<<" s\n"<<endl;
+      }
+   }
+   //##################################################################
 }
 
 //*************************************************************************************************
@@ -473,8 +590,10 @@ bool ossimIgen::writeToFile(ossimImageFileWriter* writer)
       ossimFilename logFile = writer->getFilename();
       logFile.setExtension(ossimString("log"));
 
+      ossimRefPtr<ossimConnectableContainer> container = new ossimConnectableContainer;
+      writer->fillContainer(*container.get());
       ossimKeywordlist logKwl;
-      writer->saveStateOfAllInputs(logKwl);
+      container->saveState(logKwl);
       logKwl.write(logFile.c_str());
    }
 
@@ -484,7 +603,7 @@ bool ossimIgen::writeToFile(ossimImageFileWriter* writer)
    }
 
    // Catch internal exceptions:
-   catch(std::exception& e)
+   catch(const ossimException& e)
    {
       ossimNotify(ossimNotifyLevel_FATAL)
          << "ossimIgen::outputProduct ERROR:\n"
@@ -517,17 +636,36 @@ bool ossimIgen::writeToFile(ossimImageFileWriter* writer)
 //*************************************************************************************************
 void ossimIgen::setView()
 {
-   if(!theProductChain.valid() || !theProductProjection.valid())
-      return;
-
-   // Find all view clients in the chain, and notify them of the new view:
-   ossimConnectableObject::ConnectableObjectList clientList;
-   theProductChain->findAllInputsOfType(clientList, STATIC_TYPE_INFO(ossimViewInterface), true, true);
-   for(ossim_uint32 i = 0; i < clientList.size();++i)
+   if( theProductChain.valid() && theProductProjection.valid() )
    {
-      ossimViewInterface* viewClient = PTR_CAST(ossimViewInterface, clientList[i].get());
-      if (viewClient)
-         viewClient->setView(theProductProjection->dup());
+      // Find all view clients in the chain, and notify them of the new view:
+#if 0
+      ossimConnectableObject::ConnectableObjectList clientList;
+      theProductChain->findAllInputsOfType(clientList, STATIC_TYPE_INFO(ossimViewInterface), true, true);
+      for(ossim_uint32 i = 0; i < clientList.size();++i)
+      {
+         ossimViewInterface* viewClient = dynamic_cast<ossimViewInterface*>( clientList[i].get() );
+         if (viewClient)
+            viewClient->setView(theProductProjection->dup());
+      }
+#endif
+      
+      ossimTypeNameVisitor visitor( ossimString("ossimViewInterface"),
+                                    false, // firstofTypeFlag
+                                    (ossimVisitor::VISIT_INPUTS|
+                                     ossimVisitor::VISIT_CHILDREN) );
+      theProductChain->accept( visitor );
+      for( ossim_uint32 i = 0; i < visitor.getObjects().size(); ++i )
+      {
+         ossimViewInterface* viewClient = visitor.getObjectAs<ossimViewInterface>( i );
+         if (viewClient)
+         {
+            viewClient->setView( theProductProjection->dup() );
+         }
+      }
+
+      // Force recompute of bounding rect:
+      initializeChain();
    }
 }
 
@@ -537,19 +675,31 @@ void ossimIgen::setView()
 void ossimIgen::initThumbnailProjection()
 {
    double thumb_size = ossim::max(theThumbnailSize.x, theThumbnailSize.y);
-   ossimMapProjection* mapProj = PTR_CAST (ossimMapProjection, theProductProjection.get());
+   ossimMapProjection* mapProj = dynamic_cast<ossimMapProjection*>(theProductProjection.get());
 
    if(mapProj && !theOutputRect.hasNans())
    {
-      double xScale = theOutputRect.width()  / (double)thumb_size;
-      double yScale = theOutputRect.height() / (double)thumb_size;
+      double xScale = theOutputRect.width()  / thumb_size;
+      double yScale = theOutputRect.height() / thumb_size;
       double scale = ossim::max(xScale, yScale);
       mapProj->applyScale(ossimDpt(scale, scale), true);
    }
 
    // Need to change the view in the product chain:
    setView();
-   initializeChain();
+
+   // Clamp output rectangle to thumbnail bounds.
+   ossimDpt ul = theOutputRect.ul();
+   ossimDpt lr = theOutputRect.lr();
+   if ( (lr.x - ul.x + 1) > thumb_size)
+   {
+      lr.x = ul.x + thumb_size - 1;
+   }
+   if ( (lr.y - ul.y + 1) > thumb_size )
+   {
+      lr.y = ul.y + thumb_size - 1;
+   }
+   theOutputRect = ossimDrect(ul, lr);
 }
 
 //*************************************************************************************************
@@ -561,8 +711,17 @@ void ossimIgen::initializeChain()
    // Force initialization of the chain to recompute parameters:
    theProductChain->initialize();
    theOutputRect = theProductChain->getBoundingRect();
-
-   // Stretch the rectangle out to integer boundaries.
+   
    if(!theOutputRect.hasNans())
+   {
+      // Stretch the rectangle out to integer boundaries.
       theOutputRect.stretchOut();
+
+      // Communicate the new product size to the view's geometry object. This is a total HACK that 
+      // external code needs to worry about setting this. Something is wrong with this picture 
+      // (OLK 02/11)
+      ossimImageGeometry* geom = theProductChain->getImageGeometry().get();
+      if (geom)
+         geom->setImageSize(ossimIpt(theOutputRect.size()));
+   }
 }
diff --git a/src/ossim/parallel/ossimImageChainMtAdaptor.cpp b/src/ossim/parallel/ossimImageChainMtAdaptor.cpp
new file mode 100644
index 0000000..90ca102
--- /dev/null
+++ b/src/ossim/parallel/ossimImageChainMtAdaptor.cpp
@@ -0,0 +1,458 @@
+//*************************************************************************************************
+//                                            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)
+{
+   //###### 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/src/ossim/parallel/ossimImageHandlerMtAdaptor.cpp b/src/ossim/parallel/ossimImageHandlerMtAdaptor.cpp
new file mode 100644
index 0000000..929a45b
--- /dev/null
+++ b/src/ossim/parallel/ossimImageHandlerMtAdaptor.cpp
@@ -0,0 +1,364 @@
+//**************************************************************************************************
+//                          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/src/ossim/parallel/ossimJob.cpp b/src/ossim/parallel/ossimJob.cpp
new file mode 100644
index 0000000..f1da80d
--- /dev/null
+++ b/src/ossim/parallel/ossimJob.cpp
@@ -0,0 +1,60 @@
+#include <ossim/parallel/ossimJob.h>
+
+void ossimJob::setState(int value, bool on)
+{
+   // we will need to make sure that the state flags are set properly
+   // so if you turn on running then you can't have finished or ready turned onturned on
+   // but can stil have cancel turned on
+   //
+   int newState = m_state;
+   if(on)
+   {
+      newState = ((newState | value)&ossimJob_ALL);
+   }
+   else 
+   {
+      newState = ((newState & ~value)&ossimJob_ALL);
+   }
+
+   int oldState     = 0;
+   int currentState = 0;
+   ossimRefPtr<ossimJobCallback> callback;
+
+   bool stateChangedFlag = false;
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+      
+      stateChangedFlag = newState != m_state;
+      oldState = m_state;
+      m_state = static_cast<State>(newState);
+      currentState = m_state;
+      callback = m_callback.get();
+   }
+   
+   if(stateChangedFlag&&callback.valid())
+   {
+      if(callback.valid())
+      {
+         if(!(oldState&ossimJob_READY)&&
+            (currentState&ossimJob_READY))
+         {
+            callback->ready(this);
+         }
+         else if(!(oldState&ossimJob_RUNNING)&&
+                 (currentState&ossimJob_RUNNING))
+         {
+            callback->started(this);
+         }
+         else if(!(oldState&ossimJob_CANCEL)&&
+                 (currentState&ossimJob_CANCEL))
+         {
+            callback->canceled(this);
+         }
+         else if(!(oldState&ossimJob_FINISHED)&&
+                 (currentState&ossimJob_FINISHED))
+         {
+            callback->finished(this);
+         }
+      }
+   }
+}
diff --git a/src/ossim/parallel/ossimJobMultiThreadQueue.cpp b/src/ossim/parallel/ossimJobMultiThreadQueue.cpp
new file mode 100644
index 0000000..b392bfd
--- /dev/null
+++ b/src/ossim/parallel/ossimJobMultiThreadQueue.cpp
@@ -0,0 +1,101 @@
+#include <ossim/parallel/ossimJobMultiThreadQueue.h>
+
+ossimJobMultiThreadQueue::ossimJobMultiThreadQueue(ossimJobQueue* q, ossim_uint32 nThreads)
+:m_jobQueue(q?q:new ossimJobQueue())
+{
+   setNumberOfThreads(nThreads);
+}
+ossimJobQueue* ossimJobMultiThreadQueue::getJobQueue()
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
+   return m_jobQueue.get();
+}
+const ossimJobQueue* ossimJobMultiThreadQueue::getJobQueue()const
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
+   return m_jobQueue.get();
+}
+void ossimJobMultiThreadQueue::setQueue(ossimJobQueue* q)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
+   ossim_uint32 idx = 0;
+   m_jobQueue = q;
+   for(idx = 0; idx < m_threadQueueList.size(); ++idx)
+   {
+      m_threadQueueList[idx]->setJobQueue(m_jobQueue.get());
+   }
+}
+void ossimJobMultiThreadQueue::setNumberOfThreads(ossim_uint32 nThreads)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
+   ossim_uint32 idx = 0;
+   ossim_uint32 queueSize = m_threadQueueList.size();
+   
+   if(nThreads > queueSize)
+   {
+      for(idx = queueSize; idx < nThreads;++idx)
+      {
+         ossimRefPtr<ossimJobThreadQueue> threadQueue = new ossimJobThreadQueue();
+         threadQueue->setJobQueue(m_jobQueue.get());
+         m_threadQueueList.push_back(threadQueue);
+      }
+   }
+   else if(nThreads < queueSize)
+   {
+      ThreadQueueList::iterator iter = m_threadQueueList.begin()+nThreads;
+      while(iter != m_threadQueueList.end())
+      {
+         (*iter)->cancel();
+         iter = m_threadQueueList.erase(iter);
+      }
+   }
+}
+
+ossim_uint32 ossimJobMultiThreadQueue::getNumberOfThreads() const
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
+   return static_cast<ossim_uint32>( m_threadQueueList.size() );
+}
+
+ossim_uint32 ossimJobMultiThreadQueue::numberOfBusyThreads()const
+{
+   ossim_uint32 result = 0;
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
+   ossim_uint32 idx = 0;
+   ossim_uint32 queueSize = m_threadQueueList.size();
+   for(idx = 0; idx < queueSize;++idx)
+   {
+      if(m_threadQueueList[idx]->isProcessingJob()) ++result;
+   }
+   return result;
+}
+
+bool ossimJobMultiThreadQueue::areAllThreadsBusy()const
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
+   ossim_uint32 idx = 0;
+   ossim_uint32 queueSize = m_threadQueueList.size();
+   for(idx = 0; idx < queueSize;++idx)
+   {
+      if(!m_threadQueueList[idx]->isProcessingJob()) return false;
+   }
+   
+   return true;
+}
+
+bool ossimJobMultiThreadQueue::hasJobsToProcess()const
+{
+   bool result = false;
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
+      ossim_uint32 queueSize = m_threadQueueList.size();
+      ossim_uint32 idx = 0;
+      for(idx = 0; ((idx<queueSize)&&!result);++idx)
+      {
+         result = m_threadQueueList[idx]->hasJobsToProcess();
+      }
+   }
+   
+   return result;
+}
+
diff --git a/src/ossim/parallel/ossimJobQueue.cpp b/src/ossim/parallel/ossimJobQueue.cpp
new file mode 100644
index 0000000..ffb780b
--- /dev/null
+++ b/src/ossim/parallel/ossimJobQueue.cpp
@@ -0,0 +1,299 @@
+#include <ossim/parallel/ossimJobQueue.h>
+
+#include <algorithm> /* for std::find */
+
+
+ossimJobQueue::ossimJobQueue()
+{
+}
+
+void ossimJobQueue::add(ossimJob* job, bool guaranteeUniqueFlag)
+{
+   ossimRefPtr<Callback> cb;
+   {
+      {
+         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobQueueMutex);
+         
+         if(guaranteeUniqueFlag)
+         {
+            if(findByPointer(job) != m_jobQueue.end())
+            {
+               m_block.set(true);
+               return;
+            }
+         }
+         cb = m_callback.get();
+      }
+      if(cb.valid()) cb->adding(this, job);
+      
+      job->ready();
+      m_jobQueueMutex.lock();
+      m_jobQueue.push_back(job);
+      m_jobQueueMutex.unlock();
+   }
+   if(cb.valid())
+   {
+      cb->added(this, job);
+   }
+   m_block.set(true);
+}
+
+ossimRefPtr<ossimJob> ossimJobQueue::removeByName(const ossimString& name)
+{
+   ossimRefPtr<ossimJob> result;
+   ossimRefPtr<Callback> cb;
+   if(name.empty()) return result;
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobQueueMutex);
+      ossimJob::List::iterator iter = findByName(name);
+      if(iter!=m_jobQueue.end())
+      {
+         result = *iter;
+         m_jobQueue.erase(iter);
+      }
+      cb = m_callback.get();
+   }      
+   m_block.set(!m_jobQueue.empty());
+   
+   if(cb.valid()&&result.valid())
+   {
+      cb->removed(this, result.get());
+   }
+   return result;
+}
+ossimRefPtr<ossimJob> ossimJobQueue::removeById(const ossimString& id)
+{
+   ossimRefPtr<ossimJob> result;
+   ossimRefPtr<Callback> cb;
+   if(id.empty()) return result;
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobQueueMutex);
+      ossimJob::List::iterator iter = findById(id);
+      if(iter!=m_jobQueue.end())
+      {
+         result = *iter;
+         m_jobQueue.erase(iter);
+      }
+      cb = m_callback.get();
+      m_block.set(!m_jobQueue.empty());
+   }
+   if(cb.valid()&&result.valid())
+   {
+      cb->removed(this, result.get());
+   }
+   return result;
+}
+
+void ossimJobQueue::remove(const ossimJob* Job)
+{
+   ossimRefPtr<ossimJob> removedJob;
+   ossimRefPtr<Callback> cb;
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobQueueMutex);
+      ossimJob::List::iterator iter = std::find(m_jobQueue.begin(), m_jobQueue.end(), Job);
+      if(iter!=m_jobQueue.end())
+      {
+         removedJob = (*iter);
+         m_jobQueue.erase(iter);
+      }
+      cb = m_callback.get();
+   }
+   if(cb.valid()&&removedJob.valid())
+   {
+      cb->removed(this, removedJob.get());
+   }
+}
+
+void ossimJobQueue::removeStoppedJobs()
+{
+   ossimJob::List removedJobs;
+   ossimRefPtr<Callback> cb;
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobQueueMutex);
+      cb = m_callback.get();
+      ossimJob::List::iterator iter = m_jobQueue.begin();
+      while(iter!=m_jobQueue.end())
+      {
+         if((*iter)->isStopped())
+         {
+            removedJobs.push_back(*iter);
+            iter = m_jobQueue.erase(iter);
+         }
+         else 
+         {
+            ++iter;
+         }
+      }
+   }
+   if(!removedJobs.empty())
+   {
+      if(cb.valid())
+      {
+         ossimJob::List::iterator iter = removedJobs.begin();
+         while(iter!=removedJobs.end())
+         {
+            cb->removed(this, (*iter).get());
+            ++iter;
+         }
+      }
+      removedJobs.clear();
+   }
+}
+
+void ossimJobQueue::clear()
+{
+   ossimJob::List removedJobs(m_jobQueue);
+   ossimRefPtr<Callback> cb;
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobQueueMutex);
+      m_jobQueue.clear();
+      cb = m_callback.get();
+   }
+   if(cb.valid())
+   {
+      // ossim_uint32 idx = 0;
+      for(ossimJob::List::iterator iter=removedJobs.begin();iter!=removedJobs.end();++iter)
+      {
+         cb->removed(this, (*iter).get());
+      }
+   }
+}
+
+ossimRefPtr<ossimJob> ossimJobQueue::nextJob(bool blockIfEmptyFlag)
+{
+   m_jobQueueMutex.lock();
+   bool emptyFlag = m_jobQueue.empty();
+   m_jobQueueMutex.unlock();
+   if (blockIfEmptyFlag && emptyFlag)
+   {
+      m_block.block();
+   }
+   
+   ossimRefPtr<ossimJob> result;
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobQueueMutex);
+   
+   if (m_jobQueue.empty())
+   {
+      m_block.set(false);
+      return result;
+   }
+   
+   ossimJob::List::iterator iter= m_jobQueue.begin();
+   while((iter != m_jobQueue.end())&&
+         (((*iter)->isCanceled())))
+   {
+      (*iter)->finished(); // mark the ob as being finished 
+      iter = m_jobQueue.erase(iter);
+   }
+   if(iter != m_jobQueue.end())
+   {
+      result = *iter;
+      m_jobQueue.erase(iter);
+   }
+   m_block.set(!m_jobQueue.empty());
+   return result;
+}
+void ossimJobQueue::releaseBlock()
+{
+   m_block.release();
+}
+bool ossimJobQueue::isEmpty()const
+{
+   // OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobQueueMutex);
+   // return m_jobQueue.empty();
+   m_jobQueueMutex.lock();
+   bool result =  m_jobQueue.empty();
+   m_jobQueueMutex.unlock();
+   return result;
+}
+
+ossim_uint32 ossimJobQueue::size()
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobQueueMutex);
+   return (ossim_uint32) m_jobQueue.size();
+}
+
+ossimJob::List::iterator ossimJobQueue::findById(const ossimString& id)
+{
+   if(id.empty()) return m_jobQueue.end();
+   ossimJob::List::iterator iter = m_jobQueue.begin();
+   while(iter != m_jobQueue.end())
+   {
+      if(id == (*iter)->id())
+      {
+         return iter;
+      }
+      ++iter;
+   }  
+   return m_jobQueue.end();
+}
+
+ossimJob::List::iterator ossimJobQueue::findByName(const ossimString& name)
+{
+   if(name.empty()) return m_jobQueue.end();
+   ossimJob::List::iterator iter = m_jobQueue.begin();
+   while(iter != m_jobQueue.end())
+   {
+      if(name == (*iter)->name())
+      {
+         return iter;
+      }
+      ++iter;
+   }  
+   return m_jobQueue.end();
+}
+
+ossimJob::List::iterator ossimJobQueue::findByPointer(const ossimJob* job)
+{
+   return std::find(m_jobQueue.begin(),
+                    m_jobQueue.end(),
+                    job);
+}
+
+ossimJob::List::iterator ossimJobQueue::findByNameOrPointer(const ossimJob* job)
+{
+   ossimString n = job->name();
+   ossimJob::List::iterator iter = m_jobQueue.begin();
+   while(iter != m_jobQueue.end())
+   {
+      if((*iter).get() == job)
+      {
+         return iter;
+      }
+      else if((!n.empty())&&
+              (job->name() == (*iter)->name()))
+      {
+         return iter;
+      }
+      ++iter;
+   }  
+   
+   return m_jobQueue.end();
+}
+
+bool ossimJobQueue::hasJob(ossimJob* job)
+{
+   ossimJob::List::const_iterator iter = m_jobQueue.begin();
+   while(iter != m_jobQueue.end())
+   {
+      if(job == (*iter).get())
+      {
+         return true;
+      }
+      ++iter;
+   }
+   
+   return false;
+}
+
+void ossimJobQueue::setCallback(Callback* c)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobQueueMutex);
+   m_callback = c;
+}
+
+ossimJobQueue::Callback* ossimJobQueue::callback()
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobQueueMutex);
+   return m_callback.get();
+}
diff --git a/src/ossim/parallel/ossimJobThreadQueue.cpp b/src/ossim/parallel/ossimJobThreadQueue.cpp
new file mode 100644
index 0000000..c1f4828
--- /dev/null
+++ b/src/ossim/parallel/ossimJobThreadQueue.cpp
@@ -0,0 +1,240 @@
+#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/src/ossim/parallel/ossimMultiThreadSequencer.cpp b/src/ossim/parallel/ossimMultiThreadSequencer.cpp
new file mode 100644
index 0000000..56edd13
--- /dev/null
+++ b/src/ossim/parallel/ossimMultiThreadSequencer.cpp
@@ -0,0 +1,441 @@
+//**************************************************************************************************
+//                          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/src/ossim/parallel/ossimOrthoIgen.cpp b/src/ossim/parallel/ossimOrthoIgen.cpp
index fe091e6..a8ad157 100644
--- a/src/ossim/parallel/ossimOrthoIgen.cpp
+++ b/src/ossim/parallel/ossimOrthoIgen.cpp
@@ -5,26 +5,21 @@
 // See LICENSE.txt file in the top level directory for more details.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimOrthoIgen.cpp 18606 2010-12-28 17:07:37Z gpotts $
+// $Id: ossimOrthoIgen.cpp 21962 2012-11-30 15:44:32Z dburken $
 
-// 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
 
 #include <ossim/parallel/ossimOrthoIgen.h>
-#include <sstream>
 #include <ossim/base/ossimCommon.h>
-#include <ossim/parallel/ossimIgen.h>
-#include <ossim/parallel/ossimMpi.h>
 #include <ossim/base/ossimException.h>
+#include <ossim/init/ossimInit.h>
 #include <ossim/base/ossimKeywordNames.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>
@@ -32,22 +27,42 @@
 #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/ossimMaskedImageHandler.h>
 #include <ossim/imaging/ossimOrthoImageMosaic.h>
 #include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimMaskFilter.h>
 #include <ossim/imaging/ossimTiffWriter.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimEpsgProjectionFactory.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/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimPreferences.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");
@@ -57,8 +72,8 @@ static const char* AUTOGENERATE_HISTOGRAM_KW = "autogenerate_histogram";
 using namespace ossim;
 
 //*************************************************************************************************
-// Parses the .src file specified in the command line. These contain an alternate specification
-// of input file and associated attributes as a KWL.
+// 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)
 {
@@ -125,7 +140,6 @@ bool ossimOrthoIgen::parseFilename(const ossimString& file_spec, bool decodeEntr
    } // end of while loop parsing fileInfos spec
 
    theSrcRecords.push_back(src_record);
-   
    return true;
 }
 
@@ -139,7 +153,7 @@ ossimOrthoIgen::ossimOrthoIgen()
    theDeltaPerPixelOverride(ossim::nan(), ossim::nan()),
    theProjectionType(OSSIM_UNKNOWN_PROJECTION),
    theProjectionName(""),
-   theGeographicOriginOfLatitude(0.0),
+   theGeoScalingLatitude(ossim::nan()),
    theCombinerType("ossimImageMosaic"),
    theResamplerType("nearest neighbor"),
    theWriterType(""),
@@ -161,13 +175,24 @@ ossimOrthoIgen::ossimOrthoIgen()
    theHighPercentClip(ossim::nan()),
    theStdDevClip(-1),
    theUseAutoMinMaxFlag(false),
-   theScaleToEightBitFlag(false),
-   theWriterProperties(),
-   theCutRectSpecIsConsolidated(false),
+   theClipToValidRectFlag(false),   
+   theReaderProperties(),
+   theWriterProperties(),   
    theTargetHistoFileName(),
-   theReferenceProj(0)
+   theProductFilename(),
+   theReferenceProj(0),
+   theMaskShpFile(""),
+   theCacheExcludedFlag(false),
+   theOutputRadiometry(""),
+   thePixelAlignment(OSSIM_PIXEL_IS_AREA) // will revert to "point" upon first occurrence in source list
 {
-   // setDefaultValues();
+   // 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;
 }
 
 //*************************************************************************************************
@@ -175,88 +200,127 @@ ossimOrthoIgen::ossimOrthoIgen()
 //*************************************************************************************************
 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(
-      "-t or --thumbnail", "thumbnail size");
+      "--chain-template","Specify an external file that contains chain information");
    argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--meters","Specifies an override for the meters per pixel. Takes a single value applied "
-      "equally to x and y directions.");
+      "--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(
-      "--meters-xy","Specifies an override for the meters-per-pixel. Takes two values <x> <y>");
+      "--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(
-      "--slave-buffers","number of slave tile buffers for mpi processing (default = 2)");
+      "--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(
-      "--view-template","Specify an external file that contains view information");
+      "--combiner-template","Specify an external file that contains combiner information");
    argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--chain-template","Specify an external file that contains chain information");
+      "--combiner-type","Specify what mosaic to use, ossimImageMosiac or ossimFeatherMosaic or "
+      "osimBlendMosaic ... etc");
    argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--combiner-template","Specify an external file that contains combiner information");
+      "--cut-bbox-en","Specify the min easting, min northing, max easting, max northing");
    argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--tiling-template","Specify an external file that contains tiling information");
+      "--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(
-      "--writer-template","Specify an external file that contains tiling information");
+      "--cut-pixel-width-height","Specify cut box's width and height in pixels");
    argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--utm","Defaults to a utm image chain with GSD = to the input");
+      "--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-scaled","Takes a 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(
-      "--srs","specify an output reference frame/projection. Example: --srs EPSG:4326");
+      "--mask","Specify the ESRI shape file with polygons to clip the image");
    argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--wkt","specify an output reference frame/projection that is in a wkt format.  Must have the"
-      " ossimgdal_plugin compiled");
+      "--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(
-      "--geo-scaled","Takes a latitude as an argument for purpose of scaling.  Specifies that no "
-      "spec file was defined.  Defaults to a scaled geographic image chain with GSD = to the input.");
+      "--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(
-      "--combiner-type","Specify what mosaic to use, ossimImageMosiac or ossimFeatherMosaic or "
-      "osimBlendMosaic ... etc");
+      "--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(
-      "--cut-center-ll","Specify the center cut in lat lon space.  Takes two argument <lat> <lon>");
+      "--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(
-      "--cut-radius-meters","Specify the cut distance in meters.  A bounding box for the cut will "
-      "be produced");
+      "--slave-buffers","number of slave tile buffers for mpi processing (default = 2)");
    argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--cut-bbox-ll","Specify the min lat and min lon and max lat and maxlon <minLat> <minLon> "
-      "<maxLat> <maxLon>");
+      "--srs","specify an output reference frame/projection. Example: --srs EPSG:4326");
    argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--cut-pixel-width-height","Specify cut box's width and height in pixels");
+      "--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(
-      "--hist-match","Takes one image filename argument for target histogram to match."
-      " Incompatible with other histogram options.");
+      "--supplementary-directory or --support","Specify the supplementary directory path where "
+      "overviews, histograms and external geometries are located");
    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.");
+      "-t or --thumbnail", "thumbnail size");
    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.");
+      "--tiling-template","Specify an external file that contains tiling information");
    argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--hist-auto-minmax","uses the automatic search for the best min and max clip values."
-      " Incompatible with other histogram options.");
+      "--threads [n]","Indicates multi-threaded process using optionally-specified number of threads");
    argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--supplementary-directory or --support","Specify the supplementary directory path where "
-      "overviews, histograms and external geometries are located");
+      "--utm","Defaults to a utm image chain with GSD = to the input");
    argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--scale-to-8-bit","Scales output to eight bits if not already.");
+      "--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(
-      "--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\".");
+      "--writer-template","Specify an external file that contains tiling information"); 
 }
 
 //*************************************************************************************************
@@ -276,11 +340,13 @@ void ossimOrthoIgen::initialize(ossimArgumentParser& argumentParser)
    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();
@@ -288,10 +354,16 @@ void ossimOrthoIgen::initialize(ossimArgumentParser& argumentParser)
    theCutDxDyUnit     = OSSIM_UNIT_UNKNOWN;
    theLowPercentClip  = ossim::nan();
    theHighPercentClip = ossim::nan();
-   double minLat=ossim::nan(), minLon=ossim::nan(), maxLat=ossim::nan(), maxLon=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);
@@ -308,11 +380,22 @@ void ossimOrthoIgen::initialize(ossimArgumentParser& argumentParser)
       else
       {
          theThumbnailSize.x = tempString.toInt();
-         theThumbnailSize.y = theThumbnailSize.x ;
+         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))
    {
@@ -350,24 +433,48 @@ void ossimOrthoIgen::initialize(ossimArgumentParser& argumentParser)
    }
    if(argumentParser.read("--cut-bbox-ll", doubleParam, doubleParam2, doubleParam3, doubleParam4))
    {
-      minLat = tempDouble;
-      minLon = tempDouble2;
-      maxLat = tempDouble3;
-      maxLon = tempDouble4;
+      minY = tempDouble;
+      minX = tempDouble2;
+      maxY = tempDouble3;
+      maxX = tempDouble4;
       theCutOriginUnit = OSSIM_DEGREES;
       theCutOriginType = ossimOrthoIgen::OSSIM_UPPER_LEFT_ORIGIN;
-      theCutOrigin.lat = maxLat;
-      theCutOrigin.lon = minLon;
-      theCutDxDy.lat   = (maxLat-minLat);
-      theCutDxDy.lon   = (maxLon-minLon);
-      theCutDxDyUnit   = theCutOriginUnit;
+      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(minLat) == false)&&
-         (ossim::isnan(minLon) == false)&&
-         (ossim::isnan(maxLat) == false)&&
-         (ossim::isnan(maxLon) == false))
+      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));
@@ -380,6 +487,22 @@ void ossimOrthoIgen::initialize(ossimArgumentParser& argumentParser)
       }
    }
    
+   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))
@@ -444,7 +567,7 @@ void ossimOrthoIgen::initialize(ossimArgumentParser& argumentParser)
          theUseAutoMinMaxFlag = true;
    }
 
-   int num_params = argumentParser.numberOfParams("--meters", doubleParam);
+   num_params = argumentParser.numberOfParams("--meters", doubleParam);
    if (num_params == 1)
    {
       argumentParser.read("--meters", doubleParam);
@@ -460,9 +583,20 @@ void ossimOrthoIgen::initialize(ossimArgumentParser& argumentParser)
       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"))
    {
-      theScaleToEightBitFlag = true;
+      if (theOutputRadiometry.empty())
+         theOutputRadiometry = "U8";
    }
 
    if (argumentParser.read("--stdout"))
@@ -500,6 +634,9 @@ void ossimOrthoIgen::initialize(ossimArgumentParser& argumentParser)
    {
       theCombinerTemplate = ossimFilename(tempString);
    }
+   
+   theGeoScalingLatitude = ossim::nan();
+
    if (argumentParser.read("--utm"))
    {
       theProjectionType = OSSIM_UTM_PROJECTION;
@@ -509,6 +646,7 @@ void ossimOrthoIgen::initialize(ossimArgumentParser& argumentParser)
    {
       theProjectionType = OSSIM_GEO_PROJECTION;
       theProjectionName = "ossimEquDistCylProjection";
+      theGeoScalingLatitude = 0.0;
    }
    else if(argumentParser.read("--input-proj"))
    {
@@ -525,28 +663,27 @@ void ossimOrthoIgen::initialize(ossimArgumentParser& argumentParser)
       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) )
       {
-         theGeographicOriginOfLatitude = tempDouble;
+         theGeoScalingLatitude = tempDouble;
       }
       else
       {
-         theGeographicOriginOfLatitude = 0.0;
          ossimNotify(ossimNotifyLevel_WARN)
             << "ossimOrthoIgen::initialize WARNING:"
             << "\nLatitude out  of range!  Must be between -90 and 90."
-            << "\nRemains at zero."
             << std::endl;
       }
       if (traceDebug())
       {
          ossimNotify(ossimNotifyLevel_DEBUG)
             << "ossimOrthoIgen::initialize DEBUG:"
-            << "\ngeographicOriginOfLatitude:  " << theGeographicOriginOfLatitude
+            << "\ngeographicOriginOfLatitude:  " << theGeoScalingLatitude
             << std::endl;
       }
    }
@@ -563,6 +700,45 @@ void ossimOrthoIgen::initialize(ossimArgumentParser& argumentParser)
       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)
@@ -599,7 +775,6 @@ void ossimOrthoIgen::addFiles(ossimArgumentParser& argumentParser,
 
    // The last filename left on the command line should be the product filename:
    theProductFilename = argumentParser.argv()[last_idx];
-   
 }
 
 //*************************************************************************************************
@@ -635,10 +810,6 @@ bool ossimOrthoIgen::execute()
      }
    }
 
-//    if(ossimMpi::instance()->getRank() == 0)
-//    {
-//       start = ossimMpi::instance()->getTime();
-//    }
    if(ossimMpi::instance()->getRank() == 0)
    {
       try
@@ -662,7 +833,8 @@ bool ossimOrthoIgen::execute()
 
    try
    {
-     outputProduct();
+      // theProductProjection->print(cout) << endl;
+      outputProduct();
    }
    catch(const ossimException& e)
    {
@@ -693,15 +865,91 @@ void ossimOrthoIgen::addSrcFile(const ossimFilename& src_file)
    if (!src_file.isReadable())
       return;
 
-   ossimKeywordlist src_kwl (src_file);
+   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;
-      theSrcRecords.push_back(src_record);
+      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++;
    }
 }
 
@@ -715,7 +963,7 @@ void ossimOrthoIgen::setDefaultValues()
    theDeltaPerPixelOverride.makeNan();
    theTemplateView = "";
    theProjectionType = OSSIM_UNKNOWN_PROJECTION;
-   theGeographicOriginOfLatitude = 0.0;
+   theGeoScalingLatitude = ossim::nan();
    theCombinerType = "ossimImageMosaic";
    theResamplerType = "nearest neighbor";
    theTilingTemplate = "";
@@ -729,6 +977,11 @@ void ossimOrthoIgen::setDefaultValues()
    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
 }
 
 //*************************************************************************************************
@@ -753,6 +1006,7 @@ void ossimOrthoIgen::setupIgenChain()
    ossimKeywordlist templateKwl;
    templateKwl.clear();
    ossimRefPtr<ossimImageCombiner> mosaicObject = 0;
+   ossimRefPtr<ossimImageCombiner> bandMergeObject = 0;
    if(theCombinerTemplate.exists())
    {
       templateKwl.addFile(theCombinerTemplate);
@@ -769,6 +1023,9 @@ void ossimOrthoIgen::setupIgenChain()
             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:
@@ -790,8 +1047,6 @@ void ossimOrthoIgen::setupIgenChain()
    if(!default_single_image_chain.valid())  // then create a default rendering chain
    {
       default_single_image_chain = new ossimImageChain;
-      //if ((theProjectionType != OSSIM_UNKNOWN_PROJECTION) ||
-      //    (!theDeltaPerPixelOverride.hasNans()) || theBuildThumbnailFlag)
       {
          // Only need a renderer if an output projection or an explicit GSD was specified.
          if(!orthoMosaic)
@@ -824,6 +1079,22 @@ void ossimOrthoIgen::setupIgenChain()
          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());
@@ -868,36 +1139,39 @@ void ossimOrthoIgen::setupIgenChain()
          {
             img_handler->openOverview();
          }
-         ossimRefPtr<ossimMaskedImageHandler> mask_img_handler = 0;
-         if (theSrcRecords[idx].getMaskPath().exists())
-         {
-           mask_img_handler = new ossimMaskedImageHandler;
-           mask_img_handler->setInputImageSource(img_handler);
-           if (mask_img_handler->open(theSrcRecords[idx].getMaskPath()))
-           {
-             singleImageChain->addLast(mask_img_handler.get());
-             current_source = mask_img_handler.get();
-           }
-           else
-           {
-             singleImageChain->addLast(img_handler);
-             current_source = img_handler;
-           }
-         }
-         else
+         if (theSrcRecords[idx].isRgbData() && theSrcRecords[idx].getBands().size() > 0 && 
+            theSrcRecords[idx].getOverviewPath().empty())
          {
-           singleImageChain->addLast(img_handler);
-           current_source = img_handler;
+            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();
+            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))
          {
@@ -921,23 +1195,46 @@ void ossimOrthoIgen::setupIgenChain()
             }
          }
 
-         // Install a histogram object if needed:
+         // Install a histogram object if needed. This inserts just to the left of the resampler.
          setupHistogram(singleImageChain, theSrcRecords[idx]);
 
-         // Add a cache to the left of the resampler.
-         addChainCache(singleImageChain);
+         // 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();
-         mosaicObject->connectMyInputTo(singleImageChain);
-         theContainer->addChild(singleImageChain);
+
+         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();
@@ -951,6 +1248,18 @@ void ossimOrthoIgen::setupIgenChain()
       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();
 
@@ -960,8 +1269,8 @@ void ossimOrthoIgen::setupIgenChain()
    // Output rect cutter:
    setupCutter();
 
-   // Base class makes sure the product view projection is properly wired into the chain:
-   setView();
+   // 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.
@@ -973,62 +1282,237 @@ void ossimOrthoIgen::setupIgenChain()
 }
 
 //*************************************************************************************************
+// 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() || !theProductProjection.valid() || !input_source)
+   if((theCutDxDy.hasNans()&&theMaskShpFile.empty())||!theProductProjection.valid()||!input_source)
       return;
 
-   // Before anything, make sure the cut rect is relative to UL:
-   if (!theCutRectSpecIsConsolidated)
-      consolidateCutRectSpec();
-
-   // Assumed WGS-84 coordinates specified on command line:
-   ossimGpt originLatLon(theCutOrigin.lat, theCutOrigin.lon, 0.0);
-
-   ossimDpt uli (0,0); // input image UL pixel origin (we want to be an integral distance (in pixels from here)
-   if(!theProductProjection->isGeographic())  // projection in meters...
+   //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())
    {
-      ossimEastingNorthingCutter* cutter = new ossimEastingNorthingCutter;
-      ossimDpt ul (theProductProjection->forward(originLatLon));
-      ossimDpt lr (ul.x + theCutDxDy.x, ul.y - theCutDxDy.y);
-      cutter->setEastingNorthingRectangle(ul, lr);
-      theProductChain->addFirst(cutter);
+     if (theMaskShpFile.contains("|"))
+     {
+       ossimString fileName = theMaskShpFile;
+       std::vector<ossimString> fileList = fileName.split("|");
+       if (fileList.size() > 1)
+       {
+         theMaskShpFile = fileList[0];
+         query = fileList[1];
+       }
+     }
    }
 
-   else // geographic projection, units = decimal degrees.
+   if (!theMaskShpFile.exists())
    {
-      ossimGeoPolyCutter* cutter = new ossimGeoPolyCutter;
-      std::vector<ossimGpt> polygon;
-
-      ossimGpt ul(originLatLon.lat,                originLatLon.lon               );
-      ossimGpt ur(originLatLon.lat,                originLatLon.lon + theCutDxDy.x);
-      ossimGpt lr(originLatLon.lat - theCutDxDy.y, originLatLon.lon + theCutDxDy.x);
-      ossimGpt ll(originLatLon.lat - theCutDxDy.y, originLatLon.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);
+     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();
 
-   return;
-}
+     ossimGeoPolyCutter* exteriorCutter = new ossimGeoPolyCutter;
+     exteriorCutter->setView(theProductProjection.get());
 
-void ossimOrthoIgen::setupWriter()
-{
-   if (!theProductChain.valid())
-      return;
+     ossimGeoPolyCutter* interiorCutter = NULL;
 
-   ossimRefPtr<ossimImageFileWriter> writer = 0;
-   
-   if (theWriterType.size())
-   {
+     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);
    }
@@ -1051,6 +1535,13 @@ void ossimOrthoIgen::setupWriter()
       writer = ossimImageWriterFactoryRegistry::instance()->createWriter(kwlWriter);
       theProductFilename = theProductFilename.path();
    }
+   else if (!theTilingFilename.empty())
+   {
+      if (theProductFilename.isDir())
+      {
+         theProductFilename = theProductFilename + "/" + theTilingFilename;
+      }
+   }
 
    try
    {
@@ -1084,15 +1575,22 @@ void ossimOrthoIgen::setupWriter()
          }
       }
 
+      // 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);
-         if(theScaleToEightBitFlag)
-            writer->setScaleToEightBitFlag(theScaleToEightBitFlag);
-
          writer->connectMyInputTo(0, theProductChain.get());
 
          ossimPropertyInterface* propInterface = (ossimPropertyInterface*)writer.get();
@@ -1134,21 +1632,13 @@ void ossimOrthoIgen::setupProjection()
    // Throw exception if no valid input image projection was established:
    if(!theReferenceProj.valid())
    {
-      std::string errMsg = "ossimOrthoIgen::setupView() -- Could not establish input image's "
+      std::string errMsg = "ossimOrthoIgen::setupProjection() -- Could not establish input image's "
          "projection. Cannot setup output view.";
       throw(ossimException(errMsg));
    }
 
-   // Define some quantities that may be needed for the output projection:
-   ossimDpt metersPerPixel = theReferenceProj->getMetersPerPixel();
-   double meanGSD = (metersPerPixel.x+metersPerPixel.y)*.5;
-   ossimDpt gsd(meanGSD, meanGSD);
-   ossimUnitType gsdUnits = OSSIM_METERS;
-   if(!theDeltaPerPixelOverride.hasNans())
-   {
-      gsd = theDeltaPerPixelOverride;
-      gsdUnits = theDeltaPerPixelUnit;
-   }
+   // 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:
@@ -1156,7 +1646,7 @@ void ossimOrthoIgen::setupProjection()
    {
       if (!theTemplateView.isReadable())
       {
-         std::string errMsg = "ossimOrthoIgen::setupView() -- Could not read the product "
+         ossimString errMsg = "ossimOrthoIgen::setupProjection() -- Could not read the product "
             "projection template file at <";
          errMsg += theTemplateView;
          errMsg += ">. Cannot establish output projection.";
@@ -1177,7 +1667,9 @@ void ossimOrthoIgen::setupProjection()
    else if (theProjectionType == OSSIM_GEO_PROJECTION)
    {
       theProductProjection = new ossimEquDistCylProjection();
-      ossimGpt gpt(theGeographicOriginOfLatitude, 0.0);
+      ossimGpt gpt(0.0, 0.0);
+      if (!ossim::isnan(theGeoScalingLatitude))
+        gpt = ossimGpt(theGeoScalingLatitude, 0.0);
       theProductProjection->setOrigin(gpt);
    }
 
@@ -1194,7 +1686,9 @@ void ossimOrthoIgen::setupProjection()
          if (theProductProjection->isGeographic())
          {
             theProjectionType = OSSIM_GEO_PROJECTION;
-            ossimGpt gpt(theGeographicOriginOfLatitude, 0.0);
+            ossimGpt gpt(0.0, 0.0);
+            if (!ossim::isnan(theGeoScalingLatitude))
+              gpt = ossimGpt(theGeoScalingLatitude, 0.0);
             theProductProjection->setOrigin(gpt);
          }
       }
@@ -1202,7 +1696,7 @@ void ossimOrthoIgen::setupProjection()
       {
          theProjectionType = OSSIM_UNKNOWN_PROJECTION;
          ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimOrthoIgen::srs WARNING:" << " Unsupported spatial reference system."
+            << "ossimOrthoIgen::setupProjection() WARNING:" << " Unsupported spatial reference system."
             << " Will default to the projection from the input image."
             << std::endl;
       }
@@ -1226,52 +1720,65 @@ void ossimOrthoIgen::setupProjection()
       // 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:
-      ossimMapProjection* map_proj = PTR_CAST(ossimMapProjection, theReferenceProj.get());
-      if (map_proj)
+      if (ref_map)
       {
-         theProductProjection = PTR_CAST(ossimMapProjection, map_proj->dup());
+         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(theGeographicOriginOfLatitude, 0.0);
-         theProductProjection->setOrigin(gpt);
 
-         // std::string errMsg = "ossimOrthoIgen::setupView() -- First input image's projection must "
-         //    "be a map projection when specifying \"input-proj\".";
-         // throw(ossimException(errMsg));
+         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::setupView() -- Could not establish valid output "
+      std::string errMsg = "ossimOrthoIgen::setupProjection() -- Could not establish valid output "
          "projection";
       throw(ossimException(errMsg));
    }
 
-   // HACK: The projection may not have had the PCS code initialized even though it
+   // 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:
-   theProductProjection->getPcsCode();
+   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();
 
-   //Perform some tasks common to all projection types:
-   if (gsdUnits == OSSIM_DEGREES)
-      theProductProjection->setDecimalDegreesPerPixel(gsd);
-   else
-      theProductProjection->setMetersPerPixel(gsd);
    theProjectionName = theProductProjection->getProjectionName();
 
-   // Fix the tiepoint misalignment between input and output image projections:
-   consolidateCutRectSpec();
-   snapTiePointToRefProj();
+   // 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::setupView DEBUG:"
+         << "ossimOrthoIgen::setupProjection DEBUG:"
          << "Leaving...." << __LINE__
          << std::endl;
    }
@@ -1318,7 +1825,7 @@ bool ossimOrthoIgen::setupTiling()
       ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimOrthoIgen::setupTiling: Entered......" << std::endl;
    }
    ossimKeywordlist templateKwl;
-   ossimFilename outputFilename = theProductFilename; 
+   ossimFilename outputFilename = theProductFilename;
    theTilingEnabled = false;
 
    if ((theTilingTemplate == "")||(!templateKwl.addFile(theTilingTemplate)))
@@ -1341,14 +1848,35 @@ bool ossimOrthoIgen::setupTiling()
             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);
-            theProductFilename = outputFilename.path();
+            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;
          }
@@ -1361,7 +1889,19 @@ bool ossimOrthoIgen::setupTiling()
    }
 
    // Initialize the tiling object if enabled:
-   if (theTilingEnabled && !theTiling.loadState(templateKwl, prefix))
+   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())
@@ -1378,16 +1918,17 @@ bool ossimOrthoIgen::setupTiling()
 // line. This avoids multiple, redundant checks scattered throughout the code. On exit:
 // 
 //   1. theCutOriginType is converted to OSSIM_UPPER_LEFT_ORIGIN
-//   2. theCutDxDy reflects the full size of the rect, in the units corresponding to the projection
-//   3. theCutDxDyUnit is METERS for UTM, DEGREES for geographic
-//   4. A boolean data member (theCutRectSpecIsConsolidated) is set. This is checked throughout to
-//      make sure the consolidation was done.
+//   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()
 {
-   theCutRectSpecIsConsolidated = true;
-   if (!theProductProjection.valid() || theCutDxDy.hasNans())
+   if (!theProductProjection.valid() || theCutDxDy.hasNans() || theCutOrigin.hasNans())
       return; 
 
    if ((theCutDxDyUnit != OSSIM_METERS) && 
@@ -1400,147 +1941,197 @@ void ossimOrthoIgen::consolidateCutRectSpec()
       return;
    }
 
-   // The lat lon of the origin is assumed WGS_84:
-   ossimGpt originPLH (theCutOrigin.lat, theCutOrigin.lon);
+   ossimGpt originPLH;
+   ossimDpt resolution;
+
+   // Geographic Projection (lat/lon cut rect) requested?
    if(theProductProjection->isGeographic()) 
    {
-      // geographic projection; units need to be decimal degrees:
+      // 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)
       {
-         // POTENTIAL BUG: converion from meters to degrees longitude 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;
-         theCutDxDyUnit = OSSIM_DEGREES;
       }
-      else // unknown, assume native units
-         theCutDxDyUnit = OSSIM_DEGREES;
 
-      std::vector<ossimGpt> polygon;
+      // Set these to the correct units. May already be correct, but just in case...
+      theCutOriginUnit = OSSIM_DEGREES; 
+      theCutDxDyUnit = OSSIM_DEGREES; 
 
-      if (theCutOriginType == OSSIM_CENTER_ORIGIN)
+      if (theClipToValidRectFlag)
       {
-         theCutOrigin.lat += theCutDxDy.y;
-         theCutOrigin.lon += theCutDxDy.x;
+         // 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 
    {
-       // projection in meters; units need to be in meters:
-      if (theCutDxDyUnit == OSSIM_DEGREES)
+      // 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))
       {
-         // 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;
-         theCutDxDyUnit = OSSIM_METERS;
-      }
-      else // unknown, assume native units
-         theCutDxDyUnit = OSSIM_METERS;
+         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;
 
-      if (theCutOriginType == OSSIM_CENTER_ORIGIN)
+         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
       {
-         ossimDpt originEN = theProductProjection->forward(originPLH);
-         originEN = originEN + theCutDxDy;
-         originPLH = theProductProjection->inverse(originEN);
-         theCutOrigin.lat = originPLH.lat;
-         theCutOrigin.lon = originPLH.lon;
+         // 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();
    }
 
-   // One more check then everything should be relative to UL:
+   // 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;
    }
-}
-
-//*************************************************************************************************
-// Implemented to fix the misalignment between the input projection and the product. This was
-// due to an UL corner in the product that was not an integral distance (in pixels) from the UL
-// corner of the input image (assuming single input). OLK 3/10
-//*************************************************************************************************
-void ossimOrthoIgen::snapTiePointToRefProj()
-{
-   if (!theProductProjection.valid())
-      return;
-
-   // Make sure the AOI is specified in terms of UL corner and distance towards LR:
-   if (!theCutRectSpecIsConsolidated)
-      consolidateCutRectSpec();
 
-   // When no cutting is requested, then it's the trivial case of simply copying the input
-   // projection's tiepoint to the output:
-   if (theCutOrigin.hasNans())
+   // 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)
    {
-      establishMosaicTiePoint();
-      return;
+      // Set the E/N values for the cut origin as the tie point:
+      theProductProjection->setUlTiePoints(theCutOrigin);
    }
-
-   // The notion of snapping to a tiepoint is only valid for a map projected input:
-   ossimMapProjection* in_proj = PTR_CAST(ossimMapProjection, theReferenceProj.get());
-   if (!in_proj)
-      return;
-
-   ossimDpt uli (0,0); // upper left corner of input image in pixels
-   ossimGpt ulg; // input image UL geographic origin.
-   in_proj->lineSampleToWorld(uli, ulg);
-
-   // We will be modifying the projection's tiepoint (a.k.a. UL corner point):
-   ossimGpt cutUL_gpt(theCutOrigin.lat, theCutOrigin.lon, 0.0, theProductProjection->getDatum());
-   if(in_proj->isGeographic())  // geographic projection, units = decimal degrees.
+   else
    {
-      // Need to use the degrees-per-pixel quantity for accurate snap:
-      ossimDpt degPerPixel (in_proj->getDecimalDegreesPerPixel());
-
-      // Establish offset from cut-rect UL to input image UL in integral pixels, and
-      // correct the cut-rect's origin for the misalignment:
-      double dLat = cutUL_gpt.lat - ulg.lat;
-      dLat = ossim::round<int>(dLat/degPerPixel.y) * degPerPixel.y;
-      cutUL_gpt.lat = ulg.lat + dLat - 0.5*degPerPixel.y;
-
-      double dLon = cutUL_gpt.lon - ulg.lon;
-      dLon = ossim::round<int>(dLon/degPerPixel.x) * degPerPixel.x;
-      cutUL_gpt.lon = ulg.lon + dLon - 0.5*degPerPixel.x;
+      // Set the projection center (origin) latitude at the center of the cut rect:
+      gpt.lat = cutCenter.y;
+      gpt.lon = 0.0;
+      theProductProjection->setOrigin(gpt);
 
-      theProductProjection->setUlTiePoints(cutUL_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);
    }
 
-   else    // projection in meters...
-   {
-      // Establish the easting northing (in input projection space) of the UL cut rect:
-      ossimDpt cut_ul_EN_in = in_proj->forward(cutUL_gpt);
+   // cout << "\n**************** proj 2:\n";
+   // theProductProjection->print(cout);
 
-      // Directly use the meters offset from input image UL in computing snap shift:
-      ossimDpt ul_EN_in; // input image UL E/N origin.
-      ossimDpt mtrsPerPixel (theProductProjection->getMetersPerPixel());
-      in_proj->lineSampleToEastingNorthing(uli, ul_EN_in);
-
-      // Establish offset from cut-rect UL to input image UL in integral pixels, and
-      // correct the cut-rect's origin for the misalignment:
-      double dE = cut_ul_EN_in.x - ul_EN_in.x;
-      dE = ((int)(dE/mtrsPerPixel.x)) * mtrsPerPixel.x;
-      cut_ul_EN_in.x = ul_EN_in.x + dE; // + 0.5*mtrsPerPixel.x;
-
-      double dN = cut_ul_EN_in.y - ul_EN_in.y;
-      dN = ((int)(dN/mtrsPerPixel.y)) * mtrsPerPixel.y;
-      cut_ul_EN_in.y = ul_EN_in.y + dN; // - 0.5*mtrsPerPixel.y;
-
-      // Convert input projection easting northing to geographic tiepoint:
-      cutUL_gpt = in_proj->inverse(cut_ul_EN_in);
-      theProductProjection->setUlTiePoints(cutUL_gpt);
-
-      // Update the cut rect with new UL coordinates:
-      theCutOrigin.lat = cutUL_gpt.lat;
-      theCutOrigin.lon = cutUL_gpt.lon;
-   }
+   // Propagates changes to the projection to the processing chain:
+   setView();
 }
 
 //*************************************************************************************************
@@ -1585,6 +2176,7 @@ void ossimOrthoIgen::setupHistogram(ossimImageChain* input_chain, const ossimSrc
    ossimFilename candidateHistoFilename;
    ossimFilename defaultHistoFilename (handler->createDefaultHistogramFilename());
    ossimFilename entryName (handler->getFilenameWithThisExtension(ossimString(".his"), true));
+
    do
    {
       if (!histoFilename.empty())
@@ -1609,12 +2201,12 @@ void ossimOrthoIgen::setupHistogram(ossimImageChain* input_chain, const ossimSrc
       histoFilename = defaultHistoFilename;
       if (histoFilename.exists())  break;
 
-      // Last possibility is the default name with entry index:
-      if (src_record.getEntryIndex() >= 0)
-      {
-         histoFilename = entryName;
-         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())
@@ -1646,16 +2238,23 @@ void ossimOrthoIgen::setupHistogram(ossimImageChain* input_chain, const ossimSrc
 
    // 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")));
+   // 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:
-      ossimHistogramEqualization* forwardEq = new ossimHistogramEqualization;
-      ossimHistogramEqualization* inverseEq = new ossimHistogramEqualization;
+      ossimRefPtr<ossimHistogramEqualization> forwardEq = new ossimHistogramEqualization;
+      ossimRefPtr<ossimHistogramEqualization> inverseEq = new ossimHistogramEqualization;
       
       // Init equalizers with the source and target histogram files:
       forwardEq->setInverseFlag(false);
@@ -1663,12 +2262,51 @@ void ossimOrthoIgen::setupHistogram(ossimImageChain* input_chain, const ossimSrc
       inverseEq->setInverseFlag(true);
       inverseEq->setHistogram(theTargetHistoFileName);
 
-      // Insert to the left of renderer if one exists:
-      if (renderer)
-         input_chain->insertLeft(forwardEq, renderer);
+      // 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
-         input_chain->addFirst(forwardEq);
-      input_chain->insertRight(inverseEq, forwardEq);
+      {
+         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;
    }
@@ -1676,8 +2314,8 @@ void ossimOrthoIgen::setupHistogram(ossimImageChain* input_chain, const ossimSrc
    // Remaining possibilities (clip or stretch) require a remapper.
    // Insert to the left of renderer if one exists:
    ossimRefPtr<ossimHistogramRemapper> remapper = new ossimHistogramRemapper;
-   if (renderer)
-      input_chain->insertLeft(remapper.get(), renderer);
+   if ( renderer.valid() )
+      input_chain->insertLeft( remapper.get(), renderer.get() );
    else
       input_chain->addFirst(remapper.get());
 
@@ -1771,15 +2409,21 @@ bool ossimOrthoIgen::createHistogram(ossimImageChain* chain, const ossimFilename
 void ossimOrthoIgen::addChainCache(ossimImageChain* chain) const
 {
    if (chain)
-   {  
-      ossimConnectableObject* renderer =
-         PTR_CAST(ossimConnectableObject,
-                  chain->findFirstObjectOfType(ossimString("ossimImageRenderer")));
-
-      if (renderer)
+   {
+      //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);
+         chain->insertLeft( cache, renderer.get() );
       }
    }
 }
@@ -1808,7 +2452,7 @@ void ossimOrthoIgen::generateLog()
 
 //*************************************************************************************************
 //! Determines the UL corner tiepoint of the product projection as the overall UL corner of the
-//! mosaic.
+//! mosaic. This may not be the final tiepoint, since a cut origin may have been specified, and the
 //*************************************************************************************************
 void ossimOrthoIgen::establishMosaicTiePoint()
 {
@@ -1816,6 +2460,7 @@ void ossimOrthoIgen::establishMosaicTiePoint()
       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);
 
@@ -1825,34 +2470,506 @@ void ossimOrthoIgen::establishMosaicTiePoint()
          "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();
-   ossimGpt tie_pt_i, tie_pt;
-   tie_pt.makeNan();
-   while (iter != clientList.end())
+   //   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 = PTR_CAST(ossimImageHandler, (*iter).get());
+      // iter++;
 
+      ossimImageHandler* handler = visitor.getObjectAs<ossimImageHandler>( i );
       if (!handler) break;
 
       ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
-      if (!geom) break;
+      if (!geom.valid()) 
+         continue; // Skip over any non geometry inputs (e.g., masks)
 
-      ossimIrect boundingRect = handler->getBoundingRect();
-      ossimDpt ulPt = boundingRect.ul();
-      geom->localToWorld(ulPt, tie_pt_i);
+      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));
+      
 
-      if (tie_pt.hasNans())
-         tie_pt = tie_pt_i;
+      // 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();
+}
+
+//*************************************************************************************************
+// 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
       {
-         if (tie_pt_i.lat > tie_pt.lat) tie_pt.lat = tie_pt_i.lat;
-         if (tie_pt_i.lon < tie_pt.lon) tie_pt.lon = tie_pt_i.lon;
+         // 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
    }
 
-   if (!tie_pt.hasNans())
-      theProductProjection->setUlTiePoints(tie_pt);
+   // 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/ossim/plugin/ossimDynamicLibrary.cpp b/src/ossim/plugin/ossimDynamicLibrary.cpp
index 937205f..6f34bcc 100644
--- a/src/ossim/plugin/ossimDynamicLibrary.cpp
+++ b/src/ossim/plugin/ossimDynamicLibrary.cpp
@@ -7,15 +7,12 @@
 // Author: Garrett Potts
 //
 //*********************************************************************
-// $Id: ossimDynamicLibrary.cpp 16098 2009-12-15 15:13:16Z dburken $
+// $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>
 
-
-RTTI_DEF(ossimDynamicLibrary, "ossimDynamicLibrary");
-
 // Static trace for debugging.
 static ossimTrace traceDebug(ossimString("ossimDynamicLibrary:debug"));
 
diff --git a/src/ossim/plugin/ossimPluginLibrary.cpp b/src/ossim/plugin/ossimPluginLibrary.cpp
index 6056788..5f90ad8 100644
--- a/src/ossim/plugin/ossimPluginLibrary.cpp
+++ b/src/ossim/plugin/ossimPluginLibrary.cpp
@@ -7,12 +7,10 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimPluginLibrary.cpp 18967 2011-02-25 19:40:48Z gpotts $
+// $Id: ossimPluginLibrary.cpp 20694 2012-03-19 12:22:05Z dburken $
 #include <ossim/plugin/ossimPluginLibrary.h>
 #include <iostream>
 
-RTTI_DEF1(ossimPluginLibrary, "ossimPluginLibrary", ossimDynamicLibrary);
-
 ossimPluginLibrary::ossimPluginLibrary()
    :ossimDynamicLibrary(),
     m_info(0)
diff --git a/src/ossim/plugin/ossimSharedPluginRegistry.cpp b/src/ossim/plugin/ossimSharedPluginRegistry.cpp
index 35c828f..e16bf92 100644
--- a/src/ossim/plugin/ossimSharedPluginRegistry.cpp
+++ b/src/ossim/plugin/ossimSharedPluginRegistry.cpp
@@ -6,7 +6,7 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimSharedPluginRegistry.cpp 18967 2011-02-25 19:40:48Z gpotts $
+// $Id: ossimSharedPluginRegistry.cpp 20608 2012-02-27 12:03:40Z gpotts $
 #include <algorithm>
 #include <iterator>
 #include <ossim/plugin/ossimSharedPluginRegistry.h>
@@ -158,7 +158,7 @@ ossimPluginLibrary* ossimSharedPluginRegistry::getPlugin(ossim_uint32 idx)
 {
    ossimPluginLibrary* result = 0;
    
-   if((idx>=0)&&(idx < theLibraryList.size()))
+   if(idx < theLibraryList.size())
    {
       result = theLibraryList[idx].get();
    }
@@ -170,7 +170,7 @@ const ossimPluginLibrary* ossimSharedPluginRegistry::getPlugin(ossim_uint32 idx)
 {
    const ossimPluginLibrary* result = 0;
    
-   if((idx>=0)&&(idx < theLibraryList.size()))
+   if(idx < theLibraryList.size())
    {
       result = theLibraryList[idx].get();
    }
diff --git a/src/ossim/projection/ossimAlphaSensor.cpp b/src/ossim/projection/ossimAlphaSensor.cpp
new file mode 100644
index 0000000..86808cb
--- /dev/null
+++ b/src/ossim/projection/ossimAlphaSensor.cpp
@@ -0,0 +1,710 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Dave Hicks
+//
+// Description:  Alpha Sensor Base Class
+//
+//*******************************************************************
+//  $Id$
+#include <ossim/projection/ossimAlphaSensor.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 ("ossimAlphaSensor:exec");
+static ossimTrace traceDebug("ossimAlphaSensor:debug");
+
+RTTI_DEF1(ossimAlphaSensor, "ossimAlphaSensor", ossimSensorModel);
+
+enum
+{
+   PARAM_ADJ_LON_OFFSET   = 0,
+   PARAM_ADJ_LAT_OFFSET = 1,
+   PARAM_ADJ_ALTITUDE_OFFSET = 2, 
+   PARAM_ADJ_ROLL_OFFSET = 3,
+   PARAM_ADJ_PITCH_OFFSET = 4,
+   PARAM_ADJ_HDG_OFFSET = 5,
+   PARAM_ADJ_FOCAL_LENGTH_OFFSET = 6,
+   PARAM_ADJ_COUNT = 7
+};
+
+ossimAlphaSensor::ossimAlphaSensor()
+   :
+   m_rollBias(0.0),
+   m_pitchBias(0.0),
+   m_headingBias(0.0),
+   m_fov(0.0),
+   m_slitRot(0.0),
+   m_focalLength(0.0),
+   m_adjustedFocalLength(0.0)
+{
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensor::ossimAlphaSensor DEBUG:" << std::endl;
+   }
+   m_cam2Platform.ReSize(3,3);
+   m_cam2Platform = 0.0;
+   
+   initAdjustableParameters();
+}
+
+ossimAlphaSensor::ossimAlphaSensor(const ossimAlphaSensor& src)
+   :
+   ossimSensorModel(src),
+   m_rollBias(src.m_rollBias),
+   m_pitchBias(src.m_pitchBias),
+   m_headingBias(src.m_headingBias),
+   m_fov(src.m_fov),
+   m_slitRot(src.m_slitRot),
+   m_focalLength(src.m_focalLength),
+   m_rollPoly(src.m_rollPoly),
+   m_pitchPoly(src.m_pitchPoly),
+   m_headingPoly(src.m_headingPoly),
+   m_lonPoly(src.m_lonPoly),
+   m_latPoly(src.m_latPoly),
+   m_altPoly(src.m_altPoly),
+   m_scanPoly(src.m_scanPoly),
+   m_cam2Platform(src.m_cam2Platform),
+   m_adjustedFocalLength(src.m_adjustedFocalLength)
+{
+}
+
+ossimObject* ossimAlphaSensor::dup()const
+{
+   return new ossimAlphaSensor(*this);
+}
+
+void ossimAlphaSensor::lineSampToWorld(const ossimDpt& imagePoint,
+                                             ossimGpt& worldPt) const
+{
+   ossimEcefRay ray;
+   imagingRay(imagePoint, ray);
+   ossimElevManager::instance()->intersectRay(ray, worldPt);
+}  
+
+void ossimAlphaSensor::lineSampleHeightToWorld(const ossimDpt& imagePoint,
+                                               const double&   heightEllipsoid,
+                                                     ossimGpt& worldPt) const
+{
+   ossimEcefRay ray;
+   imagingRay(imagePoint, ray);
+   ossimEcefPoint pecf(ray.intersectAboveEarthEllipsoid(heightEllipsoid));
+   worldPt = ossimGpt(pecf);
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensorHSI::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 ossimAlphaSensor::setFov(const double fov)
+{
+   m_fov = fov;
+   m_focalLength = (theImageSize.x/2)/tan((m_fov/DEG_PER_RAD)/2);
+}
+
+void ossimAlphaSensor::setRollBias(const double rollBias)
+{
+   m_rollBias = rollBias;
+}
+
+void ossimAlphaSensor::setPitchBias(const double pitchBias)
+{
+   m_pitchBias = pitchBias;
+}
+
+void ossimAlphaSensor::setHeadingBias(const double headingBias)
+{
+   m_headingBias = headingBias;
+}
+
+void ossimAlphaSensor::setSlitRot(const double slitRot)
+{
+   m_slitRot = slitRot;
+}
+
+void ossimAlphaSensor::setRollPoly(const std::vector< ossim_float64 > rollPoly)
+{
+   m_rollPoly = rollPoly;
+}
+
+void ossimAlphaSensor::setPitchPoly(const std::vector< ossim_float64 > pitchPoly)
+{
+   m_pitchPoly = pitchPoly;
+}
+
+void ossimAlphaSensor::setHeadingPoly(const std::vector< ossim_float64 > headingPoly)
+{
+   m_headingPoly = headingPoly;
+}
+
+void ossimAlphaSensor::setLonPoly(const std::vector< ossim_float64 > lonPoly)
+{
+   m_lonPoly = lonPoly;
+}
+
+void ossimAlphaSensor::setLatPoly(const std::vector< ossim_float64 > latPoly)
+{
+   m_latPoly = latPoly;
+}
+
+void ossimAlphaSensor::setAltPoly(const std::vector< ossim_float64 > altPoly)
+{
+   m_altPoly = altPoly;
+}
+
+void ossimAlphaSensor::setScanPoly(const std::vector< ossim_float64 > scanPoly)
+{
+   m_scanPoly = scanPoly;
+}
+
+void ossimAlphaSensor::getPositionOrientation(const ossim_float64& line,
+                                                    ossimEcefPoint& pos,
+                                                    NEWMAT::Matrix& cam2EcfRot) const
+{
+   // Platform position
+   pos = getCameraPosition(line);
+
+   // Local platform orientation
+   NEWMAT::Matrix platform2Local = getPlatform2LocalRot(line);
+
+   // Form local<-ECF matrix
+   ossimGpt posG = ossimGpt(pos);
+   NEWMAT::Matrix local2Ecf = formLLAmat(posG.latr(), posG.lonr(), 0.0);
+
+   // Form full ECF<-camera matrix
+   cam2EcfRot = local2Ecf.t() * platform2Local * m_cam2Platform;
+}
+
+ossimEcefPoint ossimAlphaSensor::getCameraPosition(const ossim_float64& line) const
+{
+   // Interpolate position at given line number
+   ossim_float64 lat = evalPoly(m_latPoly, line);
+   ossim_float64 lon = evalPoly(m_lonPoly, line);
+   ossim_float64 alt = evalPoly(m_altPoly, line);
+   ossimGpt cameraPositionEllipsoid(lat, lon, alt);
+
+   // Update adjusted position
+   double deltap = computeParameterOffset(PARAM_ADJ_LAT_OFFSET)/
+      cameraPositionEllipsoid.metersPerDegree().y;
+   double deltal = computeParameterOffset(PARAM_ADJ_LON_OFFSET)/
+      cameraPositionEllipsoid.metersPerDegree().x;
+   
+   ossimGpt adjustedCameraPosition = ossimGpt(cameraPositionEllipsoid.latd()   + deltap,
+                                              cameraPositionEllipsoid.lond()   + deltal,
+                                              cameraPositionEllipsoid.height() + computeParameterOffset(PARAM_ADJ_ALTITUDE_OFFSET));
+
+   ossimEcefPoint pos(adjustedCameraPosition);
+
+   return pos;
+}
+
+NEWMAT::Matrix ossimAlphaSensor::getPlatform2LocalRot(const ossim_float64& line) const
+{
+   // Interpolate orientation at given line number
+   ossim_float64 roll = evalPoly(m_rollPoly, line);
+   ossim_float64 pitch = evalPoly(m_pitchPoly, line);
+   ossim_float64 heading = evalPoly(m_headingPoly, line);
+
+   // Form orientation matrix
+   NEWMAT::Matrix rmat = formHPRmat(-roll, -pitch, -heading);
+
+   return rmat;
+}
+
+ossim_float64 ossimAlphaSensor::evalPoly(const std::vector<ossim_float64>& polyCoef,
+                                         const ossim_float64& line) const
+{
+   int nCoef = polyCoef.size();
+
+   ossim_float64 result = polyCoef[nCoef-1];
+
+   if (nCoef > 1)
+   {
+      for(int i=nCoef-2; i >= 0 ; --i)
+          result = result * line + polyCoef[i];
+   }
+
+   return result;
+}
+
+void ossimAlphaSensor::updateModel()
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensor::updateModel DEBUG:" << std::endl;
+   }
+
+   // Apply bias corrections
+   double r = ossim::degreesToRadians(m_rollBias    + computeParameterOffset(PARAM_ADJ_ROLL_OFFSET));
+   double p = ossim::degreesToRadians(m_pitchBias   + computeParameterOffset(PARAM_ADJ_PITCH_OFFSET));
+   double h = ossim::degreesToRadians(m_headingBias + computeParameterOffset(PARAM_ADJ_HDG_OFFSET));
+   
+   // Form bias rotation matrix
+   m_cam2Platform = formHPRmat(r, p, h);
+   
+   // Apply focal length correction
+   m_focalLength = (theImageSize.x/2)/tan((m_fov/DEG_PER_RAD)/2);
+   m_adjustedFocalLength = m_focalLength + computeParameterOffset(PARAM_ADJ_FOCAL_LENGTH_OFFSET);
+}
+
+void ossimAlphaSensor::initAdjustableParameters()
+{
+   if (traceExec())
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimAlphaSensor::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);
+   
+   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_HDG_OFFSET, 0.0);
+   setParameterDescription(PARAM_ADJ_HDG_OFFSET, "heading_offset");
+   setParameterUnit(PARAM_ADJ_HDG_OFFSET, "degrees");
+   setParameterSigma(PARAM_ADJ_HDG_OFFSET, 5);
+   
+   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 ossimAlphaSensor::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensor::loadState DEBUG:" << std::endl;
+   }
+
+   theGSD.makeNan();
+   theRefImgPt.makeNan();
+   ossimSensorModel::loadState(kwl, prefix);
+
+   ossimString fov = kwl.find(prefix, "fov");
+   ossimString number_samples = kwl.find(prefix, "number_samples");
+   ossimString number_lines = kwl.find(prefix, "number_lines");
+   ossimString rollBias = kwl.find(prefix, "roll_bias"); 
+   ossimString pitchBias = kwl.find(prefix, "pitch_bias"); 
+   ossimString headingBias = kwl.find(prefix, "heading_bias"); 
+   ossimString slitRot = kwl.find(prefix, "slit_rotation"); 
+
+   ossim_uint32 pcount;
+   const char* lookup;
+
+   // Roll polynomial
+   m_rollPoly.clear();
+   pcount = kwl.numberOf("roll_poly_coeff");
+   if (pcount>0)
+   {
+      ossim_uint32 found = 0;
+      ossim_uint32 count = 0;
+      while ( (found < pcount) && (count < 100) )
+      {
+         ossimString kw = "roll_poly_coeff";
+         kw += ossimString::toString(count);;
+         lookup = kwl.find(prefix, kw.c_str());
+         if (lookup)
+         {
+            ++found;
+            m_rollPoly.push_back(ossimString::toFloat64(lookup));
+         }
+         ++count;
+      }
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimAlphaSensor::loadState() roll_poly_coeff lookup failure..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   // Pitch polynomial
+   m_pitchPoly.clear();
+   pcount = kwl.numberOf("pitch_poly_coeff");
+   if (pcount>0)
+   {
+      ossim_uint32 found = 0;
+      ossim_uint32 count = 0;
+      while ( (found < pcount) && (count < 100) )
+      {
+         ossimString kw = "pitch_poly_coeff";
+         kw += ossimString::toString(count);;
+         lookup = kwl.find(prefix, kw.c_str());
+         if (lookup)
+         {
+            ++found;
+            m_pitchPoly.push_back(ossimString::toFloat64(lookup));
+         }
+         ++count;
+      }
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimAlphaSensor::loadState() pitch_poly_coeff lookup failure..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   // Heading polynomial
+   m_headingPoly.clear();
+   pcount = kwl.numberOf("heading_poly_coeff");
+   if (pcount>0)
+   {
+      ossim_uint32 found = 0;
+      ossim_uint32 count = 0;
+      while ( (found < pcount) && (count < 100) )
+      {
+         ossimString kw = "heading_poly_coeff";
+         kw += ossimString::toString(count);;
+         lookup = kwl.find(prefix, kw.c_str());
+         if (lookup)
+         {
+            ++found;
+            m_headingPoly.push_back(ossimString::toFloat64(lookup));
+         }
+         ++count;
+      }
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimAlphaSensor::loadState() heading_poly_coeff lookup failure..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   // Latitude polynomial
+   m_latPoly.clear();
+   pcount = kwl.numberOf("lat_poly_coeff");
+   if (pcount>0)
+   {
+      ossim_uint32 found = 0;
+      ossim_uint32 count = 0;
+      while ( (found < pcount) && (count < 100) )
+      {
+         ossimString kw = "lat_poly_coeff";
+         kw += ossimString::toString(count);;
+         lookup = kwl.find(prefix, kw.c_str());
+         if (lookup)
+         {
+            ++found;
+            m_latPoly.push_back(ossimString::toFloat64(lookup));
+         }
+         ++count;
+      }
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimAlphaSensor::loadState() lat_poly_coeff lookup failure..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   // Longitude polynomial
+   m_lonPoly.clear();
+   pcount = kwl.numberOf("lon_poly_coeff");
+   if (pcount>0)
+   {
+      ossim_uint32 found = 0;
+      ossim_uint32 count = 0;
+      while ( (found < pcount) && (count < 100) )
+      {
+         ossimString kw = "lon_poly_coeff";
+         kw += ossimString::toString(count);;
+         lookup = kwl.find(prefix, kw.c_str());
+         if (lookup)
+         {
+            ++found;
+            m_lonPoly.push_back(ossimString::toFloat64(lookup));
+         }
+         ++count;
+      }
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimAlphaSensor::loadState() lon_poly_coeff lookup failure..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   // Altitude polynomial
+   m_altPoly.clear();
+   pcount = kwl.numberOf("alt_poly_coeff");
+   if (pcount>0)
+   {
+      ossim_uint32 found = 0;
+      ossim_uint32 count = 0;
+      while ( (found < pcount) && (count < 100) )
+      {
+         ossimString kw = "alt_poly_coeff";
+         kw += ossimString::toString(count);;
+         lookup = kwl.find(prefix, kw.c_str());
+         if (lookup)
+         {
+            ++found;
+            m_altPoly.push_back(ossimString::toFloat64(lookup));
+         }
+         ++count;
+      }
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimAlphaSensor::loadState() alt_poly_coeff lookup failure..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   // Scan angle polynomial
+   m_scanPoly.clear();
+   pcount = kwl.numberOf("scan_poly_coeff");
+   if (pcount>0)
+   {
+      ossim_uint32 found = 0;
+      ossim_uint32 count = 0;
+      while ( (found < pcount) && (count < 100) )
+      {
+         ossimString kw = "scan_poly_coeff";
+         kw += ossimString::toString(count);;
+         lookup = kwl.find(prefix, kw.c_str());
+         if (lookup)
+         {
+            ++found;
+            m_scanPoly.push_back(ossimString::toFloat64(lookup));
+         }
+         ++count;
+      }
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimAlphaSensor::loadState() scan_poly_coeff lookup failure..."
+            << std::endl;
+      }
+      return false;
+   }
+
+
+   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(!fov.empty())
+   {
+      m_fov = fov.toDouble();
+   }
+   if(!rollBias.empty())
+   {
+      m_rollBias = rollBias.toDouble();
+   }
+   if(!pitchBias.empty())
+   {
+      m_pitchBias = pitchBias.toDouble();
+   }
+   if(!headingBias.empty())
+   {
+      m_headingBias = headingBias.toDouble();
+   }
+   if(!slitRot.empty())
+   {
+      m_slitRot = slitRot.toDouble();
+   }
+   
+   updateModel();
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensor::loadState complete..." << std::endl;
+   }
+   
+   return true;
+}
+
+bool ossimAlphaSensor::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   ossimSensorModel::saveState(kwl, prefix);
+   kwl.add(prefix, "roll_bias", ossimString::toString(m_rollBias), true);
+   kwl.add(prefix, "pitch_bias", ossimString::toString(m_pitchBias), true);
+   kwl.add(prefix, "heading_bias", ossimString::toString(m_headingBias), true);
+   kwl.add(prefix, "fov", ossimString::toString(m_fov) ,true);
+   kwl.add(prefix, "slit_rotation", ossimString::toString(m_slitRot) ,true);
+   kwl.add(prefix, "image_size", theImageSize.toString() ,true);
+
+   ossim_uint32 i;
+   for (i = 0; i < m_rollPoly.size(); ++i)
+   {
+      ossimString kw = "roll_poly_coeff";
+      kw += ossimString::toString(i);
+      kwl.add(prefix, kw, m_rollPoly[i]);
+   }
+   for (i = 0; i < m_pitchPoly.size(); ++i)
+   {
+      ossimString kw = "pitch_poly_coeff";
+      kw += ossimString::toString(i);
+      kwl.add(prefix, kw, m_pitchPoly[i]);
+   }
+   for (i = 0; i < m_headingPoly.size(); ++i)
+   {
+      ossimString kw = "heading_poly_coeff";
+      kw += ossimString::toString(i);
+      kwl.add(prefix, kw, m_headingPoly[i]);
+   }
+   for (i = 0; i < m_lonPoly.size(); ++i)
+   {
+      ossimString kw = "lon_poly_coeff";
+      kw += ossimString::toString(i);
+      kwl.add(prefix, kw, m_lonPoly[i]);
+   }
+   for (i = 0; i < m_latPoly.size(); ++i)
+   {
+      ossimString kw = "lat_poly_coeff";
+      kw += ossimString::toString(i);
+      kwl.add(prefix, kw, m_latPoly[i]);
+   }
+   for (i = 0; i < m_altPoly.size(); ++i)
+   {
+      ossimString kw = "alt_poly_coeff";
+      kw += ossimString::toString(i);
+      kwl.add(prefix, kw, m_altPoly[i]);
+   }
+   for (i = 0; i < m_scanPoly.size(); ++i)
+   {
+      ossimString kw = "scan_poly_coeff";
+      kw += ossimString::toString(i);
+      kwl.add(prefix, kw, m_scanPoly[i]);
+   }
+
+   return true;
+}
+
+
+// Form ARINC 705 standard {heading/pitch/roll} rotation matrix
+// Rotates local<-body
+NEWMAT::Matrix ossimAlphaSensor::formHPRmat(const ossim_float64& r,
+                                            const ossim_float64& p,
+                                            const ossim_float64& h)const
+{
+   ossim_float64 cp = cos(p);
+   ossim_float64 sp = sin(p);
+   ossim_float64 ch = cos(h);
+   ossim_float64 sh = sin(h);
+   ossim_float64 cr = cos(r);
+   ossim_float64 sr = sin(r);
+
+   NEWMAT::Matrix rollM   = ossimMatrix3x3::create(  1,  0,  0,
+                                                     0, cr,-sr,
+                                                     0, sr, cr);
+
+   NEWMAT::Matrix pitchM  = ossimMatrix3x3::create( cp,  0, sp,
+                                                     0,  1,  0,
+                                                   -sp,  0, cp);
+
+   NEWMAT::Matrix hdgM    = ossimMatrix3x3::create( ch,-sh,  0,
+                                                    sh, ch,  0,
+                                                     0,  0,  1);
+
+   NEWMAT::Matrix body2LocalRot = hdgM * pitchM * rollM;
+
+   return body2LocalRot;
+}
+
+
+// Form local <- ECF rotation matrix
+NEWMAT::Matrix ossimAlphaSensor::formLLAmat(const ossim_float64& lat,
+                                            const ossim_float64& lon,
+                                            const ossim_float64& az)const
+{
+   ossim_float64 cp = cos(lat);
+   ossim_float64 sp = sin(lat);
+   ossim_float64 cl = cos(lon);
+   ossim_float64 sl = sin(lon);
+   ossim_float64 ca = cos(az);
+   ossim_float64 sa = sin(az);
+
+   NEWMAT::Matrix ecf2LocalRot(3,3);
+   ecf2LocalRot(1,1) = -sl*sa - sp*cl*ca;
+   ecf2LocalRot(1,2) =  cl*sa - sp*sl*ca;
+   ecf2LocalRot(1,3) =  cp*ca;
+   ecf2LocalRot(2,1) =  sl*ca - sp*cl*sa;
+   ecf2LocalRot(2,2) = -cl*ca - sp*sl*sa;
+   ecf2LocalRot(2,3) =  cp*sa;
+   ecf2LocalRot(3,1) =  cp*cl;
+   ecf2LocalRot(3,2) =  cp*sl;
+   ecf2LocalRot(3,3) =  sp;
+
+   return ecf2LocalRot;
+}
diff --git a/src/ossim/projection/ossimAlphaSensorHRI.cpp b/src/ossim/projection/ossimAlphaSensorHRI.cpp
new file mode 100644
index 0000000..6252911
--- /dev/null
+++ b/src/ossim/projection/ossimAlphaSensorHRI.cpp
@@ -0,0 +1,252 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Dave Hicks
+//
+// Description:  Alpha HRI Sensor Model
+//
+//*******************************************************************
+//  $Id$
+#include <ossim/projection/ossimAlphaSensorHRI.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimTrace.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>
+#include <ossim/support_data/ossimAlphaSensorSupportData.h>
+
+static ossimTrace traceExec ("ossimAlphaSensorHRI:exec");
+static ossimTrace traceDebug("ossimAlphaSensorHRI:debug");
+
+RTTI_DEF1(ossimAlphaSensorHRI, "ossimAlphaSensorHRI", ossimSensorModel);
+
+
+ossimAlphaSensorHRI::ossimAlphaSensorHRI()
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensorHRI::ossimAlphaSensorHRI DEBUG:" << std::endl;
+   }
+   initAdjustableParameters();
+   theSensorID = "AlphaHRI";
+}
+
+ossimAlphaSensorHRI::ossimAlphaSensorHRI(const ossimAlphaSensorHRI& src)
+   :
+   ossimAlphaSensor(src)
+{
+}
+
+ossimObject* ossimAlphaSensorHRI::dup()const
+{
+   return new ossimAlphaSensorHRI(*this);
+}
+
+void ossimAlphaSensorHRI::imagingRay(const ossimDpt& imagePoint,
+                                     ossimEcefRay& imageRay) const
+{
+   ossim_float64 line = imagePoint.y;
+
+   ossim_float64 samp = imagePoint.x - theImageSize.x/2;
+
+   // Flip x because raw image is mirrored in sample direction
+   samp = -samp;
+
+
+   // Form camera frame LOS vector
+   ossimColumnVector3d camLOS(0.0, samp, -m_adjustedFocalLength);
+
+   // Compute camera position & orientation matrix
+   ossimEcefPoint platPos;
+   NEWMAT::Matrix cam2EcfRot;
+   getPositionOrientation(line, platPos, cam2EcfRot);
+
+   // Rotate camera vector to ECF
+   ossimColumnVector3d ecfLOS = cam2EcfRot * camLOS.unit();
+
+   // Construct ECF image ray
+   imageRay.setOrigin(platPos);
+   ossimEcefVector ecfRayDir(ecfLOS);
+   imageRay.setDirection(ecfRayDir);
+
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensorHRI::imagingRay DEBUG:\n"
+         << "  imagePoint = " << imagePoint << "\n"
+         << "  imageRay = " << imageRay << "\n"
+         << "  camLOS     = " << camLOS << "\n"
+         << "  platPos    = " << platPos << "\n"
+         << std::endl;
+   }
+
+}
+
+void ossimAlphaSensorHRI::worldToLineSample(const ossimGpt& world_point,
+                                                  ossimDpt& image_point) const
+{   
+   // Initialize at middle
+   ossim_float64 refL = theImageSize.y/2;
+   ossim_float64 drefL = 5;
+   int nIter = 0;
+   ossimColumnVector3d camLOS;
+
+   // Iterate using Newton's method
+   while (nIter<3)
+   {
+      ossim_float64 Fx[2];
+      ossim_float64 refl[2];
+      refl[0] = refL;
+      refl[1] = refL + drefL;
+
+      for (int ll=0; ll<2; ++ll)
+      {
+         // Compute camera position & orientation matrix
+         ossimEcefPoint platPos;
+         NEWMAT::Matrix cam2EcfRot;
+         getPositionOrientation(refl[ll], platPos, cam2EcfRot);
+
+         // Compute ECF vector
+         ossimEcefPoint worldPointECF = ossimEcefPoint(world_point);
+         ossimColumnVector3d ecfLOS = worldPointECF.data() - platPos.data();
+
+         // Rotate to camera frame
+         camLOS = cam2EcfRot.t() * ecfLOS;
+
+         // Set function value
+         Fx[ll] = camLOS[0];
+      }
+
+      // Compute numeric 1st derivative & new estimate for reference line (refL)
+      ossim_float64 dFx = (Fx[1]-Fx[0]) / drefL;
+      refL -= Fx[0]/dFx;
+
+      nIter++;
+   }
+
+   ossim_float64 samp = -m_adjustedFocalLength*camLOS[1]/camLOS[2] + theImageSize.x/2;
+
+   // Flip x because raw image is mirrored in sample direction
+   samp = theImageSize.x - samp;
+
+   ossimDpt p(samp, refL);
+    
+   image_point = p;
+}
+
+void ossimAlphaSensorHRI::updateModel()
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensorHRI::updateModel DEBUG:" << std::endl;
+   }
+   ossimAlphaSensor::updateModel();
+     
+   try
+   {
+      computeGsd();
+   }
+   catch(...)
+   {
+      
+   }
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensorHRI::updateModel complete..." << std::endl;
+   }
+
+   // Ref point
+   lineSampleToWorld(theRefImgPt, theRefGndPt);
+
+
+   // Bounding rectangle
+   ossimGpt gpt;
+   theBoundGndPolygon.clear();
+
+   lineSampleToWorld(theImageClipRect.ul(),gpt); //+ossimDpt(-w, -h), gpt);
+   theBoundGndPolygon.addPoint(gpt.lond(), gpt.latd());
+
+   lineSampleToWorld(theImageClipRect.ur(),gpt); //+ossimDpt(w, -h), gpt);
+   theBoundGndPolygon.addPoint(gpt.lond(), gpt.latd());
+
+   lineSampleToWorld(theImageClipRect.lr(),gpt); //+ossimDpt(w, h), gpt);
+   theBoundGndPolygon.addPoint(gpt.lond(), gpt.latd());
+
+   lineSampleToWorld(theImageClipRect.ll(),gpt); //+ossimDpt(-w, h), gpt);
+   theBoundGndPolygon.addPoint(gpt.lond(), gpt.latd());
+}
+
+void ossimAlphaSensorHRI::initAdjustableParameters()
+{
+   if (traceExec())
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimAlphaSensorHRI::initAdjustableParameters: returning..." << std::endl;
+
+   ossimAlphaSensor::initAdjustableParameters();
+}
+
+bool ossimAlphaSensorHRI::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensorHRI::loadState DEBUG:" << std::endl;
+   }
+
+   ossimAlphaSensor::loadState(kwl, prefix);
+   if(getNumberOfAdjustableParameters() < 1)
+   {
+      initAdjustableParameters();
+   }
+
+   updateModel();
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensorHRI::loadState complete..." << std::endl;
+   }
+   
+   return true;
+}
+
+bool ossimAlphaSensorHRI::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   ossimAlphaSensor::saveState(kwl, prefix);
+
+   return true;
+}
+
+bool ossimAlphaSensorHRI::initialize( const ossimAlphaSensorSupportData& supData )
+{
+   bool result = true; // Currently no error checking.
+
+   ossimDpt imageSize = supData.getImageSize();
+   setImageSize(imageSize);
+   setImageRect(ossimDrect(0,0,imageSize.x-1, imageSize.y-1));
+   setRefImgPt(ossimDpt(imageSize.x*.5, imageSize.y*.5));
+   
+   setFov(supData.getFov());
+   setRollBias(supData.getRollBias());
+   setPitchBias(supData.getPitchBias());
+   setHeadingBias(supData.getHeadingBias());
+   setSlitRot(supData.getSlitRot());
+   
+   setRollPoly(supData.getRollPoly());
+   setPitchPoly(supData.getPitchPoly());
+   setHeadingPoly(supData.getHeadingPoly());
+   setLonPoly(supData.getLonPoly());
+   setLatPoly(supData.getLatPoly());
+   setAltPoly(supData.getAltPoly());
+   setScanPoly(supData.getScanPoly());
+   
+   updateModel();
+
+   return result;
+}
diff --git a/src/ossim/projection/ossimAlphaSensorHSI.cpp b/src/ossim/projection/ossimAlphaSensorHSI.cpp
new file mode 100644
index 0000000..4d658b4
--- /dev/null
+++ b/src/ossim/projection/ossimAlphaSensorHSI.cpp
@@ -0,0 +1,257 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Dave Hicks
+//
+// Description:  Alpha HSI Sensor Model
+//
+//*******************************************************************
+//  $Id$
+#include <ossim/projection/ossimAlphaSensorHSI.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimTrace.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>
+#include <ossim/support_data/ossimAlphaSensorSupportData.h>
+
+static ossimTrace traceExec ("ossimAlphaSensorHSI:exec");
+static ossimTrace traceDebug("ossimAlphaSensorHSI:debug");
+
+RTTI_DEF1(ossimAlphaSensorHSI, "ossimAlphaSensorHSI", ossimSensorModel);
+
+
+ossimAlphaSensorHSI::ossimAlphaSensorHSI()
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensorHSI::ossimAlphaSensorHSI DEBUG:" << std::endl;
+   }
+   initAdjustableParameters();
+   theSensorID = "AlphaHSI";
+}
+
+ossimAlphaSensorHSI::ossimAlphaSensorHSI(const ossimAlphaSensorHSI& src)
+   :
+   ossimAlphaSensor(src)
+{
+}
+
+ossimObject* ossimAlphaSensorHSI::dup()const
+{
+   return new ossimAlphaSensorHSI(*this);
+}
+
+void ossimAlphaSensorHSI::imagingRay(const ossimDpt& imagePoint,
+                                     ossimEcefRay& imageRay) const
+{
+   ossim_float64 line = imagePoint.y;
+
+   // Form camera frame LOS vector
+   ossim_float64 scanAngle = getScanAngle(line);
+   ossimColumnVector3d camLOS(imagePoint.x - theImageSize.x/2,
+                              m_adjustedFocalLength * tan(scanAngle),
+                              m_adjustedFocalLength);
+
+   // Compute camera position & orientation matrix
+   ossimEcefPoint platPos;
+   NEWMAT::Matrix cam2EcfRot;
+   getPositionOrientation(line, platPos, cam2EcfRot);
+
+   // Rotate camera vector to ECF
+   ossimColumnVector3d ecfLOS = cam2EcfRot * camLOS.unit();
+
+   // Construct ECF image ray
+   imageRay.setOrigin(platPos);
+   ossimEcefVector ecfRayDir(ecfLOS);
+   imageRay.setDirection(ecfRayDir);
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensorHSI::imagingRay DEBUG:\n"
+         << "  imagePoint = " << imagePoint << "\n"
+         << "  imageRay = " << imageRay << "\n"
+         << "  camLOS     = " << camLOS << "\n"
+         << "  platPos    = " << platPos << "\n"
+         << std::endl;
+   }
+
+}
+
+void ossimAlphaSensorHSI::worldToLineSample(const ossimGpt& world_point,
+                                                  ossimDpt& image_point) const
+{   
+   // Initialize at middle
+   ossim_float64 refL = theImageSize.y/2;
+   ossim_float64 drefL = 5;
+   int nIter = 0;
+   ossimColumnVector3d camLOS;
+   ossimColumnVector3d camLOS1;
+
+   // Iterate using Newton's method
+   while (nIter<3)
+   {
+      ossim_float64 Fx[2];
+      ossim_float64 refl[2];
+      refl[0] = refL;
+      refl[1] = refL + drefL;
+
+      for (int ll=0; ll<2; ++ll)
+      {
+         // Compute camera position & orientation matrix
+         ossimEcefPoint platPos;
+         NEWMAT::Matrix cam2EcfRot;
+         getPositionOrientation(refl[ll], platPos, cam2EcfRot);
+
+         // Compute ECF vector
+         ossimEcefPoint worldPointECF = ossimEcefPoint(world_point);
+         ossimColumnVector3d ecfLOS = worldPointECF.data() - platPos.data();
+
+         // Rotate to camera frame
+         camLOS = cam2EcfRot.t() * ecfLOS;
+         if (ll==0)
+            camLOS1 = camLOS;
+
+         // Set function value
+         ossim_float64 cScanAngle = atan(camLOS[1]/camLOS[2]);
+         ossim_float64 scanAngle = getScanAngle(refl[ll]);
+         Fx[ll] = cScanAngle - scanAngle;
+      }
+
+      // Compute numeric 1st derivative & new estimate for reference line (refL)
+      ossim_float64 dFx = (Fx[1]-Fx[0]) / drefL;
+      refL -= Fx[0]/dFx;
+
+      nIter++;
+   }
+
+   ossim_float64 samp = m_adjustedFocalLength*camLOS1[0]/camLOS1[2] + theImageSize.x/2;
+
+   ossimDpt p(samp, refL);
+    
+   image_point = p;
+}
+
+ossim_float64 ossimAlphaSensorHSI::getScanAngle(const ossim_float64& line) const
+{
+   ossim_float64 scanAngle = evalPoly(m_scanPoly, line);
+
+   return scanAngle;
+}
+
+void ossimAlphaSensorHSI::updateModel()
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensorHSI::updateModel DEBUG:" << std::endl;
+   }
+   ossimAlphaSensor::updateModel();  
+     
+   try
+   {
+      computeGsd();
+   }
+   catch(...)
+   {
+      
+   }
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensorHSI::updateModel complete..." << std::endl;
+   }
+
+   // Ref point
+   lineSampleToWorld(theRefImgPt, theRefGndPt);
+
+
+   // Bounding rectangle
+   ossimGpt gpt;
+   theBoundGndPolygon.clear();
+   
+   lineSampleToWorld(theImageClipRect.ul(),gpt); //+ossimDpt(-w, -h), gpt);
+   theBoundGndPolygon.addPoint(gpt.lond(), gpt.latd());
+
+   lineSampleToWorld(theImageClipRect.ur(),gpt); //+ossimDpt(w, -h), gpt);
+   theBoundGndPolygon.addPoint(gpt.lond(), gpt.latd());
+
+   lineSampleToWorld(theImageClipRect.lr(),gpt); //+ossimDpt(w, h), gpt);
+   theBoundGndPolygon.addPoint(gpt.lond(), gpt.latd());
+
+   lineSampleToWorld(theImageClipRect.ll(),gpt); //+ossimDpt(-w, h), gpt);
+   theBoundGndPolygon.addPoint(gpt.lond(), gpt.latd());
+}
+
+void ossimAlphaSensorHSI::initAdjustableParameters()
+{
+   if (traceExec())
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimAlphaSensorHSI::initAdjustableParameters: returning..." << std::endl;
+
+   ossimAlphaSensor::initAdjustableParameters();
+}
+
+bool ossimAlphaSensorHSI::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensorHSI::loadState DEBUG:" << std::endl;
+   }
+
+   ossimAlphaSensor::loadState(kwl, prefix);
+   if(getNumberOfAdjustableParameters() < 1)
+   {
+      initAdjustableParameters();
+   }
+   
+   updateModel();
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensorHSI::loadState complete..." << std::endl;
+   }
+   
+   return true;
+}
+
+bool ossimAlphaSensorHSI::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   ossimAlphaSensor::saveState(kwl, prefix);
+
+   return true;
+}
+
+bool ossimAlphaSensorHSI::initialize( const ossimAlphaSensorSupportData& supData )
+{
+   bool result = true; // Currently no error checking.
+
+   ossimDpt imageSize = supData.getImageSize();
+   setImageSize(imageSize);
+   setImageRect(ossimDrect(0,0,imageSize.x-1, imageSize.y-1));
+   setRefImgPt(ossimDpt(imageSize.x*.5, imageSize.y*.5));
+   
+   setFov(supData.getFov());
+   setRollBias(supData.getRollBias());
+   setPitchBias(supData.getPitchBias());
+   setHeadingBias(supData.getHeadingBias());
+   setSlitRot(supData.getSlitRot());
+   
+   setRollPoly(supData.getRollPoly());
+   setPitchPoly(supData.getPitchPoly());
+   setHeadingPoly(supData.getHeadingPoly());
+   setLonPoly(supData.getLonPoly());
+   setLatPoly(supData.getLatPoly());
+   setAltPoly(supData.getAltPoly());
+   setScanPoly(supData.getScanPoly());
+
+   updateModel();
+
+   return result;
+}
diff --git a/src/ossim/projection/ossimApplanixEcefModel.cpp b/src/ossim/projection/ossimApplanixEcefModel.cpp
index 8da66ce..e360de7 100644
--- a/src/ossim/projection/ossimApplanixEcefModel.cpp
+++ b/src/ossim/projection/ossimApplanixEcefModel.cpp
@@ -7,7 +7,7 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimApplanixEcefModel.cpp 17206 2010-04-25 23:20:40Z dburken $
+//  $Id: ossimApplanixEcefModel.cpp 22271 2013-05-27 18:24:22Z gpotts $
 #include <sstream>
 #include <ossim/projection/ossimApplanixEcefModel.h>
 #include <ossim/base/ossimEllipsoid.h>
@@ -28,7 +28,7 @@ static ossimTrace traceDebug("ossimApplanixEcefModel:debug");
 RTTI_DEF1(ossimApplanixEcefModel, "ossimApplanixEcefModel", ossimSensorModel);
 
 #ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimApplanixEcefModel.cpp 17206 2010-04-25 23:20:40Z dburken $";
+static const char OSSIM_ID[] = "$Id: ossimApplanixEcefModel.cpp 22271 2013-05-27 18:24:22Z gpotts $";
 #endif
 
 ossimApplanixEcefModel::ossimApplanixEcefModel()
@@ -175,12 +175,12 @@ void ossimApplanixEcefModel::lineSampleToWorld(const ossimDpt& image_point,
    //***
    // Extrapolate if image point is outside image:
    //***
-   if (!insideImage(image_point))
-   {
-      gpt.makeNan();
+//   if (!insideImage(image_point))
+//   {
+//      gpt.makeNan();
 //       gpt = extrapolate(image_point);
-      return;
-   }
+//      return;
+//   }
 
    //***
    // Determine imaging ray and invoke elevation source object's services to
@@ -230,9 +230,9 @@ void ossimApplanixEcefModel::worldToLineSample(const ossimGpt& world_point,
    {
       if (!(theBoundGndPolygon.pointWithin(world_point)))
       {
-         image_point.makeNan();
+//         image_point.makeNan();
 //          image_point = extrapolate(world_point);
-         return;
+//         return;
       }         
    }
    ossimEcefPoint g_ecf(world_point);
@@ -285,16 +285,18 @@ void ossimApplanixEcefModel::updateModel()
    theCompositeMatrixInverse = theCompositeMatrix.i();
 
    theBoundGndPolygon.resize(4);
-   ossim_float64 w = theImageClipRect.width()*2.0;
-   ossim_float64 h = theImageClipRect.height()*2.0;
-   
-   lineSampleToWorld(theImageClipRect.ul()+ossimDpt(-w, -h), gpt);
+   // 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()+ossimDpt(w, -h), gpt);
+   lineSampleToWorld(theImageClipRect.ur(),gpt);//+ossimDpt(w, -h), gpt);
    theBoundGndPolygon[1] = gpt;
-   lineSampleToWorld(theImageClipRect.lr()+ossimDpt(w, h), gpt);
+   lineSampleToWorld(theImageClipRect.lr(),gpt);//+ossimDpt(w, h), gpt);
    theBoundGndPolygon[2] = gpt;
-   lineSampleToWorld(theImageClipRect.ll()+ossimDpt(-w, h), gpt);
+   lineSampleToWorld(theImageClipRect.ll(),gpt);//+ossimDpt(-w, h), gpt);
    theBoundGndPolygon[3] = gpt;
 }
 
@@ -425,7 +427,7 @@ bool ossimApplanixEcefModel::loadState(const ossimKeywordlist& kwl,
    theRoll    = 0.0;
    thePitch   = 0.0;
    theHeading = 0.0;
-   bool computeGsdFlag = false;
+   // bool computeGsdFlag = false;
    const char* roll              = kwl.find(prefix, "roll");
    const char* pitch             = kwl.find(prefix, "pitch");
    const char* heading           = kwl.find(prefix, "heading");
@@ -489,7 +491,7 @@ bool ossimApplanixEcefModel::loadState(const ossimKeywordlist& kwl,
       {
          return false;
       }
-      computeGsdFlag = true;
+      // computeGsdFlag = true;
    }
    else
    {
@@ -609,23 +611,48 @@ bool ossimApplanixEcefModel::loadState(const ossimKeywordlist& kwl,
          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;
-      for(idx = 0; idx < 26; ++idx)
+      std::vector<int> numberList(numberOfDistortions);
+      for(idx = 0; idx < numberList.size();++idx)
       {
-         const char* value = cameraKwl.find(ossimString("d")+ossimString::toString(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;
 
-         if(value)
+      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.split(splitString, ossimString(" "));
-            double distance = 0.0;
-            double distortion = 0.0;
-            if(splitString.size() == 2)
+            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,
@@ -757,6 +784,7 @@ bool ossimApplanixEcefModel::loadState(const ossimKeywordlist& kwl,
                                           << "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;
diff --git a/src/ossim/projection/ossimApplanixUtmModel.cpp b/src/ossim/projection/ossimApplanixUtmModel.cpp
index 95b283f..b60c0d4 100644
--- a/src/ossim/projection/ossimApplanixUtmModel.cpp
+++ b/src/ossim/projection/ossimApplanixUtmModel.cpp
@@ -6,7 +6,7 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimApplanixUtmModel.cpp 16104 2009-12-17 18:09:59Z gpotts $
+//  $Id: ossimApplanixUtmModel.cpp 21214 2012-07-03 16:20:11Z dburken $
 #include <sstream>
 #include <ossim/projection/ossimApplanixUtmModel.h>
 #include <ossim/base/ossimEllipsoid.h>
@@ -26,7 +26,7 @@ static ossimTrace traceDebug("ossimApplanixUtmModel:debug");
 RTTI_DEF1(ossimApplanixUtmModel, "ossimApplanixUtmModel", ossimSensorModel);
 
 #ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimApplanixUtmModel.cpp 16104 2009-12-17 18:09:59Z gpotts $";
+static const char OSSIM_ID[] = "$Id: ossimApplanixUtmModel.cpp 21214 2012-07-03 16:20:11Z dburken $";
 #endif
 
 ossimApplanixUtmModel::ossimApplanixUtmModel()
@@ -144,12 +144,12 @@ void ossimApplanixUtmModel::lineSampleToWorld(const ossimDpt& image_point,
    //***
    // Extrapolate if image point is outside image:
    //***
-   if (!insideImage(image_point))
-   {
-      gpt.makeNan();
+  // if (!insideImage(image_point))
+  // {
+   //   gpt.makeNan();
 //       gpt = extrapolate(image_point);
-      return;
-   }
+   //   return;
+   //}
 
    //***
    // Determine imaging ray and invoke elevation source object's services to
@@ -174,12 +174,12 @@ void ossimApplanixUtmModel::lineSampleHeightToWorld(const ossimDpt& image_point,
                                                  const double&   heightEllipsoid,
                                                  ossimGpt&       worldPoint) const
 {
-   if (!insideImage(image_point))
-   {
-      worldPoint.makeNan();
+//   if (!insideImage(image_point))
+//   {
+      //worldPoint.makeNan();
 //       worldPoint = extrapolate(image_point, heightEllipsoid);
-   }
-   else
+//   }
+//   else
    {
       //***
       // First establish imaging ray from image point:
@@ -194,6 +194,7 @@ void ossimApplanixUtmModel::lineSampleHeightToWorld(const ossimDpt& image_point,
 void ossimApplanixUtmModel::worldToLineSample(const ossimGpt& world_point,
                                            ossimDpt&       image_point) const
 {
+#if 0
    if((theBoundGndPolygon.getNumberOfVertices() > 0)&&
       (!theBoundGndPolygon.hasNans()))
    {
@@ -204,6 +205,7 @@ void ossimApplanixUtmModel::worldToLineSample(const ossimGpt& world_point,
          return;
       }         
    }
+#endif
    ossimEcefPoint g_ecf(world_point);
    ossimEcefVector ecfRayDir(g_ecf - theAdjEcefPlatformPosition);
    ossimColumnVector3d camRayDir (theCompositeMatrixInverse*ecfRayDir.data());
@@ -302,16 +304,16 @@ void ossimApplanixUtmModel::updateModel()
 //   theAdjEcefPlatformPosition = theEcefPlatformPosition; 
 
    theBoundGndPolygon.resize(4);
-   ossim_float64 w = theImageClipRect.width()*2.0;
-   ossim_float64 h = theImageClipRect.height()*2.0;
+   // ossim_float64 w = theImageClipRect.width();//*2.0;
+   // ossim_float64 h = theImageClipRect.height();//*2.0;
    
-   lineSampleToWorld(theImageClipRect.ul()+ossimDpt(-w, -h), gpt);
+   lineSampleToWorld(theImageClipRect.ul(),gpt);//+ossimDpt(-w, -h), gpt);
    theBoundGndPolygon[0] = gpt;
-   lineSampleToWorld(theImageClipRect.ur()+ossimDpt(w, -h), gpt);
+   lineSampleToWorld(theImageClipRect.ur(),gpt);//+ossimDpt(w, -h), gpt);
    theBoundGndPolygon[1] = gpt;
-   lineSampleToWorld(theImageClipRect.lr()+ossimDpt(w, h), gpt);
+   lineSampleToWorld(theImageClipRect.lr(),gpt);//+ossimDpt(w, h), gpt);
    theBoundGndPolygon[2] = gpt;
-   lineSampleToWorld(theImageClipRect.ll()+ossimDpt(-w, h), gpt);
+   lineSampleToWorld(theImageClipRect.ll(),gpt);//+ossimDpt(-w, h), gpt);
    theBoundGndPolygon[3] = gpt;
 }
 
@@ -664,7 +666,7 @@ bool ossimApplanixUtmModel::loadState(const ossimKeywordlist& kwl,
          }
          if(splitString.size() > 3)
          {
-            datumString = splitString[3];
+            datumString = splitString[3].string();
          }
          thePlatformPosition.latd(lat);
          thePlatformPosition.lond(lon);
@@ -792,23 +794,46 @@ bool ossimApplanixUtmModel::loadState(const ossimKeywordlist& kwl,
          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;
-      for(idx = 0; idx < 26; ++idx)
+      std::vector<int> numberList(numberOfDistortions);
+      for(idx = 0; idx < numberList.size();++idx)
       {
-         const char* value = cameraKwl.find(ossimString("d")+ossimString::toString(idx));
-
-         if(value)
+         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);
-            double distance=0.0, distortion=0.0;
             tempString = tempString.trim();
             tempString.split(splitString, " ");
-            if(splitString.size() == 2)
+            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),
@@ -824,7 +849,7 @@ bool ossimApplanixUtmModel::loadState(const ossimKeywordlist& kwl,
          if(pixel_size)
          {
             lensKwl.add("dxdy",
-                        ossimString(pixel_size) + " " + ossimString(pixel_size),
+                        ossimString::toString(thePixelSize.x) + " " +ossimString::toString(thePixelSize.y),
                         true);
          }
          else
@@ -848,7 +873,7 @@ bool ossimApplanixUtmModel::loadState(const ossimKeywordlist& kwl,
          ossimString tempString(principal_point);
          tempString = tempString.trim();
          tempString.split(splitString, " ");
-         if(splitString.size() == 2)
+         if(splitString.size() >= 2)
          {
             thePrincipalPoint.x = splitString[0].toDouble();
             thePrincipalPoint.y = splitString[1].toDouble();
diff --git a/src/ossim/projection/ossimBilinearProjection.cpp b/src/ossim/projection/ossimBilinearProjection.cpp
index 1e5f728..850020d 100644
--- a/src/ossim/projection/ossimBilinearProjection.cpp
+++ b/src/ossim/projection/ossimBilinearProjection.cpp
@@ -5,7 +5,7 @@
 // Author: Garrett Potts
 // 
 //********************************************************************
-// $Id: ossimBilinearProjection.cpp 19009 2011-03-04 15:56:31Z gpotts $
+// $Id: ossimBilinearProjection.cpp 19682 2011-05-31 14:21:20Z dburken $
 
 #include <sstream>
 using namespace std;
@@ -25,7 +25,7 @@ using namespace std;
 #include <ossim/base/ossimTieGptSet.h>
 
 #ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimBilinearProjection.cpp 19009 2011-03-04 15:56:31Z gpotts $";
+static const char OSSIM_ID[] = "$Id: ossimBilinearProjection.cpp 19682 2011-05-31 14:21:20Z dburken $";
 #endif
 
 // static const ossim_uint32 MINIMUM_NMBER_OF_POINTS = 4;
@@ -267,8 +267,7 @@ bool ossimBilinearProjection::loadState(const ossimKeywordlist& kwl,
          if (lookup)
          {
             ossimGpt gp;
-            istringstream is(lookup);
-            is >> gp;
+            gp.toPoint(std::string(lookup));
             
             //---
             // Allow for "nan" height values by substituting with 0.0 so the
@@ -290,8 +289,7 @@ bool ossimBilinearProjection::loadState(const ossimKeywordlist& kwl,
          if (lookup)
          {
             ossimDpt dp;
-            istringstream is(lookup);
-            is >> dp;
+            dp.toPoint(std::string(lookup));
             theLineSamplePt.push_back(dp);
          }
       }
diff --git a/src/ossim/projection/ossimBuckeyeSensor.cpp b/src/ossim/projection/ossimBuckeyeSensor.cpp
index 9975549..3d1896f 100644
--- a/src/ossim/projection/ossimBuckeyeSensor.cpp
+++ b/src/ossim/projection/ossimBuckeyeSensor.cpp
@@ -1,400 +1,623 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// 
-//*******************************************************************
-//  $Id$
-#include <ossim/projection/ossimBuckeyeSensor.h>
-#include <ossim/projection/ossimUtmProjection.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/base/ossimCsvFile.h>
-#include <ossim/elevation/ossimElevManager.h>
-static ossimTrace traceDebug("ossimBuckeyeSensor:debug");
-
-RTTI_DEF1(ossimBuckeyeSensor, "ossimBuckeyeSensor", ossimSensorModel);
-
-ossimBuckeyeSensor::ossimBuckeyeSensor()
-{
-   m_lensDistortion = new ossimSmacCallibrationSystem;
-   initAdjustableParameters();
-}
-void ossimBuckeyeSensor::imagingRay(const ossimDpt& image_point,
-                                   ossimEcefRay&   image_ray) const
-{
-   ossimDpt f1 ((image_point) - theRefImgPt);
-   f1.x *= m_pixelSize.x;
-   f1.y *= -m_pixelSize.y;
-   ossimDpt film (f1 - m_principalPoint);
-   if (m_lensDistortion.valid())
-   {
-      ossimDpt filmOut;
-      m_lensDistortion->undistort(film, filmOut);
-      film = filmOut;
-   }
-   
-   ossimColumnVector3d cam_ray_dir (film.x,
-                                    film.y,
-                                    -(m_focalLength+computeParameterOffset(6)));
-   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_ecefPlatformPosition);
-   image_ray.setDirection(ecf_ray_dir);
-}
-
-void ossimBuckeyeSensor::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 ossimBuckeyeSensor::lineSampleToWorld(const ossimDpt& image_point,
-                                          ossimGpt&       gpt) const
-{
-   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 ossimSensorModel::lineSampleToWorld: returning..." << std::endl;
-   return;
-   
-}
-
-#if 0
-void ossimBuckeyeSensor::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_ecefPlatformPosition);
-   ossimColumnVector3d camRayDir (m_compositeMatrixInverse*ecfRayDir.data());
-   
-   
-   double scale = -m_focalLength/camRayDir[2];
-   ossimDpt film (scale*camRayDir[0], scale*camRayDir[1]);
-   
-   if (m_lensDistortion.valid())
-   {
-      ossimDpt filmOut;
-      m_lensDistortion->distort(film, filmOut);
-      film = filmOut;
-   }
-   
-   ossimDpt f1(film + m_principalPoint);
-   ossimDpt p1(f1.x/m_pixelSize.x,
-               -f1.y/m_pixelSize.y);
-   
-   ossimDpt p0 (p1.x + theRefImgPt.x,
-                p1.y + theRefImgPt.y);
-   
-   image_point = p0;
-}
-#endif
-void ossimBuckeyeSensor::updateModel()
-{
-   ossimGpt gpt;
-   ossimGpt wgs84Pt;
-   double metersPerDegree = wgs84Pt.metersPerDegree().y;
-   double degreePerMeter = 1.0/metersPerDegree;
-   double latShift = computeParameterOffset(1)*degreePerMeter;
-   double lonShift = computeParameterOffset(0)*degreePerMeter;
-   
-   gpt = m_platformPosition;
-   double height = gpt.height();
-   gpt.height(height + computeParameterOffset(5));
-   gpt.latd(gpt.latd() + latShift);
-   gpt.lond(gpt.lond() + lonShift);
-   
-   m_ecefPlatformPosition = gpt;
-   ossimLsrSpace lsrSpace(m_ecefPlatformPosition, m_yaw+computeParameterOffset(4));
-   
-   NEWMAT::Matrix platformLsrMatrix = lsrSpace.lsrToEcefRotMatrix();
-   NEWMAT::Matrix orientationMatrix = (                                      
-                                       ossimMatrix3x3::createRotationXMatrix(m_pitch+computeParameterOffset(3), OSSIM_LEFT_HANDED)
-                                       *ossimMatrix3x3::createRotationYMatrix(m_roll+computeParameterOffset(2), OSSIM_LEFT_HANDED)
-            //                           ossimMatrix3x3::createRotationYMatrix(m_pitch+computeParameterOffset(2), OSSIM_RIGHT_HANDED)
-            //                           *ossimMatrix3x3::createRotationXMatrix(m_roll+computeParameterOffset(3), OSSIM_RIGHT_HANDED)
-                                      );
-   
-   m_compositeMatrix         = platformLsrMatrix*orientationMatrix;
-   m_compositeMatrixInverse  = m_compositeMatrix.i();
-   
-   
-   theBoundGndPolygon.resize(4);
-   ossim_float64 w = theImageClipRect.width()*2.0;
-   ossim_float64 h = theImageClipRect.height()*2.0;
-   lineSampleToWorld(theImageClipRect.ul()+ossimDpt(-w, -h), gpt);
-   theBoundGndPolygon[0] = gpt;
-   lineSampleToWorld(theImageClipRect.ur()+ossimDpt(w, -h), gpt);
-   theBoundGndPolygon[1] = gpt;
-   lineSampleToWorld(theImageClipRect.lr()+ossimDpt(w, h), gpt);
-   theBoundGndPolygon[2] = gpt;
-   lineSampleToWorld(theImageClipRect.ll()+ossimDpt(-w, h), gpt);
-   theBoundGndPolygon[3] = gpt;
-   lineSampleToWorld(theRefImgPt, theRefGndPt);
-}
-
-void ossimBuckeyeSensor::initAdjustableParameters()
-{
-   resizeAdjustableParameterArray(7);
-   
-   setAdjustableParameter(0, 0.0);
-   setParameterDescription(0, "x_offset");
-   setParameterUnit(0, "meters");
-   
-   setAdjustableParameter(1, 0.0);
-   setParameterDescription(1, "y_offset");
-   setParameterUnit(1, "meters");
-   
-   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, "yaw");
-   setParameterUnit(4, "degrees");
-   
-   setAdjustableParameter(5, 0.0);
-   setParameterDescription(5, "Altitude delta");
-   setParameterUnit(5, "meters");
-   
-   setAdjustableParameter(6, 0.0);
-   setParameterDescription(6, "focal length delta");
-   setParameterUnit(6, "millimeters");
-   
-   setParameterSigma(0, 10);
-   setParameterSigma(1, 10);
-   setParameterSigma(2, 1);
-   setParameterSigma(3, 1);
-   setParameterSigma(4, 5);
-   setParameterSigma(5, 100);
-   setParameterSigma(6, 50);
-}
-
-bool ossimBuckeyeSensor::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   if(getNumberOfAdjustableParameters() < 1)
-   {
-      initAdjustableParameters();
-   }
-   theGSD.makeNan();
-   theRefImgPt.makeNan();
-   ossimSensorModel::loadState(kwl, prefix);
-   if(theRefImgPt.hasNans())
-   {
-      theRefImgPt = theImageClipRect.midPoint();
-   }
-   ossimString framemeta_gsti = kwl.find(prefix, "framemeta_gsti");
-   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;
-   m_roll    = 0;
-   m_pitch   = 0;
-   m_yaw     = 0;
-   if(!framemeta_gsti.empty()&&
-      !frame_number.empty())
-   {
-      ossimCsvFile csv(" \t"); // we will use tab or spaces as seaparator
-      if(csv.open(framemeta_gsti))
-      {
-         if(csv.readHeader())
-         {
-            ossimRefPtr<ossimCsvFile::Record> record;
-            bool foundFrameNumber = false;
-            while( ((record = csv.nextRecord()).valid()) && !foundFrameNumber)
-            {
-               if( (*record)["Frame#"] == frame_number)
-               {
-                  foundFrameNumber = true;
-                  roll = (*record)["Roll(deg)"];
-                  pitch = (*record)["Pitch(deg)"];
-                  yaw = (*record)["Yaw(deg)"];
-                  platform_position = "(" + (*record)["Lat(deg)"] + "," 
-                                          + (*record)["Lon(deg)"]+ ","
-                                          + (*record)["HAE(m)"] + ",WGE)";
-               }
-            }
-         }
-      }
-   }
-   else
-   {
-      roll = kwl.find(prefix, "roll"); 
-      pitch = kwl.find(prefix, "pitch"); 
-      yaw = kwl.find(prefix, "yaw"); 
-      platform_position = kwl.find(prefix, "platform_position");
-   }
-   bool result = (!pixel_size.empty()&&
-                  !principal_point.empty()&&
-                  !focal_length.empty()&&
-                  !platform_position.empty());
-   
-   if(!focal_length.empty())
-   {
-      m_focalLength = focal_length.toDouble();
-   }
-   if(!pixel_size.empty())
-   {
-      m_pixelSize.toPoint(pixel_size);
-   }
-   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_platformPosition.toPoint(platform_position);
-   }
-   m_lensDistortion = 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))
-      {
-         m_lensDistortion = new ossimSmacCallibrationSystem(radial[0].toDouble(),
-                                                            radial[1].toDouble(),
-                                                            radial[2].toDouble(),
-                                                            radial[3].toDouble(),
-                                                            radial[4].toDouble(),
-                                                            decent[0].toDouble(),
-                                                            decent[1].toDouble(),
-                                                            decent[2].toDouble(),
-                                                            decent[3].toDouble());
-      }
-   }
-   theImageSize = ossimDpt(theImageClipRect.width(),
-                           theImageClipRect.height());
-   
-   updateModel();
-   
-   if(theGSD.isNan())
-   {
-      try
-      {
-         // This will set theGSD and theMeanGSD. Method throws ossimException.
-         computeGsd();
-      }
-      catch (const ossimException& e)
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimBuckeyeSensor::loadState Caught Exception:\n"
-               << e.what() << std::endl;
-         }
-      }
-   }
-   
-   return result;
-}
-
-bool ossimBuckeyeSensor::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, "principal_point", m_principalPoint.toString(), true);
-   kwl.add(prefix, "pixel_size", m_pixelSize.toString(), true);
-   if(m_lensDistortion.valid())
-   {
-      kwl.add(prefix, "smac_radial",
-              ossimString::toString(m_lensDistortion->symmetricRadialDistortionCoefficients()[0], 20) + " " + 
-              ossimString::toString(m_lensDistortion->symmetricRadialDistortionCoefficients()[1], 20) + " " +
-              ossimString::toString(m_lensDistortion->symmetricRadialDistortionCoefficients()[2], 20) + " " +
-              ossimString::toString(m_lensDistortion->symmetricRadialDistortionCoefficients()[3], 20) + " " +
-              ossimString::toString(m_lensDistortion->symmetricRadialDistortionCoefficients()[4], 20)
-              ,true);
-      kwl.add(prefix, "smac_decent",
-              ossimString::toString(m_lensDistortion->decenteringDistortionCoefficients()[0], 20) + " " + 
-              ossimString::toString(m_lensDistortion->decenteringDistortionCoefficients()[1], 20) + " " +
-              ossimString::toString(m_lensDistortion->decenteringDistortionCoefficients()[2], 20) + " " +
-              ossimString::toString(m_lensDistortion->decenteringDistortionCoefficients()[3], 20)
-              ,true);
-   }
-   kwl.add(prefix, "platform_postion",m_platformPosition.toString() ,true);
-   kwl.add(prefix, "focal_length", ossimString::toString(m_focalLength) ,true);
-   
-   return true;
-}
-
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Andrew Johnson
+//
+//*******************************************************************
+//  $Id: ossimBuckeyeSensor.cpp  $
+#include <sstream>
+#include <ossim/projection/ossimBuckeyeSensor.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/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				= 195.1000;
+	thePixelSize				= ossimDpt(.006, .006);
+	thePrincipalPoint			= ossimDpt(0, 0);
+	theEcefPlatformPosition		= ossimGpt(0.0,0.0, 1000.0);
+	theAdjEcefPlatformPosition	= ossimGpt(0.0,0.0, 1000.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();
+	
+	try
+	{
+		// Method throws ossimException.
+		computeGsd();
+	}
+	catch (const ossimException& e)
+	{
+		ossimNotify(ossimNotifyLevel_WARN)
+			<< "ossimBuckeyeSensor Constructor caught Exception:\n"
+			<< e.what() << std::endl;
+	}
+
+	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 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;
+	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;
+}
+
+
+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;
+
+	theImageClipRect = ossimDrect(0,0,8984,6732);
+	theRefImgPt      = ossimDpt(4492, 3366);
+
+	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;
+
+	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 seaparator
+		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.. optomization 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(radial[0].toDouble(),
+			//	radial[1].toDouble(),
+			//	radial[2].toDouble(),
+			//	radial[3].toDouble(),
+			//	radial[4].toDouble(),
+			//	decent[0].toDouble(),
+			//	decent[1].toDouble(),
+			//	decent[2].toDouble(),
+			//	decent[3].toDouble());
+
+			theLensDistortion = new ossimSmacCallibrationSystem(k0,k1,k2,k3,k4,p0,p1,p2,p3);
+		}
+	}
+	theImageSize = ossimDpt(theImageClipRect.width(),
+		theImageClipRect.height());
+
+	updateModel();
+
+	if(theGSD.isNan())
+	{
+		try
+		{
+			// This will set theGSD and theMeanGSD. Method throws ossimException.
+			computeGsd();
+		}
+		catch (const ossimException& e)
+		{
+			if (traceDebug())
+			{
+				ossimNotify(ossimNotifyLevel_DEBUG)
+					<< "ossimBuckeyeSensor::loadState Caught Exception:\n"
+					<< e.what() << std::endl;
+			}
+		}
+	}
+	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();
+
+}
\ No newline at end of file
diff --git a/src/ossim/projection/ossimCoarseGridModel.cpp b/src/ossim/projection/ossimCoarseGridModel.cpp
index 4602daa..2347b82 100644
--- a/src/ossim/projection/ossimCoarseGridModel.cpp
+++ b/src/ossim/projection/ossimCoarseGridModel.cpp
@@ -14,7 +14,7 @@
 //   elevations relative to the ellipsoid.
 //
 //*****************************************************************************
-//  $Id: ossimCoarseGridModel.cpp 19509 2011-05-05 14:11:18Z gpotts $
+//  $Id: ossimCoarseGridModel.cpp 20710 2012-04-03 19:43:46Z gpotts $
 
 #include <ossim/projection/ossimCoarseGridModel.h>
 
@@ -135,8 +135,15 @@ ossimCoarseGridModel::ossimCoarseGridModel(const ossimFilename& geom_file)
    theLatGrid.enableExtrapolation();
    theLonGrid.enableExtrapolation();
 
-   ossimKeywordlist kwl (geom_file);
-   loadState(kwl);
+   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;
diff --git a/src/ossim/projection/ossimEpsgProjectionDatabase.cpp b/src/ossim/projection/ossimEpsgProjectionDatabase.cpp
index f2d4052..1abbf8d 100644
--- a/src/ossim/projection/ossimEpsgProjectionDatabase.cpp
+++ b/src/ossim/projection/ossimEpsgProjectionDatabase.cpp
@@ -8,7 +8,7 @@
 // DESCRIPTION: Projection database for EPSG coded projections provided in database files
 //
 //*************************************************************************************************
-//  $Id$
+//  $Id: ossimEpsgProjectionDatabase.cpp 21519 2012-08-22 21:16:25Z dburken $
 #include <ossim/projection/ossimEpsgProjectionDatabase.h>
 #include <ossim/projection/ossimStatePlaneProjectionInfo.h>
 #include <ossim/base/ossimKeywordNames.h>
@@ -110,17 +110,6 @@ enum
 };
 static const ossimString SPCS_EPSG_MAP_FORMAT_C ("SPCS_EPSG_MAP");
 
-// Alternate projection Well Known Text naming scheme database CSV file format (format "D")
-// WKT_PCS coding is an alternate naming scheme that maps to EPSG.
-enum 
-{
-   D_CODE = 0,
-   D_NAME,
-   D_NUM_FIELDS   // Not an index, but a count
-};
-static const ossimString WKT_PCS_FORMAT_D ("WKT_PCS");
-
-
 //*************************************************************************************************
 //! Converts sexagesimal DMS to decimal degrees
 //*************************************************************************************************
@@ -177,15 +166,21 @@ ossimEpsgProjectionDatabase* ossimEpsgProjectionDatabase::instance()
 //! Destructor
 //*************************************************************************************************
 ossimEpsgProjectionDatabase::~ossimEpsgProjectionDatabase()
-{ }
+{
+}
 
 //*************************************************************************************************
 //! Constructor loads all DB CSV files specified in the ossim prefs
 //*************************************************************************************************
 ossimEpsgProjectionDatabase::ossimEpsgProjectionDatabase()
+   :
+   m_projDatabase(),
+   m_mutex()
 {
    // Read the ossim preferences for Db CSV files.
+   m_mutex.lock();
    initialize();
+   m_mutex.unlock();
 }
 
 //*************************************************************************************************
@@ -195,16 +190,15 @@ void ossimEpsgProjectionDatabase::initialize()
 {
    // Fetch filenames of all projection DB files specified in ossim_preferences:
    ossimString regEx =  ossimString("^epsg_database_file[0-9]+");
-   std::vector<ossimString> keys = 
+   vector<ossimString> keys = 
       ossimPreferences::instance()->preferencesKWL().getSubstringKeyList(regEx);
-   std::vector<ossimString>::const_iterator i = keys.begin();
+   vector<ossimString>::const_iterator i = keys.begin();
 
    // Create only once outside the loop:
    ossimFilename db_name;
    ossimString group_id;
    ossimString format_id;
    ossimString line;
-   DbEntry file_record;
 
    // Loop over each file and read contents into memory:
    while ( i != keys.end() )
@@ -220,12 +214,11 @@ void ossimEpsgProjectionDatabase::initialize()
       if (db_stream.good())
       {
          // Format specification implied in file's magic number:
-         std::getline(db_stream, format_id);
+         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) ||
-             (format_id == WKT_PCS_FORMAT_D))
+             (format_id == SPCS_EPSG_MAP_FORMAT_C))
             good_file = true;
       }
       if (!good_file)
@@ -237,35 +230,31 @@ void ossimEpsgProjectionDatabase::initialize()
       }
 
       // The file is good. Skip over the column descriptor line:
-      std::getline(db_stream, line);
-      file_record.clear();
+      std::getline(db_stream, line.string());
 
       // Loop to read all data records:
       while (!db_stream.eof())
       {
-         std::getline(db_stream, line);
-         file_record = line.explode(","); // ONLY CSV FILES CONSIDERED HERE
-         if (file_record.size())
+         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())
          {
-            ossimRefPtr<ossimMapProjection> proj;
-            ProjRecord proj_record;
-
             // Check if primary EPSG database format A:
             if (format_id == EPSG_DB_FORMAT_A)
             {
-               proj = createProjFromFormatARecord(file_record, proj_record.datumValid);
-               proj_record.code = file_record[A_CODE].toUInt32();
-               proj_record.name = file_record[A_NAME];
+               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)
             {
-               proj = createProjFromFormatBRecord(file_record);
-               proj_record.code = file_record[B_CODE].toUInt32();
-               proj_record.name = file_record[B_NAME];
-               proj_record.datumValid = true;
+               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.
@@ -274,62 +263,17 @@ void ossimEpsgProjectionDatabase::initialize()
             // code is saved.
             else if (format_id == SPCS_EPSG_MAP_FORMAT_C)
             {
-               proj_record.code = file_record[C_CODE].toUInt32();
-               proj_record.name = file_record[C_NAME];
-               m_projDatabase.push_back(proj_record);
-            }
-
-            // This format is for alternate projection naming scheme database CSV file format.
-            // WKT_PCS coding is an alternate naming scheme that maps to EPSG.
-            // Note that no proj is instantiated and no KWL is populated. Only name and EPSG mapped
-            // code is saved.
-            else if (format_id == WKT_PCS_FORMAT_D)
-            {
-               proj_record.code = file_record[D_CODE].toUInt32();
-               proj_record.name = file_record[D_NAME];
-               m_projDatabase.push_back(proj_record);
+               db_record->code = db_record->csvRecord[C_CODE].toUInt32();
+               db_record->name = db_record->csvRecord[C_NAME];
+               db_record->csvFormat = FORMAT_C;
             }
 
-            if (proj.valid() && proj_record.datumValid)
-            {
-               // Serialize the projection to a KWL and stick it in the in-memory database:
-               proj->saveState(proj_record.kwl);
-               m_projDatabase.push_back(proj_record);
-            }
+            m_projDatabase.insert(make_pair(db_record->code, db_record));
          }
       }
 
       db_stream.close();
    } // end of while loop over all DB files
-
-   addCustomEntries();
-}
-
-//*************************************************************************************************
-//! This method collects all custom entries that are added manually to the database (i.e., they are
-//! not provided in the DB files or are more efficiently handled this way.
-//*************************************************************************************************
-void ossimEpsgProjectionDatabase::addCustomEntries()
-{
-   ProjRecord proj_record;
-
-   // Google's spherical pseudo-Mercator projection:
-   const ossimDatum* datum = ossimDatumFactory::instance()->create(ossimString("6055"));
-   if(datum)
-   {
-      proj_record.datumValid = true;
-      proj_record.code = 900913; // = "google"
-      proj_record.name = "Google Earth Projection";
-      ossimRefPtr<ossimMercatorProjection> proj = new ossimMercatorProjection();
-      ossimGpt origin(0.0,0.0,0.0, datum);
-      proj->setFalseEasting(0.0);
-      proj->setFalseNorthing(0.0);
-      proj->setOrigin(origin); // Also sets the projections datum to the origin's datum
-      proj->update();
-      proj->setPcsCode(proj_record.code);
-      proj->saveState(proj_record.kwl);
-      m_projDatabase.push_back(proj_record);
-   }
 }
 
 //*************************************************************************************************
@@ -338,32 +282,72 @@ void ossimEpsgProjectionDatabase::addCustomEntries()
 //*************************************************************************************************
 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;
 
-   ossimMapProjectionFactory* factory = ossimMapProjectionFactory::instance();
-   ossimMapProjection* proj = 0;
+   // Check for Google projection:
+   else if (epsg_code == 900913)
+   {
+      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;
+   }
 
-   // Search database for entry:
-   std::vector<ProjRecord>::const_iterator db_iter = m_projDatabase.begin();
-   while (db_iter != m_projDatabase.end())
+   else
    {
-      if (db_iter->code == epsg_code)
+      // Search database for entry:
+      std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter = 
+         m_projDatabase.find(epsg_code);
+      if (db_iter != m_projDatabase.end())
       {
-         // We have a match, instantiate the projection from the associated KWL in the DB. Trick
-         // the registry into using appropriate factory by setting PCS code temporarily to 0 to
-         // avoid infinite recursion:
-         checkForUnhandledDatum(*db_iter);
-         ossimKeywordlist proj_kwl (db_iter->kwl); // make copy since this is a const method
-         proj_kwl.remove(ossimKeywordNames::PCS_CODE_KW);
-         proj = PTR_CAST(ossimMapProjection, factory->createProjection(proj_kwl));
-         if (proj)
-            proj->setPcsCode(epsg_code);
-         break;
+         // 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();
       }
-      db_iter++;
    }
+
    return proj;
 }
 
@@ -373,6 +357,7 @@ ossimProjection* ossimEpsgProjectionDatabase::findProjection(ossim_uint32 epsg_c
 //*************************************************************************************************
 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 
@@ -389,57 +374,42 @@ ossimProjection* ossimEpsgProjectionDatabase::findProjection(const ossimString&
    {
       spec_code = spec.toUInt32();
    }
-   if(spec_code == 4326)
-   {
-      return new ossimEquDistCylProjection();
-   }
-   // Presently only EPSG database is handled:
-   if (spec_code != 0)
-   {
-      if (spec_group != "epsg")
-         return 0;
-      proj = findProjection(spec_code);
-      if (proj)
-         return proj;
-   }
 
-   // spec_code = 0 indicates that the spec is probably a projection name. Need to search Db
-   // by the projection name. Search database for entry:
+   // 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;
-   ossimMapProjectionFactory* factory = ossimMapProjectionFactory::instance();
-   std::vector<ProjRecord>::const_iterator db_iter = m_projDatabase.begin();
+   std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter = m_projDatabase.begin();
    while ((db_iter != m_projDatabase.end()) && !proj)
    {
-      if (db_iter->name == spec)
+      ossimRefPtr<ProjDbRecord> db_record = db_iter->second;
+      if ( db_record.valid() )
       {
-         // We have a match, instantiate the projection from the associated KWL in the DB. Trick
-         // the registry into using appropriate factory by setting PCS code temporarily to 0 to
-         // avoid infinite recursion:
-         checkForUnhandledDatum(*db_iter);
-         if (db_iter->kwl.getSize() > 0)
-         {
-            ossimKeywordlist proj_kwl (db_iter->kwl); // make copy since this is a const method
-            proj_kwl.remove(ossimKeywordNames::PCS_CODE_KW);
-            map_proj = PTR_CAST(ossimMapProjection, factory->createProjection(proj_kwl));
-            if (map_proj.valid())
-            {
-               map_proj->setPcsCode(db_iter->code);
-               proj = (ossimProjection*) map_proj->dup();
-            }
-         }
-         else
+         split_db_name.clear();
+         db_record->name.split(split_db_name, separators, true);
+         if (split_spec == split_db_name)
          {
-            // An empty KWL indicates the record is simply a map to another EPSG Db entry:
-            proj = findProjection(db_iter->code);
+            // 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++;
+      ++db_iter;
    }
-   if (proj)
-      return proj;
     
    // No hit? Could be that just a datum was identified, in which case we need a simple 
-   // Platte Carr�e:
+   // Platte Carree:
    const ossimDatum* datum = ossimDatumFactoryRegistry::instance()->create(spec);
    if (datum)
    {
@@ -459,12 +429,16 @@ ossimProjection* ossimEpsgProjectionDatabase::findProjection(const ossimString&
 //*************************************************************************************************
 ossim_uint32 ossimEpsgProjectionDatabase::findProjectionCode(const ossimString& proj_name) const
 {
-   std::vector<ProjRecord>::const_iterator db_iter = m_projDatabase.begin();
+   std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter = m_projDatabase.begin();
    while (db_iter != m_projDatabase.end())
    {
-      if (db_iter->name == proj_name)
-         return (db_iter->code);
-      db_iter++;
+      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;
@@ -485,31 +459,33 @@ ossimEpsgProjectionDatabase::findProjectionCode(const ossimMapProjection& lost_p
    if ((lost_type == "ossimEquDistCylProjection") && (lost_proj.getDatum()->epsgCode() == 6326))
       return 4326;
 
-   ossimString lookup;
-   ossimRefPtr<ossimMapProjection> found_proj = 0;
-   ossimMapProjectionFactory* factory = ossimMapProjectionFactory::instance();
    ossim_uint32 found_code = 0;
+   if (lost_type == "ossimUtmProjection")
+   {
+      found_code = getCodeFromUtmProj(dynamic_cast<const ossimUtmProjection*>(&lost_proj));
+      if (found_code)
+         return found_code;
+   }
 
-   std::vector<ProjRecord>::const_iterator db_iter = m_projDatabase.begin();
+   ossimString lookup;
+   std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter =
+      m_projDatabase.begin();
    while ((db_iter != m_projDatabase.end()) && (found_code == 0))
    {
-      // To avoid having to instantiate all projections in the database, let's peek in the record's
-      // KWL for the projection type and only instantiate those that match:
-      lookup = db_iter->kwl.find(ossimKeywordNames::TYPE_KW);
-      if (lost_type == lookup)
+      ossimRefPtr<ProjDbRecord> db_record = db_iter->second;
+      if ( db_record.valid() )
       {
-         // We have a match, instantiate the projection from the associated KWL in the DB. Trick
-         // the registry into using appropriate factory by setting PCS code temporarily to 0 to
-         // avoid infinite recursion:
-         ossimKeywordlist kwl (db_iter->kwl); // make copy since this is a const method
-         kwl.remove(ossimKeywordNames::PCS_CODE_KW);
-         found_proj = PTR_CAST(ossimMapProjection, factory->createProjection(kwl));
-
-         // Test for same-ness between target and found, and return if matching:
-         if (found_proj.valid() && (*found_proj == lost_proj))
+         // Has a projection already been created for this db iter?
+         if (!db_record->proj.valid())
          {
-            found_code = db_iter->code;
-
+            // 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)
@@ -517,7 +493,7 @@ ossimEpsgProjectionDatabase::findProjectionCode(const ossimMapProjection& lost_p
                found_code = 4326;
          }
       }
-      db_iter++;
+      ++db_iter;
    }
    return found_code;
 }
@@ -529,16 +505,12 @@ ossimEpsgProjectionDatabase::findProjectionCode(const ossimMapProjection& lost_p
 ossimString ossimEpsgProjectionDatabase::findProjectionName(ossim_uint32 epsg_code) const
 {
    ossimString name ("");
-   std::vector<ProjRecord>::const_iterator db_iter = m_projDatabase.begin();
-   while (db_iter != m_projDatabase.end())
-   {
-      if (db_iter->code == epsg_code)
-      {
-         name = db_iter->name;
-         break;
-      }
-      db_iter++;
-   }
+   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;
 }
 
@@ -550,16 +522,20 @@ ossimString ossimEpsgProjectionDatabase::findProjectionName(ossim_uint32 epsg_co
 //*************************************************************************************************
 void ossimEpsgProjectionDatabase::getProjectionsList(std::vector<ossimString>& list) const
 {
-   std::vector<ProjRecord>::const_iterator db_iter = m_projDatabase.begin();
+   std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter = m_projDatabase.begin();
    while (db_iter != m_projDatabase.end())
    {
-      ossimString record ("EPSG:");
-      record += ossimString::toString(db_iter->code);
-      record += "  \"";
-      record += db_iter->name;
-      record += "\"";
-      list.push_back(record);
-      db_iter++;
+      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;
 }
@@ -571,130 +547,129 @@ void ossimEpsgProjectionDatabase::getProjectionsList(std::vector<ossimString>& l
 // with current ossimDatumFactory. Setting to default WGS84 with warning message.
 //*************************************************************************************************
 ossimMapProjection* 
-ossimEpsgProjectionDatabase::createProjFromFormatARecord(const DbEntry& record, 
-                                                         bool& datum_valid) const
+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:
-   datum_valid = true;
-   ossim_uint32 pcs_code = record[A_CODE].toUInt32();
-   ossimMapProjection* proj = createProjFromUtmCode(pcs_code);
-   if (proj)
-      return proj;
+   record->datumValid = true;
+   record->proj = 0;
 
    // Establish the units in which the easting/northing is provided:
    double mtrs_per_unit = 1.0;
-   if (record[A_UNITS] == "US survey foot")
+   if (record->csvRecord[A_UNITS] == "US survey foot")
       mtrs_per_unit = US_METERS_PER_FT;
-   else if (record[A_UNITS].contains("foot")) // THIS IS INTERNATIONAL FOOT, NOT EXACT FOR MANY INTERNATIONAL VARIETIES
+   else if (record->csvRecord[A_UNITS].contains("foot")) // THIS IS INTERNATIONAL FOOT, NOT EXACT FOR MANY INTERNATIONAL VARIETIES
       mtrs_per_unit = MTRS_PER_FT;
-   else if (!record[A_UNITS].contains("metre") || (record[A_UNITS] == "kilometre"))
+   else if (record->csvRecord[A_UNITS].contains("kilometre"))
+      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[A_UNITS]<<"> not presently supported."<<endl;
+      //   <<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[A_DATUM_CODE].toUInt32();
+   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"));
-      datum_valid = false;
+      record->datumValid = false;
    }
    const ossimEllipsoid* ellipsoid = datum->ellipsoid();
 
-   ossimGpt origin(0,0,0);
-   ossimString proj_type = record[A_PROJ_TYPE];
+   ossimGpt origin(0,0,0,datum);
+   ossimString proj_type = record->csvRecord[A_PROJ_TYPE];
    if (proj_type.contains("Transverse Mercator"))
    {
-      origin.lat = decodeSexagesimalDms(record[A_NAT_ORG_LAT]);
-      origin.lon = decodeSexagesimalDms(record[A_NAT_ORG_LON]);
-      double fe = mtrs_per_unit*record[A_FALSE_EASTING].toDouble();
-      double fn = mtrs_per_unit*record[A_FALSE_NORTHING].toDouble();
-      double sf = record[A_NAT_ORG_SCALE].toDouble();
-      proj = new ossimTransMercatorProjection(*ellipsoid, origin, fe, fn, sf);
+      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[A_NAT_ORG_LAT]);
-      origin.lon = decodeSexagesimalDms(record[A_NAT_ORG_LON]);
-      double fe = mtrs_per_unit*record[A_FALSE_EASTING].toDouble();
-      double fn = mtrs_per_unit*record[A_FALSE_NORTHING].toDouble();
-      proj = new ossimLambertConformalConicProjection(*ellipsoid, origin, origin.lat, 
+      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[A_FALSE_ORG_LAT]);
-      origin.lon = decodeSexagesimalDms(record[A_FALSE_ORG_LON]);
-      double p1 = decodeSexagesimalDms(record[A_STD_PARL_1_LAT]);
-      double p2 = decodeSexagesimalDms(record[A_STD_PARL_2_LAT]);
-      double fe = mtrs_per_unit*record[A_FALSE_ORG_EASTING].toDouble();
-      double fn = mtrs_per_unit*record[A_FALSE_ORG_NORTHING].toDouble();
-      proj = new ossimLambertConformalConicProjection(*ellipsoid, origin, p1, p2, fe, fn);
+      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[A_NAT_ORG_LAT]);
-      origin.lon = decodeSexagesimalDms(record[A_NAT_ORG_LON]);
-      double fe = mtrs_per_unit*record[A_FALSE_EASTING].toDouble();
-      double fn = mtrs_per_unit*record[A_FALSE_NORTHING].toDouble();
-      proj =  new ossimCassiniProjection(*ellipsoid, origin, fe, fn);
+      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[A_NAT_ORG_LAT]);
-      origin.lon = decodeSexagesimalDms(record[A_NAT_ORG_LON]);
-      double fe = mtrs_per_unit*record[A_FALSE_EASTING].toDouble();
-      double fn = mtrs_per_unit*record[A_FALSE_NORTHING].toDouble();
-      double sf = record[A_NAT_ORG_SCALE].toDouble();
-      proj = new ossimMercatorProjection(*ellipsoid, origin, fe, fn, sf);
+      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[A_FALSE_ORG_LAT]);
-      origin.lon = decodeSexagesimalDms(record[A_FALSE_ORG_LON]);
-      double p1 = decodeSexagesimalDms(record[A_STD_PARL_1_LAT]);
-      double p2 = decodeSexagesimalDms(record[A_STD_PARL_2_LAT]);
-      double fe = mtrs_per_unit*record[A_FALSE_ORG_EASTING].toDouble();
-      double fn = mtrs_per_unit*record[A_FALSE_ORG_NORTHING].toDouble();
-      proj = new ossimAlbersProjection(*ellipsoid, origin, p1, p2, fe, fn);
+      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[A_STD_PARL_1_LAT]);
-      origin.lon = decodeSexagesimalDms(record[A_NAT_ORG_LON]);
-      double fe = mtrs_per_unit*record[A_FALSE_EASTING].toDouble();
-      double fn = mtrs_per_unit*record[A_FALSE_NORTHING].toDouble();
-      proj = new ossimEquDistCylProjection(*ellipsoid, origin, fe, fn);
+      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[A_NAT_ORG_LAT]);
-      origin.lon = decodeSexagesimalDms(record[A_NAT_ORG_LON]);
-      double fe = mtrs_per_unit*record[A_FALSE_EASTING].toDouble();
-      double fn = mtrs_per_unit*record[A_FALSE_NORTHING].toDouble();
+      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);
-      proj = nz_proj;
+      record->proj = nz_proj;
    }
    else 
    {
       // Can't handle it now. 
-      //ossimNotify(ossimNotifyLevel_FATAL)<<MODULE<<"EPSG:"<<record[A_CODE]<<" \""<<proj_type<<"\" "
+      //ossimNotify(ossimNotifyLevel_FATAL)<<MODULE<<"EPSG:"<<record->csvRecord[A_CODE]<<" \""<<proj_type<<"\" "
       //   "not presently supported. Returning NULL projection..."<<endl;
       return 0;
    }
   
-   proj->setDatum(datum);
-   proj->setPcsCode(pcs_code);
-   return proj;
+   record->proj->setDatum(datum);
+   record->proj->setPcsCode(record->code);
+   
+   return record->proj.get();
 }
 
 //*************************************************************************************************
@@ -704,35 +679,38 @@ ossimEpsgProjectionDatabase::createProjFromFormatARecord(const DbEntry& record,
 //! programmatically arrive at the UTM projection.
 //*************************************************************************************************
 ossimMapProjection* 
-ossimEpsgProjectionDatabase::createProjFromFormatBRecord(const DbEntry& record) const
+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(record[B_NAME],
-                                       record[B_CODE].toInt(),
-                                       record[B_PROJ_TYPE],
-                                       record[B_PARAM1],
-                                       record[B_PARAM2],
-                                       record[B_PARAM3],
-                                       record[B_PARAM4],
-                                       record[B_FALSE_EASTING].toDouble(),
-                                       record[B_FALSE_NORTHING].toDouble(),
-                                       record[B_UNITS],
-                                       record[B_DATUM_CODE]);
+   // 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);
-   ossimMapProjection* proj = PTR_CAST(ossimMapProjection,
-      ossimMapProjectionFactory::instance()->createProjection(kwl));
-   if (proj)
-      proj->setPcsCode(record[B_CODE].toUInt32());
+   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 proj;
+   return db_record->proj.get();
 }
 
 //*************************************************************************************************
@@ -852,18 +830,48 @@ ossimMapProjection* ossimEpsgProjectionDatabase::createProjFromUtmCode(ossim_uin
 }
 
 //*************************************************************************************************
-//! Throws an exception if datum code is not handled yet.
+//! Given UTM projection, derives the associated EPSG code. This is faster than a Db lookup.
 //*************************************************************************************************
-void ossimEpsgProjectionDatabase::checkForUnhandledDatum(const ProjRecord& record) const
+ossim_uint32 ossimEpsgProjectionDatabase::getCodeFromUtmProj(const ossimUtmProjection* proj) const
 {
-   if (!record.datumValid)
-   {
-      ossimString errMsg ("ossimEpsgProjectionDatabase -- "
-         "EPSG database parsing of datum code has not been implemented for EPSG code=");
-      errMsg += ossimString::toString(record.code);
-      throw(ossimException(errMsg));
-   }
-}
+   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/src/ossim/projection/ossimEpsgProjectionFactory.cpp b/src/ossim/projection/ossimEpsgProjectionFactory.cpp
index 8abb7ce..7c1d2e8 100644
--- a/src/ossim/projection/ossimEpsgProjectionFactory.cpp
+++ b/src/ossim/projection/ossimEpsgProjectionFactory.cpp
@@ -9,14 +9,15 @@
 // code.
 //
 //*************************************************************************************************
-//  $Id$
-#include <sstream>
+//  $Id: ossimEpsgProjectionFactory.cpp 19879 2011-07-30 16:21:50Z dburken $
+
 #include <ossim/projection/ossimEpsgProjectionFactory.h>
 #include <ossim/projection/ossimEquDistCylProjection.h>
 #include <ossim/projection/ossimOrthoGraphicProjection.h>
 #include <ossim/projection/ossimTransMercatorProjection.h>
 #include <ossim/projection/ossimUtmProjection.h>
 #include <ossim/base/ossimKeywordNames.h>
+#include <sstream>
 
 ossimEpsgProjectionFactory* ossimEpsgProjectionFactory::m_instance = 0;
 
@@ -65,10 +66,14 @@ ossimProjection* ossimEpsgProjectionFactory::createProjection(const ossimKeyword
    // The tie points and perhaps other params might still be in the KWL, so pass the KWL on to the
    // new projection after it has been amended with the default proj info extracted from the 
    // EPSG code (i.e., sans tiepoints and gsd):
-   ossimKeywordlist amended_kwl;
-   proj->saveState(amended_kwl, prefix);
-   amended_kwl.addList(keywordList, true); // true: overriding existing default items
-   proj->loadState(amended_kwl, prefix);
+   ossimKeywordlist proj_kwl;
+   proj->saveState(proj_kwl, prefix);
+   proj_kwl.remove(prefix, ossimKeywordNames::PIXEL_SCALE_XY_KW);
+   proj_kwl.remove(prefix, ossimKeywordNames::PIXEL_SCALE_UNITS_KW);
+   proj_kwl.remove(prefix, ossimKeywordNames::TIE_POINT_XY_KW);
+   proj_kwl.remove(prefix, ossimKeywordNames::TIE_POINT_UNITS_KW);
+   proj_kwl.addList(keywordList, false); // false: do not override existing items
+   proj->loadState(proj_kwl, prefix);
    
    return proj;
 }
@@ -97,8 +102,12 @@ ossimProjection* ossimEpsgProjectionFactory::createProjection(const ossimString
       return createProjFromAutoCode(split_line);
    }
 
+   // Strip commonly found or bar '|' from end if present.
+   ossimString s = spec;
+   s.trim(ossimString("|"));
+
    // Otherwise, pass along the request to the database object for record search:
-   return m_projDatabase->findProjection(spec);
+   return m_projDatabase->findProjection(s);
 }
 
 //*************************************************************************************************
@@ -117,7 +126,7 @@ ossimEpsgProjectionFactory::createProjFromAutoCode(const std::vector<ossimString
    // Only a few AUTO codes are considered:
    switch(code)
    {
-   case 42001:
+      case 42001:
       {
          ossimUtmProjection* utm = new ossimUtmProjection;
          utm->setZone(origin);
@@ -127,8 +136,8 @@ ossimEpsgProjectionFactory::createProjFromAutoCode(const std::vector<ossimString
          utm->setPcsCode(42001);
          return utm;
       }
-
-   case 42002:
+      
+      case 42002:
       {
          ossimTransMercatorProjection* transMerc = new ossimTransMercatorProjection;
          transMerc->setFalseNorthing(origin.latd()>=0.0?0.0:10000000.0);
@@ -138,8 +147,8 @@ ossimEpsgProjectionFactory::createProjFromAutoCode(const std::vector<ossimString
          transMerc->setPcsCode(42002);
          return transMerc;
       }
-
-   case 42003:
+      
+      case 42003:
       {
          ossimOrthoGraphicProjection* ortho = new ossimOrthoGraphicProjection;
          ortho->setOrigin(origin);
@@ -147,8 +156,8 @@ ossimEpsgProjectionFactory::createProjFromAutoCode(const std::vector<ossimString
          ortho->setPcsCode(42003);
          return ortho;
       }
-
-   case 42004:
+      
+      case 42004:
       {
          ossimEquDistCylProjection* geographic = new ossimEquDistCylProjection;
          geographic->setOrigin(origin);
diff --git a/src/ossim/projection/ossimEquDistCylProjection.cpp b/src/ossim/projection/ossimEquDistCylProjection.cpp
index 8e5b8c3..b3dd2bb 100644
--- a/src/ossim/projection/ossimEquDistCylProjection.cpp
+++ b/src/ossim/projection/ossimEquDistCylProjection.cpp
@@ -9,11 +9,13 @@
 //
 // Calls Geotrans Equidistant Cylinder projection code.  
 //*******************************************************************
-//  $Id: ossimEquDistCylProjection.cpp 18701 2011-01-19 20:48:08Z dburken $
+//  $Id: ossimEquDistCylProjection.cpp 20542 2012-02-06 17:41:05Z dburken $
 
 #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>
@@ -89,13 +91,17 @@ void ossimEquDistCylProjection::update()
    theFalseEastingNorthing.x = Eqcy_False_Easting;
    theFalseEastingNorthing.y = Eqcy_False_Northing;
 
+   theMetersPerPixel.makeNan(); // force recompute by base class
+
    ossimMapProjection::update();
 
-   // Check if the origin is at (0,0). This implies EPSG:4326
-   if ((theOrigin.lat == 0.0) && (theOrigin.lon == 0.0) && (theGcsCode == 4326))
-      thePcsCode = 4326;
-   else if (thePcsCode == 0)
-      thePcsCode = theGcsCode;
+   // 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;
+   }
 }
 
 void ossimEquDistCylProjection::setFalseEasting(double falseEasting)
@@ -121,6 +127,7 @@ void ossimEquDistCylProjection::setFalseEastingNorthing(double falseEasting,
 
 void ossimEquDistCylProjection::setDefaults()
 {
+   theProjectionUnits = OSSIM_DEGREES;
    Eqcy_False_Easting  = 0.0;
    Eqcy_False_Northing = 0.0;
    Eqcy_Delta_Northing = 10007555.0;
@@ -196,75 +203,148 @@ void ossimEquDistCylProjection::worldToLineSample(const ossimGpt &worldPoint,
    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
    {
-      // 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)
+      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;
-         
-         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
+
+         //---
+         // 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)
          {
-            lineSample.x = ((lineSample.x  - theUlEastingNorthing.x)/theMetersPerPixel.x);
+            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 = (-(lineSample.y - theUlEastingNorthing.y)/theMetersPerPixel.y);
-         }
+            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
 {
@@ -317,6 +397,19 @@ bool ossimEquDistCylProjection::loadState(const ossimKeywordlist& kwl, const cha
 
    //   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);
 
diff --git a/src/ossim/projection/ossimIkonosRpcModel.cpp b/src/ossim/projection/ossimIkonosRpcModel.cpp
index 73b76a8..88ef0f7 100644
--- a/src/ossim/projection/ossimIkonosRpcModel.cpp
+++ b/src/ossim/projection/ossimIkonosRpcModel.cpp
@@ -13,7 +13,7 @@
 // LIMITATIONS: None.
 //
 //*****************************************************************************
-//  $Id: ossimIkonosRpcModel.cpp 16867 2010-03-16 03:29:40Z gpotts $
+//  $Id: ossimIkonosRpcModel.cpp 20606 2012-02-24 12:29:52Z gpotts $
 
 #include <cstdlib>
 #include <ossim/projection/ossimIkonosRpcModel.h>
@@ -56,9 +56,8 @@ static const char* SAMP_DEN_COEFF_KW = "SAMP_DEN_COEFF_";
 
 ossimIkonosRpcModel::ossimIkonosRpcModel()
    :ossimRpcModel(),
-    theSupportData(0)
+    theSupportData(new ossimIkonosMetaData())
 {
-   theSupportData = new ossimIkonosMetaData();
 }
 
 //*****************************************************************************
@@ -70,7 +69,7 @@ ossimIkonosRpcModel::ossimIkonosRpcModel()
 //*****************************************************************************
 ossimIkonosRpcModel::ossimIkonosRpcModel(const ossimFilename& geom_file)
    :  ossimRpcModel(),
-      theSupportData(0)
+      theSupportData(new ossimIkonosMetaData())
 {
    if (traceExec())
    {
@@ -79,8 +78,6 @@ ossimIkonosRpcModel::ossimIkonosRpcModel(const ossimFilename& geom_file)
          << std::endl;
    }
 
-   theSupportData = new ossimIkonosMetaData();
-   
    ossimKeywordlist kwl(geom_file);
    const char* value;
    
@@ -168,12 +165,10 @@ ossimIkonosRpcModel::ossimIkonosRpcModel(const ossimFilename& metadata,
                                          const ossimFilename& rpcdata)
    :
    ossimRpcModel(),
-   theSupportData(0)
+   theSupportData(new ossimIkonosMetaData())
 {
    if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimIkonosRpcModel Constructor #2: entering..." << std::endl;
 
-   theSupportData = new ossimIkonosMetaData();
-
    parseMetaData(metadata);
    parseRpcData (rpcdata);
    finishConstruction();
diff --git a/src/ossim/projection/ossimImageProjectionModel.cpp b/src/ossim/projection/ossimImageProjectionModel.cpp
index 1712fb4..2be06e9 100644
--- a/src/ossim/projection/ossimImageProjectionModel.cpp
+++ b/src/ossim/projection/ossimImageProjectionModel.cpp
@@ -11,11 +11,11 @@
 //-----------------------------------------------------------------------------
 // $Id$
 
-#include <string>
-
 #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",
diff --git a/src/ossim/projection/ossimImageViewAffineTransform.cpp b/src/ossim/projection/ossimImageViewAffineTransform.cpp
index ae9e91c..0ab3ee6 100644
--- a/src/ossim/projection/ossimImageViewAffineTransform.cpp
+++ b/src/ossim/projection/ossimImageViewAffineTransform.cpp
@@ -6,7 +6,7 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimImageViewAffineTransform.cpp 18999 2011-03-02 15:54:26Z gpotts $
+//  $Id: ossimImageViewAffineTransform.cpp 19802 2011-07-11 11:08:07Z gpotts $
 
 #include <ossim/projection/ossimImageViewAffineTransform.h>
 #include <ossim/base/ossimKeywordlist.h>
@@ -52,8 +52,6 @@ void ossimImageViewAffineTransform::imageToView(const ossimDpt& imagePoint,
                                                 ossimDpt&       viewPoint)const
 {
    
-//    viewPoint.x = m_transform[0][0]*(imagePoint.x - translateRotationOriginPoint.x) + m_transform[0][1]*(imagePoint.y - translateRotationOriginPoint.y) + m_transform[0][2];
-//    viewPoint.y = m_transform[1][0]*(imagePoint.x - translateRotationOriginPoint.x) + m_transform[1][1]*(imagePoint.y - translateRotationOriginPoint.y) + m_transform[1][2];
     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];
 }
@@ -61,12 +59,8 @@ void ossimImageViewAffineTransform::imageToView(const ossimDpt& imagePoint,
 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] + translateRotationOriginPoint.x;
-//    imagePoint.y = m_inverseTransform[1][0]*viewPoint.x + m_inverseTransform[1][1]*viewPoint.y + m_inverseTransform[1][2] + translateRotationOriginPoint.y;
    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)
@@ -220,81 +214,6 @@ bool ossimImageViewAffineTransform::loadState(const ossimKeywordlist& kwl,
    }
    buildCompositeTransform();
    ossimImageViewTransform::loadState(kwl, prefix);
-#if 0
-   ossimString newPrefix = ossimString(prefix) + "transform.";
-   
-   const char* lookup = kwl.find(newPrefix.c_str(),
-                                 "m11");
-   if(lookup)
-   {
-      m_transform[0][0] = ossimString(lookup).toDouble();
-   }
-
-   lookup = kwl.find(newPrefix.c_str(),
-                     "m12");
-   if(lookup)
-   {
-      m_transform[0][1] = ossimString(lookup).toDouble();
-   }
-
-   lookup = kwl.find(newPrefix.c_str(),
-                     "m13");
-   if(lookup)
-   {
-      m_transform[0][2] = ossimString(lookup).toDouble();
-   }
-
-   lookup = kwl.find(newPrefix.c_str(),
-                     "m21");
-   if(lookup)
-   {
-      m_transform[1][0] = ossimString(lookup).toDouble();
-   }
-
-   lookup = kwl.find(newPrefix.c_str(),
-                     "m22");
-   if(lookup)
-   {
-      m_transform[1][1] = ossimString(lookup).toDouble();
-   }
-
-   lookup = kwl.find(newPrefix.c_str(),
-                     "m23");
-   if(lookup)
-   {
-      m_transform[1][2] = ossimString(lookup).toDouble();
-   }
-
-   lookup = kwl.find(newPrefix.c_str(),
-                     "m31");
-   if(lookup)
-   {
-      m_transform[2][0] = ossimString(lookup).toDouble();
-   }
-
-   lookup = kwl.find(newPrefix.c_str(),
-                     "m32");
-   if(lookup)
-   {
-      m_transform[2][1] = ossimString(lookup).toDouble();
-   }
-
-   lookup = kwl.find(newPrefix.c_str(),
-                     "m33");
-   if(lookup)
-   {
-      m_transform[2][2] = ossimString(lookup).toDouble();
-   }
-
-   lookup = kwl.find(newPrefix.c_str(),
-                     "rotate");
-   if(lookup)
-   {
-      double degrees = ossimString(lookup).toDouble();
-      m_transform *=  ossimMatrix3x3::createRotationZMatrix(degrees);
-   }
-   m_inverseTransform = m_transform.i();
-#endif
    return true;
 }
 
@@ -319,44 +238,6 @@ bool ossimImageViewAffineTransform::saveState(ossimKeywordlist& kwl,
            true);
            
    return ossimImageViewTransform::saveState(kwl,prefix);
-   /*
-   kwl.add(prefix,
-           "transform.m11",
-           m_transform[0][0],
-           true);
-   kwl.add(prefix,
-           "transform.m12",
-           m_transform[0][1],
-           true);
-   kwl.add(prefix,
-           "transform.m13",
-           m_transform[0][2],
-           true);
-   kwl.add(prefix,
-           "transform.m21",
-           m_transform[1][0],
-           true);
-   kwl.add(prefix,
-           "transform.m22",
-           m_transform[1][1],
-           true);
-   kwl.add(prefix,
-           "transform.m23",
-           m_transform[1][2],
-           true);
-   kwl.add(prefix,
-           "transform.m31",
-           m_transform[2][0],
-           true);
-   kwl.add(prefix,
-           "transform.m32",
-           m_transform[2][1],
-           true);
-   kwl.add(prefix,
-           "transform.m33",
-           m_transform[2][2],
-           true);
-   */
 }
 
 bool ossimImageViewAffineTransform::isValid()const
@@ -364,19 +245,29 @@ bool ossimImageViewAffineTransform::isValid()const
    return true;
 }
 
-bool ossimImageViewAffineTransform::setView(ossimObject* /* obj */)
+bool ossimImageViewAffineTransform::setView(ossimObject* obj)
 {
-   return false;
+   ossimImageViewAffineTransform* view = dynamic_cast<ossimImageViewAffineTransform*> (obj);
+   if(view)
+   {  
+      m_transform = view->m_transform;
+      m_inverseTransform = view->m_inverseTransform;
+      m_rotation = view->m_rotation;
+      m_scale = view->m_scale;
+      m_translate = view->m_translate;
+      m_pivot = view->m_pivot;
+   }
+   return (view!=0);
 }
 
 ossimObject* ossimImageViewAffineTransform::getView()
 {
-   return NULL;
+   return this;
 }
 
 const ossimObject* ossimImageViewAffineTransform::getView()const
 {
-   return NULL;
+   return this;
 }
 
 ossimDpt ossimImageViewAffineTransform::getInputMetersPerPixel()const
@@ -392,3 +283,24 @@ ossimDpt ossimImageViewAffineTransform::getOutputMetersPerPixel()const
    
    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_scale.isEqualTo(rhs->m_scale))&&
+                   (m_translate.isEqualTo(rhs->m_translate))&&
+                   (m_pivot.isEqualTo(rhs->m_pivot))
+                   );  
+      }
+   }
+   
+   return result;
+}
diff --git a/src/ossim/projection/ossimImageViewProjectionTransform.cpp b/src/ossim/projection/ossimImageViewProjectionTransform.cpp
index 798f1e6..77ef68d 100644
--- a/src/ossim/projection/ossimImageViewProjectionTransform.cpp
+++ b/src/ossim/projection/ossimImageViewProjectionTransform.cpp
@@ -16,12 +16,16 @@
 // LIMITATIONS: None.
 //
 //*****************************************************************************
-//  $Id: ossimImageViewProjectionTransform.cpp 18990 2011-03-01 19:41:50Z gpotts $
+//  $Id: ossimImageViewProjectionTransform.cpp 20489 2012-01-23 20:07:56Z dburken $
 //
 #include <ossim/projection/ossimImageViewProjectionTransform.h>
-#include <ossim/base/ossimKeywordlist.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",
@@ -99,17 +103,12 @@ void ossimImageViewProjectionTransform::imageToView(const ossimDpt& ip, ossimDpt
    ossimGpt gp;
    m_imageGeometry->localToWorld(ip, gp);
    m_viewGeometry->worldToLocal(gp, vp);
-   
-#if 0
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         <<"DEBUG ossimImageViewProjectionTransform::imageToView:"
-         <<"\n    ip: "<<ip
-         <<"\n    gp: "<<gp
-         <<"\n    vp: "<<vp<<std::endl;
-      
-   }
+
+#if 0 /* Please leave for debug. */
+   cout <<"DEBUG ossimImageViewProjectionTransform::imageToView:"
+        <<"\n    ip: "<<ip
+        <<"\n    gp: "<<gp
+        <<"\n    vp: "<<vp<<std::endl;
 #endif
 }
 
@@ -133,11 +132,15 @@ void ossimImageViewProjectionTransform::viewToImage(const ossimDpt& vp, ossimDpt
    }
    
    // Check for same projection on input and output sides to save projection to ground:
-   if (m_imageGeometry->getProjection() == m_viewGeometry->getProjection())
+   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:
-      if ( (m_imageGeometry->getTransform() == m_viewGeometry->getTransform()) &&
-           (m_imageGeometry->decimationFactor(0) == m_viewGeometry->decimationFactor(0)) )
+      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;
@@ -157,17 +160,13 @@ void ossimImageViewProjectionTransform::viewToImage(const ossimDpt& vp, ossimDpt
    ossimGpt gp;
    m_viewGeometry->localToWorld(vp, gp);
    m_imageGeometry->worldToLocal(gp, ip);
-   
-#if 0
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         <<"DEBUG ossimImageViewProjectionTransform::viewToImage:"
-         <<"\n    vp: "<<vp
-         <<"\n    gp: "<<gp
-         <<"\n    ip: "<<ip<<std::endl;
-      
-   }
+
+#if 0 /* Please leave for debug. */
+   cout <<"DEBUG ossimImageViewProjectionTransform::viewToImage:"
+        <<"\n    vp: "<<vp
+        <<"\n    gp: "<<gp
+        <<"\n    ip: "<<ip
+        <<std::endl;
 #endif
 }
 
@@ -189,14 +188,24 @@ bool ossimImageViewProjectionTransform::setView(ossimObject* 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;
 }
 
@@ -333,7 +342,7 @@ ossimDpt ossimImageViewProjectionTransform::getInputMetersPerPixel() const
 {
     ossimDpt result;
 
-    if(m_imageGeometry->hasProjection())
+    if (m_imageGeometry.valid() && m_imageGeometry->hasProjection())
         result = m_imageGeometry->getProjection()->getMetersPerPixel();
     else
         result.makeNan();
@@ -348,7 +357,7 @@ ossimDpt ossimImageViewProjectionTransform::getOutputMetersPerPixel() const
 {
     ossimDpt result;
 
-    if(m_viewGeometry->hasProjection())
+    if(m_viewGeometry.valid() && m_viewGeometry->hasProjection())
         result = m_viewGeometry->getProjection()->getMetersPerPixel();
     else
         result.makeNan();
@@ -356,3 +365,143 @@ ossimDpt ossimImageViewProjectionTransform::getOutputMetersPerPixel() const
     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/src/ossim/projection/ossimSkyBoxLearSensor.cpp b/src/ossim/projection/ossimIpodSensor.cpp
similarity index 58%
copy from src/ossim/projection/ossimSkyBoxLearSensor.cpp
copy to src/ossim/projection/ossimIpodSensor.cpp
index 89521f0..a952a2f 100644
--- a/src/ossim/projection/ossimSkyBoxLearSensor.cpp
+++ b/src/ossim/projection/ossimIpodSensor.cpp
@@ -9,7 +9,7 @@
 // Sonoma
 //*******************************************************************
 //  $Id$
-#include <ossim/projection/ossimSkyBoxLearSensor.h>
+#include <ossim/projection/ossimIpodSensor.h>
 #include <ossim/projection/ossimUtmProjection.h>
 #include <ossim/base/ossimException.h>
 #include <ossim/base/ossimTrace.h>
@@ -23,34 +23,23 @@
 #include <ossim/base/ossimKeywordNames.h>
 #include <ossim/matrix/newmatio.h>
 
-static ossimTrace traceDebug("ossimSkyBoxLearSensor:debug");
+static ossimTrace traceDebug("ossimIpodSensor:debug");
 
-RTTI_DEF1(ossimSkyBoxLearSensor, "ossimSkyBoxLearSensor", ossimSensorModel);
+RTTI_DEF1(ossimIpodSensor, "ossimIpodSensor", ossimSensorModel);
 
-enum
-{
-   PARAM_ADJ_LON_OFFSET   = 0,
-   PARAM_ADJ_LAT_OFFSET,
-   PARAM_ADJ_ALTITUDE_OFFSET, 
-   PARAM_ADJ_ROLL_OFFSET,
-   PARAM_ADJ_PITCH_OFFSET,
-   PARAM_ADJ_YAW_OFFSET,
-   PARAM_ADJ_FOCAL_LENGTH_OFFSET,
-   PARAM_ADJ_COUNT // here as last paramter for resizing the adjustment list
-};
-
-ossimSkyBoxLearSensor::ossimSkyBoxLearSensor()
+ossimIpodSensor::ossimIpodSensor()
 {
    initAdjustableParameters();
-   theSensorID = "SkyBoxLear";
+   theSensorID = "Ipod";
 }
 
-void ossimSkyBoxLearSensor::imagingRay(const ossimDpt& image_point,
-                                      ossimEcefRay&   image_ray) const
+void ossimIpodSensor::imagingRay(const ossimDpt& image_point,
+                                   ossimEcefRay&   image_ray) const
 {
+
    ossimDpt f1 (image_point - theRefImgPt);
    f1.x *= m_pixelSize.x;
-   f1.y *= -m_pixelSize.y;
+   f1.y *= -m_pixelSize.y; 
    ossimDpt film (f1 - m_principalPoint);
    
    // once we have them we can add distortion fixes 
@@ -61,55 +50,64 @@ void ossimSkyBoxLearSensor::imagingRay(const ossimDpt& image_point,
    // now orient the local film point to the ECEF axes
    // in a north east down lsr space.
    //
-   ossimColumnVector3d rc_body(film.y, film.x, m_focalLength + computeParameterOffset(PARAM_ADJ_FOCAL_LENGTH_OFFSET));
+   ossimColumnVector3d rc_body(film.y, film.x, m_focalLength + computeParameterOffset(6));  
    ossimColumnVector3d rc_ecef = m_ecef2NedInverse*m_air2Ned*rc_body;
    image_ray.setOrigin(m_adjustedPlatformPosition);
    ossimEcefVector     ecf_ray_dir (rc_ecef);
    image_ray.setDirection(ecf_ray_dir);
-   
-}
 
-void ossimSkyBoxLearSensor::lineSampeToWorld(const ossimDpt& image_point,
-                                            ossimGpt&       worldPoint) const
-{
-   ossimEcefRay ray;
-   imagingRay(image_point, ray);
-   ossimElevManager::instance()->intersectRay(ray, worldPoint);
-   
 }
 
-void ossimSkyBoxLearSensor::lineSampleHeightToWorld(const ossimDpt& lineSampPt,
-                                                   const double&   heightEllipsoid,
-                                                   ossimGpt&       worldPt) const
+void ossimIpodSensor::lineSampleHeightToWorld(const ossimDpt& lineSampPt,
+                                     const double&   heightEllipsoid,
+                                     ossimGpt&       worldPt) const
 {
-   //***
-   // First establish imaging ray from image point:
-   //***
-   ossimEcefRay ray;
-   imagingRay(lineSampPt, ray);
-   ossimEcefPoint Pecf (ray.intersectAboveEarthEllipsoid(heightEllipsoid));
-   worldPt = ossimGpt(Pecf);
+   if (!insideImage(lineSampPt))
+   {
+      worldPt.makeNan();
+      //       worldPoint = extrapolate(image_point, heightEllipsoid);
+   }
+   else
+   {
+      //***
+      // First establish imaging ray from image point:
+      //***
+      ossimEcefRay ray;
+      imagingRay(lineSampPt, ray);
+      ossimEcefPoint Pecf (ray.intersectAboveEarthEllipsoid(heightEllipsoid));
+      worldPt = ossimGpt(Pecf);
+   }
 }
 
-void ossimSkyBoxLearSensor::updateModel()
+
+void ossimIpodSensor::updateModel()
 {
-   m_adjustedPlatformPosition = ossimGpt(m_platformPositionEllipsoid.latd()   + computeParameterOffset(PARAM_ADJ_LAT_OFFSET),
-                                         m_platformPositionEllipsoid.lond()   + computeParameterOffset(PARAM_ADJ_LON_OFFSET),
-                                         m_platformPositionEllipsoid.height() + computeParameterOffset(PARAM_ADJ_ALTITUDE_OFFSET));
+
+   m_adjustedPlatformPosition = ossimGpt(m_platformPositionEllipsoid.latd()   + computeParameterOffset(1),
+                                         m_platformPositionEllipsoid.lond()   + computeParameterOffset(0),
+                                         m_platformPositionEllipsoid.height() + computeParameterOffset(5));
    
-   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));
+   double r = ossim::degreesToRadians(m_roll  + computeParameterOffset(2));
+   double p = ossim::degreesToRadians(m_pitch + computeParameterOffset(3) );
+   double y = ossim::degreesToRadians(m_yaw   + computeParameterOffset(4));
    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_air2Ned = rollM*pitchM*yawM;
+                                                    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); 
+
+
+   
+
+   NEWMAT::Matrix camAM   = ossimMatrix3x3::create(0,1,0,-1,0,0,0,0,1); //90 deg rotation @ 3- for camera orientation on copter
+
+   NEWMAT::Matrix camM   = ossimMatrix3x3::create(-1,0,0,0,-1,0,0,0,1); //180 deg rotation @ 3- for corner alignment (mirroring)
+
+   m_air2Ned = camM*rollM*pitchM*yawM*camAM;
    
    double sin_lat = ossim::sind(m_adjustedPlatformPosition.latd());
    double cos_lat = ossim::cosd(m_adjustedPlatformPosition.latd());
@@ -119,7 +117,7 @@ void ossimSkyBoxLearSensor::updateModel()
                  ossimMatrix3x3::create(cos_lat, 0, sin_lat, 0,1,0, -sin_lat,0,cos_lat)*
                  ossimMatrix3x3::create(cos_lon,sin_lon,0, -sin_lon, cos_lon, 0, 0, 0, 1));
    m_ecef2NedInverse = m_ecef2Ned.t();
-   double adjustedFocal = m_focalLength + computeParameterOffset(PARAM_ADJ_FOCAL_LENGTH_OFFSET);
+   double adjustedFocal = m_focalLength + computeParameterOffset(6);
    m_fovIntrack    = (atan((theImageSize.y*theRefImgPt.y)/adjustedFocal));
    m_fovCrossTrack = (atan((theImageSize.x*theRefImgPt.x)/adjustedFocal));
    
@@ -139,66 +137,66 @@ void ossimSkyBoxLearSensor::updateModel()
    theBoundGndPolygon[2] = gpt;
    lineSampleToWorld(theImageClipRect.ll()+ossimDpt(-w, h), gpt);
    theBoundGndPolygon[3] = gpt;
-   
-   try
-   {
-      computeGsd();
+   try{
+   	computeGsd();
    }
    catch(...)
    {
-      
    }
+
 }
 
-void ossimSkyBoxLearSensor::initAdjustableParameters()
+void ossimIpodSensor::initAdjustableParameters()
 {
-   resizeAdjustableParameterArray(PARAM_ADJ_COUNT);
+   resizeAdjustableParameterArray(7);
+   
+   setAdjustableParameter(0, 0.0);
+   setParameterDescription(0, "lon_offset");
+   setParameterUnit(0, "degrees");
    
-   setAdjustableParameter(PARAM_ADJ_LON_OFFSET, 0.0);
-   setParameterDescription(PARAM_ADJ_LON_OFFSET, "lon_offset");
-   setParameterUnit(PARAM_ADJ_LON_OFFSET, "degrees");
-   setParameterSigma(PARAM_ADJ_LON_OFFSET, .001);
+   setAdjustableParameter(1, 0.0);
+   setParameterDescription(1, "lat_offset");
+   setParameterUnit(1, "degrees");
    
-   setAdjustableParameter(PARAM_ADJ_LAT_OFFSET, 0.0);
-   setParameterDescription(PARAM_ADJ_LAT_OFFSET, "lat_offset");
-   setParameterUnit(PARAM_ADJ_LAT_OFFSET, "degrees");
-   setParameterSigma(PARAM_ADJ_LAT_OFFSET, .001);
+   setAdjustableParameter(2, 0.0);
+   setParameterDescription(2, "roll");
+   setParameterUnit(2, "degrees");
    
-   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);
+   setAdjustableParameter(3, 0.0);
+   setParameterDescription(3, "pitch");
+   setParameterUnit(3, "degrees");
    
-   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(4, 0.0);
+   setParameterDescription(4, "yaw");
+   setParameterUnit(4, "degrees");
    
-   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(5, 0.0);
+   setParameterDescription(5, "Altitude delta");
+   setParameterUnit(5, "meters");
    
-   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(6, 0.0);
+   setParameterDescription(6, "focal length delta");
+   setParameterUnit(6, "meters");
+   
+   setParameterSigma(0, .001);
+   setParameterSigma(1, .001);
+   setParameterSigma(2, 10);
+   setParameterSigma(3, 10);
+   setParameterSigma(4, 10);
+   setParameterSigma(5, 100);
+   setParameterSigma(6, .04);
    
-   setAdjustableParameter(PARAM_ADJ_FOCAL_LENGTH_OFFSET, 0.0);
-   setParameterDescription(PARAM_ADJ_FOCAL_LENGTH_OFFSET, "focal_length_offset");
-   setParameterUnit(PARAM_ADJ_FOCAL_LENGTH_OFFSET, "meters");
-   setParameterSigma(PARAM_ADJ_FOCAL_LENGTH_OFFSET, .004);   
 }
 
-bool ossimSkyBoxLearSensor::loadState(const ossimKeywordlist& kwl, const char* prefix)
+bool ossimIpodSensor::loadState(const ossimKeywordlist& kwl, const char* prefix)
 {
-   theGSD.makeNan();
-   theRefImgPt.makeNan();
-   ossimSensorModel::loadState(kwl, prefix);
    if(getNumberOfAdjustableParameters() < 1)
    {
       initAdjustableParameters();
    }
+   theGSD.makeNan();
+   theRefImgPt.makeNan();
+   ossimSensorModel::loadState(kwl, prefix);
    ossimString image_size = kwl.find(prefix, "image_size");
    ossimString pixel_size = kwl.find(prefix, "pixel_size");
    ossimString principal_point = kwl.find(prefix, "principal_point");
@@ -280,7 +278,7 @@ bool ossimSkyBoxLearSensor::loadState(const ossimKeywordlist& kwl, const char* p
          if (traceDebug())
          {
             ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimSkyBoxLearSensor::loadState Caught Exception:\n"
+            << "ossimIpodSensor::loadState Caught Exception:\n"
             << e.what() << std::endl;
          }
       }
@@ -289,7 +287,7 @@ bool ossimSkyBoxLearSensor::loadState(const ossimKeywordlist& kwl, const char* p
    return result;
 }
 
-bool ossimSkyBoxLearSensor::saveState(ossimKeywordlist& kwl, const char* prefix)const
+bool ossimIpodSensor::saveState(ossimKeywordlist& kwl, const char* prefix)const
 {
    ossimSensorModel::saveState(kwl, prefix);
    kwl.add(prefix, "roll", ossimString::toString(m_roll), true);
@@ -297,7 +295,7 @@ bool ossimSkyBoxLearSensor::saveState(ossimKeywordlist& kwl, const char* prefix)
    kwl.add(prefix, "yaw", ossimString::toString(m_yaw), true);
    kwl.add(prefix, "principal_point", m_principalPoint.toString(), true);
    kwl.add(prefix, "pixel_size", m_pixelSize.toString(), true);
-   kwl.add(prefix, "platform_postion",m_platformPosition.toString() ,true);
+   kwl.add(prefix, "platform_position",m_platformPosition.toString() ,true);
    kwl.add(prefix, "focal_length", ossimString::toString(m_focalLength) ,true);
    kwl.add(prefix, "image_size", theImageSize.toString() ,true);
    
diff --git a/src/ossim/projection/ossimLambertConformalConicProjection.cpp b/src/ossim/projection/ossimLambertConformalConicProjection.cpp
index 51560d1..677b55a 100644
--- a/src/ossim/projection/ossimLambertConformalConicProjection.cpp
+++ b/src/ossim/projection/ossimLambertConformalConicProjection.cpp
@@ -8,7 +8,7 @@
 //
 // Calls Lamberts Conformal Conic projection code.  
 //*******************************************************************
-//  $Id: ossimLambertConformalConicProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
+//  $Id: ossimLambertConformalConicProjection.cpp 19640 2011-05-25 15:58:00Z oscarkramer $
 
 #include <iostream>
 #include <iomanip>
@@ -634,7 +634,8 @@ double ossimLambertConformalConicProjection::getStandardParallel2()const
 //*************************************************************************************************
 bool ossimLambertConformalConicProjection::operator==(const ossimProjection& proj) const
 {
-   if (!ossimMapProjection::operator==(proj)) return false;
+   if (!ossimMapProjection::operator==(proj)) 
+      return false;
 
    ossimLambertConformalConicProjection* p = PTR_CAST(ossimLambertConformalConicProjection, &proj);
    if (!p) return false;
diff --git a/src/ossim/projection/ossimLlxyProjection.cpp b/src/ossim/projection/ossimLlxyProjection.cpp
index 5732ec8..056cae4 100644
--- a/src/ossim/projection/ossimLlxyProjection.cpp
+++ b/src/ossim/projection/ossimLlxyProjection.cpp
@@ -11,7 +11,7 @@
 // longitude to x / y" projection.
 // 
 //*******************************************************************
-//  $Id: ossimLlxyProjection.cpp 16479 2010-02-02 19:22:00Z gpotts $
+//  $Id: ossimLlxyProjection.cpp 20060 2011-09-07 12:33:46Z gpotts $
 
 #include <ossim/projection/ossimLlxyProjection.h>
 #include <ossim/elevation/ossimElevManager.h>
@@ -134,7 +134,7 @@ void ossimLlxyProjection::worldToLineSample(const ossimGpt& worldPoint,
 {
    ossimGpt gpt = worldPoint;
    
-   if (theOrigin.datum() != gpt.datum())
+   if (*theOrigin.datum() != *gpt.datum())
    {
       // Apply datum shift if it's not the same.
       gpt.changeDatum(theOrigin.datum());
@@ -147,8 +147,9 @@ void ossimLlxyProjection::worldToLineSample(const ossimGpt& worldPoint,
 void ossimLlxyProjection::lineSampleToWorld(const ossimDpt& lineSampPt,
                                             ossimGpt&       worldPt) const
 {
+   worldPt.makeNan();
    // Start with the origin.  This will keep the origin's datum.
-   worldPt = theUlGpt;
+   worldPt.datum(theOrigin.datum());
    
    double lat = theUlGpt.latd() - (lineSampPt.line * theDegreesPerPixel.y);
    double lon = theUlGpt.lond() + (lineSampPt.samp * theDegreesPerPixel.x);
@@ -310,11 +311,6 @@ bool ossimLlxyProjection::isGeographic() const
    return true;
 }
 
-void ossimLlxyProjection::setOrigin(const ossimGpt& origin)
-{
-   theOrigin = origin;
-}
-
 double ossimLlxyProjection::getLatSpacing() const
 {
    return theDegreesPerPixel.y;
diff --git a/src/ossim/projection/ossimMapProjection.cpp b/src/ossim/projection/ossimMapProjection.cpp
index c178f46..251258c 100644
--- a/src/ossim/projection/ossimMapProjection.cpp
+++ b/src/ossim/projection/ossimMapProjection.cpp
@@ -9,7 +9,7 @@
 // Base class for all map projections.
 // 
 //*******************************************************************
-//  $Id: ossimMapProjection.cpp 19509 2011-05-05 14:11:18Z gpotts $
+//  $Id: ossimMapProjection.cpp 20154 2011-10-13 19:00:18Z dburken $
 
 #include <iostream>
 #include <cstdlib>
@@ -42,21 +42,19 @@ ossimMapProjection::ossimMapProjection(const ossimEllipsoid& ellipsoid,
    :theEllipsoid(ellipsoid),
     theOrigin(origin),
     theDatum(origin.datum()), // force no shifting
-    theMetersPerPixel(1, 1),
-    theDegreesPerPixel(),
     theUlGpt(0, 0),
     theUlEastingNorthing(0, 0),
     theFalseEastingNorthing(0, 0),
     thePcsCode(0),
-    theGcsCode(0),
     theElevationLookupFlag(false),
     theModelTransform(),
     theInverseModelTransform(),
     theModelTransformUnitType(OSSIM_UNIT_UNKNOWN),
-    theProjectionUnits(OSSIM_UNIT_UNKNOWN) 
+    theProjectionUnits(OSSIM_METERS) 
 {
    theUlGpt = theOrigin;
    theUlEastingNorthing.makeNan();
+   theMetersPerPixel.makeNan();
    theDegreesPerPixel.makeNan();
 }
 
@@ -71,12 +69,11 @@ ossimMapProjection::ossimMapProjection(const ossimMapProjection& src)
         theUlEastingNorthing(src.theUlEastingNorthing),
         theFalseEastingNorthing(src.theFalseEastingNorthing),
         thePcsCode(src.thePcsCode),
-        theGcsCode(src.theGcsCode),
         theElevationLookupFlag(false),
         theModelTransform(src.theModelTransform),
         theInverseModelTransform(src.theInverseModelTransform),
         theModelTransformUnitType(src.theModelTransformUnitType),
-        theProjectionUnits(OSSIM_UNIT_UNKNOWN)
+        theProjectionUnits(src.theProjectionUnits)
 {
 }
 
@@ -94,13 +91,6 @@ void ossimMapProjection::setPcsCode(ossim_uint32 pcsCode)
    thePcsCode = pcsCode;
 }
 
-void ossimMapProjection::setGcsCode(ossim_uint32 gcsCode)
-{
-   theGcsCode = gcsCode;
-}
-
-
-
 ossim_uint32 ossimMapProjection::getPcsCode() const
 {
    // The PCS code is not always set when the projection is instantiated with explicit parameters,
@@ -121,15 +111,6 @@ ossim_uint32 ossimMapProjection::getPcsCode() const
    return thePcsCode;
 }
 
-ossim_uint32 ossimMapProjection::getGcsCode() const
-{
-   // Take this opportunity to make sure the GCS code were initialized before saving state.
-   // See comments in getPcsCode()
-   if ((theGcsCode == 0) && theDatum)
-      theGcsCode = theDatum->epsgCode() - 2000;
-   return theGcsCode;
-}
-
 ossimString ossimMapProjection::getProjectionName() const
 {
    return getClassName();
@@ -197,24 +178,31 @@ void ossimMapProjection::setAB(double a, double b)
 
 void ossimMapProjection::setDatum(const ossimDatum* datum)
 {
-   if(datum)
-   {
-      theDatum = datum; 
-      setEllipsoid( *(datum->ellipsoid()));
-      theGcsCode = datum->epsgCode() - 2000;
-      update();
-   }
+
+   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;
-   theDatum     = theOrigin.datum();
-   theEllipsoid = *(theDatum->ellipsoid());
+   theOrigin.changeDatum(theDatum);
       
    update();
 }
@@ -251,17 +239,12 @@ void ossimMapProjection::update()
    {
       if(theMetersPerPixel.hasNans())
       {
-         computeMetersPerPixel(theDegreesPerPixel.y,
-                               theDegreesPerPixel.x,
-                               theMetersPerPixel);
+         computeMetersPerPixel();
       }
    }
    else if(!theMetersPerPixel.hasNans())
    {
-      computeDegreesPerPixel(theOrigin,
-                             theMetersPerPixel,
-                             theDegreesPerPixel.y,
-                             theDegreesPerPixel.x);
+      computeDegreesPerPixel();
    }
    // compute the tie points if not already computed
    //
@@ -276,16 +259,6 @@ void ossimMapProjection::update()
       theUlGpt = theOrigin;
       theUlEastingNorthing = forward(theUlGpt);
    }
-
-   // Projection Coordinate System(PCS) code check. Since this projection may have changed, it may
-   // no longer correspond to it's original PCS code (same for datum GCS code):
-   if ((thePcsCode != 0) && (thePcsCode != 32767))
-   {
-      ossimRefPtr<ossimProjection> proj = ossimEpsgProjectionFactory::instance()->
-         createProjection(ossimString::toString(thePcsCode));
-      if (proj.valid() && (*proj.get() != *this))
-         thePcsCode = 0;
-   }
 }
 
 void ossimMapProjection::updateFromTransform()
@@ -322,9 +295,7 @@ void ossimMapProjection::updateFromTransform()
             len = ut.getValue(OSSIM_DEGREES);
             theDegreesPerPixel = ossimDpt(len, len);
             theUlGpt = wpt1;
-            computeMetersPerPixel(theDegreesPerPixel.y,
-                                  theDegreesPerPixel.x,
-                                  theMetersPerPixel);
+            computeMetersPerPixel();
             break;
          }
          default:
@@ -340,10 +311,7 @@ void ossimMapProjection::updateFromTransform()
             len = ut.getValue(OSSIM_METERS);
             theMetersPerPixel = ossimDpt(len, len);
             theUlEastingNorthing = mpt1;
-            computeDegreesPerPixel(theOrigin,
-                                   theMetersPerPixel,
-                                   theDegreesPerPixel.y,
-                                   theDegreesPerPixel.x);
+            computeDegreesPerPixel();
             break;
          }
       }
@@ -354,6 +322,24 @@ void ossimMapProjection::updateFromTransform()
 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;
@@ -361,15 +347,24 @@ void ossimMapProjection::applyScale(const ossimDpt& scale,
 
    if ( recenterTiePoint )
    {
-      snapTiePointToOrigin();
+      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;
+      theModelTransform.getData()[0][0] = theModelTransform.getData()[0][0]*scale.x;
+      theModelTransform.getData()[1][1] = theModelTransform.getData()[1][1]*scale.y;
 
       theInverseModelTransform = theModelTransform;
       theInverseModelTransform.i();
@@ -709,24 +704,16 @@ void ossimMapProjection::lineSampleToEastingNorthing(const ossimDpt& lineSample,
 }
 
 
-void ossimMapProjection::setMetersPerPixel(const ossimDpt& gsd)
+void ossimMapProjection::setMetersPerPixel(const ossimDpt& resolution)
 {
-   theMetersPerPixel=gsd;
-   computeDegreesPerPixel(theOrigin,
-                          theMetersPerPixel,
-                          theDegreesPerPixel.y,
-                          theDegreesPerPixel.x);
+   theMetersPerPixel = resolution;
+   computeDegreesPerPixel();
 }
 
-void ossimMapProjection::setDecimalDegreesPerPixel(const ossimDpt& gsd)
+void ossimMapProjection::setDecimalDegreesPerPixel(const ossimDpt& resolution)
 {
-   theDegreesPerPixel.y = gsd.lat;
-   theDegreesPerPixel.x = gsd.lon;
-
-   computeMetersPerPixel(theOrigin,
-                         gsd.lat,
-                         gsd.lon,
-                         theMetersPerPixel);
+   theDegreesPerPixel = resolution;
+   computeMetersPerPixel();
 }
 
 void ossimMapProjection::eastingNorthingToWorld(const ossimDpt& eastingNorthing,
@@ -771,8 +758,8 @@ void ossimMapProjection::setUlTiePoints(const ossimGpt& gpt)
 
 void ossimMapProjection::setUlTiePoints(const ossimDpt& eastingNorthing)
 {
-   setUlGpt(inverse(eastingNorthing));
    setUlEastingNorthing(eastingNorthing);
+   setUlGpt(inverse(eastingNorthing));
 }
 
 
@@ -792,6 +779,10 @@ void ossimMapProjection::setUlEastingNorthing(const ossimDpt& ulEastingNorthing)
 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);
 }
 
 //*****************************************************************************
@@ -826,13 +817,9 @@ bool ossimMapProjection::saveState(ossimKeywordlist& kwl, const char* prefix) co
    ossim_uint32 code = getPcsCode();
    if (code)
    {
-      kwl.add(prefix, ossimKeywordNames::PCS_CODE_KW, code, true);
       ossimString epsg_spec = ossimString("EPSG:") + ossimString::toString(code);
       kwl.add(prefix, ossimKeywordNames::SRS_NAME_KW, epsg_spec, true);
    }
-   code = getGcsCode();
-   if(code != 0)
-      kwl.add(prefix, ossimKeywordNames::GCS_CODE_KW, code, true);
    
    if(isGeographic())
    {
@@ -873,18 +860,13 @@ bool ossimMapProjection::saveState(ossimKeywordlist& kwl, const char* prefix) co
               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);
+   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)
    {
@@ -907,12 +889,6 @@ bool ossimMapProjection::saveState(ossimKeywordlist& kwl, const char* prefix) co
               ossimUnitTypeLut::instance()->getEntryString(theModelTransformUnitType),
               true);
    }
-   
-   if(theProjectionUnits != OSSIM_UNIT_UNKNOWN)
-   {
-      ossimString units = ossimUnitTypeLut::instance()->getEntryString(theProjectionUnits);
-      kwl.add(prefix, ossimKeywordNames::FALSE_EASTING_NORTHING_UNITS_KW, units, true);
-   }
 
    return true;
 }
@@ -935,9 +911,9 @@ bool ossimMapProjection::loadState(const ossimKeywordlist& kwl, const char* pref
 
    const char *lookup;
 
-   // Get the Projection Coordinate System and Geographic Coordinate system (Datum) codes
-   // (assumed from EPSG database). NOTE: the codes are read here for saving in this object only. 
-   // The codes are not verified until a call to getPcs/GcsCode() is called. If ONLY these codes 
+   // 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
@@ -945,22 +921,18 @@ bool ossimMapProjection::loadState(const ossimKeywordlist& kwl, const char* pref
    lookup = kwl.find(prefix, ossimKeywordNames::PCS_CODE_KW);
    if(lookup)
       thePcsCode = ossimString(lookup).toUInt32(); // EPSG PROJECTION CODE
-   theGcsCode = 0;
-   lookup = kwl.find(prefix, ossimKeywordNames::GCS_CODE_KW);
-   if(lookup)
-      theGcsCode = ossimString(lookup).toUInt32(); // EPSG DATUM CODE
 
-   // The datum can be specified in 2 ways: either via OSSIM/geotrans alpha-codes or EPSG GCS.
+   // 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)
+   if (theDatum == NULL)
    {
-      // Let's assign a proper GCS code from the EPSG database if needed and available:
-      if (theGcsCode == 0)
-         theGcsCode = theDatum->epsgCode() - 2000;
-   }
-   else
       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();
@@ -1183,22 +1155,23 @@ bool ossimMapProjection::loadState(const ossimKeywordlist& kwl, const char* pref
 
       switch (theProjectionUnits)
       {
-      case OSSIM_METERS:
+         case OSSIM_METERS:
          {
             theFalseEastingNorthing = eastingNorthing;
             break;
          }
-      case OSSIM_FEET:
-      case OSSIM_US_SURVEY_FEET:
+         case OSSIM_FEET:
+         case OSSIM_US_SURVEY_FEET:
          {
             ossimUnitConversionTool ut;
             ut.setValue(eastingNorthing.x, theProjectionUnits);
             theFalseEastingNorthing.x = ut.getValue(OSSIM_METERS);
             ut.setValue(eastingNorthing.y, theProjectionUnits);
             theFalseEastingNorthing.y = ut.getValue(OSSIM_METERS);
+            theProjectionUnits = OSSIM_METERS;
             break;
          }
-      default:
+         default:
          {
             if(traceDebug())
             {
@@ -1388,8 +1361,7 @@ std::ostream& ossimMapProjection::print(std::ostream& out) const
        << theFalseEastingNorthing.toString().c_str()
        << "\n" << ossimKeywordNames::FALSE_EASTING_NORTHING_UNITS_KW << ": "
        << ossimUnitTypeLut::instance()->getEntryString(OSSIM_METERS)
-       << "\n" << ossimKeywordNames::PCS_CODE_KW << ": " << thePcsCode
-       << "\n" << ossimKeywordNames::GCS_CODE_KW << ": " << theGcsCode;
+       << "\n" << ossimKeywordNames::PCS_CODE_KW << ": " << thePcsCode;
 
    if(isGeographic())
    {
@@ -1423,21 +1395,13 @@ std::ostream& ossimMapProjection::print(std::ostream& out) const
 //  METHOD: ossimMapProjection::computeDegreesPerPixel
 //
 //*****************************************************************************
-void ossimMapProjection::computeDegreesPerPixel(const ossimGpt& ground,
-                                                const ossimDpt& metersPerPixel,
-                                                double &deltaLat,
-                                                double &deltaLon)
+void ossimMapProjection::computeDegreesPerPixel()
 {
-//    ossimDpt mpd = ground.metersPerDegree();
-//    ossimDpt dpm(1.0/mpd.x,
-//                 1.0/mpd.y);
-//    deltaLat = metersPerPixel.y*dpm.y;
-//    deltaLon = metersPerPixel.x*dpm.x;
-   ossimDpt eastNorthGround = forward(ground);
+   ossimDpt eastNorthGround = forward(theOrigin);
    ossimDpt rightEastNorth  =  eastNorthGround;
    ossimDpt downEastNorth   =  eastNorthGround;
-   rightEastNorth.x += metersPerPixel.x;
-   downEastNorth.y  -= metersPerPixel.y;
+   rightEastNorth.x += theMetersPerPixel.x;
+   downEastNorth.y  -= theMetersPerPixel.y;
 
    ossimGpt rightGpt = inverse(rightEastNorth);
    ossimGpt downGpt  = inverse(downEastNorth);
@@ -1445,50 +1409,40 @@ void ossimMapProjection::computeDegreesPerPixel(const ossimGpt& ground,
    // use euclidean distance to get length along the horizontal (lon)
    // and vertical (lat) directions
    //
-   double tempDeltaLat = rightGpt.latd() - ground.latd();
-   double tempDeltaLon = rightGpt.lond() - ground.lond();
-   deltaLon = sqrt(tempDeltaLat*tempDeltaLat + tempDeltaLon*tempDeltaLon);
+   double tempDeltaLat = rightGpt.latd() - theOrigin.latd();
+   double tempDeltaLon = rightGpt.lond() - theOrigin.lond();
+   theDegreesPerPixel.lon = sqrt(tempDeltaLat*tempDeltaLat + tempDeltaLon*tempDeltaLon);
 
-   tempDeltaLat = downGpt.latd() - ground.latd();
-   tempDeltaLon = downGpt.lond() - ground.lond();
-   deltaLat = 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(const ossimGpt& center,
-                                               double deltaDegreesPerPixelLat,
-                                               double deltaDegreesPerPixelLon,
-                                               ossimDpt &metersPerPixel)
+void ossimMapProjection::computeMetersPerPixel()
 {
-   ossimGpt right=center;
-   ossimGpt down=center;
-
-   down.latd(center.latd()  + deltaDegreesPerPixelLat);
-   right.lond(center.lond() + deltaDegreesPerPixelLon);
-
-   ossimDpt centerMeters = forward(center);
+//#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);
 
-   metersPerPixel.x = (rightMeters - centerMeters).length();
-   metersPerPixel.y = (downMeters  - centerMeters).length();
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::computeMetersPerPixel
-//
-//*****************************************************************************
-void ossimMapProjection::computeMetersPerPixel(double deltaDegreesPerPixelLat,
-                                               double deltaDegreesPerPixelLon,
-                                               ossimDpt &metersPerPixel)
-{
-   computeMetersPerPixel(theOrigin,
-                         deltaDegreesPerPixelLat,
-                         deltaDegreesPerPixelLon,
-                         metersPerPixel);
+   theMetersPerPixel.x = (rightMeters - centerMeters).length();
+   theMetersPerPixel.y = (downMeters  - centerMeters).length();
+#endif
 }
 
 //**************************************************************************************************
@@ -1551,6 +1505,46 @@ bool ossimMapProjection::operator==(const ossimProjection& projection) const
    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;
diff --git a/src/ossim/projection/ossimMgrs.c b/src/ossim/projection/ossimMgrs.c
index 25f5549..59d1b48 100644
--- a/src/ossim/projection/ossimMgrs.c
+++ b/src/ossim/projection/ossimMgrs.c
@@ -1009,14 +1009,14 @@ long Break_OSSIM_MGRS_String (const char* OSSIM_MGRS,
 
 long Set_OSSIM_MGRS_Parameters (double a,
                           double f,
-                          char   *Ellipsoid_Code)
+                          const char* Ellipsoid_Code)
 /*
  * The function SET_OSSIM_MGRS_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 OSSIM_MGRS_NO_ERROR is returned.
  *
  *   a                : Semi-major axis of ellipsoid in meters  (input)
- *   f                : Flattening of ellipsoid					        (input)
+ *   f                : Flattening of ellipsoid                 (input)
  *   Ellipsoid_Code   : 2-letter code for ellipsoid             (input)
  */
 { /* Set_OSSIM_MGRS_Parameters  */
diff --git a/src/ossim/projection/ossimNitfProjectionFactory.cpp b/src/ossim/projection/ossimNitfProjectionFactory.cpp
index 4c3f9c2..834d41d 100644
--- a/src/ossim/projection/ossimNitfProjectionFactory.cpp
+++ b/src/ossim/projection/ossimNitfProjectionFactory.cpp
@@ -9,38 +9,31 @@
 //
 // Contains class definition for ossimNitfProjectionFactory.
 //
-// $Id: ossimNitfProjectionFactory.cpp 18905 2011-02-16 13:30:11Z dburken $
+// $Id: ossimNitfProjectionFactory.cpp 20457 2012-01-13 20:08:49Z dburken $
 //----------------------------------------------------------------------------
 
-#include <fstream>
-#include <cmath>
-
 #include <ossim/projection/ossimNitfProjectionFactory.h>
-#include <ossim/projection/ossimMgrs.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimLlxyProjection.h>
-#include <ossim/projection/ossimBilinearProjection.h>
-#include <ossim/support_data/ossimNitfFile.h>
-#include <ossim/support_data/ossimNitfFileHeader.h>
-#include <ossim/support_data/ossimNitfImageHeader.h>
-#include <ossim/support_data/ossimNitfBlockaTag.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimFilename.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>
 
-#include <ossim/imaging/ossimNitfTileSource.h>
-//---
 // Define Trace flags for use within this file:
-//---
-#include <ossim/base/ossimTrace.h>
 static ossimTrace traceDebug(ossimString("ossimNitfProjectionFactory:debug"));
 
 ossimNitfProjectionFactory* ossimNitfProjectionFactory::theInstance = 0;
@@ -200,12 +193,15 @@ ossimProjection* ossimNitfProjectionFactory::createProjectionFromHeaders(
 {
    ossimProjection* result = 0;
    ossimString version = fileHeader->getVersion();
-   ossimString coordinateSystem   = imageHeader->getCoordinateSystem();
+   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 == "N") || (coordinateSystem == "S") || (coordinateSystem == "U") )
+   else if( (coordinateSystem == "S") || (coordinateSystem == "U") || 
+            ( version != "02.00" && (coordinateSystem == "N") ) )
    {
       result = makeUtm(imageHeader, coordinateSystem);
    }
@@ -217,83 +213,86 @@ ossimProjection* ossimNitfProjectionFactory::makeGeographic(
    const ossimString& coordinateSysetm) const
 {
    ossimProjection* proj = 0;
-   if (!hdr)
-   {
-      return proj;
-   }
 
-   // 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 )
+   if (hdr)
    {
-      ossimString geographicLocation = hdr->getGeographicLocation();
+      // 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 (traceDebug())
+         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)
+      {
+         if (!isSkewed(gpts))
+         {
+            proj = makeEuiDistant(hdr, gpts);
+         }
+         else
+         {
+            // Image is rotated.  Make a Bilinear.
+            proj = makeBilinear(hdr, gpts);
+         }
+      }
+
+      if (traceDebug() && proj)
       {
          ossimNotify(ossimNotifyLevel_DEBUG)
             << "ossimNitfProjectionFactory::makeGeographic DEBUG:"
-            << "\ngeographicLocation: " << geographicLocation
+            << "\nUpper left corner:   " << gpts[0]
+            << "\nUpper right corner:  " << gpts[1]
+            << "\nLower right corner:  " << gpts[2]
+            << "\nLower left corner:   " << gpts[3] << endl
+            << proj->print(ossimNotify(ossimNotifyLevel_DEBUG))
             << 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);
-      }
-   }
-
-   if (gpts.size() != 4)
-   {
-      return 0;
-   }
-   
-   if (!isSkewed(gpts))
-   {
-      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] << endl
-         << proj->print(ossimNotify(ossimNotifyLevel_DEBUG))
-         << std::endl;
-   }
+   } // matches: if (hdr)
 
    return proj;
 }
@@ -306,135 +305,149 @@ ossimProjection* ossimNitfProjectionFactory::makeUtm(
    if (hdr)
    {
       ossimString geographicLocation = hdr->getGeographicLocation();
-      
-      std::vector<ossimDpt> utmPoints;
-      ossim_uint32 zone;
-      ossimDpt scale;
-      char hemisphere = 'N';
 
-      bool status = true;
-      if ( coordinateSystem == "U")
+      if ( geographicLocation.size() )
       {
-         // 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")
+         std::vector<ossimDpt> utmPoints;
+         ossim_uint32 zone;
+         ossimDpt scale;
+         char hemisphere = 'N';
+         
+         bool status = true;
+         if ( coordinateSystem == "U")
          {
-            hemisphere = 'S';
+            // Sets zone, hemisphere and utmPoints. Returns true on success.
+            status = parseMgrsString(geographicLocation, zone, hemisphere, utmPoints);
          }
-      }
-      
-      if ( status )
-      {
-         if ( traceDebug() )
+         else
          {
-            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)
+            // Sets zone and utmPoints.  Void return...
+            parseUtmString(geographicLocation, zone, utmPoints);
+            if(coordinateSystem == "S")
             {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "utmPoints[" << utmPoints[i] << std::endl;
+               hemisphere = 'S';
             }
          }
          
-         ossimRefPtr<ossimUtmProjection> uproj = new ossimUtmProjection;
-         uproj->setHemisphere(hemisphere);
-         uproj->setZone(zone);
-
-         if(isSkewed(utmPoints))
+         if ( status )
          {
-            std::vector<ossimGpt> gpts;
-            
-            // Try blocka points first as they are more accurate.
-            if ( getBlockaPoints(hdr, gpts) == false )
+            if ( traceDebug() )
             {
-               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);
+               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;
+               }
             }
-
-            // Make a bilinear either from our skewed utm points or the points from the blocka tag.
-            proj = makeBilinear(hdr, gpts);
             
-            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 )
-         {
-            //---
-            // 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) )
+            ossimRefPtr<ossimUtmProjection> uproj = new ossimUtmProjection;
+            uproj->setHemisphere(hemisphere);
+            uproj->setZone(zone);
+            
+            if(isSkewed(utmPoints))
             {
-               if (traceDebug())
+               std::vector<ossimGpt> gpts;
+               
+               // Try blocka points first as they are more accurate.
+               if ( getBlockaPoints(hdr, gpts) == false )
                {
-                  ossimNotify(ossimNotifyLevel_DEBUG)
-                     << "ossimNitfProjectionFactory::makeUtm DEBUG:"
-                     << "\nTie point from blocka: " << gpts[0]
-                     << endl;
+                  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);
+               
+               uproj = 0; // Done with utm projeciton
                
-               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;
+               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 (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 )
+            if( scale.hasNans() == false )
             {
-               mproj->setUlEastingNorthing(tie);
-               mproj->setMetersPerPixel(scale);
+               //---
+               // 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 // cannot cast
+            else // Scale has nans
             {
                if ( proj )
                {
@@ -442,24 +455,16 @@ ossimProjection* ossimNitfProjectionFactory::makeUtm(
                   proj = 0;
                }
             }
-         }
-         else // Scale has nans
-         {
-            if ( proj )
-            {
-               delete proj;
-               proj = 0;
-            }
-         }
+            
+         } // matches: if (status)
+
+      } // matches:  if ( geographicLocation.size() )
          
-      } // matches: if (status)
-      
    } // matches: if (hdr)
    
    return proj;
 }
 
-
 bool ossimNitfProjectionFactory::parseMgrsString(const ossimString& mgrsLocationString,
                                                  ossim_uint32& zone,
                                                  char& hemisphere,
@@ -528,6 +533,20 @@ ossimProjection* ossimNitfProjectionFactory::makeEuiDistant(
    // 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));
diff --git a/src/ossim/projection/ossimPpjFrameSensor.cpp b/src/ossim/projection/ossimPpjFrameSensor.cpp
new file mode 100644
index 0000000..a725059
--- /dev/null
+++ b/src/ossim/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 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/src/ossim/projection/ossimProjectionFactoryRegistry.cpp b/src/ossim/projection/ossimProjectionFactoryRegistry.cpp
index 146184e..d8f5292 100644
--- a/src/ossim/projection/ossimProjectionFactoryRegistry.cpp
+++ b/src/ossim/projection/ossimProjectionFactoryRegistry.cpp
@@ -4,10 +4,11 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimProjectionFactoryRegistry.cpp 19045 2011-03-10 15:50:07Z gpotts $
+// $Id: ossimProjectionFactoryRegistry.cpp 20413 2012-01-03 19:03:59Z dburken $
 #include <ossim/projection/ossimProjectionFactoryRegistry.h>
 #include <ossim/projection/ossimProjectionFactoryBase.h>
 #include <ossim/projection/ossimEpsgProjectionFactory.h>
+#include <ossim/projection/ossimWktProjectionFactory.h>
 #include <ossim/projection/ossimMapProjectionFactory.h>
 #include <ossim/projection/ossimTiffProjectionFactory.h>
 #include <ossim/projection/ossimNitfProjectionFactory.h>
@@ -78,8 +79,13 @@ ossimProjection* ossimProjectionFactoryRegistry::createProjection(ossimImageHand
 ossimProjection* ossimProjectionFactoryRegistry::createProjection(
    const ossimKeywordlist& kwl, const char* prefix)const
 {
-   ossimProjection* result = createNativeObjectFromRegistry(kwl, prefix);
-
+   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) )
    {
       //---
@@ -118,7 +124,7 @@ ossimProjection* ossimProjectionFactoryRegistry::createProjection(
                   bFoundImageLine = true;
                   ossimString s2 = v[0];
                   s2 += ".";
-                  ossim_uint32 idx = 0;
+                  idx = 0;
                   for(;((idx < m_factoryList.size())&&!result); ++idx)
                   {
                      result =  m_factoryList[idx]->createProjection(kwl, s2.c_str());
@@ -139,13 +145,13 @@ void ossimProjectionFactoryRegistry::initializeDefaults()
 {
    registerFactory(ossimSensorModelFactory::instance());
    registerFactory(ossimNitfProjectionFactory::instance());
-   
    registerFactory(ossimTiffProjectionFactory::instance());
+   registerFactory(ossimWktProjectionFactory::instance());
    registerFactory(ossimMapProjectionFactory::instance());
    registerFactory(ossimMiscProjectionFactory::instance());
 
    // KEEP THIS LAST PLEASE!
-   // This factory costructs map projections from EPSG codes. An infinite loop will occur if this
+   // 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.
diff --git a/src/ossim/projection/ossimQuickbirdRpcModel.cpp b/src/ossim/projection/ossimQuickbirdRpcModel.cpp
index 7594b7f..b75dfc0 100644
--- a/src/ossim/projection/ossimQuickbirdRpcModel.cpp
+++ b/src/ossim/projection/ossimQuickbirdRpcModel.cpp
@@ -10,7 +10,7 @@
 // LIMITATIONS: None.
 //
 //*****************************************************************************
-//  $Id: ossimQuickbirdRpcModel.cpp 17932 2010-08-19 20:34:35Z dburken $
+//  $Id: ossimQuickbirdRpcModel.cpp 20606 2012-02-24 12:29:52Z gpotts $
 
 #include <ossim/projection/ossimQuickbirdRpcModel.h>
 #include <ossim/base/ossimException.h>
@@ -39,7 +39,7 @@ RTTI_DEF1(ossimQuickbirdRpcModel, "ossimQuickbirdRpcModel", ossimRpcModel);
 //*************************************************************************************************
 ossimQuickbirdRpcModel::ossimQuickbirdRpcModel()
    :ossimRpcModel(),
-    theSupportData(0)
+    theSupportData(new ossimQuickbirdMetaData())
 {
 }
 
@@ -48,7 +48,7 @@ ossimQuickbirdRpcModel::ossimQuickbirdRpcModel()
 //*************************************************************************************************
 ossimQuickbirdRpcModel::ossimQuickbirdRpcModel(const ossimQuickbirdRpcModel& rhs)
    : ossimRpcModel(rhs),
-     theSupportData(0)
+     theSupportData(new ossimQuickbirdMetaData())
 {
 }
 
@@ -58,7 +58,7 @@ ossimQuickbirdRpcModel::ossimQuickbirdRpcModel(const ossimQuickbirdRpcModel& rhs
 //*************************************************************************************************
 ossimQuickbirdRpcModel::ossimQuickbirdRpcModel(const ossimQbTileFilesHandler* handler)
 :  ossimRpcModel(),
-   theSupportData(0)
+   theSupportData(new ossimQuickbirdMetaData())
 {
    setErrorStatus();
    if (!handler)
@@ -426,6 +426,7 @@ void ossimQuickbirdRpcModel::finishConstruction()
 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.";
@@ -438,12 +439,12 @@ bool ossimQuickbirdRpcModel::saveState(ossimKeywordlist& kwl,
 bool ossimQuickbirdRpcModel::loadState(const ossimKeywordlist& kwl,
                                        const char* prefix)
 {
- if(theSupportData.valid())
+   // 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);
 }
 
diff --git a/src/ossim/projection/ossimRS1SarModel.cpp b/src/ossim/projection/ossimRS1SarModel.cpp
new file mode 100644
index 0000000..3ec1b9a
--- /dev/null
+++ b/src/ossim/projection/ossimRS1SarModel.cpp
@@ -0,0 +1,1083 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Oscar Kramer
+//
+// Description:
+//
+// Sensor Model for Radarsat1 SAR sensor.
+// 
+//*******************************************************************
+//  $Id:$
+
+#include <ossim/projection/ossimRS1SarModel.h>
+#include <cstdio>
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/matrix/newmat.h>
+#include <ossim/base/ossimLsrPoint.h>
+#include <ossim/elevation/ossimElevManager.h>
+
+
+using namespace std;
+using namespace ossim;
+
+static ossimTrace traceDebug("ossimRS1SarModel:debug");
+
+static const double SEC_PER_DAY              = 86400.0;
+static const double NOMINAL_ORBIT_ELEVATION  = 798000.0; // m
+static const double DEG_PER_SEC              = 0.004178074;
+static const double INTRACK_OFFSET_SIGMA     = 1000.0;  // meters
+static const double CRTRACK_OFFSET_SIGMA     = 300.0;
+static const double RADIAL_OFFSET_SIGMA      = 300.0;
+static const double LINE_SCALE_SIGMA         = 0.01;
+static const double SKEW_SIGMA               = 0.1;  // deg
+static const double ORIENTATION_SIGMA        = 0.2;  // deg
+static const double EARTH_ANGULAR_VELOCITY   = 7.2921151467e-05;  // radians/sec
+static const char*  IMAGING_MODE_ID[] = 
+{"UNKNOWN", "SCN", "SCW", "SGC", "SGF", "SGX", "SLC", "SPG", "SSG","RAW","ERS"};
+
+//******************************************************************************
+// Default.
+//******************************************************************************
+ossimRS1SarModel::ossimRS1SarModel()
+:  theCeosData        (0),
+   theImagingMode     (UNKNOWN_MODE)
+{
+   setErrorStatus();
+}
+
+//******************************************************************************
+// Takes a ossimFilename& directory containing support data, initializes the model,
+// and writes out the initial geometry file.
+//******************************************************************************
+ossimRS1SarModel::ossimRS1SarModel(const ossimFilename& imageFile)
+   :
+      theCeosData        (0),
+      theImagingMode     (UNKNOWN_MODE)
+{
+   static const char MODULE[] = "Constructor ossimRS1SarModel(ossimFilename)";
+   if (traceDebug())  CLOG << "entering..." << endl;
+
+   clearErrorStatus();
+
+   // Parse the CEOS data files:
+   ossimFilename dataDirName (imageFile.path());
+   initFromCeos(dataDirName);
+   if(getErrorStatus() != ossimErrorCodes::OSSIM_OK)
+   {
+      return;
+   }
+   if (theImagingMode == UNKNOWN_MODE) 
+      return;
+
+   // Parse the image data file for the local ORPs interpolator:
+   if ((theImagingMode == SCN) || (theImagingMode == SCW))
+      establishOrpGrid();
+   else
+      establishOrpInterp();
+
+   // Establish the ephemeris interpolator:
+   establishEphemeris();
+
+   initAdjParms();
+   establishVehicleSpace();
+
+   if (traceDebug())  CLOG << "returning..." << endl;
+   return;
+}
+
+
+//******************************************************************************
+//  DESTRUCTOR: ~ossimRS1SarModel
+//******************************************************************************
+ossimRS1SarModel::~ossimRS1SarModel()
+{
+   deallocateMemory();
+}
+
+//******************************************************************************
+//  loadSate()
+//******************************************************************************
+bool ossimRS1SarModel::loadState(const ossimKeywordlist& /* kwl */, const char* /* prefix */)
+{
+   // NOT YET IMPLEMENTED
+   setErrorStatus();
+   return false;
+}
+
+//******************************************************************************
+//  saveState()
+//******************************************************************************
+bool ossimRS1SarModel::saveState(ossimKeywordlist& /* kwl */, const char* /* prefix */) const
+{
+   // NOT YET IMPLEMENTED
+   setErrorStatus();
+   return false;
+}
+
+//*************************************************************************************************
+//! Given an image point, returns a ray originating at some arbitrarily high
+//! point (in this model at the sensor position) and pointing towards the target.
+//*************************************************************************************************
+void ossimRS1SarModel::imagingRay(const ossimDpt& image_point, ossimEcefRay& /* image_ray */) const
+{
+   const char* MODULE = "ossimRS1SarModel::imagingRay()";
+
+   // Apply offset, scale, skew, and rotation to image point:
+   ossimDpt offset (theImageSize.line/2.0, theImageSize.samp/2.0);
+   ossimDpt ip1 = image_point - offset;
+   ossimDpt ip2;
+   ip2.line = ip1.line*theCosOrientation*theLineScale +
+      ip1.samp*(theCosOrientation*theSinSkew+theSinOrientation);
+   ip2.samp = -ip1.line*theSinOrientation*theLineScale -
+      ip1.samp*(theSinOrientation*theSinSkew-theCosOrientation);
+
+   // Offset point back to origin of image:
+   ip1 = ip2 + offset;
+
+   // Given new line number, obtain the interpolated ORP:
+   ossimEcefPoint localORP;
+   if ((theImagingMode == SCN) || (theImagingMode == SCW))
+   {
+      ossimGpt gpt (theLatGrid(ip1.x, ip1.y), theLonGrid(ip1.x, ip1.y), theRefHeight);
+      localORP = ossimEcefPoint(gpt);
+   }
+   else
+   {
+      NEWMAT::ColumnVector orpPos(3);
+      theLocalOrpInterp->interpolate(ip1.line, orpPos);
+      localORP = ossimEcefPoint(orpPos[0], orpPos[1], orpPos[2]);
+   }
+   
+   // Establish imaging line time (zero-Doppler time):
+   double arpTime = theFirstLineTime + ip1.line*theTimePerLine;
+
+   NEWMAT::ColumnVector arpEph(3);
+   theArpPosInterp->interpolate(arpTime, arpEph);
+   ossimEcefPoint ecfArpPos (arpEph[0], arpEph[1], arpEph[2]);
+
+   theArpVelInterp->interpolate(arpTime, arpEph);
+   ossimEcefVector ecfArpVel (arpEph[0], arpEph[1], arpEph[2]);
+
+   // Need to correct the velocity vector by the earth rotational velocity:
+   ossimEcefVector earthVel 
+      (-ecfArpPos.y()*EARTH_ANGULAR_VELOCITY, ecfArpPos.x()*EARTH_ANGULAR_VELOCITY, 0.0);
+   ecfArpVel = ecfArpVel - earthVel;
+
+   // Compute a vehicle space with Z near intrack, X normal to Z and range
+   // vector to ORP (slant range normal), and Y in range direction.
+   // Note the application of the position adjustable parameter to the space's
+   // origin (after the range vector was established):
+   ossimEcefVector rangeVector     = localORP - ecfArpPos;
+   ossimEcefVector rangeNormal     = rangeVector.cross(ecfArpVel);
+   // ossimEcefVector zDirection      = rangeNormal.cross(rangeVector);
+   ossimLsrSpace localVehicleSpace (ossimEcefPoint(ecfArpPos + thePosCorrection), // origin
+                                    rangeNormal,  // X-direction
+                                    rangeVector, 0);   // Y-direction (Z not specified
+   double local_orp_range = rangeVector.length();
+
+   // Compute slant range distance to pixel in question:
+   double slant_range = local_orp_range;
+   switch (theImagingMode)
+   {
+   case SLC:
+      if (theDirectionFlag == ASCENDING)
+         slant_range += thePixelSpacing.samp*ip1.samp;
+      else
+         slant_range += (theImageSize.samp-1.0-ip1.samp) * thePixelSpacing.samp;
+      break;
+
+   case SGC:
+   case SGF:
+   case SGX:
+   case ERS:
+      {
+         // Compute the slant range as a polynomial expansion given ground range
+         double ground_range;
+         if (theDirectionFlag == ASCENDING)
+            ground_range = ip1.samp * thePixelSpacing.samp;
+         else
+            ground_range = (theImageSize.samp - 1.0 - ip1.samp) *
+            thePixelSpacing.samp;
+         //         double delta_g_i = 1.0;
+         //         for (int 0=1; i<6; i++)
+         double delta_g_i = ground_range;
+         for (int i=1; i<6; i++)  // NOTE: not using offset (i=0) term
+         {
+            slant_range += theSrGrCoeff[i] * delta_g_i;
+            delta_g_i *= ground_range;
+         }
+      }
+      break;
+
+   case SCN:
+   case SCW:
+      slant_range = local_orp_range;
+      break;
+
+   default:
+      CLOG << "ERROR: Invalid imaging mode encountered." << endl;
+      setErrorStatus();
+   }
+}
+
+//*************************************************************************************************
+// PUBLIC METHOD: ossimRS1SarModel::lineSampleHeightToWorld(image_point, height, is_inside_image)
+//
+//  Performs image to ground projection. 
+//*************************************************************************************************
+void ossimRS1SarModel::lineSampleHeightToWorld(const ossimDpt& image_point,
+                                               const double&   height_ellip,
+                                               ossimGpt&       worldPt) const
+{
+   static const char MODULE[] = "ossimRS1SarModel::lineSampleHeightToWorld()";
+   if (traceDebug())  CLOG << "entering..." << endl;
+
+   // static const int    MAX_NUM_ITERS = 50;
+   // static const double MAX_ELEV_DIFF = 0.001;
+
+   ossimEcefRay imaging_ray;
+   imagingRay(image_point, imaging_ray);
+   worldPt = imaging_ray.intersectAboveEarthEllipsoid(height_ellip);
+         
+   if (traceDebug())  CLOG << "returning..." << endl;
+}
+
+//******************************************************************************
+//  This method sets theImagingMode data member given a character string
+//  abbreviation of the mode.
+//******************************************************************************
+void ossimRS1SarModel::setImagingMode(char* modeStr)
+{
+   static const char MODULE[] = "ossimRS1SarModel::setImagingMode(modeStr)";
+   if (traceDebug())  CLOG << "entering..." << endl;
+
+   bool illegal_mode = false;
+   
+   if (strcmp(modeStr, "SCN") == 0)
+   {
+      theImagingMode = SCN;
+   }
+   else if (strcmp(modeStr, "SCW") == 0)
+   {
+      theImagingMode = SCW;
+   }
+   else if (strcmp(modeStr, "SGC") == 0)
+   {
+      theImagingMode = SGC;
+   }
+   else if (strcmp(modeStr, "SGF") == 0)
+   {
+      theImagingMode = SGF;
+   }
+   else if (strcmp(modeStr, "SGX") == 0)
+   {
+      theImagingMode = SGX;
+   }
+   else if (strcmp(modeStr, "SLC") == 0)
+   {
+      theImagingMode = SLC;
+   }
+   else if (strcmp(modeStr, "SPG") == 0)
+   {
+      theImagingMode = SPG;
+      illegal_mode = true;
+   }
+   else if (strcmp(modeStr, "SSG") == 0)
+   {
+      theImagingMode = SSG;
+      illegal_mode = true;
+   }
+   else if (strcmp(modeStr, "RAW") == 0)
+   {
+      theImagingMode = RAW;
+      illegal_mode = true;
+   }
+   else if (strcmp(modeStr, "ERS") == 0)
+   {
+      theImagingMode = ERS;
+   }
+   else 
+   {
+      theImagingMode = UNKNOWN_MODE;
+      illegal_mode = true;
+   }
+
+   // Test for ERS product:
+   if ((theImagingMode == UNKNOWN_MODE) && theCeosData.valid())
+   {
+      char buf[] = "xxx";
+      strncpy(buf, &(theCeosData->textRec()->product_type[8]), 3);
+      if (strcmp(buf, "ERS") == 0)
+      {
+         theImagingMode = ERS;
+         illegal_mode = false;
+      }
+   }
+      
+   // Filter the imaging modes that are not handled:
+   if (illegal_mode)
+   {
+      CLOG << "\n\t ERROR: The imaging mode <"
+           << IMAGING_MODE_ID[(int) theImagingMode]
+           << "> is currently not supported. \n" << endl;
+      theImagingMode = UNKNOWN_MODE;
+   }
+   
+   if (traceDebug())  CLOG << "returning..." << endl;
+}
+
+
+//******************************************************************************
+//  Initialize various data members from the CEOS records.
+//******************************************************************************
+void ossimRS1SarModel::initFromCeos(const ossimFilename& fname)
+{
+   static const char MODULE[] = "ossimRS1SarModel::initFromCeos()";
+   if (traceDebug())  CLOG << "entering..." << endl;
+
+   // Instantiate a CeosData object:
+   theCeosData = new ossimCeosData(fname);
+   
+   if(theCeosData->errorStatus() != ossimErrorCodes::OSSIM_OK) return;
+   const dataset_sum_rec* dsr = theCeosData->dataSetSumRec();
+   const proc_parm_rec*   ppr = theCeosData->procParmRec();
+   char buf[1024];
+   
+   // Set imaging mode:
+   strncpy(buf, &(theCeosData->volDescRec()->logvol_id[11]), 3);
+   buf[3] = '\0';
+   setImagingMode(buf);
+   
+   // Determine whether ascending or descending path acquisition. This flag
+   // dictates whether the first or last pixel of a line is of shorter range:
+   if (theImagingMode == ERS)
+   {
+      theDirectionFlag = DESCENDING;
+   }
+   else
+   {
+      if (dsr->asc_des[0] == 'A')
+         theDirectionFlag = ASCENDING;
+      else if (dsr->asc_des[0] == 'D')
+         theDirectionFlag = DESCENDING;
+      else
+      {
+         CLOG << "ERROR: Direction Flag: " << dsr->asc_des << " not supported"
+              << endl;
+         theDirectionFlag = UNKNOWN_DIRECTION;
+         setErrorStatus();
+         if (traceDebug())  CLOG << "returning with error..." << endl;
+         return;
+      }
+   }
+
+   // Image (Product) ID:
+   buf[8] = '\0';
+   strncpy(buf, theCeosData->volDescRec()->product_id, 8);
+   theImageID = buf;
+   
+   // pixel spacing in range:
+   buf[16] = '\0';
+   strncpy(buf, dsr->pix_spacing, 16);
+   thePixelSpacing.samp = atof(buf);
+   
+   // pixel spacing in azimuth:
+   strncpy(buf, dsr->line_spacing, 16);
+   buf[16] = '\0';
+   thePixelSpacing.line = atof(buf);
+
+   // The ground reference point (ORP) latitude:
+   ossimGpt grp;
+   strncpy(buf, dsr->pro_lat, 16);
+   buf[16] = '\0';
+   grp.lat = atof(buf);
+      
+   // The ground reference point (ORP) longitude:
+   strncpy(buf, dsr->pro_long, 16);
+   buf[16] = '\0';
+   grp.lon = atof(buf);
+      
+   // The ground reference point (ORP) elevation:
+   strncpy(buf, dsr->terrain_h, 16);
+   buf[16] = '\0';
+   grp.hgt = atof(buf);
+   theORP = ossimEcefPoint(grp);
+   theRefHeight = grp.hgt;
+   
+   // Illumination elevation:
+   strncpy(buf, dsr->incident_ang, 8);
+   buf[8] = '\0';
+   double incidence = atof(buf);
+   theIllumElevation = 90.0 - incidence;
+
+   // Illumination azimuth -- need to determine whether sensor is in normal
+   // right-looking mode or "antarctic" (left-looking) mode:
+   strncpy(buf, dsr->plat_head, 8);
+   theIllumAzimuth = atof(buf);
+   char sensor_orientation[] = "123456789";
+   strncpy(sensor_orientation, ppr->sens_orient, 9);
+   if (strcmp(sensor_orientation, "ANTARCTIC") == 0)
+   {
+      theIllumAzimuth -= 90.0;
+      if (theIllumAzimuth < 0.0) theIllumAzimuth += 360.0;
+   }
+   else
+   {
+      theIllumAzimuth += 90.0;
+      if (theIllumAzimuth >= 360.0) theIllumAzimuth -= 360.0;
+   }
+
+   // Determine the number of lines per image and pixels per line. NOTE: if
+   // image is scan mode, the number of lines must be computed indirectly. 
+   if ((theImagingMode == SCN) || (theImagingMode == SCW))
+   {
+      FILE* fptr = fopen(theCeosData->imageFile().chars(), "r");
+      if (!fptr)
+      {
+         CLOG << " ERROR:\n\tCannot open CEOS image file: "
+              << theCeosData->imageFile() << endl;
+         setErrorStatus();
+         return;
+      }
+      fseek(fptr, 0, SEEK_END);
+      long byte_count = ftell(fptr);
+      buf[6] = '\0';
+      strncpy(buf, theCeosData->imopDescRec()->l_dataset, 6);
+      int lengthOfRec = atoi(buf);
+      theImageSize.line = (byte_count - sizeof(*theCeosData->imopDescRec()))
+                           /lengthOfRec;
+      fclose(fptr);
+   }
+   else
+   {
+      strncpy(buf, theCeosData->imopDescRec()->n_dataset, 6);
+      buf[6] = '\0';
+      theImageSize.line = atoi(buf);
+   }
+   strncpy(buf, theCeosData->imopDescRec()->nleft, 4);
+   buf[4] = '\0';
+   int left_pixels = atoi(buf);
+   strncpy(buf, theCeosData->imopDescRec()->ngrp, 8);
+   buf[8] = '\0';
+   int data_pixels = atoi(buf);
+   strncpy(buf, theCeosData->imopDescRec()->nright, 4);
+   buf[4] = '\0';
+   int right_pixels  = atoi(buf);
+   theImageSize.samp = left_pixels + data_pixels + right_pixels;
+
+   // If ground range product, need to read the ground-to-slant range
+   // conversion coefficients from the proc_parm_rec. NOTE: only single-look
+   // products handled properly. ScanSAR requires reading multiple coefficient
+   // sets. See MDA Detailed Processing Parameter Record Description sec.3.84.
+   if ((theImagingMode==SGC) ||
+       (theImagingMode==SGF) ||
+       (theImagingMode==SGX) ||
+       (theImagingMode==ERS))
+   {
+      buf[16] = '\0';
+      for (int i=0; i<6; i++)
+      {
+         strncpy(buf, ppr->srgr_coefset[0].srgr_coef[i], 16);
+         theSrGrCoeff[i] = atof(buf);
+      }
+   }
+   else
+   {
+      theSrGrCoeff[0] = 0.0;
+      theSrGrCoeff[1] = 1.0;  // note 1.0 here (should never be accessed)
+      theSrGrCoeff[2] = 0.0;
+      theSrGrCoeff[3] = 0.0;
+      theSrGrCoeff[4] = 0.0;
+      theSrGrCoeff[5] = 0.0;
+   }
+   
+   if (traceDebug())
+   {
+      CLOG << "DEBUG -- "
+           << "\n\t theDirectionFlag = " << theDirectionFlag
+           << "\n\t thePixelSpacing = " << thePixelSpacing
+           << "\n\t theORP = " << theORP
+           << "\n\t theRefHeight = " << theRefHeight
+           << "\n\t theImageSize = " << theImageSize
+           << "\n\t sensor_orientation = " << sensor_orientation
+           << "\n\t theIllumElevation = " << theIllumElevation
+           << "\n\t theIllumAzimuth = " << theIllumAzimuth
+           << endl;
+   }
+
+   if (traceDebug())  CLOG << "returning..." << endl;
+}
+
+
+//******************************************************************************
+//  This method sets the rigorous model adjustable parameters to
+//  their initial values.
+//******************************************************************************
+void ossimRS1SarModel::initAdjParms()
+{
+   // Adjustable model not yet implemented
+#if 0
+
+   static const char* MODULE = "ossimRS1SarModel::initAdjParms()";
+   if (traceDebug())  CLOG << "entering..." << endl;
+
+   theInTrackOffset = (init_adj_parm[INTRACK_OFFSET]+adj_parm[INTRACK_OFFSET])
+                      * adj_sigma[INTRACK_OFFSET];
+   
+   theCrTrackOffset = (init_adj_parm[CRTRACK_OFFSET]+adj_parm[CRTRACK_OFFSET])
+                      * adj_sigma[CRTRACK_OFFSET];
+   
+   theRadialOffset = (init_adj_parm[RADIAL_OFFSET]+adj_parm[RADIAL_OFFSET])
+                     * adj_sigma[RADIAL_OFFSET];
+   
+   theLineScale   = (init_adj_parm[LINE_SCALE]+adj_parm[LINE_SCALE])
+                    * adj_sigma[LINE_SCALE];
+   
+   theSkew        = (init_adj_parm[SKEW]+adj_parm[SKEW])
+                    * adj_sigma[SKEW];
+   
+   theOrientation = (init_adj_parm[ORIENTATION]+adj_parm[ORIENTATION]);
+
+   // Initialize base-class initial adjustable parameter array:
+   init_adj_parm[INTRACK_OFFSET]  = theInTrackOffset/adj_sigma[INTRACK_OFFSET];
+   init_adj_parm[CRTRACK_OFFSET]  = theCrTrackOffset/adj_sigma[CRTRACK_OFFSET];
+   init_adj_parm[RADIAL_OFFSET]   = theRadialOffset/adj_sigma[RADIAL_OFFSET];  
+   init_adj_parm[LINE_SCALE]      = theLineScale/adj_sigma[LINE_SCALE];  
+   init_adj_parm[SKEW]            = theSkew/adj_sigma[SKEW];  
+   init_adj_parm[ORIENTATION]     = theOrientation/adj_sigma[ORIENTATION];  
+   
+   //  Initialize sensor adjustable parameter description strings:
+   strncpy (adj_desc[INTRACK_OFFSET], "intrack_offset", MAX_DESC_CHARS);
+   strncpy (adj_desc[CRTRACK_OFFSET], "crtrack_offset", MAX_DESC_CHARS);
+   strncpy (adj_desc[RADIAL_OFFSET],  "radial_offset",  MAX_DESC_CHARS);
+//   strncpy (adj_desc[SAMP_SCALE],  "samp_scale",      MAX_DESC_CHARS);
+   strncpy (adj_desc[LINE_SCALE],   "line_scale",       MAX_DESC_CHARS);
+   strncpy (adj_desc[SKEW],         "image_skew",       MAX_DESC_CHARS);
+   strncpy (adj_desc[ORIENTATION],  "image_orientation",MAX_DESC_CHARS);
+
+   // Initialize the adj_parms (parameter corrections) to 0:
+   for (int i=0; i<num_adj_parm; i++)
+      adj_parm[i] = 0.0;
+   
+   if (traceDebug())  CLOG << "returning..." << endl;
+#endif
+}
+
+
+//******************************************************************************
+//  This method parses the SAR header information associated with the
+//  ephemeris state vectors, and instantiates a Lagrange interpolator object
+//  for interpolating intermediate ehemeris states.
+//******************************************************************************
+void ossimRS1SarModel::establishEphemeris()
+{
+   static const char MODULE[] = "ossimRS1SarModel::establishEphemeris()";
+   if (traceDebug())  CLOG << "entering..." << endl;
+
+   char buf[23];
+   
+   // Establish pointer to platform position data record:
+   const pos_data_rec* pdr = theCeosData->posDataRec();
+   
+   // Establish the Greenwich mean hour angle at time of first sample:
+   char gha_str [23];
+   strncpy(gha_str, pdr->hr_angle, 22);
+   gha_str[22] = '\0';
+   theGHA = atof(gha_str);
+
+   // Fetch number of points in record and allocate memory:
+   strncpy(buf, pdr->ndata, 4);
+   buf[4] = '\0';
+   int numPoints = atoi(buf);
+
+   // Fetch sampling period:
+   strncpy(buf, pdr->data_int, 22);
+   buf[22] = '\0';
+   double sampling_period = atof(buf);
+
+   // Establish the first sample time's day:
+   strncpy(buf, pdr->gmt_day, 4);
+   buf[4] = '\0';
+   int first_day =  atoi(buf);
+   double time_offset = (double) (first_day - theFirstLineDay)*SEC_PER_DAY;
+
+   // Establish the first sample time in seconds from beginning of day:
+   strncpy(buf, pdr->gmt_sec, 22);
+   buf[22] = '\0';
+   theEphFirstSampTime =  atof(buf) + time_offset;
+
+   int i, j;
+   double sample_time = theEphFirstSampTime;
+   buf[22] = '\0';
+   NEWMAT::ColumnVector eciArpPos(3);
+   NEWMAT::ColumnVector eciArpVel(3);
+   NEWMAT::ColumnVector ecfArpPos(3);
+   NEWMAT::ColumnVector ecfArpVel(3);
+   NEWMAT::ColumnVector earthVel(3);
+   NEWMAT::Matrix xform;
+   theArpPosInterp = new ossimLagrangeInterpolator;
+   theArpVelInterp = new ossimLagrangeInterpolator;
+
+   // Loop over each point, converting them to vectors:
+   for (i=0; i<numPoints; i++)
+   {
+      for (j=0; j<3; j++)
+      {
+         strncpy(buf, pdr->pos_vect[i].pos[j], 22);
+         eciArpPos[j] = atof(buf);
+         strncpy(buf, pdr->pos_vect[i].vel[j], 22);
+         eciArpVel[j] = atof(buf)/1000.0;
+      }
+
+      // Convert pos and vel vectors from ECI to ECF:
+      eciToEcfXform(sample_time, xform);
+      ecfArpPos = xform*eciArpPos;
+      ecfArpVel = xform*eciArpVel;
+      theArpPosInterp->addData(sample_time, ecfArpPos);
+
+      // Correct velocity for earth rotation:
+      earthVel[0] = -ecfArpPos[1]*EARTH_ANGULAR_VELOCITY;
+      earthVel[1] =  ecfArpPos[0]*EARTH_ANGULAR_VELOCITY;
+      earthVel[2] =  0.0;
+      ecfArpVel = ecfArpVel - earthVel;
+      theArpVelInterp->addData(sample_time, ecfArpVel);
+
+      sample_time += sampling_period;
+   }
+
+   if (traceDebug())
+   {
+      CLOG << "DEBUG -- "
+           << "\n\t theGHA:              " << theGHA 
+           << "\n\t numPoints:           " << numPoints 
+           << "\n\t sampling_period:     " << sampling_period 
+           << "\n\t theEphFirstSampTime: " << theEphFirstSampTime << endl;
+   }
+
+   if (traceDebug())  CLOG << "returning..." << endl;
+}
+
+
+//******************************************************************************
+//  Returns 3x3 transform to rotate ECI into ECF. The argument is
+// in seconds of the day.
+//******************************************************************************
+void ossimRS1SarModel::eciToEcfXform(const double& acq_time, NEWMAT::Matrix& xform) const
+{
+   static const char MODULE[] = "ossimRS1SarModel::eciToEcfXform(acq_time)";
+   if (traceDebug())  CLOG << "entering..." << endl;
+
+   // Determine time elapsed since ephemeris first sample time:
+   double delta_t = acq_time - theEphFirstSampTime;
+
+   // Compute GHA at time of this image line (in degrees):
+   double gha = theGHA + delta_t*DEG_PER_SEC;
+   if (gha >= 360.0)
+      gha -=360.0;
+   else if (gha < 0.0)
+      gha += 360.0;
+   
+   // Establish rotation:
+   double cos_gha = ossim::cosd(gha);
+   double sin_gha = ossim::sind(gha);
+
+   // Establish rotation matrix:
+   xform = ossimMatrix3x3::create(cos_gha,  sin_gha,  0.0,
+                                 -sin_gha,  cos_gha,  0.0,
+                                      0.0,      0.0,  1.0);
+   if (traceDebug())
+   {
+      CLOG << "DEBUG -- "
+           << "\n\t acq_time = " << acq_time
+           << "\n\t delta_t  = " << delta_t
+           << "\n\t gha      = " << gha << endl;
+   }
+
+   if (traceDebug())  CLOG << "returning..." << endl;
+}
+   
+
+//******************************************************************************
+// PRIVATE METHOD: ossimRS1SarModel::establishOrpInterp()
+//  
+//  This method reads the image data file for obtaining the local ORPs (taken
+//  to be the lat-lon of the nearest pixel for each line), and the zero-doppler
+//  time for each line. These ORPs are used for computing SPNs.
+//
+//  The processed data records correspond to lines of imagery. Accompanying
+//  each data line is the lat-lon (at the ellipsoid) of the first, middle, and
+//  last sample of the line, the time of zero-doppler (broadside) imaging for
+//  the line.
+//
+//  A Lagrange interpolator is established with N data points representing the
+//  local ORPs and their corresponding image line numbers
+//  uniformly distributed over the image.
+//
+//  If the image is a ground range product, need to also read the ground-to-
+//  slant range conversion coefficients.
+//  
+//******************************************************************************
+void ossimRS1SarModel::establishOrpInterp()
+{
+   static const char MODULE[] = "ossimRS1SarModel::establishOrpInterp()";
+   if (traceDebug())  CLOG << "entering..." << endl;
+   
+   if (traceDebug())
+      CLOG << "DEBUG -- " << endl;
+
+   static const int      NUM_DATA_POINTS  = 11;
+
+   desc_rec        descRec;
+   pdr_prefix_rec  prefix;
+   int             sizeOfDescRec = sizeof(descRec);
+   int             sizeOfPrefRec = sizeof(prefix);
+   int             headerSize    = sizeOfDescRec + sizeOfPrefRec;
+   char            buf[] = "123456";
+   ossimGpt localOrp (0.0, 0.0, theRefHeight);
+   std::vector<double> line_numbers_list;
+   std::vector<NEWMAT::ColumnVector> orpVectorList; // X, Y, Z
+
+   if (traceDebug())
+   {
+      CLOG << "DEBUG:"
+           << "\nsizeOfDescRec:  " << sizeOfDescRec
+           << "\nsizeOfPrefRec:  " << sizeOfPrefRec << endl;
+   }
+   
+   // Open the image data file given the image directory name and seek to first
+   // SAR data record:
+   FILE* fptr = fopen(theCeosData->imageFile().chars(), "r");
+   if (!fptr)
+   {
+      CLOG << "ERROR: Could not open data file <" << theCeosData->imageFile()
+           << ">" << endl;
+      setErrorStatus();
+      return;
+   }
+   fseek(fptr, theCeosData->imopDescRec()->desc.length, SEEK_SET);
+
+   // Declare some constants and variables used in loop:
+   int last_line    = (int) theImageSize.line - 1;
+   int delta_line   = (int)ceil(last_line/((double)NUM_DATA_POINTS-1.0));
+   int line_number  = 0;
+
+   // Compute the number of SAR data bytes to skip to reach prefix of next
+   // record of interest:
+   strncpy(buf, theCeosData->imopDescRec()->l_dataset, 6);
+   int record_size = atoi(buf);
+   
+   // Loop over each imaging line:
+   int index;
+   theLocalOrpInterp = new ossimLagrangeInterpolator;
+   for (index=0; index<NUM_DATA_POINTS; index++)
+   {
+      if (traceDebug())
+         clog << "\t Processing ORP for line number " << line_number << endl;
+
+      // Read the image line prefix info:
+      fread(&descRec, sizeOfDescRec, 1, fptr);
+      fread(&prefix,  sizeOfPrefRec,  1, fptr);
+
+      // Verify correct line number being read:
+      if ((prefix.line_num-1) != line_number)
+      {
+         CLOG << "\n\tERROR: Synchronization error reading image file. "
+              << "Expected line number " << line_number+1
+              << " but read line number " << prefix.line_num << "." << endl;
+         setErrorStatus();
+         return;
+      }
+      
+      // Latch the imaging time for the first line collected:
+      if (index == 0)
+      {
+         theFirstLineDay  = prefix.acq_date.acq_day;
+         theFirstLineTime = (double) prefix.acq_date.acq_msec/1000.0;
+      }
+      
+      // Read the local ORP for this line and convert to ECF:
+      if (theDirectionFlag == ASCENDING)
+      {
+         localOrp.lat    = (double) prefix.lat_first  / 1.0e6;
+         localOrp.lon = (double) prefix.long_first / 1.0e6;
+      }
+      else
+      {
+         localOrp.lat    = (double) prefix.lat_last  / 1.0e6;
+         localOrp.lon = (double) prefix.long_last / 1.0e6;
+      }
+
+      theLocalOrpInterp->addData(line_number, ossimEcefPoint(localOrp).toVector());
+      
+      // Update the line number for next record, insuring we don't go passed
+      // the last line:
+      line_number += delta_line;
+      if (line_number > last_line)
+      {
+         delta_line -= line_number - last_line;  // adjust for fseek below
+         line_number = last_line;
+      }
+
+      // Advance to read the next prefix record of interest:
+      fseek(fptr, (delta_line)*record_size-headerSize, SEEK_CUR);
+   }
+
+   // Compute time interval between each line, handle possible day rollover:
+   double lastLineTime = (double) prefix.acq_date.acq_msec/1000.0;
+   if ((lastLineTime-theFirstLineTime) > (SEC_PER_DAY/2.0))
+      lastLineTime -= SEC_PER_DAY;
+   else if ((theFirstLineTime-lastLineTime) > (SEC_PER_DAY/2.0))
+      lastLineTime += SEC_PER_DAY;
+   theTimePerLine = (lastLineTime - theFirstLineTime)/line_number;
+
+   if (traceDebug())
+   {
+      clog << "\n\t line_number (last)   = " << line_number
+           << "\n\t last_line (in image) = " << last_line
+           << "\n\t theFirstLineTime     = " << theFirstLineTime
+           << "\n\t lastLineTime         = " << lastLineTime
+           << "\n\t theTimePerLine       = " << theTimePerLine
+           << endl;
+   }
+   
+   if (traceDebug())  CLOG << "returning..." << endl;
+}
+
+//******************************************************************************
+//  This method establishes a common mean intrack-crosstrack-radial LSR
+//  space at the ARP.
+//******************************************************************************
+void ossimRS1SarModel::establishVehicleSpace()
+{
+   static const char MODULE[] = "ossimRS1SarModel::establishVehicleSpace()";
+   if (traceDebug())  CLOG << "entering..." << endl;
+
+   // Obtain the imaging time when the vehicle is at the ARP:
+   double line = theImageSize.line/2.0;
+   double arpTime = theFirstLineTime + line*theTimePerLine;
+
+   // Obtain the ephemeris at this time:
+   NEWMAT::ColumnVector arpPos(3);
+   theArpPosInterp->interpolate(arpTime, arpPos);
+   NEWMAT::ColumnVector arpVel(3);
+   theArpVelInterp->interpolate(arpTime, arpVel);
+
+   // Convert ephemeris to ECF:
+   NEWMAT::Matrix xform;
+   eciToEcfXform(arpTime, xform);
+   ossimEcefPoint ecfArpPos  (xform * arpPos);
+   ossimEcefVector ecfArpVel (xform * arpVel);
+
+   // Need to correct the velocity vector by the earth rotational velocity:
+   ossimEcefVector earthVel(-ecfArpPos.y()*EARTH_ANGULAR_VELOCITY,
+                             ecfArpPos.x()*EARTH_ANGULAR_VELOCITY,
+                             0.0);
+   ecfArpVel = ecfArpVel - earthVel;
+
+   // Establish LSR space for intrack-crosstrack-radial at vehicle:
+   ossimEcefVector intrackDir (ecfArpVel);
+   ossimEcefVector crtrackDir (ecfArpPos.data().cross(intrackDir.data())); 
+   theVehicleSpace = ossimLsrSpace (ecfArpPos, intrackDir, crtrackDir, 0);
+
+   if (traceDebug())
+   {
+      CLOG << "DEBUG -- "
+           << "\n\t theVehicleSpace: " << theVehicleSpace << endl;
+   }
+
+   if (traceDebug())  CLOG << "returning..." << endl;
+}
+   
+
+//******************************************************************************
+//  For scan-mode imagery, this method interpolates the lat/lon given the image pixel.
+//******************************************************************************
+void ossimRS1SarModel::interpolatedScanORP(const ossimDpt& orp, ossimEcefPoint& orp_ecf) const
+{
+   static const char MODULE[] = "ossimRS1SarModel::interpolatedScanORP(gDblPoint)";
+   if (traceDebug())  CLOG << "entering..." << endl;
+
+   ossimGpt gpt;
+   gpt.lat = theLatGrid(orp);
+   gpt.lon = theLonGrid(orp);
+
+   // Convert to ECF:
+   orp_ecf = ossimEcefPoint(gpt);
+   
+   if (traceDebug())  CLOG << "returning..." << endl;
+}
+
+
+//******************************************************************************
+// PRIVATE METHOD: ossimRS1SarModel::establishOrpGrid()
+//
+//  This method establishes a grid of lat-lon across the image for interpolating
+//  the geographic point on the ellipsoid given a pixel value. This is used for
+//  scan-mode imagery for obtaining a local ORP.
+//
+//******************************************************************************
+void ossimRS1SarModel::establishOrpGrid()
+{
+   static const char MODULE[] = "ossimRS1SarModel::establishOrpGrid()";
+   if (traceDebug())  CLOG << "entering..." << endl;
+   
+   if (traceDebug())
+   {
+      CLOG << "DEBUG -- " << endl;
+   }
+
+   static const int      NUM_GRID_POINTS_U  = 11;
+
+   desc_rec        descRec;
+   pdr_prefix_rec  prefix;
+   int             sizeOfDescRec = sizeof(descRec);
+   int             sizeOfPrefRec = sizeof(prefix);
+   int             headerSize    = sizeOfDescRec + sizeOfPrefRec;
+   char            buf[] = "123456";
+   ossimDpt gridSize ((double) NUM_GRID_POINTS_U, 3.0);
+   ossimDpt cellSize (theImageSize.line/gridSize.u, theImageSize.samp/gridSize.v);
+
+   // Because we are doing integer arithmetic, it will be necessary to
+   // consider the last grid cells as being of a slightly different size:
+   //theLastGridCellSize.line = theImageSize.line - 1.0 -
+   //                           (theGridSize.u-2.0)*theGridCellSize.u;
+   //theLastGridCellSize.samp = theImageSize.samp - 1.0 -
+   //                           (theGridSize.v-2.0)*theGridCellSize.v;
+   
+   // Open the image data file given the image directory name and seek to first
+   // SAR data record:
+   FILE* fptr = fopen(theCeosData->imageFile().chars(), "r");
+   if (!fptr)
+   {
+      CLOG << "ERROR: Could not open data file <" << theCeosData->imageFile()
+           << ">" << endl;
+      setErrorStatus();
+      return;
+   }
+   fseek(fptr, theCeosData->imopDescRec()->desc.length, SEEK_SET);
+
+   // Declare some constants and variables used in loop:
+   int last_line    = (int) theImageSize.line - 1;
+   int delta_line   = (int) cellSize.u;
+   int line_number  = 0;
+
+   // Allocate memory for coarse grid:
+   theLatGrid.initialize(gridSize, ossimDpt(0,0), ossimDpt(1,1));
+   theLonGrid.initialize(gridSize, ossimDpt(0,0), ossimDpt(1,1));
+
+   // Compute the number of SAR data bytes to skip to reach prefix of next
+   // record of interest:
+   strncpy(buf, theCeosData->imopDescRec()->l_dataset, 6);
+   int record_size = atoi(buf);
+   int test_line = (int) gridSize.u - 2;
+   
+   // Loop over each imaging line:
+   for (int u=0; u<(int)gridSize.u; u++)
+   {
+      if (traceDebug())
+      {
+         clog << "\t Processing grid line number " << u << endl;
+      }
+
+      // Read the image line prefix info:
+      fread(&descRec, sizeOfDescRec, 1, fptr);
+      fread(&prefix,  sizeOfPrefRec,  1, fptr);
+
+      // Verify correct line number being read:
+      if ((prefix.line_num-1) != line_number)
+      {
+         CLOG << "\n\tERROR: Synchronization error reading image file. "
+              << "Expected line number " << line_number+1
+              << " but read line number " << prefix.line_num << "." << endl;
+         setErrorStatus();
+         return;
+      }
+      
+      // Latch the imaging time for the first line collected:
+      if (u == 0)
+      {
+         theFirstLineDay  = prefix.acq_date.acq_day;
+         theFirstLineTime = (double) prefix.acq_date.acq_msec/1000.0;
+      }
+      
+      // Read the ground points for this line:
+      theLatGrid.setNode(u, 0, (double) prefix.lat_first /1.0e6);
+      theLatGrid.setNode(u, 1, (double) prefix.lat_mid   /1.0e6);
+      theLatGrid.setNode(u, 2, (double) prefix.lat_last  /1.0e6);
+      theLonGrid.setNode(u, 0, (double) prefix.long_first/1.0e6);
+      theLonGrid.setNode(u, 1, (double) prefix.long_mid  /1.0e6);
+      theLonGrid.setNode(u, 2, (double) prefix.long_last /1.0e6);
+      
+      // Update the line number for next record, insuring we don't go passed
+      // the last line:
+      if (u == test_line)
+      {
+         delta_line  = last_line - line_number;
+         line_number = last_line;
+      }
+      else
+      {
+         line_number += delta_line;
+      }
+
+      //***
+      // Advance to read the next prefix record of interest:
+      //***
+      fseek(fptr, (delta_line)*record_size-headerSize, SEEK_CUR);
+   }
+
+   // Compute time interval between each line, handle possible day rollover:
+   double lastLineTime = (double) prefix.acq_date.acq_msec/1000.0;
+   if ((lastLineTime-theFirstLineTime) > (SEC_PER_DAY/2.0))
+   {
+      lastLineTime -= SEC_PER_DAY;
+   }
+   else if ((theFirstLineTime-lastLineTime) > (SEC_PER_DAY/2.0))
+   {
+      lastLineTime += SEC_PER_DAY;
+   }
+   theTimePerLine = (lastLineTime - theFirstLineTime)/line_number;
+
+   if (traceDebug())
+   {
+      clog << "\n\t line_number (last)   = " << line_number
+           << "\n\t last_line (in image) = " << last_line
+           << "\n\t theFirstLineTime     = " << theFirstLineTime
+           << "\n\t lastLineTime         = " << lastLineTime
+           << "\n\t theTimePerLine       = " << theTimePerLine
+           << endl;
+   }
+   
+   if (traceDebug())  CLOG << "returning..." << endl;
+}
+
+//******************************************************************************
+// PRIVATE METHOD: deallocateMemory()
+//  
+//  This method permits the partial destruction of the object so that it may
+//  be reconstructed without invoking the destructor.
+//  
+//******************************************************************************
+void ossimRS1SarModel::deallocateMemory()
+{
+   static const char MODULE[] = "ossimRS1SarModel::deallocateMemory()";
+   if (traceDebug())  CLOG << "entering..." << endl;
+
+   theArpPosInterp = 0;
+   theArpVelInterp = 0;
+   theLocalOrpInterp = 0;
+   theCeosData        = 0;
+   theLatGrid.clear();
+   theLonGrid.clear();
+      
+   if (traceDebug())  CLOG << "returning..." << endl;
+}
+
+
diff --git a/src/ossim/projection/ossimRpcModel.cpp b/src/ossim/projection/ossimRpcModel.cpp
index 9989c88..08fd46b 100644
--- a/src/ossim/projection/ossimRpcModel.cpp
+++ b/src/ossim/projection/ossimRpcModel.cpp
@@ -13,7 +13,7 @@
 // LIMITATIONS: Does not support parameter adjustment (YET)
 //
 //*****************************************************************************
-//  $Id: ossimRpcModel.cpp 16174 2009-12-23 16:34:06Z dburken $
+//  $Id: ossimRpcModel.cpp 22283 2013-06-10 18:41:54Z dburken $
 
 #include <ossim/projection/ossimRpcModel.h>
 #include <ossim/elevation/ossimElevManager.h>
@@ -282,7 +282,8 @@ void ossimRpcModel::worldToLineSample(const ossimGpt& ground_point,
 
    if( ground_point.isHgtNan() )
    {
-      nhgt = (theHgtScale - theHgtOffset) / theHgtScale;
+      // nhgt = (theHgtScale - theHgtOffset) / theHgtScale;
+      nhgt = ( - theHgtOffset) / theHgtScale;
    }
    else
    {
@@ -326,6 +327,24 @@ void ossimRpcModel::worldToLineSample(const ossimGpt& ground_point,
 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;
@@ -336,6 +355,7 @@ void  ossimRpcModel::lineSampleToWorld(const ossimDpt& imagePoint,
    {
       worldPoint.makeNan();
    }
+#endif
 }
 
 //*****************************************************************************
@@ -357,6 +377,34 @@ void ossimRpcModel::imagingRay(const ossimDpt& imagePoint,
    // 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;
@@ -374,6 +422,8 @@ void ossimRpcModel::imagingRay(const ossimDpt& imagePoint,
    ossimEcefRay ray(intECFfrom, intECFto);
    
    imageRay = ray;
+
+   #endif
 }
 
 
@@ -523,6 +573,12 @@ void ossimRpcModel::lineSampleHeightToWorld(const ossimDpt& image_point,
          nlon += deltaLon;
       }
       
+      //double h = ossimElevManager::instance()->getHeightAboveEllipsoid(ossimGpt(nlat, nlon));
+     // if(!ossim::isnan(h))
+     // {
+     //   nhgt = h;
+     // }
+
       iteration++;
       
    } while (((fabs(deltaU)>epsilonU) || (fabs(deltaV)>epsilonV))
@@ -692,7 +748,7 @@ ossimObject* ossimRpcModel::dup() const
 //*****************************************************************************
 std::ostream& ossimRpcModel::print(std::ostream& out) const
 {
-   out << "\nDump of ossimRpcModel object at " << hex << this << ":\n"
+   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"
@@ -706,24 +762,24 @@ std::ostream& ossimRpcModel::print(std::ostream& out) const
        << HGT_OFFSET_KW  << ": " << theHgtOffset  << "\n"
        << BIAS_ERROR_KW  << ": " << theBiasError  << "\n"
        << RAND_ERROR_KW  << ": " << theRandError  << "\n"
-       << endl;
+       << std::endl;
 
    for (int i=0; i<NUM_COEFFS; i++)
-      out<<"  "<<LINE_NUM_COEF_KW<<"["<<i<<"]: "<<theLineNumCoef[i]<<endl;
+      out<<"  "<<LINE_NUM_COEF_KW<<"["<<i<<"]: "<<theLineNumCoef[i]<<std::endl;
 
-   out << endl;
+   out << std::endl;
    for (int i=0; i<NUM_COEFFS; i++)
-      out<<"  "<<LINE_DEN_COEF_KW<<"["<<i<<"]: "<<theLineDenCoef[i]<<endl;
+      out<<"  "<<LINE_DEN_COEF_KW<<"["<<i<<"]: "<<theLineDenCoef[i]<<std::endl;
 
-   out << endl;
+   out << std::endl;
    for (int i=0; i<NUM_COEFFS; i++)
-      out<<"  "<<SAMP_NUM_COEF_KW<<"["<<i<<"]: "<<theSampNumCoef[i]<<endl;
+      out<<"  "<<SAMP_NUM_COEF_KW<<"["<<i<<"]: "<<theSampNumCoef[i]<<std::endl;
 
-   out << endl;
+   out << std::endl;
    for (int i=0; i<NUM_COEFFS; i++)
-      out<<"  "<<SAMP_DEN_COEF_KW<<"["<<i<<"]: "<<theSampDenCoef[i]<<endl;
+      out<<"  "<<SAMP_DEN_COEF_KW<<"["<<i<<"]: "<<theSampDenCoef[i]<<std::endl;
       
-   out << endl;
+   out << std::endl;
 
    return ossimSensorModel::print(out);
 }
diff --git a/src/ossim/projection/ossimSensorModel.cpp b/src/ossim/projection/ossimSensorModel.cpp
index 26937c0..8aa771b 100644
--- a/src/ossim/projection/ossimSensorModel.cpp
+++ b/src/ossim/projection/ossimSensorModel.cpp
@@ -27,7 +27,7 @@
 // LIMITATIONS: None.
 //
 //*****************************************************************************
-//  $Id: ossimSensorModel.cpp 19509 2011-05-05 14:11:18Z gpotts $
+//  $Id: ossimSensorModel.cpp 21808 2012-10-05 14:23:33Z dhicks $
 #include <iostream>
 #include <sstream>
 using namespace std;
@@ -1066,13 +1066,52 @@ void ossimSensorModel::imagingRay(const ossimDpt& image_point,
 //*****************************************************************************
 //  METHOD: ossimSensorModel::getObsCovMat()
 //  
-//  Default implementation for computing imaging ray from image point.
+//  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 ossimDpt& /* ipos */ , NEWMAT::SymmetricMatrix& Cov, const ossim_float64 defPointingSigma)
 {
-   return ossimSensorModel::COV_INVALID;
+   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   // 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()
diff --git a/src/ossim/projection/ossimSensorModelFactory.cpp b/src/ossim/projection/ossimSensorModelFactory.cpp
index 8614890..33f5eb2 100644
--- a/src/ossim/projection/ossimSensorModelFactory.cpp
+++ b/src/ossim/projection/ossimSensorModelFactory.cpp
@@ -11,7 +11,7 @@
 //   Contains implementation of class ossimSensorModelFactory
 //
 //*****************************************************************************
-//  $Id: ossimSensorModelFactory.cpp 18687 2011-01-14 15:24:38Z gpotts $
+//  $Id: ossimSensorModelFactory.cpp 21522 2012-08-23 13:57:45Z dburken $
 #include <fstream>
 #include <algorithm>
 #include <ossim/projection/ossimSensorModelFactory.h>
@@ -43,14 +43,21 @@ static ossimTrace traceDebug = ossimTrace("ossimSensorModelFactory:debug");
 #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/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:
@@ -133,6 +140,10 @@ ossimSensorModelFactory::createProjection(const ossimString &name) const
    {
       return new ossimSkyBoxLearSensor;
    }
+   if(name == STATIC_TYPE_NAME(ossimIpodSensor))
+   {
+      return new ossimIpodSensor;
+   }
    if(name == STATIC_TYPE_NAME(ossimCoarseGridModel))
    {
       return new ossimCoarseGridModel;
@@ -187,16 +198,30 @@ ossimSensorModelFactory::createProjection(const ossimString &name) const
    {
       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;
+   }
 
    //***
    // ADD_MODEL: (Please leave this comment for the next programmer)
@@ -245,8 +270,13 @@ ossimSensorModelFactory::getTypeNameList(std::vector<ossimString>& typeList)
    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));
 
    //***
    // ADD_MODEL: Please leave this comment for the next programmer. Add above.
@@ -258,6 +288,7 @@ ossimSensorModelFactory::getTypeNameList(std::vector<ossimString>& typeList)
 ossimProjection* ossimSensorModelFactory::createProjection(
    const ossimFilename& filename, ossim_uint32  entryIdx) const
 {
+   if(!filename.exists()) return 0;
    static const char MODULE[] = "ossimSensorModelFactory::createProjection";
    
    ossimKeywordlist kwl;
@@ -443,8 +474,14 @@ ossimProjection* ossimSensorModelFactory::createProjection(
       }
       model = 0;
    }
-   model = 0;
    
+   model = new ossimRS1SarModel(filename);
+   if(model->getErrorStatus()!= ossimErrorCodes::OSSIM_OK)
+   {
+      return model.release();
+   }
+   model = 0;
+
    ossimFilename spot5Test = geomFile;
    if(!spot5Test.exists())
    {
@@ -471,6 +508,82 @@ ossimProjection* ossimSensorModelFactory::createProjection(
       }
    }
    
+   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())
    {
@@ -480,6 +593,7 @@ ossimProjection* ossimSensorModelFactory::createProjection(
       }
       model = 0;
    }
+
    return model.release();
 }
    
@@ -546,7 +660,7 @@ void ossimSensorModelFactory::findCoarseGrid(ossimFilename& result,
          {
             if(file.ext().downcase() == "dat")
             {
-               ifstream in(file);
+               std::ifstream in(file.c_str());
                if(in)
                {
                   in.read((char*)tempBuf, 14);
diff --git a/src/ossim/projection/ossimSensorModelTuple.cpp b/src/ossim/projection/ossimSensorModelTuple.cpp
index 3427cb6..0f9eaac 100644
--- a/src/ossim/projection/ossimSensorModelTuple.cpp
+++ b/src/ossim/projection/ossimSensorModelTuple.cpp
@@ -7,7 +7,7 @@
 // Description: Base class for tuple-based ossimSensorModel metric operations.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimSensorModelTuple.cpp 12582 2008-03-27 19:37:27Z dhicks $
+// $Id: ossimSensorModelTuple.cpp 22045 2012-12-28 21:22:35Z dhicks $
 
 #include <ossim/projection/ossimSensorModelTuple.h>
 #include <ossim/projection/ossimPositionQualityEvaluator.h>
@@ -20,12 +20,13 @@
 #include <ossim/base/ossimTrace.h>
 #include <ossim/base/ossimString.h>
 #include <ossim/base/ossimNotify.h>
+#include <ossim/imaging/ossimImageGeometry.h>
 
 static ossimTrace traceDebug(ossimString("ossimSensorModelTuple:debug"));
 static ossimTrace traceExec(ossimString("ossimSensorModelTuple:exec"));
 
 #ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimSensorModelTuple.cpp 12582 2008-03-27 19:37:27Z dhicks $";
+static const char OSSIM_ID[] = "$Id: ossimSensorModelTuple.cpp 22045 2012-12-28 21:22:35Z dhicks $";
 #endif
 
 ossimRpcPqeInputs::ossimRpcPqeInputs()
@@ -177,85 +178,99 @@ intersect(const DptSet_t   obs,
    bool covOK = true;
    bool epOK;
    ossim_int32 nImages = (ossim_int32)obs.size();
-   
-   // Matrices
-   NEWMAT::SymmetricMatrix N(3);
-   NEWMAT::SymmetricMatrix BtWB(3);
-   NEWMAT::Matrix Ni(3,3);
-   NEWMAT::ColumnVector C(3);
-   NEWMAT::ColumnVector BtWF(3);
-   NEWMAT::ColumnVector F(2);
-   NEWMAT::ColumnVector dR(3);
-   NEWMAT::Matrix B(2,3);
-   NEWMAT::SymmetricMatrix W(2);
-   
-   // Get a priori ground estimate
-   ossimGpt estG;
-   theImages[0]->lineSampleHeightToWorld(obs[0], ossim::nan(), estG);
-   
-   for (int iter=0; iter<3; iter++)
-   {   
-      N = 0.0;
-      C = 0.0;
 
-      // Loop over observations
-      for (int i=0; i<nImages; i++)
-      {
-         ossimDpt resid;
-         if (!getGroundObsEqComponents(i, iter, obs[i], estG, resid, B, W))
-            covOK = false;
-         
-         F[0] = resid.x;
-         F[1] = resid.y;
-
-         // Form coefficient matrix & discrepancy vector
-         BtWF << B.t() * W * F;
-         BtWB << B.t() * W * B;
-         C += BtWF;
-         N += BtWB;
-      }
+   if (nImages > 1)
+   {
+
+      // Matrices
+      NEWMAT::SymmetricMatrix N(3);
+      NEWMAT::SymmetricMatrix BtWB(3);
+      NEWMAT::Matrix Ni(3,3);
+      NEWMAT::ColumnVector C(3);
+      NEWMAT::ColumnVector BtWF(3);
+      NEWMAT::ColumnVector F(2);
+      NEWMAT::ColumnVector dR(3);
+      NEWMAT::Matrix B(2,3);
+      NEWMAT::SymmetricMatrix W(2);
+      
+      // Get a priori ground estimate using first point
+      ossimGpt estG;
+      theImages[1]->lineSampleToWorld(obs[1], estG);
+      
+      for (int iter=0; iter<5; iter++)
+      {   
+         N = 0.0;
+         C = 0.0;
+
+   // cout<<"\n Iter: "<<iter;
+         // Loop over observations
+         for (int i=0; i<nImages; i++)
+         {
+            ossimDpt resid;
+            // if (!getGroundObsEqComponents(i, iter, obs[i], estG, resid, B, W))
+            if (!getGroundObsEqComponents(i, obs[i], estG, resid, B, W))
+            {
+               covOK = false;
+            }
+            
+            F[0] = resid.x;
+            F[1] = resid.y;
+   // cout<<"\n  F{"<<i+1<<"}: "<<F[0]<<", "<<F[1];
+
+            // Form coefficient matrix & discrepancy vector
+            BtWF << B.t() * W * F;
+            BtWB << B.t() * W * B;
+            C += BtWF;
+            N += BtWB;
+         }
+
+         // Solve system
+         Ni = invert(N);
+         dR = Ni * C;
+
+   // cout<<"\n    dR: ("<<dR[0]<<", "<<dR[1]<<", "<<dR[2]<<")"<<endl;
+
+         // Update estimate
+         double latUpd = estG.latd()   - dR[0];
+         double lonUpd = estG.lond()   - dR[1];
+         double hgtUpd = estG.height() - dR[2];
 
-      // Solve system
-      Ni = invert(N);
-      dR = Ni * C;
+         estG.latd(latUpd);
+         estG.lond(lonUpd);
+         estG.height(hgtUpd);
 
-      // Update estimate
-      ossimEcefPoint estECF(estG);
-      for (ossim_int32 i=0; i<3; i++)
-         estECF[i] += dR[i];
-      ossimGpt upd(estECF);
-      estG = upd;
+
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "DEBUG: intersect:\n"
+               << "  iteration:\n" << iter
+               // << "  C:\n"  << C 
+               // << "  Ni:\n" << Ni 
+               << "  dR:\n" << dR <<std::endl;
+         }
+      
+      } // iterative loop
       
-      if (traceDebug())
+      // Return intersected point
+      ossimEcefPoint finalEst(estG);
+      pt = finalEst;
+      
+      // Return propagated covariance matrix
+      if (covOK)
       {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG: intersect:\n"
-            << "  iteration:\n" << iter
-            << "  C:\n"  << C 
-            << "  Ni:\n" << Ni 
-            << "  dR:\n" << dR <<std::endl;
+         covMat = Ni;
+         epOK = true;
       }
-   
-   } // iterative loop
-   
-   // Return intersected point
-   ossimEcefPoint finalEst(estG);
-   pt = finalEst;
-   
-   // Return ropagated covariance matrix
-   if (covOK)
-   {
-      covMat = Ni;
-      epOK = true;
+      else
+         epOK = false;
+      
+      // Set operation status
+      if (epOK)
+         opOK = OP_SUCCESS;
+      else
+         opOK = ERROR_PROP_FAIL;
    }
-   else
-      epOK = false;
-   
-   // Set operation status
-   if (epOK)
-      opOK = OP_SUCCESS;
-   else
-      opOK = ERROR_PROP_FAIL;
    
    return opOK;
 }
@@ -336,49 +351,40 @@ intersect(const ossim_int32&     img,
 //*****************************************************************************
 bool ossimSensorModelTuple::getGroundObsEqComponents(
       const ossim_int32 img,
-      const ossim_int32 iter,
       const ossimDpt& obs,
       const ossimGpt& ptEst,
       ossimDpt& resid,
       NEWMAT::Matrix& B,
       NEWMAT::SymmetricMatrix& W) const
 {
-    //   Initialize the observations on 1st iteration
-   if (iter==0)
-   {
-      ossimGpt ptObs(obs.samp,obs.line);
-      theImages[img]->getForwardDeriv(OBS_INIT, ptObs);
-   }
+   // Temporary image geometry
+   ossimImageGeometry* iGeom = new ossimImageGeometry(NULL, theImages[img]);
 
-   //   Evaluate the partials and residuals
-   resid = theImages[img]->getForwardDeriv(EVALUATE, ptEst);
+   // Evaluate residuals
+   ossimDpt computedImg;
+   iGeom->worldToLocal(ptEst, computedImg);
+   resid = obs - computedImg;
 
-   //   Retrieve the partials
-   ossimDpt pWRTx = theImages[img]->getForwardDeriv(P_WRT_X, ptEst);
-   ossimDpt pWRTy = theImages[img]->getForwardDeriv(P_WRT_Y, ptEst);
-   ossimDpt pWRTz = theImages[img]->getForwardDeriv(P_WRT_Z, ptEst);
+   // Evaluate partials B(2X3)
+   NEWMAT::Matrix Bt(3,2);
+   iGeom->computeGroundToImagePartials(Bt, ptEst);
+   B = Bt.t();
 
    // Get covariance matrix & form weight matrix
    NEWMAT::SymmetricMatrix Cov(2);
    ossimSensorModel::CovMatStatus covStatus;
    covStatus = theImages[img]->getObsCovMat(obs,Cov);
-   NEWMAT::Matrix Wfull = invert(Cov);
-   W << Wfull;
-
-   B[0][0] = pWRTx.u;
-   B[1][0] = pWRTx.v;
-   B[0][1] = pWRTy.u;
-   B[1][1] = pWRTy.v;
-   B[0][2] = pWRTz.u;
-   B[1][2] = pWRTz.v;
-   
-   if (traceDebug())
+
+   if (covStatus == ossimSensorModel::COV_INVALID)
    {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG: getGroundObsEqComponents:"
-         << "\n  pWRTx: "<<pWRTx
-         << "\n  pWRTy: "<<pWRTy
-         << "\n  pWRTz: "<<pWRTz <<std::endl;
+      W = 0.0;
+      W(1,1) = 1.0;
+      W(2,2) = 1.0;
+   }
+   else
+   {
+      NEWMAT::Matrix Wfull = invert(Cov);
+      W << Wfull;
    }
    
    bool covOK = false;
@@ -492,13 +498,16 @@ bool ossimSensorModelTuple::computeSingleInterCov(
          ossim_float64 scaled1SigmaHgtRng = abs(scaledHgtRng/theSurfLE90);
          surfLE = scaled1SigmaHgtRng*1.6449;
          
-         ossimNotify(ossimNotifyLevel_INFO)
-            << "\n computeSingleInterCov() RPC NoDEM state selected..."
-            << "\n   RPC Height Scale = " << rpcPar.hgtScale <<" m"
-            << "\n    Scale Divisor   = " <<abs(theSurfCE90)
-            << "\n    1-Sigma Divisor = "<<abs(theSurfLE90)
-            << std::endl;
-      }
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_INFO)
+               << "\n computeSingleInterCov() RPC NoDEM state selected..."
+               << "\n   RPC Height Scale = " << rpcPar.hgtScale <<" m"
+               << "\n    Scale Divisor   = " <<abs(theSurfCE90)
+               << "\n    1-Sigma Divisor = "<<abs(theSurfLE90)
+               << std::endl;
+          }
+     }
       else
       {
          surfCE = theSurfCE90;
@@ -518,16 +527,19 @@ bool ossimSensorModelTuple::computeSingleInterCov(
          theRpcPqeInputs.theSurfaceNormalVector = surfN;
          theRpcPqeInputs.theSurfaceCovMatrix    = surfCovENU;
          
-         ossimNotify(ossimNotifyLevel_INFO)
-            << "\n RPC error prop parameters..."
-            << "\n   Elevation Angle  = " << tEl*DEG_PER_RAD<< " deg"
-            << "\n   Azimuth Angle    = " << tAz*DEG_PER_RAD<<" deg"
-            << "\n   RPC Bias Error   = " <<model->getBiasError() <<" m"
-            << "\n   RPC Random Error = " <<model->getRandError()<<" m"
-            << "\n            surfN   = " <<surfN
-            << "\n       surfCovENU   = \n" <<surfCovENU
-            << std::endl;
-         
+          if(traceDebug())
+          {
+             ossimNotify(ossimNotifyLevel_INFO)
+                        << "\n RPC error prop parameters..."
+                        << "\n   Elevation Angle  = " << tEl*DEG_PER_RAD<< " deg"
+                        << "\n   Azimuth Angle    = " << tAz*DEG_PER_RAD<<" deg"
+                        << "\n   RPC Bias Error   = " <<model->getBiasError() <<" m"
+                        << "\n   RPC Random Error = " <<model->getRandError()<<" m"
+                        << "\n            surfN   = " <<surfN
+                        << "\n       surfCovENU   = \n" <<surfCovENU
+                        << std::endl;
+          }        
+
          ossimEcefPoint pt(ptG);
          
          ossimPositionQualityEvaluator qev
@@ -554,7 +566,7 @@ bool ossimSensorModelTuple::computeSingleInterCov(
       // Standard covariance matrix formation
       // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       // Image contribution
-      covOK = getGroundObsEqComponents(img, 0, obs, ptG, resid, B, W);
+      covOK = getGroundObsEqComponents(img, obs, ptG, resid, B, W);
       BtWB << B.t() * W * B;
 
       // Height contribution
@@ -569,9 +581,12 @@ bool ossimSensorModelTuple::computeSingleInterCov(
       // Check for special case of "no DEM" error propagation, only used for RPC
       if (theSurfAccRepresentsNoDEM)
       {
-         ossimNotify(ossimNotifyLevel_INFO)
-            << "\n computeSingleInterCov() RPC NoDEM state selected..."
-            << " Not valid for this sensor model" << std::endl;
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_INFO)
+               << "\n computeSingleInterCov() RPC NoDEM state selected..."
+               << " Not valid for this sensor model" << std::endl;
+         }
       }
       
       if (hgtRef.getSurfaceCovMatrix(theSurfCE90, theSurfLE90, surfCovENU))
diff --git a/src/ossim/projection/ossimSkyBoxLearSensor.cpp b/src/ossim/projection/ossimSkyBoxLearSensor.cpp
index 89521f0..854a13a 100644
--- a/src/ossim/projection/ossimSkyBoxLearSensor.cpp
+++ b/src/ossim/projection/ossimSkyBoxLearSensor.cpp
@@ -297,7 +297,7 @@ bool ossimSkyBoxLearSensor::saveState(ossimKeywordlist& kwl, const char* prefix)
    kwl.add(prefix, "yaw", ossimString::toString(m_yaw), true);
    kwl.add(prefix, "principal_point", m_principalPoint.toString(), true);
    kwl.add(prefix, "pixel_size", m_pixelSize.toString(), true);
-   kwl.add(prefix, "platform_postion",m_platformPosition.toString() ,true);
+   kwl.add(prefix, "platform_position",m_platformPosition.toString() ,true);
    kwl.add(prefix, "focal_length", ossimString::toString(m_focalLength) ,true);
    kwl.add(prefix, "image_size", theImageSize.toString() ,true);
    
diff --git a/src/ossim/projection/ossimSonomaSensor.cpp b/src/ossim/projection/ossimSonomaSensor.cpp
index 268b3b7..8b5398c 100644
--- a/src/ossim/projection/ossimSonomaSensor.cpp
+++ b/src/ossim/projection/ossimSonomaSensor.cpp
@@ -30,8 +30,10 @@ RTTI_DEF1(ossimSonomaSensor, "ossimSonomaSensor", ossimSensorModel);
 ossimSonomaSensor::ossimSonomaSensor()
 {
    m_utmProjection = new ossimUtmProjection;
-   initAdjustableParameters();
    theSensorID = "Sonoma";
+   m_mount = ossimMatrix4x4::createIdentity();
+   m_mountInverse = m_mount;
+   initAdjustableParameters();
 }
 
 void ossimSonomaSensor::imagingRay(const ossimDpt& /* image_point */,
@@ -83,7 +85,7 @@ void ossimSonomaSensor::lineSampleHeightToWorld(const ossimDpt& image_point,
    else
    {
       ossimColumnVector3d origin = m_compositeMatrix*ossimColumnVector3d(0,0,0);
-      ossimColumnVector3d v = m_compositeMatrix*(m_mount*(m_pixelToCamera*ossimColumnVector3d(image_point.x, image_point.y, 1.0)));
+      ossimColumnVector3d v = m_compositeMatrix*(m_mountInverse*(m_pixelToCamera*ossimColumnVector3d(image_point.x, image_point.y, 1.0)));
       ossimDpt3d rayOrigin(origin[0], origin[1], origin[2]);
       ossimDpt3d rayDirection(v[0]-origin[0],
                               v[1]-origin[1],
@@ -121,7 +123,7 @@ void ossimSonomaSensor::lineSampleToWorld(const ossimDpt& image_point,
    }
    
    ossimColumnVector3d origin = m_compositeMatrix*ossimColumnVector3d(0,0,0);
-   ossimColumnVector3d v = m_compositeMatrix*(m_mount*(m_pixelToCamera*ossimColumnVector3d(image_point.x, image_point.y, 1.0)));
+   ossimColumnVector3d v = m_compositeMatrix*(m_mountInverse*(m_pixelToCamera*ossimColumnVector3d(image_point.x, image_point.y, 1.0)));
    ossimDpt3d rayOrigin(origin[0], origin[1], origin[2]);
    ossimDpt3d rayDirection(v[0]-origin[0],
                            v[1]-origin[1],
@@ -258,7 +260,7 @@ void ossimSonomaSensor::updateModel()
   
    m_compositeMatrix   = (rollM*pitchM*headingM*platformLsrMatrix4x4).i();
    m_compositeMatrixInverse = m_compositeMatrix.i();
-//   m_compositeMatrix = ((rollM*pitchM*headingM)*platformLsrMatrix4x4).t()*m_mount.t();
+//   m_compositeMatrix = ((rollM*pitchM*headingM)*platformLsrMatrix4x4).t()*m_mount;
 //   m_compositeMatrixInverse         = m_compositeMatrix.i();
 #endif
    
@@ -306,7 +308,7 @@ void ossimSonomaSensor::updateModel()
    
    
 //   ossimColumnVector3d v(0.0,0.0,1.0);
-//   v = m*(m_mount*(m_pixelToCamera*v));
+//   v = m*(m_mountInverse*(m_pixelToCamera*v));
 //   ossimEcefVector vec = ossimEcefPoint(v[0], v[1], v[2]) - m_ecefPlatformPosition;
 //   vec.normalize();
    
@@ -363,21 +365,21 @@ void ossimSonomaSensor::initAdjustableParameters()
 
 bool ossimSonomaSensor::loadState(const ossimKeywordlist& kwl, const char* prefix)
 {
-   if(getNumberOfAdjustableParameters() < 1)
-   {
-      initAdjustableParameters();
-   }
    theGSD.makeNan();
    theRefImgPt.makeNan();
    ossimSensorModel::loadState(kwl, prefix);
+   if(getNumberOfAdjustableParameters() < 7)
+   {
+      initAdjustableParameters();
+   }
    if(theRefImgPt.hasNans())
    {
       theRefImgPt = theImageClipRect.midPoint();
    }
    ossimString mount           = kwl.find(prefix, "mount");
-   ossimString pixel_size = kwl.find(prefix, "pixel_size");
+   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 focal_length    = kwl.find(prefix, "focal_length");
    ossimString roll;
    ossimString pitch;
    ossimString heading;
@@ -393,7 +395,7 @@ bool ossimSonomaSensor::loadState(const ossimKeywordlist& kwl, const char* prefi
                   !principal_point.empty()&&
                   !focal_length.empty()&&
                   !platform_position.empty());
-   if(mount)
+   if(!mount.empty())
    {
       mount = mount.trim();
       std::vector<ossimString> values;
@@ -411,17 +413,22 @@ bool ossimSonomaSensor::loadState(const ossimKeywordlist& kwl, const char* prefi
       }
       else 
       {
+         m_mount = ossimMatrix4x4::createIdentity();
+         m_mountInverse = m_mount;
          valid = false;
       }
 
-      ossim_uint32 idx = 0;
-      ossim_int32 row = -1;
-      for(idx = 0; idx < values.size(); ++idx)
+      if(valid)
       {
-         if(idx%4 == 0) ++row;
-         m_mount[row][idx%4] = values[idx].toDouble();
+         ossim_uint32 idx = 0;
+         ossim_int32 row = -1;
+         for(idx = 0; idx < values.size(); ++idx)
+         {
+            if(idx%4 == 0) ++row;
+            m_mount[row][idx%4] = values[idx].toDouble();
+         }
+         m_mountInverse = m_mount.i();
       }
-      m_mount = m_mount.i();
    }
    if(!focal_length.empty())
    {
@@ -486,12 +493,26 @@ bool ossimSonomaSensor::loadState(const ossimKeywordlist& kwl, const char* prefi
 bool ossimSonomaSensor::saveState(ossimKeywordlist& kwl, const char* prefix)const
 {
    ossimSensorModel::saveState(kwl, prefix);
+   
+   ossimString mount;
+   ossim_int32 rowIdx = 0;
+   ossim_int32 colIdx = 0;
+
+   for(rowIdx = 0; rowIdx < m_mount.Nrows(); ++rowIdx)
+   {
+      for(colIdx = 0; colIdx < m_mount.Ncols(); ++ colIdx)
+      {
+         mount += (ossimString::toString(m_mount[rowIdx][colIdx]) + " ");
+      }
+   }
+   
+   kwl.add(prefix, "mount", mount.trim(), true);
    kwl.add(prefix, "roll", ossimString::toString(m_roll), true);
    kwl.add(prefix, "pitch", ossimString::toString(m_pitch), true);
    kwl.add(prefix, "heading", ossimString::toString(m_heading), true);
    kwl.add(prefix, "principal_point", m_principalPoint.toString(), true);
    kwl.add(prefix, "pixel_size", m_pixelSize.toString(), true);
-   kwl.add(prefix, "platform_postion",m_platformPosition.toString() ,true);
+   kwl.add(prefix, "platform_position",m_platformPosition.toString() ,true);
    kwl.add(prefix, "focal_length", ossimString::toString(m_focalLength) ,true);
    
    return true;
diff --git a/src/ossim/projection/ossimSpot5Model.cpp b/src/ossim/projection/ossimSpot5Model.cpp
index 897e121..1e455ce 100644
--- a/src/ossim/projection/ossimSpot5Model.cpp
+++ b/src/ossim/projection/ossimSpot5Model.cpp
@@ -9,7 +9,7 @@
 // Contains definition of class ossimSpot5Model.
 //
 //*****************************************************************************
-// $Id: ossimSpot5Model.cpp 15766 2009-10-20 12:37:09Z gpotts $
+// $Id: ossimSpot5Model.cpp 19658 2011-05-26 13:16:06Z gpotts $
 
 #include <iostream>
 #include <iomanip>
@@ -644,7 +644,8 @@ void ossimSpot5Model::lineSampleHeightToWorld(const ossimDpt& image_point,
                                               const ossim_float64& heightEllipsoid,
                                               ossimGpt& worldPoint) const
 {
-   if (!insideImage(image_point))
+//   if (!insideImage(image_point))
+   if ( !theImageClipRect.pointWithin(image_point, 1.0-FLT_EPSILON) )   
    {
       if(theSeedFunction.valid())
       {
@@ -657,7 +658,6 @@ void ossimSpot5Model::lineSampleHeightToWorld(const ossimDpt& image_point,
       if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSpot5Model::lineSampleHeightToWorld(): returning..." << std::endl;
       return;
    }
-
    //***
    // First establish imaging ray from image point:
    //***
diff --git a/src/ossim/projection/ossimUtmProjection.cpp b/src/ossim/projection/ossimUtmProjection.cpp
index b37d8b3..ca454b8 100644
--- a/src/ossim/projection/ossimUtmProjection.cpp
+++ b/src/ossim/projection/ossimUtmProjection.cpp
@@ -8,7 +8,7 @@
 //
 // Calls Geotrans Utm projection code.  
 //*******************************************************************
-//  $Id: ossimUtmProjection.cpp 18693 2011-01-17 18:49:15Z dburken $
+//  $Id: ossimUtmProjection.cpp 20133 2011-10-12 19:03:47Z oscarkramer $
 
 #include <cstdlib>
 #include <cmath>
@@ -17,6 +17,7 @@ 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)
 
@@ -247,17 +248,12 @@ void ossimUtmProjection::setOrigin(const ossimGpt& origin)
    {
       setHemisphere(origin);
    }
-   ossimMapProjection::setOrigin(theOrigin);
+   ossimMapProjection::setOrigin(origin);
 }
 
 void ossimUtmProjection::setZone(const ossimGpt& ground)
 {
-   theZone = computeZone(ground);
-   theOrigin.lond(computeZoneMeridian(theZone));
-   theOrigin.latd(0.0);
-   theTranMerc_Origin_Long = theOrigin.lonr();
-   //char hemisphere = theOrigin.latd() < 0.0?'S':'N';
-   //setHemisphere(hemisphere);
+   setZone(computeZone(ground));
 }
 
 void ossimUtmProjection::setZone(ossim_int32 zone)
@@ -272,6 +268,7 @@ void ossimUtmProjection::setZone(ossim_int32 zone)
    }
    theOrigin.lond(computeZoneMeridian(theZone));
    theOrigin.latd(0);
+   theOrigin.datum(theDatum);
    theTranMerc_Origin_Long = theOrigin.lonr();
 }
 
@@ -742,7 +739,7 @@ ossim_int32 ossimUtmProjection::Convert_Transverse_Mercator_To_Geodetic (double
   double eta4;
   double ftphi;   /* Footpoint latitude                              */
   int    i;       /* Loop iterator                   */
-  double s;       /* Sine of latitude                        */
+  /*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                             */
@@ -797,7 +794,7 @@ ossim_int32 ossimUtmProjection::Convert_Transverse_Mercator_To_Geodetic (double
     sn = SPHSN(ftphi);
 
     /* Sine Cosine terms */
-    s = sin(ftphi);
+    // s = sin(ftphi);
     c = cos(ftphi);
 
     /* Tangent Value  */
diff --git a/src/ossim/projection/ossimWarpProjection.cpp b/src/ossim/projection/ossimWarpProjection.cpp
index 4bf5338..50b8b02 100644
--- a/src/ossim/projection/ossimWarpProjection.cpp
+++ b/src/ossim/projection/ossimWarpProjection.cpp
@@ -9,7 +9,7 @@
 //   implementation of a warping interpolation model.
 //
 //*****************************************************************************
-//  $Id: ossimWarpProjection.cpp 15766 2009-10-20 12:37:09Z gpotts $
+//  $Id: ossimWarpProjection.cpp 21214 2012-07-03 16:20:11Z dburken $
 
 #include <ossim/projection/ossimWarpProjection.h>
 RTTI_DEF1(ossimWarpProjection, "ossimWarpProjection", ossimProjection);
@@ -227,7 +227,7 @@ bool ossimWarpProjection::loadState(const ossimKeywordlist& kwl,
 
 //   bool good_load;
 //   int  err_stat;
-   bool result = true;
+   // bool result = true;
    
    ossimString projPrefix = ossimString(prefix) + PROJECTION_PREFIX;
    ossimString affinePrefix = ossimString(prefix) + AFFINE_PREFIX;
@@ -243,6 +243,13 @@ bool ossimWarpProjection::loadState(const ossimKeywordlist& kwl,
 
    theClientProjection = ossimProjectionFactoryRegistry::instance()->createProjection(kwl, projPrefix.c_str());
 
+   if ( theClientProjection.valid() )
+   {
+      theWarpTransform->loadState(kwl,   quadwarpPrefix.c_str());
+      theAffineTransform->loadState(kwl, affinePrefix.c_str()); 
+   }
+   
+#if 0 /* set but not used warning... */
    if(!theClientProjection)
    {
       result = false;
@@ -252,6 +259,7 @@ bool ossimWarpProjection::loadState(const ossimKeywordlist& kwl,
       theWarpTransform->loadState(kwl,   quadwarpPrefix.c_str());
       theAffineTransform->loadState(kwl, affinePrefix.c_str());
    }
+#endif
    
    return ossimProjection::loadState(kwl, prefix);
 }
diff --git a/src/ossim/projection/ossimWktProjectionFactory.cpp b/src/ossim/projection/ossimWktProjectionFactory.cpp
new file mode 100644
index 0000000..884fa3b
--- /dev/null
+++ b/src/ossim/projection/ossimWktProjectionFactory.cpp
@@ -0,0 +1,188 @@
+//*************************************************************************************************
+// 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 19879 2011-07-30 16:21:50Z dburken $
+
+#include <ossim/projection/ossimWktProjectionFactory.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimOrthoGraphicProjection.h>
+#include <ossim/projection/ossimTransMercatorProjection.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/projection/ossimEpsgProjectionDatabase.h>
+#include <sstream>
+
+ossimWktProjectionFactory* ossimWktProjectionFactory::m_instance = 0;
+static const ossimString WKT_MAGIC ("WKT_PCS");
+
+//*************************************************************************************************
+//! Implements singleton pattern
+//*************************************************************************************************
+ossimWktProjectionFactory* ossimWktProjectionFactory::instance()
+{
+   if(!m_instance)
+      m_instance = new ossimWktProjectionFactory;
+   return m_instance;
+}
+
+//*************************************************************************************************
+//! Constructor loads all SRS CSV files specified in the ossim prefs
+//*************************************************************************************************
+ossimWktProjectionFactory::ossimWktProjectionFactory()
+{
+   // 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 Constructor -- "
+         "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())
+   {
+      ossimRefPtr<WktProjRecord> db_record = new WktProjRecord;
+      std::getline(db_stream, line.string());
+      std::vector<ossimString> csvRecord = line.explode(","); // ONLY CSV FILES CONSIDERED HERE
+      if (csvRecord.size())
+      {
+         db_record->epsgCode  = csvRecord[0].toUInt32();
+         db_record->wktString = csvRecord[1];
+         m_wktProjRecords.push_back(db_record);
+      }
+   }
+
+   db_stream.close();
+
+}
+
+//*************************************************************************************************
+//! From keywordlist
+//*************************************************************************************************
+ossimProjection* ossimWktProjectionFactory::createProjection(const ossimKeywordlist &keywordList,
+                                                             const char *prefix) const
+{
+    ossimProjection* proj = 0;
+
+   // Look for a PCS (Projected Coordinate System) code entry and construct the basic projection.
+   // This is the bootstrap for creating the fully-initialized proj:
+   ossimString proj_spec = keywordList.find(prefix, ossimKeywordNames::PROJECTION_KW);
+   if(!proj_spec.empty())
+      proj = createProjection(proj_spec);
+  
+   if (!proj)
+      return NULL;
+
+   // The tie points and perhaps other params might still be in the KWL, so pass the KWL on to the
+   // new projection after it has been amended with the default proj info extracted from the 
+   // EPSG code (i.e., sans tiepoints and gsd):
+   ossimKeywordlist proj_kwl;
+   proj->saveState(proj_kwl, prefix);
+   proj_kwl.remove(prefix, ossimKeywordNames::PIXEL_SCALE_XY_KW);
+   proj_kwl.remove(prefix, ossimKeywordNames::PIXEL_SCALE_UNITS_KW);
+   proj_kwl.remove(prefix, ossimKeywordNames::TIE_POINT_XY_KW);
+   proj_kwl.remove(prefix, ossimKeywordNames::TIE_POINT_UNITS_KW);
+   proj_kwl.addList(keywordList, false); // false: do not override existing items
+   proj->loadState(proj_kwl, prefix);
+   
+   return proj;
+}
+
+//*************************************************************************************************
+// This is the principal factory method. It accepts a WKT string, for example 
+// "Anguilla_1957_British_West_Indies_Grid"
+//
+// 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;
+   
+   std::vector<ossimRefPtr<WktProjRecord> >::iterator db_iter = m_wktProjRecords.begin();
+   while ((db_iter != m_wktProjRecords.end()) && !proj)
+   {
+      if ((*db_iter)->wktString == spec)
+      {
+         // 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_iter)->proj.valid())
+            proj = (ossimProjection*) (*db_iter)->proj->dup();
+         else
+            proj = ossimEpsgProjectionDatabase::instance()->findProjection((*db_iter)->epsgCode);
+      }
+      db_iter++;
+   }
+   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
+{
+   std::vector<ossimRefPtr<WktProjRecord> >::iterator db_iter = m_wktProjRecords.begin();
+   while (db_iter != m_wktProjRecords.end())
+   {
+      typeList.push_back((*db_iter)->wktString);
+      db_iter++;
+   }
+   return;
+}
+
diff --git a/src/ossim/support_data/ossimAlphaSensorSupportData.cpp b/src/ossim/support_data/ossimAlphaSensorSupportData.cpp
new file mode 100644
index 0000000..abc2e00
--- /dev/null
+++ b/src/ossim/support_data/ossimAlphaSensorSupportData.cpp
@@ -0,0 +1,691 @@
+#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
+         {
+            navDir = navDir.replace(navDir.find("HRI_"), 5, "NavData");
+         }
+         if ( navDir.exists() )
+         {
+            txtFile = navDir.dirCat( hdr.getFile().file() );
+            txtFile.replace(txtFile.find("HRI_"), 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/src/ossim/support_data/ossimApplanixEOFile.cpp b/src/ossim/support_data/ossimApplanixEOFile.cpp
index b79b325..478db2e 100644
--- a/src/ossim/support_data/ossimApplanixEOFile.cpp
+++ b/src/ossim/support_data/ossimApplanixEOFile.cpp
@@ -5,17 +5,18 @@
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimApplanixEOFile.cpp 13021 2008-06-10 16:22:58Z dburken $
+//  $Id: ossimApplanixEOFile.cpp 20483 2012-01-21 15:42:22Z dburken $
+
 #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>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimRegExp.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimCommon.h>
 
 static ossimTrace traceDebug("ossimApplanixEOFile:debug");
 
@@ -128,7 +129,6 @@ bool ossimApplanixEOFile::isEOFile(std::istream& in)const
    return parseHeader(in, header);
 }
 
-
 bool ossimApplanixEOFile::parseStream(std::istream& in)
 {
    theRecordIdMap.clear();
@@ -145,7 +145,7 @@ bool ossimApplanixEOFile::parseStream(std::istream& in)
    while(in.good()&&
          !line.contains("RECORD FORMAT"))
    {
-      std::getline(in, line);
+      std::getline(in, line.string());
       line = line.upcase();
       line = line.substitute("\r","\n", true);
       if(line.contains("KAPPA CARDINAL"))
@@ -314,7 +314,7 @@ bool ossimApplanixEOFile::parseStream(std::istream& in)
 
    if(in.peek() == '(')
    {
-      std::getline(in, line);
+      std::getline(in, line.string());
    }
    in>>applanix_skipws;
    ossimRefPtr<ossimApplanixEORecord> record = new ossimApplanixEORecord((ossim_uint32)theRecordFormat.size());
@@ -340,7 +340,7 @@ bool ossimApplanixEOFile::parseStream(std::istream& in)
    
    while(in.good()&&theRecordFormat.size())
    {
-      std::getline(in, line);
+      std::getline(in, line.string());
       line = line.trim();
       if(line != "")
       {
@@ -404,7 +404,7 @@ bool ossimApplanixEOFile::parseHeader(std::istream& in,
    }
    ossimString line;
 
-   std::getline(in, line);
+   std::getline(in, line.string());
    line = line .substitute("\r",
                            "\n");
    if(!line.contains("************"))
@@ -416,7 +416,7 @@ bool ossimApplanixEOFile::parseHeader(std::istream& in,
    header += "\n";
 
    in>>applanix_skipws;
-   std::getline(in, line);
+   std::getline(in, line.string());
    line = line .substitute("\r",
                            "\n");
    
@@ -425,7 +425,7 @@ bool ossimApplanixEOFile::parseHeader(std::istream& in,
    {
       header += line;
       header += "\n";
-      std::getline(in, line);
+      std::getline(in, line.string());
       line = line .substitute("\r",
                               "\n");
    }
@@ -498,7 +498,8 @@ const ossimRefPtr<ossimApplanixEORecord> ossimApplanixEOFile::getRecordGivenId(c
 
    if(theRecordIdMap.size())
    {
-      std::map<ossimString, ossimRefPtr<ossimApplanixEORecord> >::const_iterator iter = theRecordIdMap.find(id);
+      std::map<ossimString, ossimRefPtr<ossimApplanixEORecord>,
+         ossimStringLtstr >::const_iterator iter = theRecordIdMap.find(id);
       
       if(iter!=theRecordIdMap.end())
       {
diff --git a/src/ossim/support_data/ossimAuxFileHandler.cpp b/src/ossim/support_data/ossimAuxFileHandler.cpp
index 1ba1a1f..236f304 100644
--- a/src/ossim/support_data/ossimAuxFileHandler.cpp
+++ b/src/ossim/support_data/ossimAuxFileHandler.cpp
@@ -1,1137 +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 992 2010-06-10 18:05:37Z ming.su $
-
-#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)
-  {
-    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");
-      const char* proj = NULL;
-      if (projEntry)
-      {
-        proj = projEntry->getStringField("proName");
-      }
-      
-      if (proj != NULL)
-      {
-        ossimString tmpProj(proj);
-        projName = tmpProj;
-      }
-
-      ossimAuxEntry* datumEntry = node->getNamedChild( "Projection.Datum" );
-      const char* datumStr = NULL;
-      if (datumEntry)
-      {
-        datumStr = datumEntry->getStringField("datumname");
-      }
-      
-      if (datumStr != NULL)
-      {
-        ossimString tmpDatum(datumStr);
-        datumName = tmpDatum;
-      }
-
-      break;
-    }
-
-    node = node->getNext();
-  }
-
-  fclose(fp);
-  return true;
-}
-
-ossimString ossimAuxFileHandler::getProjectionName()
-{
-  return projName;
-}
-
-ossimString ossimAuxFileHandler::getDatumName()
-{
-  return datumName;
-}
-
-/************************************************************************/
-/*                              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;
-}
+//*******************************************************************
+// 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)
+  {
+    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/ossim/support_data/ossimCeosData.cpp b/src/ossim/support_data/ossimCeosData.cpp
new file mode 100644
index 0000000..92a9c83
--- /dev/null
+++ b/src/ossim/support_data/ossimCeosData.cpp
@@ -0,0 +1,1379 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Oscar Kramer
+//
+// Description:
+//
+// Class for reading CEOS-formatted metadata.
+// 
+//*******************************************************************
+//  $Id:$
+
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+using namespace std;
+
+#include <ossim/support_data/ossimCeosData.h>
+#include "ossim/base/ossimCommon.h"
+#include <ossim/base/ossimTrace.h>
+
+// Define Trace flags for use within this file:
+static ossimTrace traceExec  ("ossimCeosData:exec");
+static ossimTrace traceDebug ("ossimCeosData:debug");
+
+static const ossimFilename   CEOS_VOL_DIR_FILENAME  = "vdf_dat.001";
+static const ossimFilename   CEOS_LEADER_FILENAME   = "lea_01.001";
+static const ossimFilename   CEOS_IMAGE_FILENAME    = "dat_01.001";
+static const ossimFilename   CEOS_TRAILER_FILENAME  = "tra_01.001";
+
+
+//******************************************************************************
+//  CONSTRUCTOR: 
+//******************************************************************************
+ossimCeosData::ossimCeosData(const ossimFilename& volDirFile,
+                   const ossimFilename& leaderFile,
+                   const ossimFilename& imageFile,
+                   const ossimFilename& trailerFile)
+   :
+      theVolDirFileName  (volDirFile),
+      theLeaderFileName  (leaderFile),
+      theImageFileName   (imageFile),
+      theTrailerFileName (trailerFile),
+      theErrorStatus     (OK),
+      theVolDescRec      (0),
+      theTextRec         (0),
+      theDataSetSumRec   (0),
+      theQualSumRec      (0),
+      theSdrHistRec      (0),
+      thePdr16HistRec    (0),
+      thePdr8HistRec     (0),
+      theProcParmRec     (0),
+      theMapProjRec      (0),
+      thePosDataRec      (0),
+      theAttDataRec      (0),
+      theRadiDataRec     (0),
+      theRadiCompRec     (0)
+{
+   static const char MODULE[] = "ossimCeosData Constructor #1";
+   if (traceExec())  CLOG << "entering..." << endl;
+
+   loadCeosRecords();
+   
+   if (traceExec())  CLOG << "returning..." << endl;
+}
+
+
+//******************************************************************************
+//  CONSTRUCTOR: ossimCeosData(ossimFilename)
+//  
+//  Initializes given the image directory (assumes default filenames).
+//  
+//******************************************************************************
+ossimCeosData::ossimCeosData(const ossimFilename& imageDir)
+   :
+      theErrorStatus   (OK),
+      theVolDescRec    (0),
+      theTextRec       (0),
+      theDataSetSumRec (0),
+      theQualSumRec    (0),
+      theSdrHistRec    (0),
+      thePdr16HistRec  (0),
+      thePdr8HistRec   (0),
+      theProcParmRec   (0),
+      theMapProjRec    (0),
+      thePosDataRec    (0),
+      theAttDataRec    (0),
+      theRadiDataRec   (0),
+      theRadiCompRec   (0)
+{
+   static const char MODULE[] = "ossimCeosData Constructor #1";
+   if (traceExec())  CLOG << "entering..." << endl;
+
+   //***
+   // Assign values to ossimFilename data members:
+   //***
+   theVolDirFileName  = imageDir.dirCat(CEOS_VOL_DIR_FILENAME);
+   theLeaderFileName  = imageDir.dirCat(CEOS_LEADER_FILENAME);
+   theImageFileName   = imageDir.dirCat(CEOS_IMAGE_FILENAME);
+   theTrailerFileName = imageDir.dirCat(CEOS_TRAILER_FILENAME);
+
+   loadCeosRecords();
+   
+   if (traceExec())  CLOG << "returning..." << endl;
+}
+
+
+//******************************************************************************
+// PUBLIC METHOD: ossimCeosData::dump(ostream&)
+//  
+//******************************************************************************
+void ossimCeosData::dump(ostream& stream) const 
+{
+   static const char MODULE[] = "ossimCeosData::dump(ostream& stream)";
+   if (traceExec())  CLOG << "entering..." << endl;
+
+   stream << "\nDump of ossimCeosData Object -----------------------------" << endl;
+
+   if (theVolDescRec)
+      dumpVolDescRec(stream);
+   else
+      stream << "\n\n\tvol_desc_rec not present." << endl;
+
+   if (theTextRec)
+      dumpTextRec(stream);
+   else
+      stream << "\n\n\ttext_rec not present." << endl;
+
+   if (imopDescRec())
+      dumpImopDescRec(stream);
+   else
+      stream << "\n\n\timop_desc_rec not present." << endl;
+
+   if (theDataSetSumRec)
+      dumpDataSetSumRec(stream);
+   else
+      stream << "\n\n\tdataset_sum_rec not present." << endl;
+
+   if (theQualSumRec)
+      dumpQualSumRec(stream);
+   else
+      stream << "\n\n\tqual_sum_rec not present." << endl;
+
+   if (theSdrHistRec)
+      dumpSdrHistRec(stream);
+   else
+      stream << "\n\n\tsdr_hist_rec not present." << endl;
+
+   if (thePdr16HistRec)
+      dumpPdr16HistRec(stream);
+   else
+      stream << "\n\n\tpdr16_hist_rec not present." << endl;
+
+   if (thePdr8HistRec)
+      dumpPdr8HistRec(stream);
+   else
+      stream << "\n\n\tpdr8_hist_rec not present." << endl;
+
+   if (theProcParmRec)
+      dumpProcParmRec(stream);
+   else
+      stream << "\n\n\tproc_parm_rec not present." << endl;
+
+   if (theMapProjRec)
+      dumpMapProjRec(stream);
+   else
+      stream << "\n\n\tmap_proj_rec not present." << endl;
+
+   if (thePosDataRec)
+      dumpPosDataRec(stream);
+   else
+      stream << "\n\n\tpos_data_rec not present." << endl;
+
+   if (theAttDataRec)
+      dumpAttDataRec(stream);
+   else
+      stream << "\n\n\tatt_data_rec not present." << endl;
+
+   if (theRadiDataRec)
+      dumpRadiDataRec(stream);
+   else
+      stream << "\n\n\tradi_data_rec not present." << endl;
+
+   if (theRadiCompRec)
+      dumpRadiCompRec(stream);
+   else
+      stream << "\n\n\tradi_comp_rec not present." << endl;
+
+   stream << "\nEnd of ossimCeosData Object Dump -------------------------" << endl;
+
+   if (traceExec())  CLOG << "returning..." << endl;
+   return;
+}
+
+//******************************************************************************
+// PRIVATE METHOD: ossimCeosData::dumpVolDescRec()
+//  
+//******************************************************************************
+void ossimCeosData::dumpVolDescRec(ostream& stream) const
+{
+   const vol_desc_rec* p = theVolDescRec;
+
+   stream << "\n\n\tContents of vol_desc_rec:\n";
+   stream << "\n\t  ascii_flag         \""; stream.write(p->ascii_flag, 2);
+   stream << "\"\n\t  format_doc         \""; stream.write(p->format_doc, 12);
+   stream << "\"\n\t  format_ver         \""; stream.write(p->format_ver, 2);
+   stream << "\"\n\t  format_rev         \""; stream.write(p->format_rev, 2);
+   stream << "\"\n\t  software_id        \""; stream.write(p->software_id, 12);
+   stream << "\"\n\t  phyvol_id          \""; stream.write(p->phyvol_id, 16);
+   stream << "\"\n\t  logvol_id          \""; stream.write(p->logvol_id, 16);
+   stream << "\"\n\t  volset_id          \""; stream.write(p->volset_id, 16);
+   stream << "\"\n\t  phyvol_cnt         \""; stream.write(p->phyvol_cnt, 2);
+   stream << "\"\n\t  first_phyvol       \""; stream.write(p->first_phyvol, 2);
+   stream << "\"\n\t  last_phyvol        \""; stream.write(p->last_phyvol, 2);
+   stream << "\"\n\t  curr_phyvol        \""; stream.write(p->curr_phyvol, 2);
+   stream << "\"\n\t  first_file         \""; stream.write(p->first_file, 4);
+   stream << "\"\n\t  volset_log         \""; stream.write(p->volset_log, 4);
+   stream << "\"\n\t  phyvol_log         \""; stream.write(p->phyvol_log, 4);
+   stream << "\"\n\t  logvol_date        \""; stream.write(p->logvol_date, 8);
+   stream << "\"\n\t  logvol_time        \""; stream.write(p->logvol_time, 8);
+   stream << "\"\n\t  logvol_country     \"";
+   stream.write(p->logvol_country, 12);
+   stream << "\"\n\t  logvol_agency      \""; stream.write(p->logvol_agency, 8);
+   stream << "\"\n\t  logvol_facility    \"";
+   stream.write(p->logvol_facility,12);
+   stream << "\"\n\t  n_filepoint        \""; stream.write(p->n_filepoint, 4);
+   stream << "\"\n\t  n_voldir           \""; stream.write(p->n_voldir, 4);
+   stream << "\"\n\t  product_id         \""; stream.write(p->product_id, 8);
+
+   stream << "\"" << endl;
+}
+
+//******************************************************************************
+// PRIVATE METHOD: ossimCeosData::dumpTextRec()
+//  
+//******************************************************************************
+void ossimCeosData::dumpTextRec(ostream& stream) const
+{
+   const text_rec* p = theTextRec;
+   
+   stream << "\n\n\tContents of text_rec:\n\t";
+   stream << "\n\t  ascii_flag         \""; stream.write(p->ascii_flag, 2);
+   stream << "\"\n\t  cont_flag          \""; stream.write(p->cont_flag, 2);
+   stream << "\"\n\t  product_type       \""; stream.write(p->product_type, 40);
+   stream << "\"\n\t  product_create     \"";
+   stream.write(p->product_create, 60);
+   stream << "\"\n\t  phyvol_id          \""; stream.write(p->phyvol_id, 40);
+   stream << "\"\n\t  scene_id           \""; stream.write(p->scene_id, 40);
+   stream << "\"\n\t  scene_loc          \""; stream.write(p->scene_loc, 40);
+   stream << "\"" << endl;
+}
+
+//******************************************************************************
+// PRIVATE METHOD: ossimCeosData::dumpImopDescRec()
+//  
+//******************************************************************************
+void ossimCeosData::dumpImopDescRec(ostream& stream) const
+{
+   const imop_desc_rec* p = &theImopDescRec;
+   
+   stream << "\n\n\tContents of imop_desc_rec:\n\t";
+   stream << "\n\t  ascii_flag         \""; stream.write(p->ascii_flag, 2);
+   stream << "\"\n\t  spare1             \""; stream.write(p->spare1, 2);
+   stream << "\"\n\t  format_doc         \""; stream.write(p->format_doc, 12);
+   stream << "\"\n\t  format_rev         \""; stream.write(p->format_rev, 2);
+   stream << "\"\n\t  design_rev         \""; stream.write(p->design_rev, 2);
+   stream << "\"\n\t  software_id        \""; stream.write(p->software_id, 12);
+   stream << "\"\n\t  file_num           \""; stream.write(p->file_num, 4);
+   stream << "\"\n\t  file_name          \""; stream.write(p->file_name, 16);
+   stream << "\"\n\t  rec_seq            \""; stream.write(p->rec_seq, 4);
+   stream << "\"\n\t  seq_loc            \""; stream.write(p->seq_loc, 8);
+   stream << "\"\n\t  seq_len            \""; stream.write(p->seq_len, 4);
+   stream << "\"\n\t  rec_code           \""; stream.write(p->rec_code, 4);
+   stream << "\"\n\t  code_loc           \""; stream.write(p->code_loc, 8);
+   stream << "\"\n\t  code_len           \""; stream.write(p->code_len, 4);
+   stream << "\"\n\t  rec_len            \""; stream.write(p->rec_len, 4);
+   stream << "\"\n\t  rlen_loc           \""; stream.write(p->rlen_loc, 8);
+   stream << "\"\n\t  rlen_len           \""; stream.write(p->rlen_len, 4);
+   stream << "\"\n\t  spare2             \""; stream.write(p->spare2, 4);
+   stream << "\"\n\t  spare3             \""; stream.write(p->spare3, 64);
+   stream << "\"\n\t  n_dataset          \""; stream.write(p->n_dataset, 6);
+   stream << "\"\n\t  l_dataset          \""; stream.write(p->l_dataset, 6);
+   stream << "\"\n\t  spare4             \""; stream.write(p->spare4, 24);
+   stream << "\"\n\t  nbit               \""; stream.write(p->nbit, 4);
+   stream << "\"\n\t  nsamp              \""; stream.write(p->nsamp, 4);
+   stream << "\"\n\t  nbyte              \""; stream.write(p->nbyte, 4);
+   stream << "\"\n\t  justify            \""; stream.write(p->justify, 4);
+   stream << "\"\n\t  nchn               \""; stream.write(p->nchn, 4);
+   stream << "\"\n\t  nlin               \""; stream.write(p->nlin, 8);
+   stream << "\"\n\t  nleft              \""; stream.write(p->nleft, 4);
+   stream << "\"\n\t  ngrp               \""; stream.write(p->ngrp, 8);
+   stream << "\"\n\t  nright             \""; stream.write(p->nright, 4);
+   stream << "\"\n\t  ntop               \""; stream.write(p->ntop, 4);
+   stream << "\"\n\t  nbott              \""; stream.write(p->nbott, 4);
+   stream << "\"\n\t  intleav            \""; stream.write(p->intleav, 4);
+   stream << "\"\n\t  nrec_lin           \""; stream.write(p->nrec_lin, 2);
+   stream << "\"\n\t  nrec_chn           \""; stream.write(p->nrec_chn, 2);
+   stream << "\"\n\t  n_prefix           \""; stream.write(p->n_prefix, 4);
+   stream << "\"\n\t  n_sar              \""; stream.write(p->n_sar, 8);
+   stream << "\"\n\t  n_suffix           \""; stream.write(p->n_suffix, 4);
+   stream << "\"\n\t  spare5             \""; stream.write(p->spare5, 4);
+   stream << "\"\n\t  lin_loc            \""; stream.write(p->lin_loc, 8);
+   stream << "\"\n\t  chn_loc            \""; stream.write(p->chn_loc, 8);
+   stream << "\"\n\t  tim_loc            \""; stream.write(p->tim_loc, 8);
+   stream << "\"\n\t  left_loc           \""; stream.write(p->left_loc, 8);
+   stream << "\"\n\t  right_loc          \""; stream.write(p->right_loc, 8);
+   stream << "\"\n\t  pad_ind            \""; stream.write(p->pad_ind, 4);
+   stream << "\"\n\t  spare6             \""; stream.write(p->spare6, 28);
+   stream << "\"\n\t  qual_loc           \""; stream.write(p->qual_loc, 8);
+   stream << "\"\n\t  cali_loc           \""; stream.write(p->cali_loc, 8);
+   stream << "\"\n\t  gain_loc           \""; stream.write(p->gain_loc, 8);
+   stream << "\"\n\t  bias_loc           \""; stream.write(p->bias_loc, 8);
+   stream << "\"\n\t  type_id            \""; stream.write(p->type_id, 28);
+   stream << "\"\n\t  type_code          \""; stream.write(p->type_code, 4);
+   stream << "\"\n\t  left_fill          \""; stream.write(p->left_fill, 4);
+   stream << "\"\n\t  right_fill         \""; stream.write(p->right_fill, 4);
+   stream << "\"\n\t  pix_rng            \""; stream.write(p->pix_rng, 8);
+   stream << "\"" << endl;
+}
+
+//******************************************************************************
+// PRIVATE METHOD: ossimCeosData::dumpDataSetSumRec()
+//  
+//******************************************************************************
+void ossimCeosData::dumpDataSetSumRec(ostream& stream) const
+{
+   const dataset_sum_rec* p = theDataSetSumRec;
+   
+   stream << "\n\n\tContents of dataset_sum_rec:\n\t      \"";
+   stream << "\n\t  seq_num            \""; stream.write(p->seq_num, 4);
+   stream << "\"\n\t  sar_chn            \""; stream.write(p->sar_chn, 4);
+   stream << "\"\n\t  scene_id           \""; stream.write(p->scene_id, 16);
+   stream << "\"\n\t  scene_des          \""; stream.write(p->scene_des, 32);
+   stream << "\"\n\t  inp_sctim          \""; stream.write(p->inp_sctim, 32);
+   stream << "\"\n\t  asc_des            \""; stream.write(p->asc_des, 16);
+   stream << "\"\n\t  pro_lat            \""; stream.write(p->pro_lat, 16);
+   stream << "\"\n\t  pro_long           \""; stream.write(p->pro_long, 16);
+   stream << "\"\n\t  pro_head           \""; stream.write(p->pro_head, 16);
+   stream << "\"\n\t  ellip_des          \""; stream.write(p->ellip_des, 16);
+   stream << "\"\n\t  ellip_maj          \""; stream.write(p->ellip_maj, 16);
+   stream << "\"\n\t  ellip_min          \""; stream.write(p->ellip_min, 16);
+   stream << "\"\n\t  earth_mass         \""; stream.write(p->earth_mass, 16);
+   stream << "\"\n\t  grav_const         \""; stream.write(p->grav_const, 16);
+   stream << "\"\n\t  ellip_j[0]         \""; stream.write(p->ellip_j[0], 16);
+   stream << "\"\n\t  ellip_j[1]         \""; stream.write(p->ellip_j[1], 16);
+   stream << "\"\n\t  ellip_j[2]         \""; stream.write(p->ellip_j[2], 16);
+   stream << "\"\n\t  spare1             \""; stream.write(p->spare1, 16);
+   stream << "\"\n\t  terrain_h          \""; stream.write(p->terrain_h, 16);
+   stream << "\"\n\t  sc_lin             \""; stream.write(p->sc_lin, 8);
+   stream << "\"\n\t  sc_pix             \""; stream.write(p->sc_pix, 8);
+   stream << "\"\n\t  scene_len          \""; stream.write(p->scene_len, 16);
+   stream << "\"\n\t  scene_wid          \""; stream.write(p->scene_wid, 16);
+   stream << "\"\n\t  spare2             \""; stream.write(p->spare2, 16);
+   stream << "\"\n\t  nchn               \""; stream.write(p->nchn, 4);
+   stream << "\"\n\t  spare3             \""; stream.write(p->spare3, 4);
+   stream << "\"\n\t  mission_id         \""; stream.write(p->mission_id, 16);
+   stream << "\"\n\t  sensor_id          \""; stream.write(p->sensor_id, 32);
+   stream << "\"\n\t  orbit_num          \""; stream.write(p->orbit_num, 8);
+   stream << "\"\n\t  plat_lat           \""; stream.write(p->plat_lat, 8);
+   stream << "\"\n\t  plat_long          \""; stream.write(p->plat_long, 8);
+   stream << "\"\n\t  plat_head          \""; stream.write(p->plat_head, 8);
+   stream << "\"\n\t  clock_ang          \""; stream.write(p->clock_ang, 8);
+   stream << "\"\n\t  incident_ang       \""; stream.write(p->incident_ang, 8);
+   stream << "\"\n\t  spare4             \""; stream.write(p->spare4, 8);
+   stream << "\"\n\t  wave_length        \""; stream.write(p->wave_length, 16);
+   stream << "\"\n\t  motion_comp        \""; stream.write(p->motion_comp, 2);
+   stream << "\"\n\t  pulse_code         \""; stream.write(p->pulse_code, 16);
+   stream << "\"\n\t  ampl_coef[0]       \""; stream.write(p->ampl_coef[0], 16);
+   stream << "\"\n\t  ampl_coef[1]       \""; stream.write(p->ampl_coef[1], 16);
+   stream << "\"\n\t  ampl_coef[2]       \""; stream.write(p->ampl_coef[2], 16);
+   stream << "\"\n\t  ampl_coef[3]       \""; stream.write(p->ampl_coef[3], 16);
+   stream << "\"\n\t  ampl_coef[4]       \""; stream.write(p->ampl_coef[4], 16);
+   stream << "\"\n\t  phas_coef[0]       \""; stream.write(p->phas_coef[0], 16);
+   stream << "\"\n\t  phas_coef[1]       \""; stream.write(p->phas_coef[1], 16);
+   stream << "\"\n\t  phas_coef[2]       \""; stream.write(p->phas_coef[2], 16);
+   stream << "\"\n\t  phas_coef[3]       \""; stream.write(p->phas_coef[3], 16);
+   stream << "\"\n\t  phas_coef[4]       \""; stream.write(p->phas_coef[4], 16);
+   stream << "\"\n\t  chirp_ext_ind      \""; stream.write(p->chirp_ext_ind, 8);
+   stream << "\"\n\t  spare5             \""; stream.write(p->spare5, 8);
+   stream << "\"\n\t  fr                 \""; stream.write(p->fr, 16);
+   stream << "\"\n\t  rng_gate           \""; stream.write(p->rng_gate, 16);
+   stream << "\"\n\t  rng_length         \""; stream.write(p->rng_length, 16);
+   stream << "\"\n\t  baseband_f         \""; stream.write(p->baseband_f, 4);
+   stream << "\"\n\t  rngcmp_f           \""; stream.write(p->rngcmp_f, 4);
+   stream << "\"\n\t  gn_polar           \""; stream.write(p->gn_polar, 16);
+   stream << "\"\n\t  gn_cross           \""; stream.write(p->gn_cross, 16);
+   stream << "\"\n\t  chn_bits           \""; stream.write(p->chn_bits, 8);
+   stream << "\"\n\t  quant_desc         \""; stream.write(p->quant_desc, 12);
+   stream << "\"\n\t  i_bias             \""; stream.write(p->i_bias, 16);
+   stream << "\"\n\t  q_bias             \""; stream.write(p->q_bias, 16);
+   stream << "\"\n\t  iq_ratio           \""; stream.write(p->iq_ratio, 16);
+   stream << "\"\n\t  spare6             \""; stream.write(p->spare6, 16);
+   stream << "\"\n\t  spare7             \""; stream.write(p->spare7, 16);
+   stream << "\"\n\t  ele_sight          \""; stream.write(p->ele_sight, 16);
+   stream << "\"\n\t  mech_sight         \""; stream.write(p->mech_sight, 16);
+   stream << "\"\n\t  echo_track         \""; stream.write(p->echo_track, 4);
+   stream << "\"\n\t  fa                 \""; stream.write(p->fa, 16);
+   stream << "\"\n\t  elev_beam          \""; stream.write(p->elev_beam, 16);
+   stream << "\"\n\t  azim_beam          \""; stream.write(p->azim_beam, 16);
+   stream << "\"\n\t  sat_bintim         \""; stream.write(p->sat_bintim, 16);
+   stream << "\"\n\t  sat_clktim         \""; stream.write(p->sat_clktim, 32);
+   stream << "\"\n\t  sat_clkinc         \""; stream.write(p->sat_clkinc, 8);
+   stream << "\"\n\t  spare8             \""; stream.write(p->spare8, 8);
+   stream << "\"\n\t  fac_id             \""; stream.write(p->fac_id, 16);
+   stream << "\"\n\t  sys_id             \""; stream.write(p->sys_id, 8);
+   stream << "\"\n\t  ver_id             \""; stream.write(p->ver_id, 8);
+   stream << "\"\n\t  fac_code           \""; stream.write(p->fac_code, 16);
+   stream << "\"\n\t  lev_code           \""; stream.write(p->lev_code, 16);
+   stream << "\"\n\t  prod_type          \""; stream.write(p->prod_type, 32);
+   stream << "\"\n\t  algor_id           \""; stream.write(p->algor_id, 32);
+   stream << "\"\n\t  n_azilok           \""; stream.write(p->n_azilok, 16);
+   stream << "\"\n\t  n_rnglok           \""; stream.write(p->n_rnglok, 16);
+   stream << "\"\n\t  bnd_azilok         \""; stream.write(p->bnd_azilok, 16);
+   stream << "\"\n\t  bnd_rnglok         \""; stream.write(p->bnd_rnglok, 16);
+   stream << "\"\n\t  bnd_azi            \""; stream.write(p->bnd_azi, 16);
+   stream << "\"\n\t  bnd_rng            \""; stream.write(p->bnd_rng, 16);
+   stream << "\"\n\t  azi_weight         \""; stream.write(p->azi_weight, 32);
+   stream << "\"\n\t  rng_weight         \""; stream.write(p->rng_weight, 32);
+   stream << "\"\n\t  data_inpsrc        \""; stream.write(p->data_inpsrc, 16);
+   stream << "\"\n\t  rng_res            \""; stream.write(p->rng_res, 16);
+   stream << "\"\n\t  azi_res            \""; stream.write(p->azi_res, 16);
+   stream << "\"\n\t  radi_stretch[0]    \"";
+   stream.write(p->radi_stretch[0],16);
+   stream << "\"\n\t  radi_stretch[1]    \"";
+   stream.write(p->radi_stretch[1],16);
+   stream << "\"\n\t  alt_dopcen[0]      \""; stream.write(p->alt_dopcen[0],16);
+   stream << "\"\n\t  alt_dopcen[1]      \""; stream.write(p->alt_dopcen[1],16);
+   stream << "\"\n\t  alt_dopcen[2]      \""; stream.write(p->alt_dopcen[2],16);
+   stream << "\"\n\t  spare9             \""; stream.write(p->spare9, 16);
+   stream << "\"\n\t  crt_dopcen[0]      \""; stream.write(p->crt_dopcen[0],16);
+   stream << "\"\n\t  crt_dopcen[1]      \""; stream.write(p->crt_dopcen[1],16);
+   stream << "\"\n\t  crt_dopcen[2]      \""; stream.write(p->crt_dopcen[2],16);
+   stream << "\"\n\t  time_dir_pix       \""; stream.write(p->time_dir_pix, 8);
+   stream << "\"\n\t  time_dir_lin       \""; stream.write(p->time_dir_lin, 8);
+   stream << "\"\n\t  alt_rate[0]        \""; stream.write(p->alt_rate[0], 16);
+   stream << "\"\n\t  alt_rate[1]        \""; stream.write(p->alt_rate[1], 16);
+   stream << "\"\n\t  alt_rate[2]        \""; stream.write(p->alt_rate[2], 16);
+   stream << "\"\n\t  spare10            \""; stream.write(p->spare10, 16);
+   stream << "\"\n\t  crt_rate[0]        \""; stream.write(p->crt_rate[0], 16);
+   stream << "\"\n\t  crt_rate[1]        \""; stream.write(p->crt_rate[1], 16);
+   stream << "\"\n\t  crt_rate[2]        \""; stream.write(p->crt_rate[2], 16);
+   stream << "\"\n\t  spare11            \""; stream.write(p->spare11, 16);
+   stream << "\"\n\t  line_cont          \""; stream.write(p->line_cont, 8);
+   stream << "\"\n\t  clutter_lock       \""; stream.write(p->clutter_lock, 4);
+   stream << "\"\n\t  auto_focus         \""; stream.write(p->auto_focus, 4);
+   stream << "\"\n\t  line_spacing       \""; stream.write(p->line_spacing, 16);
+   stream << "\"\n\t  pix_spacing        \""; stream.write(p->pix_spacing, 16);
+   stream << "\"\n\t  rngcmp_desg        \""; stream.write(p->rngcmp_desg, 16);
+   stream << "\"" << endl;
+}
+
+//******************************************************************************
+// PRIVATE METHOD: ossimCeosData::dumpQualSumRec()
+//  
+//******************************************************************************
+void ossimCeosData::dumpQualSumRec(ostream& stream) const
+{
+   const qual_sum_rec* p = theQualSumRec;
+   
+   stream << "\n\n\tContents of qual_sum_rec:\n\t";
+   stream << "\n\t  rec_seq            \""; stream.write(p->rec_seq, 4);
+   stream << "\"\n\t  sar_chn            \""; stream.write(p->sar_chn, 4);
+   stream << "\"\n\t  cali_date          \""; stream.write(p->cali_date, 6);
+   stream << "\"\n\t  nchn               \""; stream.write(p->nchn, 4);
+   stream << "\"\n\t  islr               \""; stream.write(p->islr, 16);
+   stream << "\"\n\t  pslr               \""; stream.write(p->pslr, 16);
+   stream << "\"\n\t  azi_ambig          \""; stream.write(p->azi_ambig, 16);
+   stream << "\"\n\t  rng_ambig          \""; stream.write(p->rng_ambig, 16);
+   stream << "\"\n\t  snr                \""; stream.write(p->snr, 16);
+   stream << "\"\n\t  ber                \""; stream.write(p->ber, 16);
+   stream << "\"\n\t  rng_res            \""; stream.write(p->rng_res, 16);
+   stream << "\"\n\t  azi_res            \""; stream.write(p->azi_res, 16);
+   stream << "\"\n\t  rad_res            \""; stream.write(p->rad_res, 16);
+   stream << "\"\n\t  dyn_rng            \""; stream.write(p->dyn_rng, 16);
+   stream << "\"\n\t  rad_unc_db         \""; stream.write(p->rad_unc_db, 16);
+   stream << "\"\n\t  rad_unc_deg        \""; stream.write(p->rad_unc_deg, 16);
+   int i;
+   for (i=0; i<16; i++)
+   {
+      stream << "\"\n\t  rad_unc[" << i << "]:";
+      stream << "\n\t    db               \"";
+      stream.write(p->rad_unc[i].db, 16);
+      stream << "\"\n\t    deg              \"";
+      stream.write(p->rad_unc[i].deg, 16);
+   }
+   stream << "\"\n\t  alt_locerr         \""; stream.write(p->alt_locerr, 16);
+   stream << "\"\n\t  crt_locerr         \""; stream.write(p->crt_locerr, 16);
+   stream << "\"\n\t  alt_scale          \""; stream.write(p->alt_scale, 16);
+   stream << "\"\n\t  crt_scale          \""; stream.write(p->crt_scale, 16);
+   stream << "\"\n\t  dis_skew           \""; stream.write(p->dis_skew, 16);
+   stream << "\"\n\t  ori_err            \""; stream.write(p->ori_err, 16);
+   for (i=0; i<16; i++)
+   {
+      stream << "\"\n\t  misreg[" << i << "]:";
+      stream << "\n\t    alt_m            \"";
+      stream.write(p->misreg[i].alt_m, 16);
+      stream << "\"\n\t    crt_m            \"";
+      stream.write(p->misreg[i].crt_m, 16);
+   }
+   stream << "\"\n\t  nesz               \""; stream.write(p->nesz, 16);
+   stream << "\"\n\t  enl                \""; stream.write(p->enl, 16);
+   stream << "\"\n\t  tb_update          \""; stream.write(p->tb_update, 8);
+   stream << "\"" << endl;
+}
+
+//******************************************************************************
+// PRIVATE METHOD: ossimCeosData::dumpSdrHistRec()
+//  
+//******************************************************************************
+void ossimCeosData::dumpSdrHistRec(ostream& stream) const
+{
+   const sdr_hist_rec* p = theSdrHistRec;
+   
+   stream << "\n\n\tContents of sdr_hist_rec:\n\t";
+   stream << "\n\t  rec_seq            \""; stream.write(p->rec_seq, 4);
+   stream << "\"\n\t  sar_chn            \""; stream.write(p->sar_chn, 4);
+   stream << "\"\n\t  ntab               \""; stream.write(p->ntab, 8);
+   stream << "\"\n\t  ltab               \""; stream.write(p->ltab, 8);
+   stream << "\"\n\t  htab[0] (only one sdr_htab_rec declared in data struct):";
+   stream << "\n\t    hist_desc        \"";
+   stream.write(p->htab.hist_desc, 32);
+   stream << "\"\n\t    nrec             \""; stream.write(p->htab.nrec, 4);
+   stream << "\"\n\t    tab_seq          \""; stream.write(p->htab.tab_seq, 4);
+   stream << "\"\n\t    nbin             \""; stream.write(p->htab.nbin, 8);
+   stream << "\"\n\t    ns_lin           \""; stream.write(p->htab.ns_lin, 8);
+   stream << "\"\n\t    ns_pix           \""; stream.write(p->htab.ns_pix, 8);
+   stream << "\"\n\t    ngrp_lin         \""; stream.write(p->htab.ngrp_lin, 8);
+   stream << "\"\n\t    ngrp_pix         \""; stream.write(p->htab.ngrp_pix, 8);
+   stream << "\"\n\t    nsamp_lin        \""; stream.write(p->htab.nsamp_lin,8);
+   stream << "\"\n\t    nsamp_pix        \""; stream.write(p->htab.nsamp_pix,8);
+   stream << "\"\n\t    min_smp          \""; stream.write(p->htab.min_smp, 16);
+   stream << "\"\n\t    max_smp          \""; stream.write(p->htab.max_smp, 16);
+   stream << "\"\n\t    mean_smp         \""; stream.write(p->htab.mean_smp,16);
+   stream << "\"\n\t    std_smp          \""; stream.write(p->htab.std_smp, 16);
+   stream << "\"\n\t    smp_inc          \""; stream.write(p->htab.smp_inc, 16);
+   stream << "\"\n\t    min_hist         \""; stream.write(p->htab.min_hist,16);
+   stream << "\"\n\t    max_hist         \""; stream.write(p->htab.max_hist,16);
+   stream << "\"\n\t    mean_hist        \"";
+   stream.write(p->htab.mean_hist, 16);
+   stream << "\"\n\t    std_hist         \""; stream.write(p->htab.std_hist,16);
+   stream << "\"\n\t    nhist            \""; stream.write(p->htab.nhist, 16);
+   stream << "\"\n\t    [Use debugger to view histogram]";
+   stream << endl;
+}
+
+//******************************************************************************
+// PRIVATE METHOD: ossimCeosData::dumpPdr16HistRec()
+//  
+//******************************************************************************
+void ossimCeosData::dumpPdr16HistRec(ostream& stream) const
+{
+   const  pdr16_hist_rec* p = thePdr16HistRec;
+   
+   stream << "\n\n\tContents of pdr16_hist_rec:\n\t";
+   stream << "\n\t  rec_seq            \""; stream.write(p->rec_seq, 4);
+   stream << "\"\n\t  sar_chn            \""; stream.write(p->sar_chn, 4);
+   stream << "\"\n\t  ntab               \""; stream.write(p->ntab, 8);
+   stream << "\"\n\t  ltab               \""; stream.write(p->ltab, 8);
+
+   char buf[] = "12345678";
+   strncpy(buf, p->ntab, 8);
+   int n = atoi(buf);
+   for (int i=0; i<n; i++)
+   {
+      stream << "\"\n\t  htab[" << i << "]:";
+      stream << "\n\t    hist_desc        \"";
+      stream.write(p->htab[i].hist_desc, 32);
+      stream << "\"\n\t    nrec             \"";
+      stream.write(p->htab[i].nrec, 4);
+      stream << "\"\n\t    tab_seq          \"";
+      stream.write(p->htab[i].tab_seq, 4);
+      stream << "\"\n\t    nbin             \"";
+      stream.write(p->htab[i].nbin, 8);
+      stream << "\"\n\t    ns_lin           \"";
+      stream.write(p->htab[i].ns_lin, 8);
+      stream << "\"\n\t    ns_pix           \"";
+      stream.write(p->htab[i].ns_pix, 8);
+      stream << "\"\n\t    ngrp_lin         \"";
+      stream.write(p->htab[i].ngrp_lin, 8);
+      stream << "\"\n\t    ngrp_pix         \"";
+      stream.write(p->htab[i].ngrp_pix, 8);
+      stream << "\"\n\t    nsamp_lin        \"";
+      stream.write(p->htab[i].nsamp_lin, 8);
+      stream << "\"\n\t    nsamp_pix        \"";
+      stream.write(p->htab[i].nsamp_pix, 8);
+      stream << "\"\n\t    min_smp          \"";
+      stream.write(p->htab[i].min_smp, 16);
+      stream << "\"\n\t    max_smp          \"";
+      stream.write(p->htab[i].max_smp, 16);
+      stream << "\"\n\t    mean_smp         \"";
+      stream.write(p->htab[i].mean_smp, 16);
+      stream << "\"\n\t    std_smp          \"";
+      stream.write(p->htab[i].std_smp, 16);
+      stream << "\"\n\t    smp_inc          \"";
+      stream.write(p->htab[i].smp_inc, 16);
+      stream << "\"\n\t    min_hist         \"";
+      stream.write(p->htab[i].min_hist, 16);
+      stream << "\"\n\t    max_hist         \"";
+      stream.write(p->htab[i].max_hist, 16);
+      stream << "\"\n\t    mean_hist        \"";
+      stream.write(p->htab[i].mean_hist, 16);
+      stream << "\"\n\t    std_hist         \"";
+      stream.write(p->htab[i].std_hist, 16);
+      stream << "\"\n\t    nhist            \"";
+      stream.write(p->htab[i].nhist, 16);
+      stream << "\n\t    [Use debugger to view histogram]";
+   }
+   stream << "\"" << endl;
+}
+
+//******************************************************************************
+// PRIVATE METHOD: ossimCeosData::dumpPdr8HistRec()
+//  
+//******************************************************************************
+void ossimCeosData::dumpPdr8HistRec(ostream& stream) const
+{
+   const pdr8_hist_rec* p = thePdr8HistRec;
+   
+   stream << "\n\n\tContents of pdr18hist_rec:\n\t";
+   stream << "\n\t  rec_seq            \""; stream.write(p->rec_seq, 4);
+   stream << "\"\n\t  sar_chn            \""; stream.write(p->sar_chn, 4);
+   stream << "\"\n\t  ntab               \""; stream.write(p->ntab, 8);
+   stream << "\"\n\t  ltab               \""; stream.write(p->ltab, 8);
+   stream << "\"\n\t  htab[0] (only one sdr_htab_rec declared in data struct):";
+   stream << "\n\t    hist_desc        \"";
+   stream.write(p->htab.hist_desc, 32);
+   stream << "\"\n\t    nrec             \""; stream.write(p->htab.nrec, 4);
+   stream << "\"\n\t    tab_seq          \""; stream.write(p->htab.tab_seq, 4);
+   stream << "\"\n\t    nbin             \""; stream.write(p->htab.nbin, 8);
+   stream << "\"\n\t    ns_lin           \""; stream.write(p->htab.ns_lin, 8);
+   stream << "\"\n\t    ns_pix           \""; stream.write(p->htab.ns_pix, 8);
+   stream << "\"\n\t    ngrp_lin         \""; stream.write(p->htab.ngrp_lin, 8);
+   stream << "\"\n\t    ngrp_pix         \""; stream.write(p->htab.ngrp_pix, 8);
+   stream << "\"\n\t    nsamp_lin        \""; stream.write(p->htab.nsamp_lin,8);
+   stream << "\"\n\t    nsamp_pix        \""; stream.write(p->htab.nsamp_pix,8);
+   stream << "\"\n\t    min_smp          \""; stream.write(p->htab.min_smp, 16);
+   stream << "\"\n\t    max_smp          \""; stream.write(p->htab.max_smp, 16);
+   stream << "\"\n\t    mean_smp         \""; stream.write(p->htab.mean_smp,16);
+   stream << "\"\n\t    std_smp          \""; stream.write(p->htab.std_smp, 16);
+   stream << "\"\n\t    smp_inc          \""; stream.write(p->htab.smp_inc, 16);
+   stream << "\"\n\t    min_hist         \""; stream.write(p->htab.min_hist,16);
+   stream << "\"\n\t    max_hist         \""; stream.write(p->htab.max_hist,16);
+   stream << "\"\n\t    mean_hist        \"";
+   stream.write(p->htab.mean_hist, 16);
+   stream << "\"\n\t    std_hist         \""; stream.write(p->htab.std_hist,16);
+   stream << "\"\n\t    nhist            \""; stream.write(p->htab.nhist, 16);
+   stream << "\"\n\t    [Use debugger to view histogram]";
+   stream << endl;
+}
+
+//******************************************************************************
+// PRIVATE METHOD: ossimCeosData::dumpProcParmRec()
+//  
+//******************************************************************************
+void ossimCeosData::dumpProcParmRec(ostream& stream) const
+{
+   const proc_parm_rec* p = theProcParmRec;
+
+   stream << "\n\n\tContents of proc_parm_rec:\n\t";
+   stream << "\n\t  slow_time_coef[1]  \"";
+   stream.write(p->slow_time_coef[1], 22);
+   stream << "\"\n\t  rec_seq            \""; stream.write(p->rec_seq, 4);
+   stream << "\"\n\t  spare1             \""; stream.write(p->spare1, 4);
+   stream << "\"\n\t  inp_media          \""; stream.write(p->inp_media, 3);
+   stream << "\"\n\t  n_tape_id          \""; stream.write(p->n_tape_id, 4);
+   stream << "\"\n\t  tape_id[0]         \""; stream.write(p->tape_id[0], 8);
+   stream << "\"\n\t  exp_ing_start      \""; stream.write(p->exp_ing_start,21);
+   stream << "\"\n\t  exp_ing_stop       \""; stream.write(p->exp_ing_stop, 21);
+   stream << "\"\n\t  act_ing_start      \""; stream.write(p->act_ing_start,21);
+   stream << "\"\n\t  act_ing_stop       \""; stream.write(p->act_ing_stop, 21);
+   stream << "\"\n\t  proc_start         \""; stream.write(p->proc_start, 21);
+   stream << "\"\n\t  proc_stop          \""; stream.write(p->proc_stop, 21);
+   stream << "\"\n\t  mn_sig_lev[0]      \""; stream.write(p->mn_sig_lev[0],16);
+   stream << "\"\n\t  mn_sig_lev[1]      \""; stream.write(p->mn_sig_lev[1],16);
+   stream << "\"\n\t  mn_sig_lev[2]      \""; stream.write(p->mn_sig_lev[2],16);
+   stream << "\"\n\t  mn_sig_lev[3]      \""; stream.write(p->mn_sig_lev[3],16);
+   stream << "\"\n\t  mn_sig_lev[4]      \""; stream.write(p->mn_sig_lev[4],16);
+   stream << "\"\n\t  mn_sig_lev[5]      \""; stream.write(p->mn_sig_lev[5],16);
+   stream << "\"\n\t  mn_sig_lev[6]      \""; stream.write(p->mn_sig_lev[6],16);
+   stream << "\"\n\t  mn_sig_lev[7]      \""; stream.write(p->mn_sig_lev[7],16);
+   stream << "\"\n\t  mn_sig_lev[8]      \""; stream.write(p->mn_sig_lev[8],16);
+   stream << "\"\n\t  mn_sig_lev[9]      \""; stream.write(p->mn_sig_lev[9],16);
+   stream << "\"\n\t  scr_data_ind       \""; stream.write(p->scr_data_ind, 4);
+   stream << "\"\n\t  miss_ln            \""; stream.write(p->miss_ln, 8);
+   stream << "\"\n\t  rej_ln             \""; stream.write(p->rej_ln, 8);
+   stream << "\"\n\t  large_gap          \""; stream.write(p->large_gap, 8);
+   stream << "\"\n\t  bit_err_rate       \""; stream.write(p->bit_err_rate, 16);
+   stream << "\"\n\t  fm_crc_err         \""; stream.write(p->fm_crc_err, 16);
+   stream << "\"\n\t  date_incons        \""; stream.write(p->date_incons, 8);
+   stream << "\"\n\t  prf_changes        \""; stream.write(p->prf_changes, 8);
+   stream << "\"\n\t  delay_changes      \""; stream.write(p->delay_changes, 8);
+   stream << "\"\n\t  skipd_frams        \""; stream.write(p->skipd_frams, 8);
+   stream << "\"\n\t  rej_bf_start       \""; stream.write(p->rej_bf_start, 8);
+   stream << "\"\n\t  rej_few_fram       \""; stream.write(p->rej_few_fram, 8);
+   stream << "\"\n\t  rej_many_fram      \""; stream.write(p->rej_many_fram, 8);
+   stream << "\"\n\t  rej_mchn_err       \""; stream.write(p->rej_mchn_err, 8);
+   stream << "\"\n\t  rej_vchn_err       \""; stream.write(p->rej_vchn_err, 8);
+   stream << "\"\n\t  rej_rec_type       \""; stream.write(p->rej_rec_type, 8);
+   stream << "\"\n\t  sens_config        \""; stream.write(p->sens_config, 10);
+   stream << "\"\n\t  sens_orient        \""; stream.write(p->sens_orient, 9);
+   stream << "\"\n\t  sych_marker        \""; stream.write(p->sych_marker, 8);
+   stream << "\"\n\t  rng_ref_src        \""; stream.write(p->rng_ref_src, 12);
+   stream << "\"\n\t  rng_amp_coef[0]    \"";
+   stream.write(p->rng_amp_coef[0],16);
+   stream << "\"\n\t  rng_amp_coef[1]    \"";
+   stream.write(p->rng_amp_coef[1],16);
+   stream << "\"\n\t  rng_amp_coef[2]    \"";
+   stream.write(p->rng_amp_coef[2],16);
+   stream << "\"\n\t  rng_amp_coef[3]    \"";
+   stream.write(p->rng_amp_coef[3],16);
+   stream << "\"\n\t  rng_phas_coef[0]   \"";
+   stream.write(p->rng_phas_coef[0], 16);
+   stream << "\"\n\t  rng_phas_coef[1]   \"";
+   stream.write(p->rng_phas_coef[1], 16);
+   stream << "\"\n\t  rng_phas_coef[2]   \"";
+   stream.write(p->rng_phas_coef[2], 16);
+   stream << "\"\n\t  rng_phas_coef[3]   \"";
+   stream.write(p->rng_phas_coef[3], 16);
+   stream << "\"\n\t  err_amp_coef[0]    \"";
+   stream.write(p->err_amp_coef[0],16);
+   stream << "\"\n\t  err_amp_coef[1]    \"";
+   stream.write(p->err_amp_coef[1],16);
+   stream << "\"\n\t  err_amp_coef[2]    \"";
+   stream.write(p->err_amp_coef[2],16);
+   stream << "\"\n\t  err_amp_coef[3]    \"";
+   stream.write(p->err_amp_coef[3],16);
+   stream << "\"\n\t  err_phas_coef[0]   \"";
+   stream.write(p->err_phas_coef[0], 16);
+   stream << "\"\n\t  err_phas_coef[1]   \"";
+   stream.write(p->err_phas_coef[1], 16);
+   stream << "\"\n\t  err_phas_coef[2]   \"";
+   stream.write(p->err_phas_coef[2], 16);
+   stream << "\"\n\t  err_phas_coef[3]   \"";
+   stream.write(p->err_phas_coef[3], 16);
+   stream << "\"\n\t  pulse_bandw        \""; stream.write(p->pulse_bandw, 4);
+   stream << "\"\n\t  adc_samp_rate      \""; stream.write(p->adc_samp_rate, 5);
+   stream << "\"\n\t  rep_agc_attn       \""; stream.write(p->rep_agc_attn, 16);
+   stream << "\"\n\t  gn_corctn_fctr     \"";
+   stream.write(p->gn_corctn_fctr, 16);
+   stream << "\"\n\t  rep_energy_gn      \""; stream.write(p->rep_energy_gn,16);
+   stream << "\"\n\t  orb_data_src       \""; stream.write(p->orb_data_src, 11);
+   stream << "\"\n\t  pulse_cnt_1        \""; stream.write(p->pulse_cnt_1, 4);
+   stream << "\"\n\t  pulse_cnt_2        \""; stream.write(p->pulse_cnt_2, 4);
+   stream << "\"\n\t  beam_edge_rqd      \""; stream.write(p->beam_edge_rqd, 3);
+   stream << "\"\n\t  beam_edge_conf     \"";
+   stream.write(p->beam_edge_conf, 16);
+   stream << "\"\n\t  pix_overlap        \""; stream.write(p->pix_overlap, 4);
+   stream << "\"\n\t  n_beams            \""; stream.write(p->n_beams, 4);
+   stream << "\"\n\t  [Use debugger to view contents of beam_info record] ";
+   stream << "\n\t  n_pix_updates      \""; stream.write(p->n_pix_updates, 4);
+   stream << "\"\n\t  [Use debugger to view contents of pix_count record] ";
+   stream << "\n\t  pwin_start         \""; stream.write(p->pwin_start, 16);
+   stream << "\"\n\t  pwin_end           \""; stream.write(p->pwin_end, 16);
+   stream << "\"\n\t  recd_type          \""; stream.write(p->recd_type, 9);
+   stream << "\"\n\t  temp_set_inc       \""; stream.write(p->temp_set_inc, 16);
+   stream << "\"\n\t  n_temp_set         \""; stream.write(p->n_temp_set, 4);
+   stream << "\"\n\t  [Use debugger to view contents of temp record] ";
+   stream << "\n\t  n_image_pix        \""; stream.write(p->n_image_pix, 8);
+   stream << "\"\n\t  prc_zero_pix       \""; stream.write(p->prc_zero_pix, 16);
+   stream << "\"\n\t  prc_satur_pix      \""; stream.write(p->prc_satur_pix,16);
+   stream << "\"\n\t  img_hist_mean      \""; stream.write(p->img_hist_mean,16);
+   stream << "\"\n\t  img_cumu_dist[0]   \"";
+   stream.write(p->img_cumu_dist[0], 16);
+   stream << "\"\n\t  img_cumu_dist[1]   \"";
+   stream.write(p->img_cumu_dist[1], 16);
+   stream << "\"\n\t  img_cumu_dist[2]   \"";
+   stream.write(p->img_cumu_dist[2], 16);
+   stream << "\"\n\t  pre_img_gn         \""; stream.write(p->pre_img_gn, 16);
+   stream << "\"\n\t  post_img_gn        \""; stream.write(p->post_img_gn, 16);
+   stream << "\"\n\t  dopcen_inc         \""; stream.write(p->dopcen_inc, 16);
+   stream << "\"\n\t  n_dopcen           \""; stream.write(p->n_dopcen, 4);
+   stream << "\"\n\t  [Use debugger to view contents of dopcen_est record] ";
+   stream << "\n\t  dop_amb_err        \""; stream.write(p->dop_amb_err, 4);
+   stream << "\"\n\t  dopamb_conf        \""; stream.write(p->dopamb_conf, 16);
+   stream << "\"\n\t  eph_orb_data[0]    \"";
+   stream.write(p->eph_orb_data[0],16);
+   stream << "\"\n\t  eph_orb_data[1]    \"";
+   stream.write(p->eph_orb_data[1],16);
+   stream << "\"\n\t  eph_orb_data[2]    \"";
+   stream.write(p->eph_orb_data[2],16);
+   stream << "\"\n\t  eph_orb_data[3]    \"";
+   stream.write(p->eph_orb_data[3],16);
+   stream << "\"\n\t  eph_orb_data[4]    \"";
+   stream.write(p->eph_orb_data[4],16);
+   stream << "\"\n\t  eph_orb_data[5]    \"";
+   stream.write(p->eph_orb_data[5],16);
+   stream << "\"\n\t  eph_orb_data[6]    \"";
+   stream.write(p->eph_orb_data[6],16);
+   stream << "\"\n\t  appl_type          \""; stream.write(p->appl_type, 12);
+   stream << "\"\n\t  slow_time_coef[1]  \"";
+   stream.write(p->slow_time_coef[1], 22);
+   stream << "\"\n\t  slow_time_coef[2]  \"";
+   stream.write(p->slow_time_coef[2], 22);
+   stream << "\"\n\t  slow_time_coef[3]  \"";
+   stream.write(p->slow_time_coef[3], 22);
+   stream << "\"\n\t  slow_time_coef[4]  \"";
+   stream.write(p->slow_time_coef[4], 22);
+   stream << "\"\n\t  n_srgr             \""; stream.write(p->n_srgr, 4);
+   stream << "\"\n\t  [Use debugger to view contents of srgr_coefset record]";
+   stream << "\n\t  pixel_spacing      \""; stream.write(p->pixel_spacing,16);
+   stream << "\"\n\t  gics_reqd          \""; stream.write(p->gics_reqd, 3);
+   stream << "\"\n\t  wo_number          \""; stream.write(p->wo_number, 8);
+   stream << "\"\n\t  wo_date            \""; stream.write(p->wo_date, 20);
+   stream << "\"\n\t  satellite_id       \""; stream.write(p->satellite_id, 10);
+   stream << "\"\n\t  user_id            \""; stream.write(p->user_id, 20);
+   stream << "\"\n\t  complete_msg       \""; stream.write(p->complete_msg, 3);
+   stream << "\"\n\t  scene_id           \""; stream.write(p->scene_id, 5);
+   stream << "\"\n\t  density_in         \""; stream.write(p->density_in, 4);
+   stream << "\"\n\t  media_id           \""; stream.write(p->media_id, 8);
+   stream << "\"\n\t  angle_first        \""; stream.write(p->angle_first, 16);
+   stream << "\"\n\t  angle_last         \""; stream.write(p->angle_last, 16);
+   stream << "\"\n\t  prod_type          \""; stream.write(p->prod_type, 3);
+   stream << "\"\n\t  map_system         \""; stream.write(p->map_system, 16);
+   stream << "\"\n\t  centre_lat         \""; stream.write(p->centre_lat, 22);
+   stream << "\"\n\t  centre_long        \""; stream.write(p->centre_long, 22);
+   stream << "\"\n\t  span_x             \""; stream.write(p->span_x, 22);
+   stream << "\"\n\t  span_y             \""; stream.write(p->span_y, 22);
+   stream << "\"\n\t  apply_dtm          \""; stream.write(p->apply_dtm, 3);
+   stream << "\"\n\t  density_out        \""; stream.write(p->density_out, 4);
+   stream << "\"\n\t  state_time         \""; stream.write(p->state_time, 21);
+   stream << "\"\n\t  num_state_vectors  \"";
+   stream.write(p->num_state_vectors, 4);
+   stream << "\"\n\t  state_time_inc     \"";
+   stream.write(p->state_time_inc, 16);
+   stream << "\"" << endl;
+}
+
+//******************************************************************************
+// PRIVATE METHOD: ossimCeosData::dumpMapProjRec()
+//  
+//******************************************************************************
+void ossimCeosData::dumpMapProjRec(ostream& stream) const
+{
+   const map_proj_rec* p = theMapProjRec;
+
+   stream << "\n\n\tContents of map_proj_rec:\n\t";
+   stream << "\n\t  spare1             \""; stream.write(p->spare1, 16);
+   stream << "\"\n\t  map_desc           \""; stream.write(p->map_desc, 32);
+   stream << "\"\n\t  n_pixel            \""; stream.write(p->n_pixel, 16);
+   stream << "\"\n\t  n_line             \""; stream.write(p->n_line, 16);
+   stream << "\"\n\t  pixel_spacing      \""; stream.write(p->pixel_spacing,16);
+   stream << "\"\n\t  line_spacing       \""; stream.write(p->line_spacing, 16);
+   stream << "\"\n\t  osc_orient         \""; stream.write(p->osc_orient, 16);
+   stream << "\"\n\t  orb_incl           \""; stream.write(p->orb_incl, 16);
+   stream << "\"\n\t  asc_node           \""; stream.write(p->asc_node, 16);
+   stream << "\"\n\t  isc_dist           \""; stream.write(p->isc_dist, 16);
+   stream << "\"\n\t  geo_alt            \""; stream.write(p->geo_alt, 16);
+   stream << "\"\n\t  isc_vel            \""; stream.write(p->isc_vel, 16);
+   stream << "\"\n\t  plat_head          \""; stream.write(p->plat_head, 16);
+   stream << "\"\n\t  ref_ellip          \""; stream.write(p->ref_ellip, 32);
+   stream << "\"\n\t  semi_major         \""; stream.write(p->semi_major, 16);
+   stream << "\"\n\t  semi_minor         \""; stream.write(p->semi_minor, 16);
+   stream << "\"\n\t  datum_shift[0]     \"";
+   stream.write(p->datum_shift[0], 16);
+   stream << "\"\n\t  datum_shift[1]     \"";
+   stream.write(p->datum_shift[1], 16);
+   stream << "\"\n\t  datum_shift[2]     \"";
+   stream.write(p->datum_shift[2], 16);
+   stream << "\"\n\t  aux_datum_shift[0] \"";
+   stream.write(p->aux_datum_shift[0], 16);
+   stream << "\"\n\t  aux_datum_shift[1] \"";
+   stream.write(p->aux_datum_shift[1], 16);
+   stream << "\"\n\t  aux_datum_shift[2] \"";
+   stream.write(p->aux_datum_shift[2], 16);
+   stream << "\"\n\t  scal_ellip         \""; stream.write(p->scal_ellip, 16);
+   stream << "\"\n\t  proj_desc          \""; stream.write(p->proj_desc, 32);
+   stream << "\"\n\t  utm_desc           \""; stream.write(p->utm_desc, 32);
+   stream << "\"\n\t  utm_zone_sig       \""; stream.write(p->utm_zone_sig, 4);
+   stream << "\"\n\t  utm_east_orig      \""; stream.write(p->utm_east_orig,16);
+   stream << "\"\n\t  utm_north_orig     \"";
+   stream.write(p->utm_north_orig, 16);
+   stream << "\"\n\t  utm_cent_long      \""; stream.write(p->utm_cent_long,16);
+   stream << "\"\n\t  utm_cent_lat       \""; stream.write(p->utm_cent_lat, 16);
+   stream << "\"\n\t  utm_stand_par[0]   \"";
+   stream.write(p->utm_stand_par[0], 16);
+   stream << "\"\n\t  utm_stand_par[1]   \"";
+   stream.write(p->utm_stand_par[1], 16);
+   stream << "\"\n\t  utm_scale          \""; stream.write(p->utm_scale, 16);
+   stream << "\"\n\t  ups_desc           \""; stream.write(p->ups_desc, 32);
+   stream << "\"\n\t  ups_cent_long      \""; stream.write(p->ups_cent_long,16);
+   stream << "\"\n\t  ups_cent_lat       \""; stream.write(p->ups_cent_lat, 16);
+   stream << "\"\n\t  ups_scale          \""; stream.write(p->ups_scale, 16);
+   stream << "\"\n\t  nsp_desc           \""; stream.write(p->nsp_desc, 32);
+   stream << "\"\n\t  nsp_east_orig      \""; stream.write(p->nsp_east_orig,16);
+   stream << "\"\n\t  nsp_north_orig     \"";
+   stream.write(p->nsp_north_orig,16);
+   stream << "\"\n\t  nsp_cent_long      \""; stream.write(p->nsp_cent_long,16);
+   stream << "\"\n\t  nsp_cent_lat       \""; stream.write(p->nsp_cent_lat, 16);
+   stream << "\"\n\t  nsp_stand_par[0]   \"";
+   stream.write(p->nsp_stand_par[0], 16);
+   stream << "\"\n\t  nsp_stand_par[1]   \"";
+   stream.write(p->nsp_stand_par[1], 16);
+   stream << "\"\n\t  nsp_stand_par[2]   \"";
+   stream.write(p->nsp_stand_par[2], 16);
+   stream << "\"\n\t  nsp_stand_par[3]   \"";
+   stream.write(p->nsp_stand_par[3], 16);
+   stream << "\"\n\t  nsp_stand_mer[0]   \"";
+   stream.write(p->nsp_stand_mer[0], 16);
+   stream << "\"\n\t  nsp_stand_mer[1]   \"";
+   stream.write(p->nsp_stand_mer[1], 16);
+   stream << "\"\n\t  nsp_stand_mer[2]   \"";
+   stream.write(p->nsp_stand_mer[2], 16);
+   stream << "\"\n\t  nsp_spare[0]       \""; stream.write(p->nsp_spare[0], 16);
+   stream << "\"\n\t  nsp_spare[1]       \""; stream.write(p->nsp_spare[1], 16);
+   stream << "\"\n\t  nsp_spare[2]       \""; stream.write(p->nsp_spare[2], 16);
+   stream << "\"\n\t  nsp_spare[3]       \""; stream.write(p->nsp_spare[3], 16);
+   stream << "\"\n\t  corner_ne[0]       \""; stream.write(p->corner_ne[0], 16);
+   stream << "\"\n\t  corner_ne[1]       \""; stream.write(p->corner_ne[1], 16);
+   stream << "\"\n\t  corner_ne[2]       \""; stream.write(p->corner_ne[2], 16);
+   stream << "\"\n\t  corner_ne[3]       \""; stream.write(p->corner_ne[3], 16);
+   stream << "\"\n\t  corner_ne[4]       \""; stream.write(p->corner_ne[4], 16);
+   stream << "\"\n\t  corner_ne[5]       \""; stream.write(p->corner_ne[5], 16);
+   stream << "\"\n\t  corner_ne[6]       \""; stream.write(p->corner_ne[6], 16);
+   stream << "\"\n\t  corner_ne[7]       \""; stream.write(p->corner_ne[7], 16);
+   stream << "\"\n\t  corner_ll[0]       \""; stream.write(p->corner_ll[0], 16);
+   stream << "\"\n\t  corner_ll[1]       \""; stream.write(p->corner_ll[1], 16);
+   stream << "\"\n\t  corner_ll[2]       \""; stream.write(p->corner_ll[2], 16);
+   stream << "\"\n\t  corner_ll[3]       \""; stream.write(p->corner_ll[3], 16);
+   stream << "\"\n\t  corner_ll[4]       \""; stream.write(p->corner_ll[4], 16);
+   stream << "\"\n\t  corner_ll[5]       \""; stream.write(p->corner_ll[5], 16);
+   stream << "\"\n\t  corner_ll[6]       \""; stream.write(p->corner_ll[6], 16);
+   stream << "\"\n\t  corner_ll[7]       \""; stream.write(p->corner_ll[7], 16);
+   stream << "\"\n\t  terr_height[0]     \"";
+   stream.write(p->terr_height[0], 16);
+   stream << "\"\n\t  terr_height[1]     \"";
+   stream.write(p->terr_height[1], 16);
+   stream << "\"\n\t  terr_height[2]     \"";
+   stream.write(p->terr_height[2], 16);
+   stream << "\"\n\t  terr_height[3]     \"";
+   stream.write(p->terr_height[3], 16);
+   stream << "\"\n\t  lp_conv_coef[0]    \"";
+   stream.write(p->lp_conv_coef[0],20);
+   stream << "\"\n\t  lp_conv_coef[1]    \"";
+   stream.write(p->lp_conv_coef[1],20);
+   stream << "\"\n\t  lp_conv_coef[2]    \"";
+   stream.write(p->lp_conv_coef[2],20);
+   stream << "\"\n\t  lp_conv_coef[3]    \"";
+   stream.write(p->lp_conv_coef[3],20);
+   stream << "\"\n\t  lp_conv_coef[4]    \"";
+   stream.write(p->lp_conv_coef[4],20);
+   stream << "\"\n\t  lp_conv_coef[5]    \"";
+   stream.write(p->lp_conv_coef[5],20);
+   stream << "\"\n\t  lp_conv_coef[6]    \"";
+   stream.write(p->lp_conv_coef[6],20);
+   stream << "\"\n\t  lp_conv_coef[7]    \"";
+   stream.write(p->lp_conv_coef[7],20);
+   stream << "\"\n\t  mp_conv_coef[0]    \"";
+   stream.write(p->mp_conv_coef[0],20);
+   stream << "\"\n\t  mp_conv_coef[1]    \"";
+   stream.write(p->mp_conv_coef[1],20);
+   stream << "\"\n\t  mp_conv_coef[2]    \"";
+   stream.write(p->mp_conv_coef[2],20);
+   stream << "\"\n\t  mp_conv_coef[3]    \"";
+   stream.write(p->mp_conv_coef[3],20);
+   stream << "\"\n\t  mp_conv_coef[4]    \"";
+   stream.write(p->mp_conv_coef[4],20);
+   stream << "\"\n\t  mp_conv_coef[5]    \"";
+   stream.write(p->mp_conv_coef[5],20);
+   stream << "\"\n\t  mp_conv_coef[6]    \"";
+   stream.write(p->mp_conv_coef[6],20);
+   stream << "\"\n\t  mp_conv_coef[7]    \"";
+   stream.write(p->mp_conv_coef[7],20);
+   stream << "\"\n\t  dem_type           \""; stream.write(p->dem_type, 4);
+   stream << "\"\n\t  spare3             \""; stream.write(p->spare3, 32);
+   stream << "\"" << endl;
+}
+
+//******************************************************************************
+// PRIVATE METHOD: ossimCeosData::dumpPosDataRec()
+//  
+//******************************************************************************
+void ossimCeosData::dumpPosDataRec(ostream& stream) const
+{
+   const pos_data_rec* p = thePosDataRec;
+   
+   stream << "\n\n\tContents of pos_data_rec:\n\t";
+   stream << "\n\t  orbit_ele_desg     \""; stream.write(p->orbit_ele_desg, 32);
+   stream << "\"\n\t  orbit_ele[0]       \""; stream.write(p->orbit_ele[0], 16);
+   stream << "\"\n\t  orbit_ele[1]       \""; stream.write(p->orbit_ele[1], 16);
+   stream << "\"\n\t  orbit_ele[2]       \""; stream.write(p->orbit_ele[2], 16);
+   stream << "\"\n\t  orbit_ele[3]       \""; stream.write(p->orbit_ele[3], 16);
+   stream << "\"\n\t  orbit_ele[4]       \""; stream.write(p->orbit_ele[4], 16);
+   stream << "\"\n\t  orbit_ele[5]       \""; stream.write(p->orbit_ele[5], 16);
+   stream << "\"\n\t  ndata              \""; stream.write(p->ndata, 4);
+   stream << "\"\n\t  year               \""; stream.write(p->year, 4);
+   stream << "\"\n\t  month              \""; stream.write(p->month, 4);
+   stream << "\"\n\t  day                \""; stream.write(p->day, 4);
+   stream << "\"\n\t  gmt_day            \""; stream.write(p->gmt_day, 4);
+   stream << "\"\n\t  gmt_sec            \""; stream.write(p->gmt_sec, 22);
+   stream << "\"\n\t  data_int           \""; stream.write(p->data_int, 22);
+   stream << "\"\n\t  ref_coord          \""; stream.write(p->ref_coord, 64);
+   stream << "\"\n\t  hr_angle           \""; stream.write(p->hr_angle, 22);
+   stream << "\"\n\t  alt_poserr         \""; stream.write(p->alt_poserr, 16);
+   stream << "\"\n\t  crt_poserr         \""; stream.write(p->crt_poserr, 16);
+   stream << "\"\n\t  rad_poserr         \""; stream.write(p->rad_poserr, 16);
+   stream << "\"\n\t  alt_velerr         \""; stream.write(p->alt_velerr, 16);
+   stream << "\"\n\t  crt_velerr         \""; stream.write(p->crt_velerr, 16);
+   stream << "\"\n\t  rad_velerr         \""; stream.write(p->rad_velerr, 16);
+   stream << "\"\n\t  [Use debugger to view contents of pos_vect record]";
+   stream << endl;
+}
+
+//******************************************************************************
+// PRIVATE METHOD: ossimCeosData::dumpAttDataRec()
+//  
+//******************************************************************************
+void ossimCeosData::dumpAttDataRec(ostream& stream) const
+{
+   const att_data_rec* p = theAttDataRec;
+   
+   stream << "\n\n\tContents of att_data_rec:\n\t";
+   stream << "\n\t  npoint             \""; stream.write(p->npoint, 4);
+   stream << "\"\n\t  [Use debugger to view contents of att_vect record]";
+   stream << "\n\t  pitch_bias         \""; stream.write(p->pitch_bias, 14);
+   stream << "\"\n\t  roll_bias          \""; stream.write(p->roll_bias, 14);
+   stream << "\"\n\t  yaw_bias           \""; stream.write(p->yaw_bias, 14);
+   stream << "\"" << endl;
+}
+
+//******************************************************************************
+// PRIVATE METHOD: ossimCeosData::dumpRadiDataRec()
+//  
+//******************************************************************************
+void ossimCeosData::dumpRadiDataRec(ostream& stream) const
+{
+   const radi_data_rec* p = theRadiDataRec;
+   
+   stream << "\n\n\tContents of radi_data_rec:\n\t";
+   stream << "\n\t  seq_num            \""; stream.write(p->seq_num, 4);
+   stream << "\"\n\t  n_data             \""; stream.write(p->n_data, 4);
+   stream << "\"\n\t  field_size         \""; stream.write(p->field_size, 8);
+   stream << "\"\n\t  [Use debugger to view contents of dset record]";
+   stream << endl;
+}
+
+//******************************************************************************
+// PRIVATE METHOD: ossimCeosData::dumpRadiCompRec()
+//  
+//******************************************************************************
+void ossimCeosData::dumpRadiCompRec(ostream& stream) const
+{
+   const radi_comp_rec* p = theRadiCompRec;
+   
+   stream << "\n\n\tContents of radi_comp_rec:\n\t";
+   stream << "\n\t  seq_num            \""; stream.write(p->seq_num, 4);
+   stream << "\"\n\t  chan_ind           \""; stream.write(p->chan_ind, 4);
+   stream << "\"\n\t  n_dset             \""; stream.write(p->n_dset, 8);
+   stream << "\"\n\t  dset_size          \""; stream.write(p->dset_size, 8);
+   stream << "\"\n\t  [Use debugger to view contents of dset record]";
+   stream << endl;
+}
+
+
+//*****************************************************************************
+// PRIVATE METHOD: ossimCeosData::loadCeosRecords()
+//
+//  Reads the data files and initializes the data members. 
+//
+//*****************************************************************************
+void ossimCeosData::loadCeosRecords()
+{
+   static const char MODULE[] = "ossimCeosData::loadCeosFile()";
+   if (traceExec()) CLOG << " Entered method." << endl;
+
+   int       sizeOfRec;
+   char      bufI6[] = "123456";
+   int       numRecords;
+   
+   //***
+   // Open Volume Directory File and parse:
+   //***
+   FILE* fptr = fopen(theVolDirFileName.chars(), "r");
+   if (!fptr)
+   {
+      if(traceDebug())
+      {
+         CLOG << " ERROR:\n\tCannot open CEOS Volume Directory file: "
+              << theVolDirFileName << endl;
+      }
+      theErrorStatus = ERROR;
+      return;
+   }
+   sizeOfRec = sizeof(theVolumeDirectory);
+   fread(&theVolumeDirectory, sizeOfRec, 1, fptr);
+   fclose(fptr);
+   theVolDescRec = &theVolumeDirectory.volDescRec;
+   theTextRec    = &theVolumeDirectory.textRec;
+
+   if (traceDebug())
+   {
+      CLOG << "DEBUG\n   -- List of Records Present ---" << endl;
+   }
+
+   //***
+   // Open and parse Leader File:
+   //***
+   if (!theLeaderFileName.empty())
+   {
+      fptr = fopen(theLeaderFileName.chars(), "r");
+      if (!fptr)
+      {
+         if(traceDebug())
+         {
+            CLOG << " ERROR:\n\tCannot open CEOS Leader file: "
+                  << theLeaderFileName << endl;
+         }
+         theErrorStatus = ERROR;
+         return;
+      }
+      fread(&(theSarLeaderFile.sarDescRec), 720, 1, fptr);
+
+      //***
+      // Establish which CEOS records are in the leader file, and read them.
+      // First the dataset summary record:
+      //***
+      strncpy(bufI6, theSarLeaderFile.sarDescRec.n_dataset, 6);
+      numRecords = atoi(bufI6);
+      if (numRecords)
+      {
+         fread(&theSarLeaderFile.dataSetSumRec, sizeOfNextRec(fptr), 1, fptr);
+         theDataSetSumRec = &(theSarLeaderFile.dataSetSumRec);
+         if (traceDebug()) clog << "\t Leader: dataSetSumRec" << endl;
+      }
+
+      //***
+      // Data quality summary record:
+      //***
+      strncpy(bufI6, theSarLeaderFile.sarDescRec.n_qual_sum, 6);
+      numRecords = atoi(bufI6);
+      if (numRecords)
+      {
+         fread(&(theSarLeaderFile.qualSumRec), sizeOfNextRec(fptr), 1, fptr);
+         theQualSumRec = &(theSarLeaderFile.qualSumRec);
+         if (traceDebug()) clog << "\t Leader: qualSumRec" << endl;
+      }
+
+      //***
+      // Histogram records:
+      //***
+      strncpy(bufI6, theSarLeaderFile.sarDescRec.n_data_hist, 6);
+      numRecords = atoi(bufI6);
+      if (numRecords)
+      {
+         fread(&(theSarLeaderFile.sdrHistRec), sizeOfNextRec(fptr), 1, fptr);
+         theSdrHistRec = &(theSarLeaderFile.sdrHistRec);
+         fread(&(theSarLeaderFile.pdr16HistRec), sizeOfNextRec(fptr), 1, fptr);
+         thePdr16HistRec = &(theSarLeaderFile.pdr16HistRec);
+         if (traceDebug()) clog << "\t Leader: sdrHistRec & pdr16HistRec"
+                                << endl;
+      }
+
+      //***
+      // Processing parameter record:
+      //***
+      strncpy(bufI6, theSarLeaderFile.sarDescRec.n_det_proc, 6);
+      numRecords = atoi(bufI6);
+      if (numRecords)
+      {
+         fread(&(theSarLeaderFile.procParmRec), sizeOfNextRec(fptr), 1, fptr);
+         theProcParmRec = &(theSarLeaderFile.procParmRec);
+         if (traceDebug()) clog << "\t Leader: procParmRec" << endl;
+      }
+
+      //***
+      // Map projection record:
+      //***
+      strncpy(bufI6, theSarLeaderFile.sarDescRec.n_map_proj, 6);
+      numRecords = atoi(bufI6);
+      if (numRecords)
+      {
+         fread(&(theSarLeaderFile.mapProjRec), sizeOfNextRec(fptr), 1, fptr);
+         theMapProjRec = &(theSarLeaderFile.mapProjRec);
+         if (traceDebug()) clog << "\t Leader: mapProjRec" << endl;
+      }
+
+      //***
+      // Position data record:
+      //***
+      strncpy(bufI6, theSarLeaderFile.sarDescRec.n_plat_pos, 6);
+      numRecords = atoi(bufI6);
+      if (numRecords)
+      {
+         fread(&(theSarLeaderFile.posDataRec), sizeOfNextRec(fptr), 1, fptr);
+         thePosDataRec = &(theSarLeaderFile.posDataRec);
+         if (traceDebug()) clog << "\t Leader: posDataRec" << endl;
+      }
+
+      //***
+      // Attitude data record:
+      //***
+      strncpy(bufI6, theSarLeaderFile.sarDescRec.n_att_data, 6);
+      numRecords = atoi(bufI6);
+      if (numRecords)
+      {
+         fread(&(theSarLeaderFile.attDataRec), sizeOfNextRec(fptr), 1, fptr);
+         theAttDataRec = &(theSarLeaderFile.attDataRec);
+         if (traceDebug()) clog << "\t Leader: attDataRec" << endl;
+      }
+
+      //***
+      // Radiometric data record:
+      //***
+      strncpy(bufI6, theSarLeaderFile.sarDescRec.n_radi_data, 6);
+      numRecords = atoi(bufI6);
+      if (numRecords)
+      {
+         fread(&(theSarLeaderFile.radiDataRec), sizeOfNextRec(fptr), 1, fptr);
+         theRadiDataRec = &(theSarLeaderFile.radiDataRec);
+         if (traceDebug()) clog << "\t Leader: radiDataRec" << endl;
+      }
+
+      //***
+      // Radiometric compensation data record:
+      //***
+      strncpy(bufI6, theSarLeaderFile.sarDescRec.n_radi_comp, 6);
+      numRecords = atoi(bufI6);
+      if (numRecords)
+      {
+         fread(&(theSarLeaderFile.radiCompRec), sizeOfNextRec(fptr), 1, fptr);
+         theRadiCompRec = &(theSarLeaderFile.radiCompRec);
+         if (traceDebug()) clog << "\t Leader: radiCompRec" << endl;
+      }
+
+      fclose(fptr);
+   }
+   
+   //***
+   // Open and parse CEOS SAR data File to read the image options:
+   //***
+   fptr = fopen(theImageFileName.chars(), "r");
+   if (!fptr)
+   {
+      CLOG << " ERROR:\n\tCannot open CEOS image file: " << theImageFileName
+           << endl;
+      theErrorStatus = ERROR;
+      return;
+   }
+   sizeOfRec = sizeof(theImopDescRec);
+   fread(&theImopDescRec, sizeOfRec, 1, fptr);
+   fclose(fptr);
+
+   //***
+   // Open and parse trailer file:
+   //***
+   if (!theTrailerFileName.empty())
+   {
+      fptr = fopen(theTrailerFileName.chars(), "r");
+      if (!fptr)
+      {
+         CLOG << " ERROR:\n\tCannot open CEOS Trailer file: "
+              << theTrailerFileName << endl;
+         theErrorStatus = ERROR;
+         return;
+      }
+      fread(&(theSarTrailerFile.sarDescRec), 720, 1, fptr);
+
+      //***
+      // Establish which CEOS records are in the Trailer file, and read them.
+      // First the dataset summary record:
+      //***
+      strncpy(bufI6, theSarTrailerFile.sarDescRec.n_dataset, 6);
+      numRecords = atoi(bufI6);
+      if (numRecords)
+      {
+         fread(&(theSarTrailerFile.dataSetSumRec), sizeOfNextRec(fptr),1, fptr);
+         theDataSetSumRec = &(theSarTrailerFile.dataSetSumRec);
+         if (traceDebug()) clog << "\t Trailer: dataSetSumRec" << endl;
+      }
+
+      //***
+      // Data quality summary record:
+      //***
+      strncpy(bufI6, theSarTrailerFile.sarDescRec.n_qual_sum, 6);
+      numRecords = atoi(bufI6);
+      if (numRecords)
+      {
+         fread(&(theSarTrailerFile.qualSumRec), sizeOfNextRec(fptr), 1, fptr);
+         theQualSumRec = &(theSarTrailerFile.qualSumRec);
+         if (traceDebug()) clog << "\t Trailer: qualSumRec" << endl;
+      }
+
+      //***
+      // Histogram records:
+      //***
+      strncpy(bufI6, theSarTrailerFile.sarDescRec.n_data_hist, 6);
+      numRecords = atoi(bufI6);
+      if (numRecords)
+      {
+         fread(&(theSarTrailerFile.sdrHistRec), sizeOfNextRec(fptr), 1, fptr);
+         theSdrHistRec = &(theSarTrailerFile.sdrHistRec);
+         fread(&(theSarTrailerFile.pdr8HistRec), 16920, 1, fptr);
+         thePdr8HistRec = &(theSarTrailerFile.pdr8HistRec);
+         if (traceDebug()) clog << "\t Trailer: sdrHistRec & pdr8HistRec"
+                                << endl;
+      }
+
+      //***
+      // Processing parameter record:
+      //***
+      strncpy(bufI6, theSarTrailerFile.sarDescRec.n_det_proc, 6);
+      numRecords = atoi(bufI6);
+      if (numRecords)
+      {
+         fread(&(theSarTrailerFile.procParmRec), sizeOfNextRec(fptr), 1, fptr);
+         theProcParmRec = &(theSarTrailerFile.procParmRec);
+         if (traceDebug()) clog << "\t Trailer: procParmRec" << endl;
+      }
+
+      //***
+      // Attitude data record:
+      //***
+      strncpy(bufI6, theSarTrailerFile.sarDescRec.n_att_data, 6);
+      numRecords = atoi(bufI6);
+      if (numRecords)
+      {
+         fread(&(theSarTrailerFile.attDataRec), sizeOfNextRec(fptr), 1, fptr);
+         theAttDataRec = &(theSarTrailerFile.attDataRec);
+         if (traceDebug()) clog << "\t Trailer: attDataRec" << endl;
+      }
+
+      //***
+      // Radiometric data record:
+      //***
+      strncpy(bufI6, theSarTrailerFile.sarDescRec.n_radi_data, 6);
+      numRecords = atoi(bufI6);
+      if (numRecords)
+      {
+         fread(&(theSarTrailerFile.radiDataRec), sizeOfNextRec(fptr), 1, fptr);
+         theRadiDataRec = &(theSarTrailerFile.radiDataRec);
+         if (traceDebug()) clog << "\t Trailer: radiDataRec" << endl;
+      }
+
+      //***
+      // Radiometric compensation data record:
+      //***
+      strncpy(bufI6, theSarTrailerFile.sarDescRec.n_radi_comp, 6);
+      numRecords = atoi(bufI6);
+      if (numRecords)
+      {
+         fread(&(theSarTrailerFile.radiCompRec), sizeOfNextRec(fptr), 1, fptr);
+         theRadiCompRec = &(theSarTrailerFile.radiCompRec);
+         if (traceDebug()) clog << "\t Trailer: radiCompRec" << endl;
+      }
+
+      fclose(fptr);
+   }
+
+   if (traceExec()) CLOG << " Exiting method." << endl;
+}
+
+
+//******************************************************************************
+// PRIVATE METHOD: ossimCeosData::sizeOfNextRec(FILE*)
+//  
+//  Reads the descriptor record pointed to by the file ptr and returns the
+//  size of the following record in bytes.
+//  
+//******************************************************************************
+int ossimCeosData::sizeOfNextRec(FILE* fptr)
+{
+   static const char MODULE[] = "ossimCeosData::sizeOfNextRec(FILE* fptr)";
+   if (traceExec())  CLOG << "entering..." << endl;
+   
+   static desc_rec descRec;
+   static int DESC_REC_SIZE = 12;
+   
+   fread(&descRec, DESC_REC_SIZE, 1, fptr);
+   fseek(fptr, (long) -DESC_REC_SIZE, SEEK_CUR);
+   
+   if (traceDebug())
+   {
+      CLOG << "DEBUG -- "
+           << "\n\t length = " << descRec.length << endl;
+   }
+
+   if (traceExec())  CLOG << "returning..." << endl;
+   return descRec.length;
+}
diff --git a/src/ossim/support_data/ossimDoqq.cpp b/src/ossim/support_data/ossimDoqq.cpp
index c4e378a..fce4374 100644
--- a/src/ossim/support_data/ossimDoqq.cpp
+++ b/src/ossim/support_data/ossimDoqq.cpp
@@ -11,15 +11,9 @@
 //              header.
 //
 //********************************************************************
-// $Id: ossimDoqq.cpp 13175 2008-07-14 15:23:45Z gpotts $
-
-#include <fstream>
-#include <iostream>
+// $Id: ossimDoqq.cpp 19900 2011-08-04 14:19:57Z dburken $
 
 #include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
 #include <ossim/support_data/ossimDoqq.h>
 #include <ossim/base/ossimTrace.h>
 #include <ossim/base/ossimNotifyContext.h>
@@ -29,23 +23,37 @@ static ossimTrace traceDebug("ossimDoqq:debug");
 //**************************************************************************
 // CONSTRUCTOR
 //**************************************************************************
+ossimDoqq::ossimDoqq()
+   :  theErrorStatus(OSSIM_ERROR)
+{
+}
+
+//**************************************************************************
+// CONSTRUCTOR
+//**************************************************************************
 ossimDoqq::ossimDoqq(ossimFilename file)
-   :
-      theErrorStatus(OSSIM_OK)
+   :  theErrorStatus(OSSIM_ERROR)
 {
-   static const char MODULE[] = "ossimDoqq Constructor";
+   open(file);
+   theDoqFile.close();
+}
+
+//**************************************************************************
+// Opens the DOQ header and parses info.
+//**************************************************************************
+bool ossimDoqq::open(const ossimFilename& file)
+{
+   // Assume all kosher:
+   theErrorStatus = OSSIM_OK;
 
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "Entering " << MODULE << std::endl;
-   }
-      
    // Check first line of header to determine which version to parse.
-   std::ifstream inFile(file.c_str(), std::ios::in);
+   if (theDoqFile.is_open())
+      theDoqFile.close();
+
+   theDoqFile.open(file.c_str(), std::ios::in);
    char header[23];
-   inFile.seekg(0, std::ios::beg);
-   inFile.get(header, 22);
+   theDoqFile.seekg(0, std::ios::beg);
+   theDoqFile.get(header, 22);
    header[22] = '\0';
    if(strcmp((const char*)header, "BEGIN_USGS_DOQ_HEADER") == 0)
    {
@@ -56,7 +64,7 @@ ossimDoqq::ossimDoqq(ossimFilename file)
             << std::endl;
       }
 
-      ldstr_v2(inFile);
+      ldstr_v2(theDoqFile);
    }
    else
    {
@@ -67,21 +75,13 @@ ossimDoqq::ossimDoqq(ossimFilename file)
             << std::endl;
       }
 
-      ldstr_v1(inFile);
+      ldstr_v1(theDoqFile);
    }
 
-   inFile.close();
-
    // Check for error.
    if(theErrorStatus)
-   {
-      return;
-   }
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << *this << std::endl;
-   }
+      return false;
+   return true;
 }
 
 ossimDoqq::~ossimDoqq()
@@ -99,6 +99,11 @@ void ossimDoqq::ldstr_v2(std::istream& in)
    }
 
    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()))
    {
@@ -107,91 +112,67 @@ void ossimDoqq::ldstr_v2(std::istream& in)
       
       if(strncmp(line, "SAMPLES_AND_LINES", 17) == 0)
       {
-         char dum1[30];
-         char dum2[30];
-         char dum3[30];
          sscanf(line, "%s %s %s", dum1, dum2, dum3);
          theLine = atoi(dum3);
          theSample = atoi(dum2);
       }
 
-      if(strncmp(line, "HORIZONTAL_COORDINATE_SYSTEM", 28) == 0)
+      else if(strncmp(line, "HORIZONTAL_COORDINATE_SYSTEM", 28) == 0)
       {
-         char dum1[30];
-         char dum2[30];
          sscanf(line, "%s %s", dum1, dum2);
          theProjection = dum2;
       }
       
-      if(strncmp(line, "NW_QUAD_CORNER_XY", 17) == 0)
+      else if(strncmp(line, "NW_QUAD_CORNER_XY", 17) == 0)
       {         
-         char dum1[30];
-         char dum2[30];
-         char dum3[30];         
          sscanf(line, "%s %s %s", dum1, dum2, dum3);
          
          theUE = atof(dum2);
          theUN = atof(dum3);
       }
       
-      if(strncmp(line, "NE_QUAD_CORNER_XY", 17) == 0)
+      else if(strncmp(line, "NE_QUAD_CORNER_XY", 17) == 0)
       {
-         char dum1[30];
-         char dum2[30];
-         char dum3[30];
          sscanf(line, "%s %s %s", dum1, dum2, dum3);
          theLE = atof(dum2);
          theLN = atof(dum3);
       }
 
-      if(strncmp(line, "COORDINATE_ZONE", 15) == 0)
+      else if(strncmp(line, "COORDINATE_ZONE", 15) == 0)
       {
-         char dum1[30];
-         char dum2[30];
          sscanf(line, "%s %s", dum1, dum2);
          theUtmZone = atoi(dum2);
       }
 
-      if(strncmp(line, "SOURCE_IMAGE_DATE", 17) == 0)
+      else if(strncmp(line, "SOURCE_IMAGE_DATE", 17) == 0)
       {
-         char dum1[30];
-         char dum2[30];
-	 char dum3[30];
-	 char dum4[30];
          sscanf(line, "%s %s %s %s", dum1, dum2, dum3, dum4);
          theAcqYear  = ossimString(dum2);
-	 theAcqMonth = ossimString(dum3);
-	 theAcqDay   = ossimString(dum4);
+         theAcqMonth = ossimString(dum3);
+         theAcqDay   = ossimString(dum4);
       }
 
-      if((strncmp(line, "XY_ORIGIN", 9) == 0))
+      else if((strncmp(line, "XY_ORIGIN", 9) == 0))
       {
-         char dum1[30];
-         char dum2[30];
-         char dum3[30];
          sscanf(line, "%s %s %s", dum1, dum2, dum3);
          theEasting = atof(dum2);
          theNorthing = atof(dum3);        
       }
 
-      if((strncmp(line, "HORIZONTAL_DATUM", 16) == 0) && theDatum.empty())
+      else if((strncmp(line, "HORIZONTAL_DATUM", 16) == 0) && theDatum.empty())
       {
-         char dum1[30];
-         char dum2[30];
          ossimString datum;         
          sscanf(line, "%s %s", dum1, dum2);
          datum = dum2; 
          
          if(datum.contains("NAD27"))
-	   theDatum = "NAD";
+            theDatum = "NAD";
          else
-	   theDatum = "NAR";
+            theDatum = "NAR";
       }
 
-      if(strncmp(line, "BYTE_COUNT", 10) == 0)
+      else if(strncmp(line, "BYTE_COUNT", 10) == 0)
       {
-         char dum1[30];
-         char dum2[30];
          ossimString header;         
          sscanf(line, "%s %s", dum1, dum2);
          header = dum2;
@@ -199,10 +180,8 @@ void ossimDoqq::ldstr_v2(std::istream& in)
          theHeaderSize = atoi(header.chars());
       }
 
-      if(strncmp(line, "BAND_CONTENT", 12) == 0)
+      else if(strncmp(line, "BAND_CONTENT", 12) == 0)
       {
-         char dum1[30];
-         char dum2[30];
          ossimString rgbType;        
          sscanf(line, "%s %s", dum1, dum2);
          rgbType = dum2;
@@ -213,26 +192,65 @@ void ossimDoqq::ldstr_v2(std::istream& in)
             theRgb = 3;
       }
 
-      if(strncmp(line, "HORIZONTAL_RESOLUTION", 21) == 0)
+      else if(strncmp(line, "HORIZONTAL_RESOLUTION", 21) == 0)
       {
-         char dum1[30];
-         char dum2[30];
          ossimString gsd;
          sscanf(line, "%s %s", dum1, dum2);
          gsd = dum2;
 
          theGsd.x = gsd.toDouble();
          theGsd.y = gsd.toDouble();
-//         theGsd = atof(gsd.chars());
-//          theGsd.x = std::abs(ossimString(dum1).toDouble());
-//          theGsd.y = std::abs(ossimString(dum2).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())
+	if (!in.good())
 	{
       theErrorStatus = OSSIM_ERROR;
-		
       if(traceDebug())
       {
          ossimNotify(ossimNotifyLevel_WARN)
@@ -242,11 +260,11 @@ void ossimDoqq::ldstr_v2(std::istream& in)
       }
 		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)
@@ -254,9 +272,16 @@ void ossimDoqq::ldstr_v2(std::istream& in)
             << "\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)
@@ -386,22 +411,27 @@ ossim_float64 ossimDoqq::convertStr(const char* str) const
    return tmp.toFloat64();
 }
 
-std::ostream& operator<<(std::ostream& out, const ossimDoqq& doq)
+std::ostream& ossimDoqq::print(std::ostream& out) const
 {
-   out << "\nContents of DOQQ Update:\n"
-       << "\nLine:           " << doq.theLine
-       << "\nSample:         " << doq.theSample
-       << "\nProjection:     " << doq.theProjection
-       << "\nDatum:          " << doq.theDatum
-       << "\nEasting:        " << doq.theEasting
-       << "\nNorthing:       " << doq.theNorthing
-       << "\nUN:             " << doq.theUN
-       << "\nUE:             " << doq.theUE
-       << "\nLN:             " << doq.theLN
-       << "\nLE:             " << doq.theLE
-       << "\nGSD:            " << doq.theGsd
-       << "\nBand:           " << doq.theRgb
-       << "\nUtm Zone:       " << doq.theUtmZone << std::endl;
+   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/ossim/support_data/ossimDtedRecord.cpp b/src/ossim/support_data/ossimDtedRecord.cpp
index 05fbe8d..3cef1dc 100644
--- a/src/ossim/support_data/ossimDtedRecord.cpp
+++ b/src/ossim/support_data/ossimDtedRecord.cpp
@@ -17,7 +17,7 @@
 //         User Header Label (UHL) in South to North profile sequence.
 //
 //********************************************************************
-// $Id: ossimDtedRecord.cpp 14248 2009-04-08 19:38:11Z dburken $
+// $Id: ossimDtedRecord.cpp 20611 2012-02-27 12:21:51Z gpotts $
 
 #include <iostream>
 
@@ -72,7 +72,7 @@ ossimDtedRecord::ossimDtedRecord(std::istream& in,
    printf("\nBuf: %02X", (int)buf[0]);  // Display in HEX
 #endif
    
-   if(!(buf[0] = DATA_RECOGNITION_SENTINEL))
+   if(buf[0] != DATA_RECOGNITION_SENTINEL)
    {
       theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
       ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimDtedRecord::ossimDtedRecord: reading DTED's data record at: " << theStartOffset
diff --git a/src/ossim/support_data/ossimEnviHeader.cpp b/src/ossim/support_data/ossimEnviHeader.cpp
index 95c18e5..ce40bb6 100644
--- a/src/ossim/support_data/ossimEnviHeader.cpp
+++ b/src/ossim/support_data/ossimEnviHeader.cpp
@@ -10,18 +10,44 @@
 // Images) header file.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimEnviHeader.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
-
-#include <fstream>
-#include <string>
+// $Id: ossimEnviHeader.cpp 22354 2013-08-02 16:22:15Z gpotts $
 
 #include <ossim/support_data/ossimEnviHeader.h>
 #include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNotifyContext.h>
 #include <ossim/base/ossimFilename.h>
 #include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/support_data/ossimWavelength.h>
+#include <algorithm>
+#include <fstream>
+#include <string>
+
+typedef  std::unary_function<std::pair<ossimString, ossimString>, bool> KwlCompareFunctionType;
+typedef  std::pair<const ossimString, ossimString> KwlComparePairType;
+
+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;
+};
+class KwlKeySubStringCaseInsensitive : public KwlCompareFunctionType
+{
+public:
+   KwlKeySubStringCaseInsensitive(const ossimString& key):m_key(key){}
+   virtual bool operator()(const KwlComparePairType& rhs)const
+   {
+      return (rhs.first.downcase().contains(m_key));
+   }
+   ossimString m_key;
+};
 
 // Define keywords not already found in ossimKeywordNames.
 static const char HEADER_OFFSET_KW[]    = "header_offset";
@@ -29,6 +55,7 @@ static const char FILE_TYPE_KW[]        = "file_type";
 static const char DATA_TYPE_KW[]        = "data_type";
 static const char SENSOR_TYPE_KW[]      = "sensor_type";
 static const char X_START_KW[]          = "x_start";
+static const char Y_START_KW[]          = "y_start";
 static const char MAP_INFO_KW[]         = "map_info";
 static const char WAVELENGTH_UNITS_KW[] = "wavelength_units";
 static const char BAND_NAME_KW[]        = "band_name";
@@ -38,182 +65,142 @@ static ossimTrace traceDebug(ossimString("ossimEnviHeader:debug"));
 
 ossimEnviHeader::ossimEnviHeader()
    :
-   ossimErrorStatusInterface(),
-   theDescription(),
-   theSamples(0),
-   theLines(0),
-   theBands(0),
-   theHeaderOffset(0),
-   theFileType("ENVI Standard"),
-   theDataType(0),
-   theInterleave("Unknown"),
-   theSensorType(),
-   theByteOrder(OSSIM_LITTLE_ENDIAN),
-   theXStart(0),
-   theMapInfo(),
-   theWavelengthUnits("Unknown"),
-   theBandName(),
-   theWavelength()   
+   m_file(),
+   m_keywords()
 {
    // Start the byte order of with the machine byte order.
-   theByteOrder = ossim::byteOrder();
+   m_keywords[FILE_TYPE_KW] = "ENVI Standard";
+   setByteorder(ossim::byteOrder());   
 }
 
 ossimEnviHeader::~ossimEnviHeader()
 {
 }
 
-bool ossimEnviHeader::open(const ossimFilename& file)
+void ossimEnviHeader::reset()
 {
-   std::ifstream is(file.c_str(), std::ios_base::in);
-   if (!is)
+   m_file.string().clear();
+   m_keywords.clear();
+   m_keywords[FILE_TYPE_KW] = "ENVI Standard";
+   setByteorder(ossim::byteOrder());
+}
+
+const ossimKeywordlist& ossimEnviHeader::getMap() const
+{
+   return m_keywords;
+}
+
+ossimKeywordlist& ossimEnviHeader::getMap()
+{
+   return m_keywords;
+}
+
+bool ossimEnviHeader::getValue( const ossimString& key, ossimString& value ) const
+{
+   bool result = false;
+   value.string() = m_keywords.findKey( key.string());
+   if( value.size() )
    {
-      setErrorStatus();
-      return false;
+      result = true;
+   }
+   else
+   {
+      result = m_keywords.hasKey( key.string() );
    }
+   return result;
+}
+
+bool ossimEnviHeader::findSubStringCaseInsensitive(const ossimString& key,
+                                                   ossimString& value) const
+{
+   return m_keywords.findValue<KwlKeySubStringCaseInsensitive>(
+      value, KwlKeySubStringCaseInsensitive(key));
+}
+
+bool ossimEnviHeader::open(const ossimFilename& file)
+{
+   bool result = false;
 
-   std::string s;
-   is >> s;
+   reset(); // Clear the map, file name.
 
-   if (s != "ENVI")
+   std::ifstream in;
+   in.open(file.c_str(), std::ios::in | std::ios::binary);
+   if( in.is_open() )
    {
-      setErrorStatus();
-      return false;
+      result = readStream( in );
+      if ( result )
+      {
+         m_file = file;
+      }
    }
 
-   // Parse the file.
-   while (is)
+   return result;
+}
+
+bool ossimEnviHeader::readStream(std::istream& in)
+{
+   reset();
+   bool result = isEnviHeader( in );
+   if ( result )
    {
-      // read something.
-      is >> s;
+      m_keywords.clear();
       
-      if (s == "description")
-      {
-         parseDescription(is);
-      }
-      else if (s == "samples")
-      {
-         is >> s; // eat the =
-         is >> theSamples;
-      }
-      else if (s == "lines")
-      {
-         is >> s; // eat the =
-         is >> theLines;
-      }
-      else if (s == "bands")
-      {
-         is >> s; // eat the =
-         is >> theBands;
-      }
-      else if (s == "header")
-      {
-         is >> s;
-         if (s == "offset")
-         {
-            is >> s; // eat the =
-            is >> theHeaderOffset;
-         }
-      }
-      else if (s == "file")
-      {
-         is >> s;
-         if (s == "type")
+      while(!in.eof()&&in.good())
+      {
+         // read name
+         ossimString name = "";
+         ossimString value = "";
+         ossim::skipws(in);
+         int c = static_cast<char>(in.get());
+         while((c != '=')&&(in.good())&&!in.eof())
          {
-            is >> s; // eat the =
-            std::getline(is, s);
-            theFileType = s;
+            name +=static_cast<char>(c);
+            c = in.get();
          }
-      }
-      else if (s == "data")
-      {
-         is >> s;
-         if (s == "type")
-         {
-            is >> s; // eat the =
-            is >> theDataType;
-         }
-      }
-      else if (s == "interleave")
-      {
-         is >> s; // eat the =
-         is >> theInterleave;
-      }
-      else if (s == "sensor")
-      {
-         is >> s;
-         if (s == "type")
-         {
-            is >> s; // eat the =
-            is >> theSensorType;
-         }
-      }
-      else if (s == "byte")
-      {
-         is >> s;
-         if (s == "order")
-         {
-            is >> s; // eat the =
-            int i;
-            is >> i;
-            theByteOrder = (i == 1 ? OSSIM_BIG_ENDIAN : OSSIM_LITTLE_ENDIAN);
-         }
-      }
-      else if (s == "x")
-      {
-         is >> s;
-         if (s == "start")
-         {
-            is >> s; // eat the =
-            is >> theXStart;
-         }
-      }
-      else if (s == "map")
-      {
-         is >> s;
-         if (s == "info")
-         {
-            is >> s; // eat the =
-            getline(is, theMapInfo); // one big string
-         }
-      }
-      else if (s == "wavelength")
-      {
-         is >> s;
-         if (s == "units")
-         {
-            is >> s; // eat the =
-            is >> theWavelengthUnits;
-         }
-         else if (s == "=")
+         ossim::skipws(in);
+         c = in.get();
+         
+         if(in.good()&&!in.eof())
          {
-            parseWavelength(is);
+            if(c == '{') // continue til '}'
+            {
+               c = in.get();
+               while((c != '}')&&(in.good())&&!in.eof())
+               {
+                  value +=static_cast<char>(c);
+                  c = in.get();
+               }
+            }
+            else
+            {
+               while(((c != '\n')&&(c!='\r'))&&(in.good())&&!in.eof())
+               {
+                  value +=static_cast<char>(c);
+                  c = (in.get());
+               }
+               
+            }
+            m_keywords.add(name.trim(), value);
          }
       }
-      else if (s == "band")
+
+      // Test for minimum set of keywords needed.
+      if ( m_keywords.findKey( std::string("samples") ).empty() ||
+           m_keywords.findKey( std::string("lines") ).empty() || 
+           m_keywords.findKey( std::string("bands") ).empty())
       {
-         is >> s;
-         if (s == "names")
-         {
-            parseBandNames(is);
-         }
+         result =  false;
       }
    }
 
-   // Must have these; else, error.
-   if (!theSamples || !theLines || !theBands)
-   {
-      return false;
-   }
-   
-   return true;
+   return result;
 }
 
 bool ossimEnviHeader::writeFile(const ossimFilename& file)
 {
-   if (theDescription.empty())
+   if (m_keywords.findKey( std::string("description") ).empty())
    {
-      theDescription = file;
+      m_keywords["description"] = file.c_str();
    }
    
    std::ofstream out(file.c_str(), std::ios_base::out);
@@ -230,259 +217,256 @@ bool ossimEnviHeader::writeFile(const ossimFilename& file)
 
 std::ostream& ossimEnviHeader::print(std::ostream& out) const
 {
-   out << "ENVI"
-       << "\ndescription = {\n" << theDescription << "}"
-       << "\nsamples = " << theSamples
-       << "\nlines   = " << theLines
-       << "\nbands   = " << theBands
-       << "\nheader offset = " << theHeaderOffset
-       << "\nfile type = " << theFileType
-       << "\ndata type = " << theDataType
-       << "\ninterleave = " << theInterleave;
-   if (theSensorType.size())
-   {
-      out << "\nsensor type = " << theSensorType;
-   }
-
-   out << "\nbyte order = " << theByteOrder;
-
-   if (theXStart)
-   {
-      out << "\nx start = " << theXStart;
-   }
-
-   if (theMapInfo.size())
-   {
-      out << "\nmap info = " << theMapInfo;
-   }
-
-   if (theWavelength.size())
-   {
-      out << "\nwavelength units = " << theWavelengthUnits;
-   }
-
-   if (theBandName.size())
-   {
-      out << "\nband names = {";
-      ossim_uint32 i;
-      ossim_uint32 size = (ossim_uint32)theBandName.size();
-      for (i = 0; i < size; ++i)
-      {
-         out << "\n " << theBandName[i];
-         if (i < size-1)
-         {
-            out << ",";
-         }
-         else
-         {
-            out << "}";
-         }
-      }
-   }
-   else
-   {
-      out << "\nband names = {";
-      ossim_uint32 i;
-      for (i = 0; i < theBands; ++i)
-      {
-         out << "\nBand " << (i+1);
-         if (i < theBands-1)
-         {
-            out << ",";
-         }
-         else
-         {
-            out << "}";
-         }
-      }
-   }
-   
-   if (theWavelength.size())
-   {
-      out << "\nwavelength = {\n";
-      ossim_uint32 i;
-      ossim_uint32 size = (ossim_uint32)theWavelength.size();
-      for (i = 0; i < size; ++i)
-      {
-         out << theWavelength[i];
-         if (i < size-1)
-         {
-            out << ", ";
-         }
-         else
-         {
-            out << "}";
-         }
-      }
-   }
-
-   out << std::endl;
-   
+   out << "ENVI" << "\n" << m_keywords << std::endl;
    return out;
 }
 
+std::ostream& operator<<(std::ostream& out, const ossimEnviHeader& obj)
+{
+   return obj.print( out );
+}
+
 ossimString ossimEnviHeader::getDescription() const
 {
-   return theDescription;
+   return ossimString( m_keywords.findKey( std::string("description") ) );
 }
 
 void ossimEnviHeader::setDescription(const ossimString& description)
 {
-   theDescription = description;
+   m_keywords["description"] = description.c_str();
 }
 
 ossim_uint32 ossimEnviHeader::getSamples() const
 {
-   return theSamples;
+   ossim_uint32 result = 0;
+   ossimString value = m_keywords.findKey( std::string("samples") );
+   if( value.size() )
+   {
+      result = value.toUInt32();
+   }
+   return result;
 }
 
 void ossimEnviHeader::setSamples(ossim_uint32 samples)
 {
-   theSamples = samples;
+   m_keywords[ std::string("samples") ] = ossimString::toString(samples).c_str();
 }
 
 ossim_uint32 ossimEnviHeader::getLines() const
 {
-   return theLines;
+   ossim_uint32 result = 0;
+   ossimString value = m_keywords.findKey( std::string("lines") );
+   if( value.size() )
+   {
+      result = value.toUInt32();
+   }
+   return result;
 }
 
 void ossimEnviHeader::setLines(ossim_uint32 lines)
 {
-   theLines = lines;
+   m_keywords["lines"] = ossimString::toString(lines).c_str();
 }
 
 ossim_uint32 ossimEnviHeader::getBands() const
 {
-   return theBands;
+   ossim_uint32 result = 0;
+   ossimString value = m_keywords.findKey( std::string("bands") );
+   if( value.size() )
+   {
+      result = value.toUInt32();
+   }
+   return result;
 }
 
 void ossimEnviHeader::setBands(ossim_uint32 bands)
 {
-   theBands = bands;
+   m_keywords["bands"] = ossimString::toString(bands).c_str();
+}
+
+bool ossimEnviHeader::getDefaultBands( std::vector<ossim_uint32>& bands ) const
+{
+   bands.clear();
+
+   // Note: We could do a "m_map.downcaseKeywords()". (drb)
+   ossimString value = m_keywords.findKey( std::string("default bands") );
+   if ( !value.size() )
+   {
+      value = m_keywords.findKey( std::string("Default bands") );
+      if ( !value.size() )
+      {
+        value = m_keywords.findKey( std::string("DEFAULT BANDS") );
+      }
+   }
+
+   if ( value.size() )
+   {
+      std::vector<ossimString> strLst;
+      value.split( strLst, ossimString(","));
+      if ( strLst.size() )
+      {
+         std::vector<ossimString>::const_iterator i = strLst.begin();
+         ossim_uint32 band = 0;
+         while ( i != strLst.end() )
+         {
+            band = (*i).toUInt32();
+            if ( band )
+            {
+               // Assuming "default bands" are one based.  Totally a hunch... (drb)
+               --band;
+               bands.push_back(band);
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimEnviHeader::getDefaultBands WARN!"
+                  << "\nDetected zero based bands in \"default bands\" from header!"
+                  << std::endl;
+            }
+            
+            ++i;
+         }
+      }
+   }
+
+   if ( rangeCheckBands( bands ) == false )
+   {
+      bands.clear();
+   }
+   
+   return (bands.size() ? true : false);
 }
 
 ossim_uint32 ossimEnviHeader::getHeaderOffset() const
 {
-   return theHeaderOffset;
+   ossim_uint32 result = 0;
+   ossimString value = m_keywords["header offset"];
+   if( value.size() )
+   {
+      result = value.toUInt32();
+   }
+   return result;
 }
 
 void ossimEnviHeader::setHeaderOffset(ossim_uint32 headerOffset)
 {
-   theHeaderOffset = headerOffset;
+   m_keywords["header offset"] = ossimString::toString(headerOffset).c_str();
 }
 
 ossimString ossimEnviHeader::getFileType() const
 {
-   return theFileType;
+   return m_keywords[FILE_TYPE_KW];
 }
 
 void ossimEnviHeader::setFileType(const ossimString& fileType)
 {
-   theFileType = fileType;
+    m_keywords[FILE_TYPE_KW] = fileType.c_str();
 }
 
 ossim_uint32 ossimEnviHeader::getDataType() const
 {
-   return theDataType;
+   return ossimString(m_keywords["data type"]).toUInt32();
 }
 
 ossimScalarType ossimEnviHeader::getOssimScalarType() const
 {
-   switch( theDataType )
+   ossim_uint32 dataTypeInt = ossimString(m_keywords["data type"]).toUInt32();
+   
+   ossimScalarType result = OSSIM_SCALAR_UNKNOWN;
+
+   switch( dataTypeInt )
    {
       case 1:
-         return OSSIM_UINT8;
-
+         result = OSSIM_UINT8;
+         break;
       case 2:
-         return OSSIM_SINT16;
-
+         result = OSSIM_SINT16;
+         break;
       case 3:
-         return OSSIM_SINT32;
-
+         result = OSSIM_SINT32;
+         break;
       case 4:
-         return OSSIM_FLOAT32;
-
+         result = OSSIM_FLOAT32;
+         break;
       case 5:
-         return OSSIM_FLOAT64;
-
+         result = OSSIM_FLOAT64;
+         break;
       case 6:
-         return OSSIM_CFLOAT32;
-
+         result = OSSIM_CFLOAT32;
+         break;
       case 9:
-         return OSSIM_CFLOAT64;
-
+         result = OSSIM_CFLOAT64;
+         break;
       case 12:
-         return OSSIM_UINT16;
-
+         result = OSSIM_UINT16;
+         break;
       case 13:
-         return OSSIM_UINT32;
-
+         result = OSSIM_UINT32;
+         break;
       default:
-         return OSSIM_SCALAR_UNKNOWN;
+         break;
    }
 
-   return OSSIM_SCALAR_UNKNOWN;
+   return result;
 }
 
 void ossimEnviHeader::setDataType(ossimScalarType scalar)
 {
+   ossimString dataTypeString = "";
    switch( scalar )
    {
       case OSSIM_UINT8:
-         theDataType = 1;
+         dataTypeString = "1";
          break;
-
       case OSSIM_SINT16:
-         theDataType = 2;
+         dataTypeString = "2";
          break;
-
       case OSSIM_SINT32:
-         theDataType = 3;
+         dataTypeString = "3";
          break;
-
       case OSSIM_FLOAT32:
-         theDataType = 4;
+         dataTypeString = "4";
          break;
-
       case OSSIM_FLOAT64:
-         theDataType = 5;
+         dataTypeString = "5";
          break;
-
       case OSSIM_CFLOAT32:
-         theDataType = 6;
+         dataTypeString = "6";
          break;
-
       case OSSIM_CFLOAT64:
-         theDataType = 9;
+         dataTypeString = "9";
          break;
-
       case OSSIM_UINT16:
-         theDataType = 12;
+         dataTypeString = "12";
          break;
-
       case OSSIM_UINT32:
-         theDataType = 13;
+         dataTypeString = "13";
          break;
-
       default:
          break;
    }
+   
+   if(!dataTypeString.empty())
+   {
+      m_keywords["data type"] = dataTypeString.c_str();
+   }
 }
 ossimString ossimEnviHeader::getInterleaveType() const
 {
-   return theInterleave;
+   return m_keywords["interleave"];
 }
 ossimInterleaveType ossimEnviHeader::getOssimInterleaveType() const
 {
-   if (theInterleave == "bsq")
+   ossimString interleave = getInterleaveType();
+   if (interleave == "bsq")
    {
       return OSSIM_BSQ;
    }
-   else if  (theInterleave == "bil")
+   else if  (interleave == "bil")
    {
       return OSSIM_BIL;
    }
-   else if  (theInterleave == "bip")
+   else if  (interleave == "bip")
    {
       return OSSIM_BIP;
    }
@@ -494,65 +478,109 @@ ossimInterleaveType ossimEnviHeader::getOssimInterleaveType() const
 
 void ossimEnviHeader::setInterleaveType(ossimInterleaveType interleave)
 {
+   std::string interleaveString = "";
    switch (interleave)
    {
       case OSSIM_BIL:
-         theInterleave = "bil";
+         interleaveString = "bil";
          break;
-         
       case OSSIM_BSQ:
-         theInterleave = "bsq";
+         interleaveString = "bsq";
          break;
-         
       case OSSIM_BIP:
-         theInterleave = "bip";
+         interleaveString = "bip";
          break;
       default:
-         theInterleave = "Unknown";
+         interleaveString = "Unknown";
          break;
    }
+   m_keywords["interleave"] = interleaveString;
 }
 
 ossimString ossimEnviHeader::getSensorType() const
 {
-   return theSensorType;
+   return m_keywords["sensor type"];
 }
 
 void ossimEnviHeader::setSensorType(const ossimString& sensorType)
 {
-   theSensorType = sensorType;
+   m_keywords["sensor type"] = sensorType.c_str();
 }
 
 ossimByteOrder ossimEnviHeader::getByteOrder() const
 {
-   // 0 = little
-   // 1 = big
-   return theByteOrder;
+   ossimByteOrder result = ossim::byteOrder(); // System byte order.
+   std::string value = m_keywords["byte order"];
+   if ( value.size() )
+   {
+      // 0 = LITTLE_ENDIAN
+      // 1 = BIG_ENDIAN
+      ossim_int32 order = ossimString(value).toInt32();
+      result = order ? OSSIM_BIG_ENDIAN : OSSIM_LITTLE_ENDIAN;
+   }
+   return result;
 }
 
 void ossimEnviHeader::setByteorder(ossimByteOrder byteOrder)
 {
-   theByteOrder = byteOrder;
+   if(byteOrder==OSSIM_LITTLE_ENDIAN)
+   {
+      m_keywords["byte order"] = "0";
+   }
+   else
+   {
+      m_keywords["byte order"] = "1";
+   }
 }
 
 ossim_int32 ossimEnviHeader::getXStart() const
 {
-   return theXStart;
+   ossim_int32 result = 0;
+   std::string s = m_keywords.findKey( std::string("x start") );
+   if ( !s.size() )
+   {
+      s = m_keywords.findKey( std::string("sample start") );
+   }
+   if ( s.size() )
+   {
+      result = ossimString( s ).toInt32();
+   }
+   return result;
 }
 
 void ossimEnviHeader::setXStart(ossim_int32 xstart)
 {
-   theXStart = xstart;
+   m_keywords["x start"] = ossimString::toString(xstart).c_str();
+}
+
+ossim_int32 ossimEnviHeader::getYStart() const
+{
+   ossim_int32 result = 0;
+   std::string s = m_keywords.findKey( std::string("y start") );
+   if ( !s.size() )
+   {
+      s = m_keywords.findKey( std::string("line start") );
+   }
+   if ( s.size() )
+   {
+      result = ossimString( s ).toInt32();
+   }
+   return result;
+}
+
+void ossimEnviHeader::setYStart(ossim_int32 ystart)
+{
+   m_keywords["y start"] = ossimString::toString(ystart).c_str();
 }
 
 ossimString ossimEnviHeader::getMapInfo() const
 {
-   return theMapInfo;
+   return m_keywords["map info"];
 }
 
 void ossimEnviHeader::setMapInfo(const ossimString& mapInfo)
 {
-   theMapInfo = mapInfo;
+   m_keywords["map info"] = mapInfo.c_str();
 }
 
 void ossimEnviHeader::setMapInfo(const ossimKeywordlist& kwl,
@@ -566,7 +594,7 @@ void ossimEnviHeader::setMapInfo(const ossimKeywordlist& kwl,
          << kwl
          << std::endl;
    }
-
+   ossimString mapInfoString;
    const char* lookup;
    
    // Get the projection type.
@@ -592,7 +620,7 @@ void ossimEnviHeader::setMapInfo(const ossimKeywordlist& kwl,
    if (lookup)
    {
       ossimString os = lookup;
-      if (os = "WGE")
+      if (os == "WGE")
       {
          datum = "WGS-84";
       }
@@ -625,294 +653,179 @@ void ossimEnviHeader::setMapInfo(const ossimKeywordlist& kwl,
          return;
       }
                  
-      theMapInfo = "{Geographic Lat/Lon, 1.0000, 1.0000, ";
-      theMapInfo += tieLon;
-      theMapInfo += ", ";
-      theMapInfo += tieLat;
-      theMapInfo += ", ";
-      theMapInfo += degLon;
-      theMapInfo += ", ";
-      theMapInfo += degLat;
-      theMapInfo += ", ";
-      theMapInfo += datum;
-      theMapInfo += ", units=degrees}";
-   }
-
+      mapInfoString = "{Geographic Lat/Lon, 1.0000, 1.0000, ";
+      mapInfoString += tieLon;
+      mapInfoString += ", ";
+      mapInfoString += tieLat;
+      mapInfoString += ", ";
+      mapInfoString += degLon;
+      mapInfoString += ", ";
+      mapInfoString += degLat;
+      mapInfoString += ", ";
+      mapInfoString += datum;
+      mapInfoString += ", units=degrees}";
+   }
+
+   m_keywords["map info"] = mapInfoString.c_str();
    if (traceDebug())
    {
       ossimNotify(ossimNotifyLevel_DEBUG)
          << "ossimEnviHeader::setMapInfo DEBUG:"
-         << "\ntheMapInfo:  " << theMapInfo
+         << "\ntheMapInfo:  " << mapInfoString
          << std::endl;
    }
 }
 
 ossimString ossimEnviHeader::getWavelengthUnits() const
 {
-   return theWavelengthUnits;
+   return m_keywords["wavelength units"];
 }
 
 void ossimEnviHeader::setWavelengthUnits(const ossimString& waveLengthUnits)
 {
-   theWavelengthUnits = waveLengthUnits;
+   
+   m_keywords["wavelength units"] = waveLengthUnits.c_str();
 }
 
 void ossimEnviHeader::getBandNames(std::vector<ossimString>& bandNames) const
 {
-   bandNames = theBandName;
+   bandNames.clear();
+   ossimString bandNamesString = m_keywords["band names"];
+   bandNamesString.split(bandNames, ",");
 }
 
 void ossimEnviHeader::setBandNames(const std::vector<ossimString>& bandNames)
 {
-   theBandName = bandNames;
+   ossimString value;
+   value.join(bandNames, ",");
+   m_keywords["band names"] = value.c_str();
 }
 
 void ossimEnviHeader::getWavelengths(std::vector<ossimString>& waveLengths)
    const
 {
-   waveLengths = theWavelength;
+   waveLengths.clear();
+   ossimString bandNamesString = m_keywords[WAVELENGTH_KW];
+   bandNamesString.split(waveLengths, ",");
 }
 
 void ossimEnviHeader::setWavelengths(
    const std::vector<ossimString>& wavelengths)
 {
-   theWavelength = wavelengths;
-}
-
-void ossimEnviHeader::parseDescription(std::ifstream& is)
-{
-   bool record = false;
-   theDescription.clear();
-   char c = '\0';
-
-   while (c != '}')
-   {
-      is.get(c);
-      if (c == '{') // start record.
-      {
-         record = true;
-         continue;
-      }
-      else if (c == '}') // finished recording
-      {
-         break;
-      }
-      else if (!is) // something bad happened.
-      {
-         setErrorStatus();
-         return;
-      }
-
-      if (record)
-      {
-         theDescription.push_back(c);
-      }
-   }
-}
-
-void ossimEnviHeader::parseWavelength(std::ifstream& is)
-{
-   bool record = false;
-   theWavelength.clear();
-   char c = '\0';
-
-   std::string bandWavelength;
-   
-   while (c != '}')
-   {
-      is.get(c);
-      if (c == '{') // start record.
-      {
-         record = true;
-         continue;
-      }
-      else if (c == '\n')
-      {
-         continue; // skip newlines
-      }
-      else if (c == '}') // finished recording
-      {
-         theWavelength.push_back(bandWavelength);
-         break;
-      }
-      else if (c == ',')
-      {
-         theWavelength.push_back(bandWavelength);
-         bandWavelength.clear();
-         continue;
-      }
-
-      if (!is) // something bad happened.
-      {
-         setErrorStatus();
-         return;
-      }
-
-      if (record)
-      {
-         bandWavelength.push_back(c);
-      }
-   }
-}
-
-void ossimEnviHeader::parseBandNames(std::ifstream& is)
-{
-   bool record = false;
-   theBandName.clear();
-   char c = '\0';
-
-   std::string bandName;
-   
-   while (c != '}')
-   {
-      is.get(c);
-      if (c == '{') // start record.
-      {
-         record = true;
-         continue;
-      }
-      else if (c == '\n')
-      {
-         continue; // skip newlines
-      }
-      else if (c == '}') // finished recording
-      {
-         ossimString os = bandName;
-         os.trim();
-         theBandName.push_back(os);
-         break;
-      }
-      else if (c == ',')
-      {
-         ossimString os = bandName;
-         os.trim();
-         theBandName.push_back(os);
-         bandName.clear();
-         continue;
-      }
-
-      if (!is) // something bad happened.
-      {
-         setErrorStatus();
-         return;
-      }
-
-      if (record)
-      {
-         bandName.push_back(c);
-      }
-   }
+   ossimString value;
+   value.join(wavelengths, ",");
+   m_keywords[WAVELENGTH_KW] = value.c_str();
 }
 
 bool ossimEnviHeader::loadState(const ossimKeywordlist& kwl,
                                 const char* prefix)
 {
-   const char* lookup;
+   std::string lookup;
+   std::string pfx = (prefix ? prefix: "" );
    ossimString s;
 
-   lookup = kwl.find(prefix, ossimKeywordNames::DESCRIPTION_KW);
-   if (lookup)
+   reset();
+
+   lookup = kwl.findKey(pfx, std::string(ossimKeywordNames::FILENAME_KW));
+   if (lookup.size())
+   {
+      m_file.string() = lookup;
+   }
+  
+   lookup = kwl.findKey(pfx, std::string(ossimKeywordNames::DESCRIPTION_KW));
+   if (lookup.size())
    {
-      theDescription = lookup;
+      setDescription(lookup);
    }
 
-   lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_SAMPLES_KW);
-   if (lookup)
+   lookup = kwl.findKey(pfx, std::string(ossimKeywordNames::NUMBER_SAMPLES_KW));
+   if (lookup.size())
    {
-      s = lookup;
-      theSamples = s.toUInt32();
+      m_keywords["samples"] = lookup;
    }
    
-   lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_LINES_KW);
-   if (lookup)
+   lookup = kwl.findKey(pfx, std::string(ossimKeywordNames::NUMBER_LINES_KW));
+   if (lookup.size())
    {
-      s = lookup;
-      theLines = s.toUInt32();
+      m_keywords["lines"] = lookup;
    }
 
-   lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_BANDS_KW);
-   if (lookup)
+   lookup = kwl.findKey(pfx, std::string(ossimKeywordNames::NUMBER_BANDS_KW));
+   if (lookup.size())
    {
-      s = lookup;
-      theBands = s.toUInt32();
+      m_keywords["bands"] = lookup;
    }
 
-   lookup = kwl.find(prefix, HEADER_OFFSET_KW);
-   if (lookup)
+   lookup = kwl.findKey(pfx, std::string(HEADER_OFFSET_KW));
+   if (lookup.size())
    {
-      s = lookup;
-      theHeaderOffset = s.toUInt32();
+      m_keywords["header offset"] = lookup;
    }
 
-   lookup = kwl.find(prefix, FILE_TYPE_KW);
-   if (lookup)
+   lookup = kwl.findKey(pfx, std::string(FILE_TYPE_KW));
+   if (lookup.size())
    {
-      theFileType = lookup;
+       m_keywords["file_type"] = lookup;
    }
 
-   lookup = kwl.find(prefix, DATA_TYPE_KW);
-   if (lookup)
+   lookup = kwl.findKey(pfx, DATA_TYPE_KW);
+   if (lookup.size())
    {
-      s = lookup;
-      theDataType = s.toUInt32();
+      m_keywords["data type"] = lookup;
    }
 
-   lookup = kwl.find(prefix, ossimKeywordNames::INTERLEAVE_TYPE_KW);
-   if (lookup)
+   lookup = kwl.findKey(pfx, std::string(ossimKeywordNames::INTERLEAVE_TYPE_KW));
+   if (lookup.size())
    {
-      theInterleave = lookup;
+      m_keywords["interleave"] = lookup;
    }
 
-   lookup = kwl.find(prefix, SENSOR_TYPE_KW);
-   if (lookup)
+   lookup = kwl.findKey(pfx, std::string(SENSOR_TYPE_KW));
+   if (lookup.size())
    {
-      theSensorType = lookup;
+      m_keywords["sensor type"] = lookup;
    }
 
-   lookup = kwl.find(prefix, ossimKeywordNames::BYTE_ORDER_KW);
-   if (lookup)
+   lookup = kwl.findKey(pfx, std::string(ossimKeywordNames::BYTE_ORDER_KW));
+   if (lookup.size())
    {
       s = lookup;
       s.downcase();
       if (s == "little_endian")
       {
-         theByteOrder = OSSIM_LITTLE_ENDIAN;
+         m_keywords["byte order"] = "0";
       }
       else if (s == "big_endian")
       {
-         theByteOrder= OSSIM_BIG_ENDIAN;
+         m_keywords["byte order"] = "1";
       }
       else
       {
-         ossim_uint32 i = s.toUInt32();
-         if (i == 0)
-         {
-            theByteOrder = OSSIM_LITTLE_ENDIAN;
-         }
-         else if (i == 1)
-         {
-            theByteOrder= OSSIM_BIG_ENDIAN;
-         }
+         m_keywords["byte order"] = lookup;
       }
    }
    
-   lookup = kwl.find(prefix, X_START_KW);
-   if (lookup)
+   lookup = kwl.findKey(pfx, std::string(X_START_KW));
+   if (lookup.size())
    {
-      s = lookup;
-      theXStart = (ossimByteOrder)s.toInt32();
+      m_keywords["x start"] = lookup;
+   }
+   lookup = kwl.findKey(pfx, std::string(Y_START_KW));
+   if (lookup.size())
+   {
+      m_keywords["y start"] = lookup;
    }
 
-   lookup = kwl.find(prefix, MAP_INFO_KW);
-   if (lookup)
+   lookup = kwl.findKey(pfx, std::string(MAP_INFO_KW));
+   if (lookup.size())
    {
-      theMapInfo = lookup;
+      m_keywords["map info"] = lookup;
    }
 
-   lookup = kwl.find(prefix, WAVELENGTH_UNITS_KW);
-   if (lookup)
+   lookup = kwl.findKey(pfx, std::string(WAVELENGTH_UNITS_KW));
+   if (lookup.size())
    {
-      theWavelengthUnits = lookup;
+      m_keywords["wavelength units"] = lookup;
    }
 
    ossim_uint32 n;
@@ -923,47 +836,117 @@ bool ossimEnviHeader::loadState(const ossimKeywordlist& kwl,
    n = kwl.numberOf(prefix, BAND_NAME_KW);
    if (n)
    {
-      theBandName.clear();
+      ossimString value = "";
       count = 0;
       while ( (count < n) || (count > MAX_TRIES) )
       {
          s = BAND_NAME_KW;
          s += ossimString::toString(count);
-         lookup = kwl.find(prefix, s);
-         if (lookup)
+         lookup = kwl.findKey(pfx, s.string());
+         if (lookup.size())
          {
-            theBandName.push_back(ossimString(lookup));
+            if(!value.empty())
+            {
+               value += ossimString(lookup);
+            }
+            else
+            {
+               value += (", " + ossimString(lookup));
+
+            }
+            
          }
          ++count;
       }
+      m_keywords["band names"] = value.c_str();
    }
             
    // Get the band names.
    n = kwl.numberOf(prefix, WAVELENGTH_KW);
    if (n)
    {
-      theWavelength.clear();
+      ossimString value;
       count = 0;
       while ( (count < n) || (count > MAX_TRIES) )
       {
          s = WAVELENGTH_KW;
          s += ossimString::toString(count);
-         lookup = kwl.find(prefix, s);
-         if (lookup)
+         lookup = kwl.findKey(pfx, s.string());
+         if (lookup.size())
          {
-            theWavelength.push_back(ossimString(lookup));
+            if(!value.empty())
+            {
+               value += ossimString(lookup);
+            }
+            else
+            {
+               value += (", " + ossimString(lookup));
+            }
          }
          ++count;
       }
+      m_keywords["wavelength"] = value.c_str();
    }
-
    if (traceDebug())
    {
       ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimEnviHeader::loadState DEUG\n"
-         << *this
-         << std::endl;
+         << "ossimEnviHeader::loadState DEUG\n";
+      print(ossimNotify(ossimNotifyLevel_DEBUG));
    }
    
    return true;
 }
+
+bool ossimEnviHeader::isEnviHeader( const ossimFilename& file )
+{
+   bool result = false;
+   std::ifstream in;
+   in.open(file.c_str(), std::ios::in | std::ios::binary);
+   if ( in.is_open() )
+   {
+      result = isEnviHeader( in );
+      in.close();
+   }
+   return result;
+}
+
+bool ossimEnviHeader::isEnviHeader( std::istream& in )
+{
+   bool result = false;
+   ossim::skipws(in);
+   char eh[5];
+   in.read(eh, 4);
+   eh[4] = '\0';
+   std::string s(eh);
+   if ( s == "ENVI" )
+   {
+      result = true;
+   }
+   return result;
+}
+
+const ossimFilename& ossimEnviHeader::getFile() const
+{
+   return m_file;
+}
+
+bool ossimEnviHeader::rangeCheckBands( const std::vector<ossim_uint32>& bands ) const
+{
+   bool result = false;
+   const ossim_uint32 INPUT_BANDS = getBands();
+   if ( INPUT_BANDS )
+   {
+      result = true;
+      std::vector<ossim_uint32>::const_iterator i = bands.begin();
+      while ( i != bands.end() )
+      {
+         if ( (*i) >= INPUT_BANDS )
+         {
+            result = false;
+            break;
+         }
+         ++i;
+      }
+   }
+   return result;
+}
diff --git a/src/ossim/support_data/ossimEnviInfo.cpp b/src/ossim/support_data/ossimEnviInfo.cpp
new file mode 100644
index 0000000..a5030ce
--- /dev/null
+++ b/src/ossim/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/src/ossim/support_data/ossimFgdcTxtDoc.cpp b/src/ossim/support_data/ossimFgdcTxtDoc.cpp
new file mode 100644
index 0000000..6aa2a2a
--- /dev/null
+++ b/src/ossim/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/ossim/support_data/ossimFgdcXmlDoc.cpp b/src/ossim/support_data/ossimFgdcXmlDoc.cpp
index 63f8dd0..737ea52 100644
--- a/src/ossim/support_data/ossimFgdcXmlDoc.cpp
+++ b/src/ossim/support_data/ossimFgdcXmlDoc.cpp
@@ -541,7 +541,7 @@ const ossimDatum* ossimFgdcXmlDoc::createOssimDatum(const ossimString& s) const
    else
    {
       std::string errMsg = "ossimFgdcXmlDoc::createOssimDatum ERROR: Unhandled datum: ";
-      errMsg += horizdn;
+      errMsg += horizdn.string();
       throw ossimException(errMsg);
    }
    return ossimDatumFactoryRegistry::instance()->create(datumCode);   
diff --git a/src/ossim/support_data/ossimGeoTiff.cpp b/src/ossim/support_data/ossimGeoTiff.cpp
index ad54ede..fd7c7df 100644
--- a/src/ossim/support_data/ossimGeoTiff.cpp
+++ b/src/ossim/support_data/ossimGeoTiff.cpp
@@ -9,7 +9,7 @@
 // information.
 //
 //***************************************************************************
-// $Id: ossimGeoTiff.cpp 18693 2011-01-17 18:49:15Z dburken $
+// $Id: ossimGeoTiff.cpp 21024 2012-05-30 08:45:13Z dburken $
 
 #include <ossim/support_data/ossimGeoTiff.h>
 #include <ossim/base/ossimTrace.h>
@@ -53,7 +53,7 @@ static const ossimGeoTiffDatumLut DATUM_LUT;
 OpenThreads::Mutex ossimGeoTiff::theMutex;
 
 #ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimGeoTiff.cpp 18693 2011-01-17 18:49:15Z dburken $";
+static const char OSSIM_ID[] = "$Id: ossimGeoTiff.cpp 21024 2012-05-30 08:45:13Z dburken $";
 #endif
 
 //---
@@ -64,6 +64,26 @@ 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
 //*************************************************************************************************
@@ -99,7 +119,7 @@ ossimGeoTiff::ossimGeoTiff()
       theFalseEasting(0.0),
       theFalseNorthing(0.0),
       theScaleFactor(0.0),
-      theNormalizedDefinitions(0)
+      thePrivateDefinitions(new ossimPrivateGtifDef())
 {
 }
 
@@ -138,7 +158,7 @@ ossimGeoTiff::ossimGeoTiff(const ossimFilename& file, ossim_uint32 entryIdx)
       theFalseEasting(0.0),
       theFalseNorthing(0.0),
       theScaleFactor(0.0),
-      theNormalizedDefinitions(0)
+      thePrivateDefinitions(new ossimPrivateGtifDef())
 {
    if (traceDebug())
    {
@@ -175,10 +195,10 @@ ossimGeoTiff::ossimGeoTiff(const ossimFilename& file, ossim_uint32 entryIdx)
 
 ossimGeoTiff::~ossimGeoTiff()
 {
-   if(theNormalizedDefinitions)
+   if(thePrivateDefinitions)
    {
-      delete theNormalizedDefinitions;
-      theNormalizedDefinitions = 0;
+      delete thePrivateDefinitions;
+      thePrivateDefinitions = 0;
    }
    if(theTiffPtr)
    {
@@ -273,7 +293,7 @@ bool ossimGeoTiff::writeTags(TIFF* tifPtr,
             pcsCode = meter_pcs;
       }
 
-      int gcs_code = mapProj->getGcsCode();
+      //int gcs_code = mapProj->getGcsCode();
       int datum_code = USER_DEFINED;
       int ellipsoid_code = USER_DEFINED;
       const ossimDatum* datum = mapProj->getDatum();
@@ -284,7 +304,10 @@ bool ossimGeoTiff::writeTags(TIFF* tifPtr,
          if (ellipsoid)
             ellipsoid_code = ellipsoid->getEpsgCode();
       }
-      GTIFKeySet(gtif, GeographicTypeGeoKey,    TYPE_SHORT, 1, gcs_code);
+      
+      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);
@@ -343,7 +366,7 @@ bool ossimGeoTiff::writeTags(TIFF* tifPtr,
          gcs = USER_DEFINED;
 
          std::ostringstream os;
-         os << "IMAGINE GeoTIFF Support\nCopyright 1991 -  2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision: 18693 $ $Date: 2011-01-17 19:49:15 +0100(lun, 17 gen 2011) $\nUnable to match Ellipsoid (Datum) to a GeographicTypeGeoKey value\nEllipsoid = Clarke 1866\nDatum = NAD27 (CONUS)";
+         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,
@@ -360,8 +383,8 @@ bool ossimGeoTiff::writeTags(TIFF* tifPtr,
       }
       else
       {
-         GTIFKeySet( gtif, GeographicTypeGeoKey, TYPE_SHORT, 1, gcs );
-         gcsTypeSet = true;
+      GTIFKeySet( gtif, GeographicTypeGeoKey, TYPE_SHORT, 1, gcs );
+      gcsTypeSet = true;
       }
 
       // Write the projection parameters.
@@ -826,7 +849,8 @@ bool ossimGeoTiff::writeTags(TIFF* tifPtr,
 bool ossimGeoTiff::writeJp2GeotiffBox(const ossimFilename& tmpFile,
                                       const ossimIrect& rect,
                                       const ossimProjection* proj,
-                                      std::vector<ossim_uint8>& buf)
+                                       std::vector<ossim_uint8>& buf,
+                                       ossimPixelType pixelType )
 {
    //---
    // Snip from The "GeoTIFF Box" Specification for JPEG 2000 Metadata:
@@ -853,6 +877,11 @@ bool ossimGeoTiff::writeJp2GeotiffBox(const ossimFilename& tmpFile,
       {
          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);
       }
 
@@ -973,12 +1002,12 @@ bool ossimGeoTiff::readTags(
    }
    theTiffPtr = tiff;
    
-   if(theNormalizedDefinitions)
+   if(thePrivateDefinitions->m_defs)
    {
-      delete theNormalizedDefinitions;
+      delete thePrivateDefinitions->m_defs;;
    }
-   theNormalizedDefinitions = new GTIFDefn;
-   GTIFGetDefn(gtif, theNormalizedDefinitions);
+   thePrivateDefinitions->m_defs = new GTIFDefn;
+   GTIFGetDefn(gtif, thePrivateDefinitions->m_defs);
    ossim_uint32 idx = 0;
    theGeoKeysPresentFlag = true;
    if(traceDebug())
@@ -998,12 +1027,12 @@ bool ossimGeoTiff::readTags(
    {
    }
    theScaleFactor     = 0.0;
-   theModelType       = theNormalizedDefinitions->Model;
-   theGcsCode         = theNormalizedDefinitions->GCS;
-   thePcsCode         = theNormalizedDefinitions->PCS;
-   theDatumCode       = theNormalizedDefinitions->Datum;
-   theAngularUnits    = theNormalizedDefinitions->UOMAngle;
-   theLinearUnitsCode = theNormalizedDefinitions->UOMLength;
+   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)
    {
@@ -1082,63 +1111,63 @@ bool ossimGeoTiff::readTags(
       thePcsCitation = ossimString(buf);
    }
    GTIFKeyGet(gtif, ProjCoordTransGeoKey , &theCoorTransGeoCode, 0, 1);
-   for(idx = 0; idx < (ossim_uint32)theNormalizedDefinitions->nParms; ++idx)
+   for(idx = 0; idx < (ossim_uint32)thePrivateDefinitions->m_defs->nParms; ++idx)
    {
-      switch(theNormalizedDefinitions->ProjParmId[idx])
+      switch(thePrivateDefinitions->m_defs->ProjParmId[idx])
       {
          case ProjStdParallel1GeoKey:
          {
-            theStdPar1 = theNormalizedDefinitions->ProjParm[idx];
+            theStdPar1 = thePrivateDefinitions->m_defs->ProjParm[idx];
             break;
          }
          case ProjStdParallel2GeoKey:
          {
-            theStdPar2 = theNormalizedDefinitions->ProjParm[idx];
+            theStdPar2 = thePrivateDefinitions->m_defs->ProjParm[idx];
             break;
          }
          case ProjOriginLongGeoKey:
          {
-            theOriginLon = theNormalizedDefinitions->ProjParm[idx];
+            theOriginLon = thePrivateDefinitions->m_defs->ProjParm[idx];
             break;
          }
          case ProjOriginLatGeoKey:
          {
-            theOriginLat = theNormalizedDefinitions->ProjParm[idx];
+            theOriginLat = thePrivateDefinitions->m_defs->ProjParm[idx];
             break;
          }
          case ProjFalseEastingGeoKey:
          {
-            theFalseEasting = theNormalizedDefinitions->ProjParm[idx];
+            theFalseEasting = thePrivateDefinitions->m_defs->ProjParm[idx];
             break;
          }
          case ProjFalseNorthingGeoKey:
          {
-            theFalseNorthing = theNormalizedDefinitions->ProjParm[idx];
+            theFalseNorthing = thePrivateDefinitions->m_defs->ProjParm[idx];
             break;
          }
          case ProjCenterLongGeoKey:
          {
-            theOriginLon = theNormalizedDefinitions->ProjParm[idx];
+            theOriginLon = thePrivateDefinitions->m_defs->ProjParm[idx];
             break;
          }
          case ProjCenterLatGeoKey:
          {
-            theOriginLat = theNormalizedDefinitions->ProjParm[idx];
+            theOriginLat = thePrivateDefinitions->m_defs->ProjParm[idx];
             break;
          }
          case ProjFalseOriginLatGeoKey:
          {
-            theOriginLat = theNormalizedDefinitions->ProjParm[idx];
+            theOriginLat = thePrivateDefinitions->m_defs->ProjParm[idx];
             break;
          }
          case ProjFalseOriginLongGeoKey:
          {
-            theOriginLon = theNormalizedDefinitions->ProjParm[idx];
+            theOriginLon = thePrivateDefinitions->m_defs->ProjParm[idx];
             break;
          }
          case ProjScaleAtNatOriginGeoKey:
          {
-            theScaleFactor = theNormalizedDefinitions->ProjParm[idx];
+            theScaleFactor = thePrivateDefinitions->m_defs->ProjParm[idx];
             break;
          }
       }
@@ -1188,36 +1217,37 @@ bool ossimGeoTiff::readTags(
    double* pixScale=0;
    if(TIFFGetField(theTiffPtr, TIFFTAG_GEOPIXELSCALE, &pixScaleSize, &pixScale))
    {
-      theScale.insert(theScale.begin(),
-                      pixScale, pixScale+pixScaleSize);
+      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);
+      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]);
-         }
-      }
+      //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;
@@ -1349,7 +1379,7 @@ bool ossimGeoTiff::addImageGeometry(ossimKeywordlist& kwl, const char* prefix) c
    }
 
    // NOT SURE THIS IS A GOOD IDEA HERE. KEPT FOR LEGACY SAKE. (OLK 5/10)
-   else if(theGcsCode == 3785)
+   if(theGcsCode == 3785)
    {
       ossimRefPtr<ossimProjection> proj = 
          ossimProjectionFactoryRegistry::instance()->createProjection(ossimString("EPSG:3785"));
@@ -1481,12 +1511,10 @@ bool ossimGeoTiff::addImageGeometry(ossimKeywordlist& kwl, const char* prefix) c
       }
    }
   
-   if ((theRasterType == OSSIM_PIXEL_IS_AREA))
+   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;
@@ -1533,8 +1561,13 @@ bool ossimGeoTiff::addImageGeometry(ossimKeywordlist& kwl, const char* prefix) c
          return false;
       }
 
+      //---
       // Tiepoint
-      ossimDpt tiepoint (x_tie_point,y_tie_point);
+      // 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);
 
@@ -1546,15 +1579,22 @@ bool ossimGeoTiff::addImageGeometry(ossimKeywordlist& kwl, const char* prefix) c
          kwl.add(prefix, ossimKeywordNames::PIXEL_SCALE_UNITS_KW, "degrees", true);
 
          // origin
-         if (ossim::isnan(theOriginLat) || ossim::isnan(theOriginLon))
+         if ( ossim::isnan(theOriginLat) )
          {
-            double centerX = theWidth/2.0;
+            //---
+            // Put the origin lat at the center of the image so the meters per
+            // pixel is somewhat real.
+            //---
             double centerY = theLength/2.0;
-            theOriginLat = theScale[1]*centerY + y_tie_point;
-            theOriginLon = theScale[0]*centerX + x_tie_point;
+            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);
@@ -1837,15 +1877,15 @@ bool ossimGeoTiff::parseProjection(ossimMapProjection* map_proj)
    else
       theModelType = ModelTypeProjected;
 
-   if (map_proj->getProjectionName() == "ossimEquDistCylProjection")
    theProjectionName = map_proj->getProjectionName();
    theFalseEasting   = map_proj->getFalseEasting();
    theFalseNorthing  = map_proj->getFalseNorthing();
    theStdPar1        = map_proj->getStandardParallel1();
    theStdPar2        = map_proj->getStandardParallel2();
    thePcsCode        = map_proj->getPcsCode();
-   theGcsCode        = map_proj->getGcsCode();
-   theDatumCode      = theGcsCode;
+
+   // 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;
@@ -1853,10 +1893,17 @@ bool ossimGeoTiff::parseProjection(ossimMapProjection* map_proj)
    
    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 (theProjectionName == "ossimUtmProjection")
+   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();
@@ -1908,6 +1955,14 @@ 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;
diff --git a/src/ossim/support_data/ossimInfoBase.cpp b/src/ossim/support_data/ossimInfoBase.cpp
index cb5ecbb..6acc6c4 100644
--- a/src/ossim/support_data/ossimInfoBase.cpp
+++ b/src/ossim/support_data/ossimInfoBase.cpp
@@ -12,8 +12,8 @@
 // $Id$
 
 #include <ossim/support_data/ossimInfoBase.h>
-#include <ossim/base/ossimIoStream.h> /* for ossimIOMemoryStream */
 #include <ossim/base/ossimKeywordlist.h>
+#include <sstream>
 
 ossimInfoBase::ossimInfoBase()
    : theOverviewFlag(true)
@@ -32,7 +32,6 @@ bool ossimInfoBase::getProcessOverviewFlag() const
    return theOverviewFlag;
 }
 
-
 bool ossimInfoBase::getKeywordlist(ossimKeywordlist& kwl)const
 {  
    // Do a print to a memory stream.
diff --git a/src/ossim/support_data/ossimInfoFactory.cpp b/src/ossim/support_data/ossimInfoFactory.cpp
index 9fd8df6..5b2b818 100644
--- a/src/ossim/support_data/ossimInfoFactory.cpp
+++ b/src/ossim/support_data/ossimInfoFactory.cpp
@@ -9,47 +9,56 @@
 // Description: Factory for info objects.
 // 
 //----------------------------------------------------------------------------
-// $Id$
+// $Id: ossimInfoFactory.cpp 22118 2013-01-18 21:05:14Z 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()
 {
-   static ossimInfoFactory sharedInstance;
-
-   return &sharedInstance;
+   if ( !theInstance )
+   {
+      theInstance = new ossimInfoFactory;
+   }
+   return theInstance;
 }
 
 ossimInfoBase* ossimInfoFactory::create(const ossimFilename& file) const
 {
    ossimRefPtr<ossimInfoBase> result = 0;
 
-   result = new ossimJ2kInfo();
+   result = new ossimTiffInfo();
    if ( result->open(file) )
    {
       return result.release();
    }
 
-   result = new ossimNitfInfo();
+   result = new ossimJp2Info();
    if ( result->open(file) )
    {
       return result.release();
    }
 
-   result = new ossimTiffInfo();
+   result = new ossimNitfInfo();
    if ( result->open(file) )
    {
       return result.release();
@@ -67,17 +76,41 @@ ossimInfoBase* ossimInfoFactory::create(const ossimFilename& file) const
       return result.release();
    }
 
-   result = new ossimDtedInfo();
+   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) )
diff --git a/src/ossim/support_data/ossimInfoFactoryRegistry.cpp b/src/ossim/support_data/ossimInfoFactoryRegistry.cpp
index 9bad48d..2317e83 100644
--- a/src/ossim/support_data/ossimInfoFactoryRegistry.cpp
+++ b/src/ossim/support_data/ossimInfoFactoryRegistry.cpp
@@ -9,22 +9,27 @@
 //----------------------------------------------------------------------------
 // $Id$
 
-#include <algorithm> /* for std::find */
-
 #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()
 {
-   theFactoryList.clear();
+   m_factoryList.clear();
 }
 
 ossimInfoFactoryRegistry* ossimInfoFactoryRegistry::instance()
 {
-   static ossimInfoFactoryRegistry sharedInstance;
-   return &sharedInstance;
+   if ( !m_instance )
+   {
+      m_instance = new ossimInfoFactoryRegistry;
+   }
+   return m_instance;
 }
 
 void ossimInfoFactoryRegistry::registerFactory(
@@ -32,20 +37,35 @@ void ossimInfoFactoryRegistry::registerFactory(
 {
    if (factory)
    {
-      theFactoryList.push_back(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(theFactoryList.begin(), theFactoryList.end(), factory);
+      std::find(m_factoryList.begin(), m_factoryList.end(), factory);
    
-   if( i != theFactoryList.end() )
+   if( i != m_factoryList.end() )
    {
-      theFactoryList.erase(i);
+      m_factoryList.erase(i);
    }
+   m_mutex.unlock();
 }
 
 ossimInfoBase* ossimInfoFactoryRegistry::create(
@@ -54,9 +74,9 @@ ossimInfoBase* ossimInfoFactoryRegistry::create(
    ossimInfoBase* result = 0;
    
    std::vector<ossimInfoFactoryInterface*>::const_iterator i =
-      theFactoryList.begin();
+      m_factoryList.begin();
 
-   while ( i != theFactoryList.end() )
+   while ( i != m_factoryList.end() )
    {
       result = (*i)->create(file);
       if ( result )
@@ -71,7 +91,8 @@ ossimInfoBase* ossimInfoFactoryRegistry::create(
 
 /** hidden from use default constructor */
 ossimInfoFactoryRegistry::ossimInfoFactoryRegistry()
-   : theFactoryList()
+   : m_factoryList(),
+     m_mutex()
 {
    this->registerFactory(ossimInfoFactory::instance());
 }
diff --git a/src/ossim/support_data/ossimJp2Info.cpp b/src/ossim/support_data/ossimJp2Info.cpp
new file mode 100644
index 0000000..22d26db
--- /dev/null
+++ b/src/ossim/support_data/ossimJp2Info.cpp
@@ -0,0 +1,211 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: JP2 Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimJp2Info.cpp 20504 2012-01-27 15:34:21Z dburken $
+
+#include <ossim/support_data/ossimJp2Info.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/support_data/ossimTiffInfo.h>
+#include <fstream>
+#include <iostream>
+
+ossimJp2Info::ossimJp2Info()
+   : ossimInfoBase(),
+     m_file()
+{
+}
+
+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() )
+   {
+      // Look for the GeoTIFF Box
+      std::ifstream str;
+      str.open( m_file.c_str(), std::ios_base::in | std::ios_base::binary);
+      
+      if ( str.is_open() )
+      {
+         // Position to start of code file.
+         str.seekg(SIGNATURE_BOX_SIZE, std::ios_base::beg);
+         
+         // See if we need to byte swap.  JP2 boxes are big endian.
+         ossimEndian* swapper = 0;
+         if ( ossim::byteOrder() == OSSIM_LITTLE_ENDIAN )
+         {
+            swapper = new ossimEndian();
+         }
+         
+         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() )
+         {
+            str.read((char*)&lbox, 4);
+            str.read((char*)&tbox, 4);
+            ossim_uint32 bytesRead = 8;
+            if (swapper)
+            {
+               swapper->swap(lbox);
+               swapper->swap(tbox);
+            }
+            
+            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);
+               bytesRead += GEOTIFF_UUID_SIZE;
+               
+               bool foundIt = true;
+               for (ossim_uint32 i = 0; i < GEOTIFF_UUID_SIZE; ++i)
+               {
+                  if (geotiffUuid[i] != GEOTIFF_UUID[i])
+                  {
+                     foundIt = false;
+                     break;
+                  }
+               }
+               
+               if ( foundIt )
+               {
+                  //---
+                  // 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;
+                  }
+                  
+                  break; // Get out of while loop.
+               }
+            }
+            else
+            {
+               str.read((char*)&xlbox, 8);
+               bytesRead += 8;
+               if (swapper)
+               {
+                  swapper->swap(xlbox);
+               }
+            }
+            
+            if (lbox == 0) // last box?
+            {
+               break;
+            }
+            
+            // Seek to the next box.  If xlbox is 1
+            std::streamoff seekPos = 0;
+            if (lbox == 1)
+            {
+               seekPos = static_cast<std::streamoff>(xlbox) - static_cast<std::streamoff>(bytesRead);
+            }
+            else
+            {
+               seekPos = static_cast<std::streamoff>(lbox) - static_cast<std::streamoff>(bytesRead);
+            }
+            str.seekg(seekPos,  std::ios_base::cur);
+            
+         } // matches: while ( str.good() )
+         
+         // cleanup
+         if (swapper)
+         {
+            delete swapper; 
+            swapper = 0;
+         }
+         
+         // Close the stream.
+         str.close();
+         
+      } // matches: if ( str.is_open() )
+      
+   } // matches: if ( m_file.size() )
+   
+   return out; 
+}
diff --git a/src/ossim/support_data/ossimJpipMessage.cpp b/src/ossim/support_data/ossimJpipMessage.cpp
new file mode 100644
index 0000000..5c0a4ae
--- /dev/null
+++ b/src/ossim/support_data/ossimJpipMessage.cpp
@@ -0,0 +1,35 @@
+#include <ossim/support_data/ossimJpipMessage.h>
+
+ossimJpipMessage::ossimJpipMessage()
+:m_header(new ossimJpipMessageHeader())
+{    
+}
+
+void ossimJpipMessage::reset()
+{
+    m_header->reset();
+    m_messageBody.clear();
+    m_headerLength = 0;
+    
+}
+
+void ossimJpipMessage::dumpBodyAsHex(std::ostream& out)const
+{
+    ossim_uint32 idx = 0;
+    for(idx = 0; idx < m_messageBody.size();++idx)
+    {
+        std::cout << std::hex<<(int)m_messageBody[idx]<< " " ;
+        if((idx+1)%16 == 0)
+        {
+            out << "\n";
+        }
+    }
+}
+void ossimJpipMessage::dumpBodyAsText(std::ostream& out)const
+{
+    ossim_uint32 idx = 0;
+    for(idx = 0; idx < m_messageBody.size();++idx)
+    {
+        out << (char)m_messageBody[idx];
+    }
+}
diff --git a/src/ossim/support_data/ossimJpipMessageDecoder.cpp b/src/ossim/support_data/ossimJpipMessageDecoder.cpp
new file mode 100644
index 0000000..90001b6
--- /dev/null
+++ b/src/ossim/support_data/ossimJpipMessageDecoder.cpp
@@ -0,0 +1,171 @@
+#include <ossim/support_data/ossimJpipMessageDecoder.h>
+
+ossimJpipMessageDecoder::ossimJpipMessageDecoder()
+:m_lastClass(0),
+m_lastCSn(0),
+m_headerLength(0),
+m_inputStream(&m_streamBuffer)
+{
+}
+
+// ossimJpipMessage* ossimJpipMessageDecoder::readMessage() throw(ossimException)
+ossimJpipMessage* ossimJpipMessageDecoder::readMessage()   
+{
+    ossim_int32 BinIDIndicator = 0;
+    ossim_int64 inClassIdentifier = 0;
+    bool completeDataBin = false;
+    ossim_int64 tempByte = 0;
+    
+    // Initialization
+    m_headerLength = 0;
+    ossimRefPtr<ossimJpipMessage> jpipMessage = new ossimJpipMessage();
+    
+    //	Bin-ID
+    tempByte = m_inputStream.get();
+    m_headerLength++;
+    
+    if (tempByte == 0x00) 
+    { // EOR is reached
+        jpipMessage = readEORMessage();
+        jpipMessage->setHeaderLength(m_headerLength);
+        return jpipMessage.release();
+    }
+    
+    // b bits
+    BinIDIndicator = (tempByte >> 5) & 0x03;
+    if ( (BinIDIndicator < 1) || (BinIDIndicator > 3) ) 
+    {
+        throw new ossimException("Wrong server response: impossible to decode it correctly");
+    }
+    
+    // c bit
+    completeDataBin = (tempByte & 0x10)==0 ? false : true;
+    
+    // d bits (In-Class ID)
+    inClassIdentifier = tempByte & 0x0F;
+    if ((tempByte >> 7) > 0 ) {
+        int numBytesVBAS = 1;
+        do {
+            tempByte = m_inputStream.get();
+            m_headerLength++;
+            if (tempByte == -1) {
+                throw new ossimException("There is not data available to read the VBAS");
+            }
+            inClassIdentifier = (inClassIdentifier << 7) | (ossim_int64)(tempByte & 0x7F);
+            numBytesVBAS++;
+            
+            if (numBytesVBAS > 9) {	// maximum long value is 2^63 - 1 => 9 bytes VBAS 
+                throw new ossimException("VBAS length is larger than 63 bits (which is the maximum of long)");
+            }
+        } while ( (tempByte & 0x80) != 0 );
+    }
+    
+    jpipMessage->header()->m_isLastByte = completeDataBin;
+    jpipMessage->header()->m_inClassIdentifier = inClassIdentifier;
+    
+    // Class		
+    if ( (BinIDIndicator == 2) || (BinIDIndicator == 3) )  
+    {
+        jpipMessage->header()->m_classIdentifier = (int)readVBAS();
+        m_lastClass = jpipMessage->header()->m_classIdentifier;
+        
+    } 
+    else 
+    {
+        jpipMessage->header()->m_classIdentifier = m_lastClass;
+    }
+    if ((jpipMessage->header()->m_classIdentifier < 0) || (jpipMessage->header()->m_classIdentifier > 8) )
+        throw new ossimException("Wrong server response: invalid value for Class identifier)");
+    
+    // CSn				
+    if ( BinIDIndicator == 3) 
+    {
+        jpipMessage->header()->m_CSn = (int)readVBAS();
+        m_lastCSn = jpipMessage->header()->m_CSn;
+        
+    } 
+    else 
+    {
+        jpipMessage->header()->m_CSn = m_lastCSn;
+    }
+    
+    // Msg-Offset
+    jpipMessage->header()->m_msgOffset = (int)readVBAS();
+    
+    // Msg-Length						
+    jpipMessage->header()->m_msgLength = (int)readVBAS();			
+    
+    // Aux
+    if ( (jpipMessage->header()->m_classIdentifier % 2) == 1 ) 
+    {
+        jpipMessage->header()->m_aux = (int)readVBAS();
+    }
+    
+    // Read jpip message body
+    if (jpipMessage->header()->m_msgLength > 0) 
+    {
+        jpipMessage->messageBody().resize(jpipMessage->header()->m_msgLength);
+        m_inputStream.read((char*)&jpipMessage->messageBody().front(), (int)jpipMessage->header()->m_msgLength);					
+    }
+    
+    jpipMessage->setHeaderLength(m_headerLength);
+    
+    return jpipMessage.release();
+}
+
+// ossim_int64 ossimJpipMessageDecoder::readVBAS() throw(ossimException)
+ossim_int64 ossimJpipMessageDecoder::readVBAS()
+{
+    ossim_int64 value = 0;
+    ossim_int64 tempByte;
+    ossim_int32 numBytesVBAS = 0;
+    m_headerLength = 0;
+    
+    do 
+    {			
+        tempByte = m_inputStream.get();
+        m_headerLength++;
+        
+        if(tempByte == -1) 
+        {
+            throw ossimException("There is not data available to read the VBAS");
+        }
+        
+        value = (value << 7) | (long) (tempByte & 0x7F);
+        numBytesVBAS++;
+        
+        if (numBytesVBAS > 9) 
+        {	// maximum long value is 2^63 - 1 => 9 bytes VBAS 
+            throw ossimException("VBAS length is larger than 63 bits (which is the maximum of long)");
+        }
+        
+    } while ( (tempByte & 0x80) != 0 );					
+    
+    return value;
+}
+
+// ossimJpipMessage* ossimJpipMessageDecoder::readEORMessage() throw(ossimException)
+ossimJpipMessage* ossimJpipMessageDecoder::readEORMessage()
+{
+    ossimRefPtr<ossimJpipMessage> jpipMessage; 
+    
+    jpipMessage = new ossimJpipMessage();			
+    jpipMessage->header()->m_isEOR = true;
+    
+    // Read EOR code		
+    jpipMessage->header()->m_EORCode = m_inputStream.get();
+    m_headerLength++;
+    
+    // Read EOR body length
+    int EORBodyLength = (int)readVBAS();
+    jpipMessage->header()->m_msgLength = EORBodyLength;
+    
+    // Read EOR body
+    if (EORBodyLength > 0 ) 
+    {
+        jpipMessage->messageBody().resize(EORBodyLength);
+        m_inputStream.read((char*)&jpipMessage->messageBody().front(), EORBodyLength);
+    }
+    
+    return jpipMessage.release();
+}
diff --git a/src/ossim/support_data/ossimNitfAcftbTag.cpp b/src/ossim/support_data/ossimNitfAcftbTag.cpp
index d5419e2..14e11ba 100644
--- a/src/ossim/support_data/ossimNitfAcftbTag.cpp
+++ b/src/ossim/support_data/ossimNitfAcftbTag.cpp
@@ -25,7 +25,7 @@
 RTTI_DEF1(ossimNitfAcftbTag, "ossimNitfAcftbTag", ossimNitfRegisteredTag);
 
 ossimNitfAcftbTag::ossimNitfAcftbTag()
-   : ossimNitfRegisteredTag()
+   : ossimNitfRegisteredTag(std::string("ACFTB"), CEL_SIZE)
 {
    clearFields();
 }
@@ -34,11 +34,6 @@ ossimNitfAcftbTag::~ossimNitfAcftbTag()
 {
 }
 
-ossimString ossimNitfAcftbTag::getRegisterTagName() const
-{
-   return "ACFTB";
-}
-
 void ossimNitfAcftbTag::parseStream(std::istream& in)
 {
    clearFields();
@@ -105,11 +100,6 @@ void ossimNitfAcftbTag::writeStream(std::ostream& out)
    out.write(theMtiTot, MTI_TOT_SIZE);
 }
 
-ossim_uint32 ossimNitfAcftbTag::getSizeInBytes()const
-{
-   return CEL_SIZE;
-}
-
 void ossimNitfAcftbTag::clearFields()
 {
    // BCS-N's to '0's, BCS-A's to ' '(spaces)
@@ -206,13 +196,13 @@ std::ostream& ossimNitfAcftbTag::print(
    std::ostream& out, const std::string& prefix) const
 {
    std::string pfx = prefix;
-   pfx += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
    
    out << setiosflags(std::ios::left)
        << pfx << std::setw(24) << "CETAG:"
-       << getRegisterTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getSizeInBytes() << "\n"
+       << 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:"
diff --git a/src/ossim/support_data/ossimNitfAimidbTag.cpp b/src/ossim/support_data/ossimNitfAimidbTag.cpp
index 3c15dad..02af9d9 100644
--- a/src/ossim/support_data/ossimNitfAimidbTag.cpp
+++ b/src/ossim/support_data/ossimNitfAimidbTag.cpp
@@ -25,7 +25,7 @@
 RTTI_DEF1(ossimNitfAimidbTag, "ossimNitfAimidbTag", ossimNitfRegisteredTag);
 
 ossimNitfAimidbTag::ossimNitfAimidbTag()
-   : ossimNitfRegisteredTag()
+   : ossimNitfRegisteredTag(std::string("AIMIDB"), CEL_SIZE)
 {
    clearFields();
 }
@@ -34,11 +34,6 @@ ossimNitfAimidbTag::~ossimNitfAimidbTag()
 {
 }
 
-ossimString ossimNitfAimidbTag::getRegisterTagName() const
-{
-   return "AIMIDB";
-}
-
 void ossimNitfAimidbTag::parseStream(std::istream& in)
 {
    clearFields();
@@ -85,11 +80,6 @@ void ossimNitfAimidbTag::writeStream(std::ostream& out)
    out.write(theReserved3, RESERVED_3_SIZE);
 }
 
-ossim_uint32 ossimNitfAimidbTag::getSizeInBytes()const
-{
-   return CEL_SIZE;
-}
-
 void ossimNitfAimidbTag::clearFields()
 {
    // BCS-N's to '0's, BCS-A's to ' '(spaces)
@@ -139,13 +129,13 @@ std::ostream& ossimNitfAimidbTag::print(
    std::ostream& out, const std::string& prefix) const
 {
    std::string pfx = prefix;
-   pfx += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
    
    out << setiosflags(std::ios::left)
        << pfx << std::setw(24) << "CETAG:"
-       << getRegisterTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getSizeInBytes() << "\n"
+       << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
        << pfx << std::setw(24) << "ACQUISITION_DATE:"
        << theAcquisitionDate << "\n"
        << pfx << std::setw(24) << "MISSION_NO:"
diff --git a/src/ossim/support_data/ossimNitfBlockaTag.cpp b/src/ossim/support_data/ossimNitfBlockaTag.cpp
index 12be532..3aea93a 100644
--- a/src/ossim/support_data/ossimNitfBlockaTag.cpp
+++ b/src/ossim/support_data/ossimNitfBlockaTag.cpp
@@ -9,7 +9,7 @@
 // Description: BLOCKA tag class declaration.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimNitfBlockaTag.cpp 14754 2009-06-23 23:13:05Z dburken $
+// $Id: ossimNitfBlockaTag.cpp 22013 2012-12-19 17:37:20Z dburken $
 
 #include <cstring> /* for memcpy */
 #include <sstream>
@@ -27,15 +27,11 @@ static const ossimTrace traceDebug(ossimString("ossimNitfBlockaTag:debug"));
 RTTI_DEF1(ossimNitfBlockaTag, "ossimNitfBlockaTag", ossimNitfRegisteredTag);
 
 ossimNitfBlockaTag::ossimNitfBlockaTag()
+   : ossimNitfRegisteredTag(std::string("BLOCKA"), 123)
 {
    clearFields();
 }
 
-ossimString ossimNitfBlockaTag::getRegisterTagName() const
-{
-   return ossimString("BLOCKA");
-}
-
 void ossimNitfBlockaTag::parseStream(std::istream& in)
 {
    clearFields();
@@ -69,11 +65,6 @@ void ossimNitfBlockaTag::writeStream(std::ostream& out)
    out.write(theField11,       FIELD_11_SIZE);
 }
 
-ossim_uint32 ossimNitfBlockaTag::getSizeInBytes()const
-{
-   return 123;
-}
-
 void ossimNitfBlockaTag::clearFields()
 {
    memcpy(theBlockInstance, "01",    BLOCK_INSTANCE_SIZE);
@@ -105,7 +96,7 @@ std::ostream& ossimNitfBlockaTag::print(std::ostream& out,
                                         const std::string& prefix) const
 {
    std::string pfx = prefix;
-   pfx += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
    
    // Grab the corners parsed into points.
@@ -119,8 +110,8 @@ std::ostream& ossimNitfBlockaTag::print(std::ostream& out,
    getLrfcLoc(llPt);
    
    out << setiosflags(ios::left)
-       << pfx << std::setw(24) << "CETAG:" << getRegisterTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getSizeInBytes() << "\n"
+       << 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"
diff --git a/src/ossim/support_data/ossimNitfCsccgaTag.cpp b/src/ossim/support_data/ossimNitfCsccgaTag.cpp
new file mode 100644
index 0000000..1cb56ae
--- /dev/null
+++ b/src/ossim/support_data/ossimNitfCsccgaTag.cpp
@@ -0,0 +1,86 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description: CSCCGA tag source file
+//
+//----------------------------------------------------------------------------
+// $Id$
+#include <ossim/support_data/ossimNitfCsccgaTag.h>
+#include <iomanip>
+#include <iostream>
+
+ossimNitfCsccgaTag::ossimNitfCsccgaTag()
+   : ossimNitfRegisteredTag(std::string("CSCCGA"), CEL_SIZE)
+{
+   clearFields();
+}
+
+void ossimNitfCsccgaTag::parseStream(std::istream& in)
+{
+   in.read(m_ccgSource, CCG_SOURCE_SIZE);
+   in.read(m_regSensor, REG_SENSOR_SIZE);
+   in.read(m_originLine, ORIGIN_LINE_SIZE);
+   in.read(m_originSample, ORIGIN_SAMPLE_SIZE);
+   in.read(m_asCellSize, AS_CELL_SIZE_SIZE);
+   in.read(m_csCellSize, CS_CELL_SIZE_SIZE);
+   in.read(m_ccgMaxLine, CCG_MAX_LINE_SIZE);
+   in.read(m_ccgMaxSample, CCG_MAX_SAMPLE_SIZE);
+}
+
+void ossimNitfCsccgaTag::writeStream(std::ostream& out)
+{
+   out.write(m_ccgSource, CCG_SOURCE_SIZE);
+   out.write(m_regSensor, REG_SENSOR_SIZE);
+   out.write(m_originLine, ORIGIN_LINE_SIZE);
+   out.write(m_originSample, ORIGIN_SAMPLE_SIZE);
+   out.write(m_asCellSize, AS_CELL_SIZE_SIZE);
+   out.write(m_csCellSize, CS_CELL_SIZE_SIZE);
+   out.write(m_ccgMaxLine, CCG_MAX_LINE_SIZE);
+   out.write(m_ccgMaxSample, CCG_MAX_SAMPLE_SIZE);
+}
+
+std::ostream& ossimNitfCsccgaTag::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) << "CCG_SOURCE:" << m_ccgSource << "\n"
+       << pfx << std::setw(24) << "CCG_SOURCE:" << m_regSensor << "\n"
+       << pfx << std::setw(24) << "ORIGIN_LINE:" << m_originLine << "\n"
+       << pfx << std::setw(24) << "ORIGIN_SAMPLE:" << m_originSample << "\n"
+       << pfx << std::setw(24) << "AS_CELL_SIZE:" << m_asCellSize << "\n"
+       << pfx << std::setw(24) << "CS_CELL_SIZE:" << m_csCellSize << "\n"
+       << pfx << std::setw(24) << "CCG_MAX_LINE:" << m_ccgMaxLine << "\n"
+       << pfx << std::setw(24) << "CCG_MAX_SAMPLE:" << m_ccgMaxSample << "\n";
+
+
+   return out;
+}
+
+void ossimNitfCsccgaTag::clearFields()
+{
+   memset(m_ccgSource,' ', CCG_SOURCE_SIZE);
+   memset(m_regSensor, ' ', REG_SENSOR_SIZE);
+   memset(m_originLine, '0', ORIGIN_LINE_SIZE);
+   memset(m_originSample, '0', ORIGIN_SAMPLE_SIZE);
+   memset(m_asCellSize, '0', AS_CELL_SIZE_SIZE);
+   memset(m_csCellSize, '0', CS_CELL_SIZE_SIZE);
+   memset(m_ccgMaxLine, '0', CCG_MAX_LINE_SIZE);
+   memset(m_ccgMaxSample, '0', CCG_MAX_SAMPLE_SIZE);
+
+   m_ccgSource[CCG_SOURCE_SIZE] = '\0';
+   m_regSensor[REG_SENSOR_SIZE] = '\0';
+   m_originLine[ORIGIN_LINE_SIZE] = '\0';
+   m_originSample[ORIGIN_SAMPLE_SIZE] = '\0';
+   m_asCellSize[AS_CELL_SIZE_SIZE] = '\0';
+   m_csCellSize[CS_CELL_SIZE_SIZE] = '\0';
+   m_ccgMaxLine[CCG_MAX_LINE_SIZE] = '\0';
+   m_ccgMaxSample[CCG_MAX_SAMPLE_SIZE] = '\0';
+}
diff --git a/src/ossim/support_data/ossimNitfCscrnaTag.cpp b/src/ossim/support_data/ossimNitfCscrnaTag.cpp
index b9e686a..ac4fe6b 100644
--- a/src/ossim/support_data/ossimNitfCscrnaTag.cpp
+++ b/src/ossim/support_data/ossimNitfCscrnaTag.cpp
@@ -26,7 +26,7 @@
 RTTI_DEF1(ossimNitfCscrnaTag, "ossimNitfCscrnaTag", ossimNitfRegisteredTag);
 
 ossimNitfCscrnaTag::ossimNitfCscrnaTag()
-   : ossimNitfRegisteredTag()
+   : ossimNitfRegisteredTag(std::string("CSCRNA"), 109)
 {
    clearFields();
 }
@@ -35,11 +35,6 @@ ossimNitfCscrnaTag::~ossimNitfCscrnaTag()
 {
 }
 
-ossimString ossimNitfCscrnaTag::getRegisterTagName() const
-{
-   return "CSCRNA";
-}
-
 void ossimNitfCscrnaTag::parseStream(std::istream& in)
 {
    clearFields();
@@ -84,11 +79,6 @@ void ossimNitfCscrnaTag::writeStream(std::ostream& out)
    out.write(theLlHt, 8);
 }
 
-ossim_uint32 ossimNitfCscrnaTag::getSizeInBytes()const
-{
-   return 109;
-}
-
 void ossimNitfCscrnaTag::clearFields()
 {
    // BCS-N's to '0's, BCS-A's to ' '(spaces)
@@ -133,13 +123,13 @@ std::ostream& ossimNitfCscrnaTag::print(
    std::ostream& out, const std::string& prefix) const
 {
    std::string pfx = prefix;
-   pfx += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
    
    out << setiosflags(std::ios::left)
        << pfx << std::setw(24) << "CETAG:"
-       << getRegisterTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getSizeInBytes() << "\n"
+       << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
       
        << pfx << std::setw(24) << "PREDICT_CORNERS:"
        << thePredictedCornerFlag << "\n"
diff --git a/src/ossim/support_data/ossimNitfCsdidaTag.cpp b/src/ossim/support_data/ossimNitfCsdidaTag.cpp
index c6d11ac..eba286d 100644
--- a/src/ossim/support_data/ossimNitfCsdidaTag.cpp
+++ b/src/ossim/support_data/ossimNitfCsdidaTag.cpp
@@ -26,7 +26,7 @@
 RTTI_DEF1(ossimNitfCsdidaTag, "ossimNitfCsdidaTag", ossimNitfRegisteredTag);
 
 ossimNitfCsdidaTag::ossimNitfCsdidaTag()
-   : ossimNitfRegisteredTag()
+   : ossimNitfRegisteredTag(std::string("CSDIDA"), 70)
 {
    clearFields();
 }
@@ -35,11 +35,6 @@ ossimNitfCsdidaTag::~ossimNitfCsdidaTag()
 {
 }
 
-ossimString ossimNitfCsdidaTag::getRegisterTagName() const
-{
-   return "CSDIDA";
-}
-
 void ossimNitfCsdidaTag::parseStream(std::istream& in)
 {
    clearFields();
@@ -84,11 +79,6 @@ void ossimNitfCsdidaTag::writeStream(std::ostream& out)
    out.write(theSoftwareVersionNumber, 10);
 }
 
-ossim_uint32 ossimNitfCsdidaTag::getSizeInBytes()const
-{
-   return 70;
-}
-
 void ossimNitfCsdidaTag::clearFields()
 {
    // BCS-N's to '0's, BCS-A's to ' '(spaces)
@@ -125,8 +115,8 @@ void ossimNitfCsdidaTag::clearFields()
    theProcessTime[14] = '\0';
    theReservedField2[2] = '\0';
    theReservedField3[2] = '\0';
-   theReservedField4[1] = '\0';
-   theReservedField5[1] = '\0';
+   theReservedField4[0] = '\0';
+   theReservedField5[0] = '\0';
    theSoftwareVersionNumber[10] = '\0';
 }
 
@@ -134,13 +124,13 @@ std::ostream& ossimNitfCsdidaTag::print(
    std::ostream& out, const std::string& prefix) const
 {
    std::string pfx = prefix;
-   pfx += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
    
    out << setiosflags(std::ios::left)
        << pfx << std::setw(24) << "CETAG:"
-       << getRegisterTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getSizeInBytes() << "\n"
+       << 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"
diff --git a/src/ossim/support_data/ossimNitfCsexraTag.cpp b/src/ossim/support_data/ossimNitfCsexraTag.cpp
index 8ab848d..9cc07da 100644
--- a/src/ossim/support_data/ossimNitfCsexraTag.cpp
+++ b/src/ossim/support_data/ossimNitfCsexraTag.cpp
@@ -26,7 +26,7 @@
 RTTI_DEF1(ossimNitfCsexraTag, "ossimNitfCsexraTag", ossimNitfRegisteredTag);
 
 ossimNitfCsexraTag::ossimNitfCsexraTag()
-   : ossimNitfRegisteredTag()
+   : ossimNitfRegisteredTag(std::string("CSEXRA"), 132)
 {
    clearFields();
 }
@@ -35,11 +35,6 @@ ossimNitfCsexraTag::~ossimNitfCsexraTag()
 {
 }
 
-ossimString ossimNitfCsexraTag::getRegisterTagName() const
-{
-   return "CSEXRA";
-}
-
 void ossimNitfCsexraTag::parseStream(std::istream& in)
 {
    clearFields();
@@ -98,11 +93,6 @@ void ossimNitfCsexraTag::writeStream(std::ostream& out)
    out.write(theLinearError, 3);
 }
 
-ossim_uint32 ossimNitfCsexraTag::getSizeInBytes()const
-{
-   return 132;
-}
-
 void ossimNitfCsexraTag::clearFields()
 {
    //---
@@ -166,14 +156,14 @@ std::ostream& ossimNitfCsexraTag::print(
    std::ostream& out, const std::string& prefix) const
 {
    std::string pfx = prefix;
-   pfx += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
    
    out << setiosflags(std::ios::left)
        << pfx << std::setw(24) << "CETAG:"
-       << getRegisterTagName() << "\n"
+       << getTagName() << "\n"
        << pfx << std::setw(24) << "CEL:"
-       << getSizeInBytes() << "\n"
+       << getTagLength() << "\n"
        << pfx << std::setw(24) << "SENSOR:"
        << theSensor << "\n"
        << pfx << std::setw(24) << "TIME_FIRST_LINE_IMAGE:"
diff --git a/src/ossim/support_data/ossimNitfCsproaTag.cpp b/src/ossim/support_data/ossimNitfCsproaTag.cpp
new file mode 100644
index 0000000..ddb6b9b
--- /dev/null
+++ b/src/ossim/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 += 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/src/ossim/support_data/ossimNitfEmbeddedRpfDes.cpp b/src/ossim/support_data/ossimNitfEmbeddedRpfDes.cpp
index 90f0d18..ab4e959 100644
--- a/src/ossim/support_data/ossimNitfEmbeddedRpfDes.cpp
+++ b/src/ossim/support_data/ossimNitfEmbeddedRpfDes.cpp
@@ -9,7 +9,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfEmbeddedRpfDes.cpp 17206 2010-04-25 23:20:40Z dburken $
+// $Id: ossimNitfEmbeddedRpfDes.cpp 22013 2012-12-19 17:37:20Z dburken $
 
 #include <istream>
 #include <ostream>
@@ -20,6 +20,7 @@ RTTI_DEF1(ossimNitfEmbeddedRpfDes, "ossimNitfEmbeddedRpfDes", ossimNitfRegistere
 
 
 ossimNitfEmbeddedRpfDes::ossimNitfEmbeddedRpfDes()
+   : ossimNitfRegisteredTag(std::string("RPFDES"), 0)
 {
 }
 
diff --git a/src/ossim/support_data/ossimNitfEngrdaTag.cpp b/src/ossim/support_data/ossimNitfEngrdaTag.cpp
index 338e43d..c09c321 100644
--- a/src/ossim/support_data/ossimNitfEngrdaTag.cpp
+++ b/src/ossim/support_data/ossimNitfEngrdaTag.cpp
@@ -26,7 +26,7 @@
 RTTI_DEF1(ossimNitfEngrdaTag, "ossimNitfEngrdaTag", ossimNitfRegisteredTag);
 
 ossimNitfEngrdaTag::ossimNitfEngrdaTag()
-   : ossimNitfRegisteredTag()
+   : ossimNitfRegisteredTag(std::string("ENGRDA"), 0)
 {
    clearFields();
 }
@@ -35,22 +35,17 @@ ossimNitfEngrdaTag::~ossimNitfEngrdaTag()
 {
 }
 
-ossimString ossimNitfEngrdaTag::getRegisterTagName() const
-{
-   return "ENGRDA";
-}
-
 void ossimNitfEngrdaTag::parseStream(std::istream& in)
 {
    clearFields();
 
-   // theTreLength = RETAG_SIZE + REL_SIZE;
+   // m_tagLength = RETAG_SIZE + REL_SIZE;
    
    in.read(theReSrc, RESRC_SIZE);
-   theTreLength += RESRC_SIZE;
+   m_tagLength += RESRC_SIZE;
    
    in.read(theReCnt, RECNT_SIZE);
-   theTreLength += RECNT_SIZE;
+   m_tagLength += RECNT_SIZE;
 
    const ossim_uint16 ELEMENT_COUNT = ossimString(theReCnt).toUInt16();
    
@@ -62,48 +57,48 @@ void ossimNitfEngrdaTag::parseStream(std::istream& in)
 
       // ENGLN - label length field
       in.read(buf, ENGLN_SIZE);
-      theTreLength += ENGLN_SIZE;
+      m_tagLength += ENGLN_SIZE;
       buf[ENGLN_SIZE] = '\n';
       os = buf;
 
       // ENGLBL - label field
       ossim_uint32 size = os.toUInt16();
       in.read(buf, size);
-      theTreLength += size;
+      m_tagLength += size;
       buf[size] = '\0';
       element.theEngLbl = buf;
 
       // ENGMTXC - data column count
       in.read(buf, ENGMTXC_SIZE);
-      theTreLength += 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);
-      theTreLength += 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 );
-      theTreLength += ENGTYP_SIZE;
+      m_tagLength += ENGTYP_SIZE;
 
       // ENGDTS - Engineering Data Element Size
       element.theEngDts = static_cast<ossim_uint8>(in.get());
-      theTreLength += ENGDTS_SIZE;
+      m_tagLength += ENGDTS_SIZE;
 
       // ENGDATU - Engineering Data Units.
       in.read(buf, ENGDATU_SIZE);
-      theTreLength += ENGDATU_SIZE;
+      m_tagLength += ENGDATU_SIZE;
       buf[ENGDATU_SIZE] = '\0';
       element.theEngDatU = buf;
 
       // ENGDATC - Engineering Data Count
       in.read(buf, ENGDATC_SIZE);
-      theTreLength += ENGDATC_SIZE;
+      m_tagLength += ENGDATC_SIZE;
       buf[ENGDATC_SIZE] = '\n';
       os = buf;
       ossim_uint32 engDatC = os.toUInt32();
@@ -111,7 +106,7 @@ void ossimNitfEngrdaTag::parseStream(std::istream& in)
       // ENGDATA - Engineering Data
       element.theEngDat.resize(engDatC);
       in.read((char*)&(element.theEngDat.front()), (std::streamsize)element.theEngDat.size());
-      theTreLength += engDatC;
+      m_tagLength += engDatC;
       
       theData.push_back(element);
 
@@ -167,11 +162,6 @@ void ossimNitfEngrdaTag::writeStream(std::ostream& out)
    
 }
 
-ossim_uint32 ossimNitfEngrdaTag::getSizeInBytes()const
-{
-   return theTreLength;
-}
-
 void ossimNitfEngrdaTag::clearFields()
 {
    // BCS-N's to '0's, BCS-A's to ' '(spaces)
@@ -185,19 +175,19 @@ void ossimNitfEngrdaTag::clearFields()
    theReSrc[RESRC_SIZE] = '\0';
    theReCnt[RECNT_SIZE] = '\0';
 
-   theTreLength = 0;
+   m_tagLength = 0;
 }
 
 std::ostream& ossimNitfEngrdaTag::print(
    std::ostream& out, const std::string& prefix) const
 {
    std::string pfx = prefix;
-   pfx += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
    
    out << setiosflags(std::ios::left)
        << pfx << std::setw(24) << "CETAG:"
-       << getRegisterTagName() << "\n"
+       << getTagName() << "\n"
        << pfx << std::setw(24) << "CEL:"   << getSizeInBytes() << "\n"
        << pfx << std::setw(24) << "RESRC:" << theReSrc << "\n"
        << pfx << std::setw(24) << "RECNT:" << theReCnt << "\n";
@@ -246,6 +236,7 @@ std::ostream& ossimNitfEngrdaTag::printData(std::ostream& out,
    {
       ossimNotify(ossimNotifyLevel_WARN)
          << "ossimNitfEngrdaTag::printData WARNING unhandled data type."
+         << "Data type = " << (char)element.theEngTyp << "\n"
          << std::endl;
    } 
    return out;
diff --git a/src/ossim/support_data/ossimNitfExoptaTag.cpp b/src/ossim/support_data/ossimNitfExoptaTag.cpp
new file mode 100644
index 0000000..efa9da9
--- /dev/null
+++ b/src/ossim/support_data/ossimNitfExoptaTag.cpp
@@ -0,0 +1,139 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description: EXOPTA tag class definition
+//
+//----------------------------------------------------------------------------
+// $Id$
+#include <ossim/support_data/ossimNitfExoptaTag.h>
+#include <iomanip>
+#include <iostream>
+
+ossimNitfExoptaTag::ossimNitfExoptaTag()
+   : ossimNitfRegisteredTag(std::string("EXOPTA"), CEL_SIZE) 
+{
+   clearFields();   
+}
+
+void ossimNitfExoptaTag::parseStream(std::istream& in)
+{
+   clearFields();
+   in.read(m_angleToNorth,ANGLE_TO_NORTH_SIZE);
+   in.read(m_meanGsd, MEAN_GSD_SIZE); 
+   in.read(m_reserved1, EXOPTA_RESERVED1_SIZE);
+   in.read(m_dynamicRange, DYNAMIC_RANGE_SIZE);
+   in.read(m_reserved2, EXOPTA_RESERVED2_SIZE);
+   in.read(m_oblAng, OBL_ANG_SIZE);
+   in.read(m_rollAng, ROLL_ANG_SIZE);
+   in.read(m_primeId, PRIME_ID_SIZE);
+   in.read(m_primeBe, PRIME_BE_SIZE);
+   in.read(m_reserved3, EXOPTA_RESERVED3_SIZE);
+   in.read(m_nSec, N_SEC_SIZE);
+   in.read(m_reserved4, EXOPTA_RESERVED4_SIZE);
+   in.read(m_reserved5, EXOPTA_RESERVED5_SIZE);
+   in.read(m_nSeg, N_SEG_SIZE);
+   in.read(m_maxLpSeg, MAX_LP_SEG_SIZE);
+   in.read(m_reserved6, EXOPTA_RESERVED6_SIZE);
+   in.read(m_sunEl, SUN_EL_SIZE);
+   in.read(m_sunAz, SUN_AZ_SIZE);
+}
+
+void ossimNitfExoptaTag::writeStream(std::ostream& out)
+{
+   out.write(m_angleToNorth,ANGLE_TO_NORTH_SIZE);
+   out.write(m_meanGsd, MEAN_GSD_SIZE); 
+   out.write(m_reserved1, EXOPTA_RESERVED1_SIZE);
+   out.write(m_dynamicRange, DYNAMIC_RANGE_SIZE);
+   out.write(m_reserved2, EXOPTA_RESERVED2_SIZE);
+   out.write(m_oblAng, OBL_ANG_SIZE);
+   out.write(m_rollAng, ROLL_ANG_SIZE);
+   out.write(m_primeId, PRIME_ID_SIZE);
+   out.write(m_primeBe, PRIME_BE_SIZE);
+   out.write(m_reserved3, EXOPTA_RESERVED3_SIZE);
+   out.write(m_nSec, N_SEC_SIZE);
+   out.write(m_reserved4, EXOPTA_RESERVED4_SIZE);
+   out.write(m_reserved5, EXOPTA_RESERVED5_SIZE);
+   out.write(m_nSeg, N_SEG_SIZE);
+   out.write(m_maxLpSeg, MAX_LP_SEG_SIZE);
+   out.write(m_reserved6, EXOPTA_RESERVED6_SIZE);
+   out.write(m_sunEl, SUN_EL_SIZE);
+   out.write(m_sunAz, SUN_AZ_SIZE);
+}
+
+std::ostream& ossimNitfExoptaTag::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) << "ANGLE_TO_NORTH:"        << m_angleToNorth<< "\n"
+       << pfx << std::setw(24) << "DYNAMIC_RANGE:"        << m_dynamicRange<< "\n"
+       << pfx << std::setw(24) << "OBL_ANG:"        << m_oblAng<< "\n"
+       << pfx << std::setw(24) << "ROLL_ANG:"        << m_rollAng<< "\n"
+       << pfx << std::setw(24) << "PRIME_ID:"        << m_primeId<< "\n"
+       << pfx << std::setw(24) << "PRIME_BE:"        << m_primeBe<< "\n"
+       << pfx << std::setw(24) << "N_SEC"        << m_nSec<< "\n"
+       << pfx << std::setw(24) << "N_SEG:"        << m_nSeg<< "\n"
+       << pfx << std::setw(24) << "MAX_LP_SEG:"        << m_maxLpSeg<< "\n"
+       << pfx << std::setw(24) << "SUN_EL:"        << m_sunEl<< "\n"
+       << pfx << std::setw(24) << "SUN_AZ:"        << m_sunAz<< "\n";
+   
+   return out;
+}
+
+void ossimNitfExoptaTag::clearFields()
+{
+   memset(m_angleToNorth, '0', ANGLE_TO_NORTH_SIZE);
+   memset(m_meanGsd, '0', MEAN_GSD_SIZE);
+   m_meanGsd[3] = '.';
+   m_reserved1[0] = '1';
+   memset(m_dynamicRange, '0', DYNAMIC_RANGE_SIZE);
+   memset(m_reserved2, ' ', EXOPTA_RESERVED2_SIZE);
+   memset(m_oblAng, '0', OBL_ANG_SIZE);
+   m_oblAng[2] = '.';
+   memset(m_rollAng, '0',ROLL_ANG_SIZE);
+   m_rollAng[0]='+';
+   m_rollAng[3]='.';
+   memset(m_primeId, ' ', PRIME_ID_SIZE);
+   memset(m_primeBe, ' ', PRIME_BE_SIZE);
+   memset(m_reserved3, ' ', EXOPTA_RESERVED3_SIZE);
+   memset(m_nSec, '0', N_SEC_SIZE);
+   memset(m_reserved4, ' ', EXOPTA_RESERVED4_SIZE);
+   memset(m_reserved5, '0', EXOPTA_RESERVED5_SIZE);
+   m_reserved5[6] = '1';
+   memset(m_nSeg, '0', N_SEG_SIZE);
+   m_nSeg[2] = '1';
+   memset(m_maxLpSeg, '0', MAX_LP_SEG_SIZE);
+   m_maxLpSeg[5] = '1';
+   memset(m_reserved6, ' ', EXOPTA_RESERVED6_SIZE);
+   memset(m_sunEl, '0', SUN_EL_SIZE);
+   m_sunEl[0] = '+';
+   m_sunEl[3] = '.';
+   memset(m_sunAz, '0', SUN_AZ_SIZE);
+   m_sunAz[3] = '.';
+   
+   m_angleToNorth[ANGLE_TO_NORTH_SIZE] = '\0';
+   m_meanGsd[MEAN_GSD_SIZE]='\0';
+   m_reserved1[EXOPTA_RESERVED1_SIZE]='\0';
+   m_dynamicRange[DYNAMIC_RANGE_SIZE]='\0';
+   m_reserved2[EXOPTA_RESERVED2_SIZE]='\0';
+   m_oblAng[OBL_ANG_SIZE]='\0';
+   m_rollAng[ROLL_ANG_SIZE]='\0';
+   m_primeId[PRIME_ID_SIZE]='\0';
+   m_primeBe[PRIME_BE_SIZE]='\0';
+   m_reserved3[EXOPTA_RESERVED3_SIZE]='\0';
+   m_nSec[N_SEC_SIZE]='\0';
+   m_reserved4[EXOPTA_RESERVED4_SIZE]='\0';
+   m_reserved5[EXOPTA_RESERVED5_SIZE]='\0';
+   m_nSeg[N_SEG_SIZE]='\0';
+   m_maxLpSeg[MAX_LP_SEG_SIZE]='\0';
+   m_reserved6[EXOPTA_RESERVED6_SIZE]='\0';
+   m_sunEl[SUN_EL_SIZE]='\0';
+   m_sunAz[SUN_AZ_SIZE]='\0';
+}
diff --git a/src/ossim/support_data/ossimNitfFile.cpp b/src/ossim/support_data/ossimNitfFile.cpp
index 7a57f1f..01bc679 100644
--- a/src/ossim/support_data/ossimNitfFile.cpp
+++ b/src/ossim/support_data/ossimNitfFile.cpp
@@ -9,11 +9,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfFile.cpp 18674 2011-01-11 16:24:12Z dburken $
-
-#include <fstream>
-#include <iostream>
-#include <iomanip>
+// $Id: ossimNitfFile.cpp 22238 2013-04-18 12:57:27Z dburken $
 
 #include <ossim/support_data/ossimNitfFile.h>
 #include <ossim/support_data/ossimNitfFileHeader.h>
@@ -27,8 +23,10 @@
 #include <ossim/support_data/ossimRpfToc.h>
 #include <ossim/base/ossimTrace.h>
 #include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimNotifyContext.h>
-
+#include <ossim/base/ossimNotify.h>
+#include <fstream>
+#include <iostream>
+#include <iomanip>
 
 
 // Static trace for debugging
@@ -91,7 +89,7 @@ std::ostream& ossimNitfFile::print(std::ostream& out,
                // Add our prefix onto prefix.
                std::string s = pfx;
                s += "image";
-               s += ossimString::toString(idx);
+               s += ossimString::toString(idx).string();
                s += ".";
                
                ih->print(out, s);
@@ -110,15 +108,13 @@ std::ostream& ossimNitfFile::print(std::ostream& out,
       if(info.getTagName() == "RPFHDR")
       {
          // Open of the a.toc.
-         ossimRpfToc* toc = new ossimRpfToc;
+         ossimRefPtr<ossimRpfToc> toc = new ossimRpfToc;
          if ( toc->parseFile(getFilename()) ==
               ossimErrorCodes::OSSIM_OK )
          {
             pfx += "rpf.";
             toc->print(out, pfx, printOverviews);
          }
-         delete toc;
-         toc = 0;
       }
       
    } // matches:  if(theNitfFileHeader.valid())
@@ -242,8 +238,31 @@ bool ossimNitfFile::parseFile(const ossimFilename& file)
       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(std::exception& e)
+      catch( const ossimException& e )
       {
          if (traceDebug())
          {
@@ -291,12 +310,24 @@ ossimNitfImageHeader* ossimNitfFile::getNewImageHeader(
    ossimNitfImageHeader* result = 0;
    if(theNitfFileHeader.valid())
    {
-      std::ifstream in(theFilename.c_str(), std::ios::in|std::ios::binary);
-
-      result = theNitfFileHeader->getNewImageHeader(imageNumber, in);
-      in.close();
+      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;
 }
 
diff --git a/src/ossim/support_data/ossimNitfFileHeaderV2_1.cpp b/src/ossim/support_data/ossimNitfFileHeaderV2_1.cpp
index b6c8a3d..b934093 100644
--- a/src/ossim/support_data/ossimNitfFileHeaderV2_1.cpp
+++ b/src/ossim/support_data/ossimNitfFileHeaderV2_1.cpp
@@ -9,7 +9,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfFileHeaderV2_1.cpp 19058 2011-03-11 20:03:24Z dburken $
+// $Id: ossimNitfFileHeaderV2_1.cpp 20123 2011-10-11 17:55:44Z dburken $
 
 #include <iostream>
 #include <iomanip>
@@ -34,17 +34,17 @@ RTTI_DEF1(ossimNitfFileHeaderV2_1,
           "ossimNitfFileHeaderV2_1",
           ossimNitfFileHeaderV2_X)
 
-const ossimString ossimNitfFileHeaderV2_1::FSCLASY_KW = "fsclasy";
-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 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"));
@@ -518,7 +518,7 @@ std::ostream& ossimNitfFileHeaderV2_1::print(std::ostream& out,
        << theFileTitle << "\n"    
        << prefix << std::setw(24) << "FSCLAS:"
        << theSecurityClassification<< "\n"
-       << prefix << std::setw(24) << "FSCLASY:"
+       << prefix << std::setw(24) << "FSCLSY:"
        << theSecurityClassificationSys<< "\n"
        << prefix << std::setw(24) << "FSCODE:"
        << theCodewords << "\n"
@@ -777,8 +777,8 @@ void ossimNitfFileHeaderV2_1::clearFields()
    memset(theClassificationReason, ' ', 1);
    memset(theSecuritySourceDate, ' ', 8);
    memset(theSecurityControlNumber, ' ', 15);
-   memset(theCopyNumber, ' ', 5);
-   memset(theNumberOfCopies, ' ', 5);
+   memset(theCopyNumber, '0', 5);
+   memset(theNumberOfCopies, '0', 5);
    memset(theEncryption, ' ', 1);
    memset(theFileBackgroundColor, 0, 3);
    memset(theOriginatorsName, ' ', 24);
@@ -1540,12 +1540,96 @@ void ossimNitfFileHeaderV2_1::setOriginatorsPhone(const ossimString& phone)
    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();
-   if(name == FSCLASY_KW)
+
+   // Make case insensitive:
+   name.upcase();
+   
+   if(name == FSCLSY_KW)
    {
      setSecurityClassificationSys(property->valueToString()); 
    }
@@ -1614,7 +1698,7 @@ ossimRefPtr<ossimProperty> ossimNitfFileHeaderV2_1::getProperty(const ossimStrin
    {
       property = new ossimStringProperty(name, getComplexityLevel().trim());
    }
-   else if(name == FSCLASY_KW)
+   else if(name == FSCLSY_KW)
    {
       property = new ossimStringProperty(name,
                                                getSecurityClassificationSys().trim());
@@ -1722,7 +1806,7 @@ void ossimNitfFileHeaderV2_1::getPropertyNames(std::vector<ossimString>& propert
 {
    ossimNitfFileHeaderV2_X::getPropertyNames(propertyNames);
 
-   propertyNames.push_back(FSCLASY_KW);
+   propertyNames.push_back(FSCLSY_KW);
    propertyNames.push_back(FSDCTP_KW);
    propertyNames.push_back(FSDCDT_KW);
    propertyNames.push_back(FSDCXM_KW);
@@ -1734,43 +1818,3 @@ void ossimNitfFileHeaderV2_1::getPropertyNames(std::vector<ossimString>& propert
    propertyNames.push_back(FSSRDT_KW);
    propertyNames.push_back(FBKGC_KW);
 }
-
-bool ossimNitfFileHeaderV2_1::setDefaults(const ossimKeywordlist& /* kwl */,
-                                          const char* /* prefix */)
-{
-#if 0	
-   const char* complexityLevel             = kwl.find(prefix, CLEVEL_KW);
-   const char* systemType                  = kwl.find(prefix, STYPE_KW);
-   const char* originatingStationId        = kwl.find(prefix, OSTAID_KW);
-   const char* dateTime                    = kwl.find(prefix, FDT_KW);
-   const char* title                       = kwl.find(prefix, FTITLE_KW);
-   const char* securityClassification      = kwl.find(prefix, FSCLAS_KW);
-   const char* securityClassificationSys   = kwl.find(prefix, FSCLASY_KW);
-   const char* codeWords                   = kwl.find(prefix, FSCODE_KW);
-   const char* controlAndHandling          = kwl.find(prefix, FSCTLH_KW);
-   const char* releasingInstructions       = kwl.find(prefix, FSREL_KW);
-   const char* declassificationType        = kwl.find(prefix, FSDCTP_KW);
-   const char* declassificationDate        = kwl.find(prefix, FSDCDT_KW);
-   const char* declassificationExemption   = kwl.find(prefix, FSDCXM_KW);
-   const char* downgrade                   = kwl.find(prefix, FSDG_KW);
-   const char* downgradingDate             = kwl.find(prefix, FSDGDT_KW);
-   const char* classificationText          = kwl.find(prefix, FSCLTX_KW);
-   const char* classificationAuthorityType = kwl.find(prefix, FSCATP_KW);
-   const char* classificationAuthority     = kwl.find(prefix, FSCAUT_KW);
-   const char* classificationReason        = kwl.find(prefix, FSCRSN_KW);
-   const char* securitySourceDate          = kwl.find(prefix, FSSRDT_KW);
-   const char* securityControlNumber       = kwl.find(prefix, FSCTLN_KW);
-   const char* copyNumber                  = kwl.find(prefix, FSCOP_KW);
-   const char* numberOfCopies              = kwl.find(prefix, FSCPYS_KW);
-   const char* encryption                  = kwl.find(prefix, ENCRYP_KW);
-   const char* fileBackgroundColor         = kwl.find(prefix, FBKGC_KW);
-   const char* originatorsName             = kwl.find(prefix, ONAME_KW);
-   const char* originatorsPhone            = kwl.find(prefix, OPHONE_KW);
-   if(complexityLevel)
-   {
-      setComplexityLevel(complexityLevel);
-   }
-#endif
-   return true;
-}
-
diff --git a/src/ossim/support_data/ossimNitfFileHeaderV2_X.cpp b/src/ossim/support_data/ossimNitfFileHeaderV2_X.cpp
index 0e89ff1..0320ea0 100644
--- a/src/ossim/support_data/ossimNitfFileHeaderV2_X.cpp
+++ b/src/ossim/support_data/ossimNitfFileHeaderV2_X.cpp
@@ -5,7 +5,7 @@
 // See LICENSE.txt file in the top level directory for more details.
 // 
 //----------------------------------------------------------------------------
-// $Id: ossimNitfFileHeaderV2_X.cpp 18413 2010-11-11 19:56:22Z gpotts $
+// $Id: ossimNitfFileHeaderV2_X.cpp 20123 2011-10-11 17:55:44Z dburken $
 
 #include <ossim/support_data/ossimNitfFileHeaderV2_X.h>
 #include <ossim/support_data/ossimNitfCommon.h>
@@ -14,6 +14,7 @@
 #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>
@@ -21,25 +22,25 @@
 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";
+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()
 {
@@ -221,6 +222,10 @@ void ossimNitfFileHeaderV2_X::setProperty(ossimRefPtr<ossimProperty> property)
    if(!property.valid()) return;
 
    ossimString name = property->getName();
+
+   // Make case insensitive:
+   name.upcase();
+
    if(name == FHDR_KW)
    {
       
@@ -406,21 +411,101 @@ bool ossimNitfFileHeaderV2_X::saveState(ossimKeywordlist& kwl, const ossimString
    
    if(result)
    {
-      kwl.add(prefix, "FHDR",theFileTypeVersion);
-      kwl.add(prefix, "CLEVEL",theComplexityLevel);
-      kwl.add(prefix, "STYPE",theSystemType);
-      kwl.add(prefix, "OSTAID",theOriginatingStationId);
-      kwl.add(prefix, "FDT",theDateTime);
-      kwl.add(prefix, "FTITLE",theFileTitle);
-      kwl.add(prefix, "FSCLAS",theSecurityClassification);
-      kwl.add(prefix, "FSCOP",theCopyNumber);
-      kwl.add(prefix, "FSCOPYS",theNumberOfCopies);
-      kwl.add(prefix, "ENCRYP",theEncryption);
+      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);
diff --git a/src/ossim/support_data/ossimNitfGeoPositioningTag.cpp b/src/ossim/support_data/ossimNitfGeoPositioningTag.cpp
index ccd38f0..5a4b0ea 100644
--- a/src/ossim/support_data/ossimNitfGeoPositioningTag.cpp
+++ b/src/ossim/support_data/ossimNitfGeoPositioningTag.cpp
@@ -9,7 +9,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfGeoPositioningTag.cpp 14241 2009-04-07 19:59:23Z dburken $
+// $Id: ossimNitfGeoPositioningTag.cpp 22013 2012-12-19 17:37:20Z dburken $
 
 #include <ossim/support_data/ossimNitfGeoPositioningTag.h>
 #include <cstring>
@@ -20,7 +20,7 @@
 RTTI_DEF1(ossimNitfGeoPositioningTag, "ossimNitfGeoPositioningTag", ossimNitfRegisteredTag);
 
 ossimNitfGeoPositioningTag::ossimNitfGeoPositioningTag()
-      :ossimNitfRegisteredTag()
+   : ossimNitfRegisteredTag(std::string("GEOPSB"),  443)
 {
    clearFields();
 }
@@ -29,11 +29,6 @@ ossimNitfGeoPositioningTag::~ossimNitfGeoPositioningTag()
 {
 }
 
-ossimString ossimNitfGeoPositioningTag::getRegisterTagName()const
-{
-   return "GEOPSB";
-}
-
 void ossimNitfGeoPositioningTag::parseStream(std::istream& in)
 {
    clearFields();
@@ -72,11 +67,6 @@ void ossimNitfGeoPositioningTag::writeStream(std::ostream& out)
    out.write(theGridZoneNumber, 4);
 }
 
-ossim_uint32 ossimNitfGeoPositioningTag::getSizeInBytes()const
-{
-   return 443;
-}
-
 void ossimNitfGeoPositioningTag::clearFields()
 {
    memset(theType, ' ', 3);
@@ -126,13 +116,13 @@ std::ostream& ossimNitfGeoPositioningTag::print(
    std::ostream& out, const std::string& prefix) const
 {
    std::string pfx = prefix;
-   pfx += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
    
    out << setiosflags(std::ios::left)
        << pfx << std::setw(24) << "CETAG:"
-       << getRegisterTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getSizeInBytes() << "\n"
+       << 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"
diff --git a/src/ossim/support_data/ossimNitfHistoaTag.cpp b/src/ossim/support_data/ossimNitfHistoaTag.cpp
new file mode 100644
index 0000000..a5d4b72
--- /dev/null
+++ b/src/ossim/support_data/ossimNitfHistoaTag.cpp
@@ -0,0 +1,470 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description: HISTOA tag class definition.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimNitfHistoaTag.cpp 22013 2012-12-19 17:37:20Z dburken $
+
+#include <ossim/support_data/ossimNitfHistoaTag.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimString.h>
+#include <iomanip>
+
+ossimNitfHistoaProcessingEvent::ossimNitfHistoaProcessingEvent()
+{
+   clearFields();
+}
+
+ossim_uint32 ossimNitfHistoaProcessingEvent::getSizeInBytes()const
+{
+   ossim_uint32 sizeInBytes = (PDATE_SIZE + PSITE_SIZE + PAS_SIZE + NIPCOM_SIZE);
+
+   if ( (*m_nIpcom != '0') && m_comment.size() )
+   {
+      sizeInBytes += ( m_comment.size() * IPCOM_SIZE );
+   }
+
+   sizeInBytes += (IBPP_SIZE + IPVTYPE_SIZE + INBWC_SIZE + 
+                   DISP_FLAG_SIZE + ROT_FLAG_SIZE);
+
+   if(*m_rotFlag == '1')
+   {
+      sizeInBytes += ROT_ANGLE_SIZE;
+   }
+   
+   sizeInBytes += ASYM_FLAG_SIZE;
+   if(*m_asymFlag == '1')
+   {
+      sizeInBytes += (ZOOMROW_SIZE + ZOOMCOL_SIZE);
+   }
+   
+   sizeInBytes += ( PROJ_FLAG_SIZE + SHARP_FLAG_SIZE );
+   if(*m_sharpFlag == '1')
+   {
+      sizeInBytes += (SHARPFAM_SIZE + SHARPMEM_SIZE);
+   }
+
+   sizeInBytes += MAG_FLAG_SIZE;
+   if(*m_magFlag == '1')
+   {
+      sizeInBytes += MAG_LEVEL_SIZE;
+   }
+
+   sizeInBytes += DRA_FLAG_SIZE;
+   if(*m_draFlag == '1')
+   {
+      sizeInBytes += (DRA_MULT_SIZE + DRA_SUB_SIZE);
+   }
+
+   sizeInBytes += TTC_FLAG_SIZE;
+   if(*m_ttcFlag == '1')
+   {
+      sizeInBytes += (TTCFAM_SIZE + TTCMEM_SIZE);
+   }
+
+   sizeInBytes += DEVLUT_FLAG_SIZE + OBPP_SIZE + OPVTYPE_SIZE + OUTBWC_SIZE;
+
+   return sizeInBytes;
+}
+
+void ossimNitfHistoaProcessingEvent::parseStream(std::istream& in)
+{
+   clearFields();
+
+   in.read(m_pdate, PDATE_SIZE);
+   in.read(m_psite, PSITE_SIZE);
+   in.read(m_pas, PAS_SIZE);
+   in.read(m_nIpcom, NIPCOM_SIZE);
+   ossim_uint32 nIpcom = ossimString(m_nIpcom).toUInt32();
+   if(nIpcom < 10)
+   {
+      ossim_uint32 idx = 0;
+      for(;idx < nIpcom;++idx)
+      {
+         char tempBuf[IPCOM_SIZE+1];
+         in.read(tempBuf, IPCOM_SIZE);
+         tempBuf[IPCOM_SIZE] = '\0';
+      
+         // m_comment += std::string(tempBuf, tempBuf + 80);
+         
+         m_comment.push_back( std::string(tempBuf) );
+      }
+   }
+   in.read(m_ibpp, IBPP_SIZE);
+   in.read(m_ipvType, IPVTYPE_SIZE);
+   
+   in.read(m_inbwc, INBWC_SIZE);
+   in.read(m_dispFlag, DISP_FLAG_SIZE);
+   in.read(m_rotFlag, ROT_FLAG_SIZE);
+   if(*m_rotFlag =='1')
+   {
+      in.read(m_rotAngle, ROT_ANGLE_SIZE);
+   }
+
+   in.read(m_asymFlag, ASYM_FLAG_SIZE);
+   if(ossimString(m_asymFlag).toBool())
+   {
+      in.read(m_zoomRow, ZOOMROW_SIZE);
+      in.read(m_zoomCol, ZOOMCOL_SIZE);
+   }
+
+   in.read(m_projFlag, PROJ_FLAG_SIZE);   
+   in.read(m_sharpFlag, SHARP_FLAG_SIZE);
+   if(ossimString(m_sharpFlag).toBool())
+   {
+      in.read(m_sharpFam, SHARPFAM_SIZE);
+      in.read(m_sharpMem, SHARPMEM_SIZE);
+   }
+
+   in.read(m_magFlag, MAG_FLAG_SIZE);
+   if(ossimString(m_magFlag).toBool())
+   {
+      in.read(m_magLevel, MAG_LEVEL_SIZE);
+   }
+
+   in.read(m_draFlag, DRA_FLAG_SIZE);
+   if(ossimString(m_draFlag).toBool())
+   {
+      in.read(m_draMult, DRA_MULT_SIZE);
+      in.read(m_draSub, DRA_SUB_SIZE);
+   }
+
+   in.read(m_ttcFlag, TTC_FLAG_SIZE);
+   if(ossimString(m_ttcFlag).toBool())
+   {
+      in.read(m_ttcFam, TTCFAM_SIZE);
+      in.read(m_ttcMem, TTCMEM_SIZE);
+   }
+
+   in.read(m_devLutFlag, DEVLUT_FLAG_SIZE);
+   in.read(m_obpp, OBPP_SIZE);
+   in.read(m_opvType, OPVTYPE_SIZE);
+   in.read(m_outBwc, OUTBWC_SIZE);
+}
+
+void ossimNitfHistoaProcessingEvent::writeStream(std::ostream& out)
+{
+   out.write(m_pdate, PDATE_SIZE);
+   out.write(m_psite, PSITE_SIZE);
+   out.write(m_pas, PAS_SIZE);
+   out.write(m_nIpcom, NIPCOM_SIZE);
+   ossim_uint32 nIpcom = ossimString(m_nIpcom).toUInt32();
+   if( (nIpcom > 0) && (nIpcom < 10) )
+   {
+      for( ossim_uint32 i = 0; i < nIpcom; ++i )
+      {
+         // Should size check std::string or make set method that ensures 80 chars.
+         out.write( m_comment[i].data(), IPCOM_SIZE );
+      }
+   }
+   out.write(m_ibpp, IBPP_SIZE);
+   out.write(m_ipvType, IPVTYPE_SIZE);
+   
+   out.write(m_inbwc, INBWC_SIZE);
+   out.write(m_dispFlag, DISP_FLAG_SIZE);
+   out.write(m_rotFlag, ROT_FLAG_SIZE);
+   if(*m_rotFlag =='1')
+   {
+      out.write(m_rotAngle, ROT_ANGLE_SIZE);
+   }
+   out.write(m_asymFlag, ASYM_FLAG_SIZE);
+   if(*m_asymFlag == '1')
+   {
+      out.write(m_zoomRow, ZOOMROW_SIZE);
+      out.write(m_zoomCol, ZOOMCOL_SIZE);
+   }
+   out.write(m_projFlag, PROJ_FLAG_SIZE);
+   out.write(m_sharpFlag, SHARP_FLAG_SIZE);
+   if(*m_sharpFlag == '1')
+   {
+      out.write(m_sharpFam, SHARPFAM_SIZE);
+      out.write(m_sharpMem, SHARPMEM_SIZE);
+   }
+   out.write(m_magFlag, MAG_FLAG_SIZE);
+   if(*m_magFlag == '1')
+   {
+      out.write(m_magLevel, MAG_LEVEL_SIZE);
+   }
+   out.write(m_draFlag, DRA_FLAG_SIZE);
+   if(*m_draFlag == '1')
+   {
+      out.write(m_draMult, DRA_MULT_SIZE);
+      out.write(m_draSub, DRA_SUB_SIZE);
+   }
+   out.write(m_ttcFlag, TTC_FLAG_SIZE);
+   if(*m_ttcFlag == '1')
+   {
+      out.write(m_ttcFam, TTCFAM_SIZE);
+      out.write(m_ttcMem, TTCMEM_SIZE);
+   }
+   out.write(m_devLutFlag, DEVLUT_FLAG_SIZE);
+   out.write(m_obpp, OBPP_SIZE);
+   out.write(m_opvType, OPVTYPE_SIZE);
+   out.write(m_outBwc, OUTBWC_SIZE);
+}
+
+std::ostream& ossimNitfHistoaProcessingEvent::print(std::ostream& out,
+                                                    const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += ".";
+   
+   out << setiosflags(std::ios::left)
+   << pfx << std::setw(24) << "PDATE:"     << m_pdate << "\n"
+   << pfx << std::setw(24) << "PSITE:"  << m_psite << "\n"
+   << pfx << std::setw(24) << "PAS:"  << m_pas << "\n"
+   << pfx << std::setw(24) << "NIPCOM:"   << m_nIpcom << "\n";
+   ossim_uint32 nIpcom = ossimString(m_nIpcom).toUInt32();
+   if( ( nIpcom > 0 ) && ( nIpcom < 10 ) )
+   {
+      for( ossim_uint32 i = 0; i < nIpcom; ++i )
+      {
+         std::string s = "IPCOM";
+         
+         //---
+         // NOTE:
+         // Doing  s += ossimString::toString( i ).string() core dumping linux gcc version 4.7.0.
+         //---
+         std::string s2 = ossimString::toString( i ).string();
+         s += s2;
+         s += ":";
+         out << pfx << std::setw(24) << s.c_str();
+         out.write( m_comment[i].data(), IPCOM_SIZE );
+         out << "\n";
+      }
+   }
+   
+   out << setiosflags(std::ios::left)
+   << pfx << std::setw(24) << "IBPP:"     << m_ibpp << "\n"
+   << pfx << std::setw(24) << "IPVTYPE:"     << m_ipvType << "\n"
+   << pfx << std::setw(24) << "INBWC:"     << m_inbwc << "\n"
+   << pfx << std::setw(24) << "DISP_FLAG:"     << m_dispFlag << "\n"
+   << pfx << std::setw(24) << "ROT_FLAG:"     << m_rotFlag << "\n";
+   if(*m_rotFlag == '1')
+   {
+      out<< pfx << std::setw(24) << "ROT_ANGLE:" << m_rotAngle << "\n";
+   }
+
+   out<< pfx << std::setw(24) << "ASYM_FLAG:" << m_asymFlag << "\n";
+   
+   if(*m_asymFlag=='1')
+   {
+      out<< pfx << std::setw(24) << "ZOOMROW:" << m_zoomRow << "\n";
+      out<< pfx << std::setw(24) << "ZOOMCOL:" << m_zoomCol << "\n";
+   }
+   out<< pfx << std::setw(24) << "PROJ_FLAG:" << m_projFlag << "\n";
+   out<< pfx << std::setw(24) << "SHARP_FLAG:" << *m_sharpFlag << "\n";
+   if(*m_sharpFlag == '1')
+   {
+      out<< pfx << std::setw(24) << "SHARPFAM:" << m_sharpFam << "\n";
+      out<< pfx << std::setw(24) << "SHARPMEM:" << m_sharpMem << "\n";
+   }
+   out<< pfx << std::setw(24) << "MAG_FLAG:" << *m_magFlag << "\n";
+   if(*m_magFlag  == '1')
+   {
+      out<< pfx << std::setw(24) << "MAG_LEVEL:" << m_magLevel << "\n";
+   }
+   out<< pfx << std::setw(24) << "DRA_FLAG:" << *m_draFlag << "\n";
+   if(*m_draFlag=='1')
+   {
+      out<< pfx << std::setw(24) << "DRA_MULT:" << m_draMult << "\n";
+      out<< pfx << std::setw(24) << "DRA_SUB:" << m_draSub << "\n";
+   }
+   out<< pfx << std::setw(24) << "TTC_FLAG:" << *m_ttcFlag << "\n";
+   if(*m_ttcFlag == '1')
+   {
+      out<< pfx << std::setw(24) << "TTCFAM:" << m_ttcFam << "\n";
+      out<< pfx << std::setw(24) << "TTCMEM:" << m_ttcMem << "\n";
+   }
+   out<< pfx << std::setw(24) << "DEVLUT_FLAG:" << *m_devLutFlag << "\n";
+   out<< pfx << std::setw(24) << "OBPP:" << m_obpp << "\n";
+   out<< pfx << std::setw(24) << "OPVTYPE:" << m_opvType << "\n";
+   out<< pfx << std::setw(24) << "OUTBWC:" << m_outBwc << "\n";
+   
+   return out;
+}
+
+void ossimNitfHistoaProcessingEvent::clearFields()
+{
+   memset(m_pdate, ' ', PDATE_SIZE+1);
+   memset(m_psite, ' ', PSITE_SIZE+1);
+   memset(m_pas, ' ', PAS_SIZE+1);
+   memset(m_nIpcom, ' ', NIPCOM_SIZE+1);
+   memset(m_ibpp, ' ', IBPP_SIZE+1);
+   memset(m_ipvType, ' ', IPVTYPE_SIZE+1);
+   
+   memset(m_inbwc, ' ', INBWC_SIZE);
+   memset(m_dispFlag, '0', DISP_FLAG_SIZE);
+   memset(m_rotFlag, '0', DISP_FLAG_SIZE);
+   memset(m_rotAngle, '0', ROT_ANGLE_SIZE);
+   m_rotAngle[3]='.';
+   memset(m_projFlag, '0', PROJ_FLAG_SIZE);
+   memset(m_asymFlag, '0', ASYM_FLAG_SIZE);
+   memset(m_zoomRow, '0', ZOOMROW_SIZE);
+   m_zoomRow[2]='.';
+   memset(m_zoomCol, '0', ZOOMCOL_SIZE);
+   m_zoomCol[2]='.';
+   memset(m_sharpFlag, '0', SHARP_FLAG_SIZE);
+   memset(m_sharpFam, ' ', SHARPFAM_SIZE);
+   memset(m_sharpMem, ' ', SHARPMEM_SIZE);
+   memset(m_magFlag, '0', MAG_FLAG_SIZE);
+   memset(m_magLevel, ' ', MAG_LEVEL_SIZE);
+   memset(m_draFlag, '0', DRA_FLAG_SIZE);
+   memset(m_draMult, ' ', DRA_MULT_SIZE);
+   
+   memset(m_draSub, ' ', DRA_SUB_SIZE);
+   memset(m_ttcFlag, '0', TTC_FLAG_SIZE);
+   memset(m_ttcFam, ' ', TTCFAM_SIZE);
+   memset(m_ttcMem, ' ', TTCMEM_SIZE);
+   memset(m_obpp, ' ', OBPP_SIZE);
+   memset(m_opvType, ' ', OPVTYPE_SIZE);
+   memset(m_outBwc, ' ', OUTBWC_SIZE);
+   
+   m_pdate[PDATE_SIZE]     = '\0';
+   m_psite[PSITE_SIZE]     = '\0';
+   m_pas[PAS_SIZE]         = '\0';
+   m_nIpcom[NIPCOM_SIZE]   = '\0';
+   m_ibpp[IBPP_SIZE]       = '\0';
+   m_ipvType[IPVTYPE_SIZE] = '\0';
+   
+   m_comment.clear();
+
+   m_inbwc[INBWC_SIZE] = '\0';
+   m_dispFlag[DISP_FLAG_SIZE] = '\0';
+   m_rotFlag[ROT_FLAG_SIZE] = '\0';
+   m_rotAngle[ROT_ANGLE_SIZE] = '\0';
+   m_projFlag[PROJ_FLAG_SIZE] = '\0';
+   m_asymFlag[ASYM_FLAG_SIZE] = '\0';
+   m_zoomRow[ZOOMROW_SIZE] = '\0';
+   m_zoomCol[ZOOMCOL_SIZE] = '\0';
+   m_sharpFlag[SHARP_FLAG_SIZE] = '\0';
+   m_sharpFam[SHARPFAM_SIZE] = '\0';
+   m_sharpMem[SHARPMEM_SIZE] = '\0';
+   m_magFlag[MAG_FLAG_SIZE] = '\0';
+   m_magLevel[MAG_LEVEL_SIZE] = '\0';
+   m_draFlag[DRA_FLAG_SIZE] = '\0';
+   m_draMult[DRA_MULT_SIZE] = '\0';
+   m_draSub[DRA_SUB_SIZE] = '\0';
+   m_ttcFlag[TTC_FLAG_SIZE] = '\0';
+   m_ttcFam[TTCFAM_SIZE] = '\0';
+   m_ttcMem[TTCMEM_SIZE] = '\0';
+   m_obpp[OBPP_SIZE] = '\0';
+   m_opvType[OPVTYPE_SIZE] = '\0';
+   m_outBwc[OUTBWC_SIZE] = '\0';
+}
+
+ossimNitfHistoaTag::ossimNitfHistoaTag()
+   : ossimNitfRegisteredTag( std::string("HISTOA"), 0 )
+{
+}
+
+void ossimNitfHistoaTag::parseStream(std::istream& in)
+{
+   clearFields();
+
+   in.read(m_systype, SYSTYPE_SIZE);
+   in.read(m_pc, PC_SIZE);
+   in.read(m_pe, PE_SIZE);
+   in.read(m_remapFlag, REMAP_FLAG_SIZE);
+   in.read(m_lutid, LUTID_SIZE);
+   in.read(m_nEvents, NEVENTS_SIZE);
+
+   ossim_uint32 nEvents = ossimString(m_nEvents).toUInt32();
+   if(nEvents < 100)
+   {
+      for(ossim_uint32 idx = 0; idx < nEvents; ++idx)
+      {
+         ossimNitfHistoaProcessingEvent evt;
+         evt.parseStream(in);
+         m_eventList.push_back(evt);
+      }
+   }
+
+   // Set the tag length in base for the getTagLenth method.
+   setTagLength( getSizeInBytes() );
+}
+
+void ossimNitfHistoaTag::writeStream(std::ostream& out)
+{
+   out.write(m_systype, SYSTYPE_SIZE);
+   out.write(m_pc, PC_SIZE);
+   out.write(m_pe, PE_SIZE);
+   out.write(m_remapFlag, REMAP_FLAG_SIZE);
+   out.write(m_lutid, LUTID_SIZE);
+   out.write(m_nEvents, NEVENTS_SIZE);
+   ossim_uint32 idx = 0;
+   ossim_uint32 nEvents = ossimString(m_nEvents).toUInt32();
+   if(nEvents < 100)
+   {
+      for(;idx < nEvents; ++idx)
+      {
+         m_eventList[idx].writeStream(out);
+      }
+   }
+}
+
+ossim_uint32 ossimNitfHistoaTag::getSizeInBytes()const
+{
+   // Make this dynamic for constructed HISTOA tags instead of using theTagLength.
+   ossim_uint32 sizeInBytes = (SYSTYPE_SIZE + PC_SIZE + PE_SIZE + 
+                               REMAP_FLAG_SIZE + LUTID_SIZE + NEVENTS_SIZE);
+
+   for ( ossim_uint32 idx = 0; idx < m_eventList.size(); ++idx)
+   {
+      sizeInBytes += m_eventList[idx].getSizeInBytes();
+   }
+
+   return sizeInBytes;
+}
+
+void ossimNitfHistoaTag::clearFields()
+{
+   memset(m_systype,     ' ', SYSTYPE_SIZE);
+   memset(m_pc,     ' ', PC_SIZE);
+   memset(m_pe,     ' ', PE_SIZE);
+   memset(m_remapFlag,     ' ', REMAP_FLAG_SIZE);
+   memset(m_lutid,     '0', LUTID_SIZE);
+   memset(m_nEvents,     '0', NEVENTS_SIZE);
+
+   m_systype[SYSTYPE_SIZE] = '\0';
+   m_pc[PC_SIZE] = '\0';
+   m_pe[PE_SIZE] = '\0';
+   m_remapFlag[REMAP_FLAG_SIZE] = '\0';
+   m_lutid[LUTID_SIZE] = '\0';
+   m_nEvents[NEVENTS_SIZE] = '\0';
+   m_eventList.clear();
+
+   // Clear the tag length in base.
+   setTagLength(0);
+}
+
+std::ostream& ossimNitfHistoaTag::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) << "SYSTYPE:"     << m_systype << "\n"
+   << pfx << std::setw(24) << "PC:"  << m_pc << "\n"
+   << pfx << std::setw(24) << "PE:"  << m_pe << "\n"
+   << pfx << std::setw(24) << "REMAP_FLAG:"   << m_remapFlag << "\n"
+   << pfx << std::setw(24) << "LUTID:"     << m_lutid << "\n"
+   << pfx << std::setw(24) << "NEVENTS:"     << m_nEvents << "\n";
+   for ( ossim_uint32 idx = 0; idx < m_eventList.size(); ++idx )
+   {
+      m_eventList[idx].print(out, pfx+"EVENT"+ossimString::toString(idx));
+   }
+   
+   return out;
+}
+
diff --git a/src/ossim/support_data/ossimNitfIchipbTag.cpp b/src/ossim/support_data/ossimNitfIchipbTag.cpp
index a87d679..0281eb8 100644
--- a/src/ossim/support_data/ossimNitfIchipbTag.cpp
+++ b/src/ossim/support_data/ossimNitfIchipbTag.cpp
@@ -11,7 +11,7 @@
 // http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
 //
 //----------------------------------------------------------------------------
-// $Id: ossimNitfIchipbTag.cpp 15766 2009-10-20 12:37:09Z gpotts $
+// $Id: ossimNitfIchipbTag.cpp 22013 2012-12-19 17:37:20Z dburken $
 
 #include <cstring> /* for memcpy */
 #include <iomanip>
@@ -50,15 +50,11 @@ static const ossimString FI_COL_KW = "FI_COL";
 RTTI_DEF1(ossimNitfIchipbTag, "ossimNitfIchipbTag", ossimNitfRegisteredTag);
 
 ossimNitfIchipbTag::ossimNitfIchipbTag()
+   : ossimNitfRegisteredTag(std::string("ICHIPB"), 224)
 {
    clearFields();
 }
 
-ossimString ossimNitfIchipbTag::getRegisterTagName() const
-{
-   return ossimString("ICHIPB");
-}
-
 void ossimNitfIchipbTag::parseStream(std::istream& in)
 {
    clearFields();
@@ -113,11 +109,6 @@ void ossimNitfIchipbTag::writeStream(std::ostream& out)
    out.write(theFullImageCol, FI_COL_SIZE);
 }
 
-ossim_uint32 ossimNitfIchipbTag::getSizeInBytes()const
-{
-   return 224;
-}
-
 void ossimNitfIchipbTag::clearFields()
 {
    memset(theXfrmFlag,     '0', XFRM_FLAG_SIZE);
@@ -171,14 +162,14 @@ std::ostream& ossimNitfIchipbTag::print(std::ostream& out,
                                         const std::string& prefix) const
 {
    std::string pfx = prefix;
-   pfx += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
 
    out << setiosflags(std::ios::left)
        << pfx << std::setw(24) << "CETAG:"
-       << getRegisterTagName() << "\n"
+       << getTagName() << "\n"
        << pfx << std::setw(24) << "CEL:"
-       << getSizeInBytes() << "\n"
+       << 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"
diff --git a/src/ossim/support_data/ossimNitfImageHeaderV2_0.cpp b/src/ossim/support_data/ossimNitfImageHeaderV2_0.cpp
index fd6c2e3..f129cd7 100644
--- a/src/ossim/support_data/ossimNitfImageHeaderV2_0.cpp
+++ b/src/ossim/support_data/ossimNitfImageHeaderV2_0.cpp
@@ -9,7 +9,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfImageHeaderV2_0.cpp 18434 2010-11-17 19:23:11Z gpotts $
+// $Id: ossimNitfImageHeaderV2_0.cpp 21518 2012-08-22 21:15:56Z dburken $
 
 
 #include <iomanip>
@@ -221,7 +221,7 @@ void ossimNitfImageHeaderV2_0::parseStream(std::istream &in)
       if(theBlockMaskRecordLength>0)
       {
          ossim_uint32 totalNumber = 0;
-         if((theImageMode[0] == 'S'))
+         if(theImageMode[0] == 'S')
          {
             totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol()*getNumberOfBands();
          }
@@ -248,7 +248,7 @@ void ossimNitfImageHeaderV2_0::parseStream(std::istream &in)
           (thePadPixelMaskRecordLength == 0)))
       {
          ossim_uint32 totalNumber = 0;
-         if((theImageMode[0] == 'S'))
+         if(theImageMode[0] == 'S')
          {
             totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol()*getNumberOfBands();
          }
@@ -836,7 +836,7 @@ void ossimNitfImageHeaderV2_0::clearFields()
    memset(thePixelValueType, ' ', 3);
    memset(theRepresentation, ' ', 8);
    memset(theCategory, ' ', 8);
-   memset(theActualBitsPerPixelPerBand, ' ', 2);
+   memset(theActualBitsPerPixelPerBand, '0', 2);
    memset(theJustification, ' ', 1);
    memset(theCoordinateSystem, 'N', 1);
    memset(theGeographicLocation, ' ', 60);
@@ -850,7 +850,7 @@ void ossimNitfImageHeaderV2_0::clearFields()
    memset(theNumberOfBlocksPerCol, ' ', 4);
    memset(theNumberOfPixelsPerBlockHoriz, ' ', 4);
    memset(theNumberOfPixelsPerBlockVert, ' ', 4);
-   memset(theNumberOfBitsPerPixelPerBand, ' ', 2);
+   memset(theNumberOfBitsPerPixelPerBand, '0', 2);
    memset(theDisplayLevel, ' ', 3);
    memset(theAttachmentLevel, ' ', 3);
    memcpy(theImageLocation, "0000000000", 10);
diff --git a/src/ossim/support_data/ossimNitfImageHeaderV2_1.cpp b/src/ossim/support_data/ossimNitfImageHeaderV2_1.cpp
index 1ae7d80..7b18e11 100644
--- a/src/ossim/support_data/ossimNitfImageHeaderV2_1.cpp
+++ b/src/ossim/support_data/ossimNitfImageHeaderV2_1.cpp
@@ -9,7 +9,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfImageHeaderV2_1.cpp 18413 2010-11-11 19:56:22Z gpotts $
+// $Id: ossimNitfImageHeaderV2_1.cpp 21518 2012-08-22 21:15:56Z dburken $
 #include <sstream>
 #include <iomanip>
 #include <cstring> // for memset
@@ -236,7 +236,7 @@ void ossimNitfImageHeaderV2_1::parseStream(std::istream &in)
       if(theBlockMaskRecordLength>0)
       {
          ossim_uint32 totalNumber = 0;
-         if((theImageMode[0] == 'S'))
+         if(theImageMode[0] == 'S')
          {
              totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol()*getNumberOfBands();
          }
@@ -258,12 +258,11 @@ void ossimNitfImageHeaderV2_1::parseStream(std::istream &in)
          }
          delete [] blockRead;
       }
-      if((thePadPixelMaskRecordLength > 0)||
-         (( (getCompressionCode().upcase() == "M3"))&&
-          (thePadPixelMaskRecordLength == 0)))
+      if( (thePadPixelMaskRecordLength > 0) ||
+          ( (getCompressionCode().upcase() == "M3") && (thePadPixelMaskRecordLength == 0) ) )
       {
          ossim_uint32 totalNumber = 0;
-         if((theImageMode[0] == 'S'))
+         if(theImageMode[0] == 'S')
          {
             totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol()*getNumberOfBands();
          }
@@ -634,6 +633,91 @@ bool ossimNitfImageHeaderV2_1::saveState(ossimKeywordlist& kwl, const ossimStrin
    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;
@@ -835,7 +919,7 @@ void ossimNitfImageHeaderV2_1::clearFields()
    memset(thePixelValueType, ' ',3);
    memset(theRepresentation, ' ',8);
    memset(theCategory, ' ',8);
-   memset(theActualBitsPerPixelPerBand, ' ',2);
+   memset(theActualBitsPerPixelPerBand, '0',2);
    memset(theJustification, ' ',1);
    memset(theCoordinateSystem, ' ',1);
    memset(theGeographicLocation, ' ',60);
@@ -1102,6 +1186,10 @@ void ossimNitfImageHeaderV2_1::setImageMagnification(const ossimString& value)
 void ossimNitfImageHeaderV2_1::setProperty(ossimRefPtr<ossimProperty> property)
 {
    ossimString name = property->getName();
+
+   // Make case insensitive:
+   name.upcase();
+   
    std::ostringstream out;
    
    if(!property) return;
diff --git a/src/ossim/support_data/ossimNitfImageHeaderV2_X.cpp b/src/ossim/support_data/ossimNitfImageHeaderV2_X.cpp
index ea0108c..f820fcd 100644
--- a/src/ossim/support_data/ossimNitfImageHeaderV2_X.cpp
+++ b/src/ossim/support_data/ossimNitfImageHeaderV2_X.cpp
@@ -17,35 +17,48 @@
 static const ossimTrace traceDebug(
    ossimString("ossimNitfImageHeaderV2_X:debug"));
 
-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::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::IC_KW = "ic";
-const ossimString ossimNitfImageHeaderV2_X::COMRAT_KW = "comrat";
-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::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",
@@ -190,14 +203,22 @@ void ossimNitfImageHeaderV2_X::setBitsPerPixel(ossim_uint32 bitsPerPixel)
 {
    std::stringstream strm;
    strm << bitsPerPixel;
-   ossimNitfCommon::setField(theNumberOfBitsPerPixelPerBand, strm.str(), 2);
+   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);
+   ossimNitfCommon::setField(theActualBitsPerPixelPerBand,
+                             strm.str(),
+                             2,
+                             std::ios::right,
+                             '0');
 }
 
 void ossimNitfImageHeaderV2_X::setImageMode(char mode)
@@ -389,9 +410,68 @@ 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;
@@ -801,46 +881,45 @@ bool ossimNitfImageHeaderV2_X::saveState(ossimKeywordlist& kwl, const ossimStrin
 {
    bool result = ossimNitfImageHeader::saveState(kwl, prefix);
    
-   kwl.add(prefix, "IM", theType);
-   kwl.add(prefix, "IID1", theImageId);
-   kwl.add(prefix, "IDATIM", theDateTime);
-   kwl.add(prefix, "TGTID", theTargetId);
-   kwl.add(prefix, "IID2", theTitle);
-   kwl.add(prefix, "ISCLAS", theSecurityClassification);
-   kwl.add(prefix, "ENCRYP", theEncryption);
-   kwl.add(prefix, "ISORCE", theImageSource);
-   kwl.add(prefix, "NROWS", theSignificantRows);
-   kwl.add(prefix, "NCOLS", theSignificantCols);
-   kwl.add(prefix, "PVTYPE", thePixelValueType);
-   kwl.add(prefix, "IREP", theRepresentation);
-   kwl.add(prefix, "ABPP", theActualBitsPerPixelPerBand);
-   kwl.add(prefix, "ICAT", theCategory);
-   kwl.add(prefix, "PJUST", theJustification);
-   kwl.add(prefix, "ICORDS", theCoordinateSystem);
-   kwl.add(prefix, "NICOM", theNumberOfComments);
-   
-   kwl.add(prefix, "ICOM", ossimString(theImageComments));
-   kwl.add(prefix, "IGEOLO", theGeographicLocation);
-   kwl.add(prefix, "IC", theCompression);
-   kwl.add(prefix, "COMRAT", theCompressionRateCode);
-   kwl.add(prefix, "NBANDS", theNumberOfBands);
-   kwl.add(prefix, "ISYNC", theImageSyncCode);
-   kwl.add(prefix, "IMODE", theImageMode);
-   kwl.add(prefix, "NBPR", theNumberOfBlocksPerRow);
-   kwl.add(prefix, "NBPC", theNumberOfBlocksPerCol);
-   kwl.add(prefix, "NPPBH", theNumberOfPixelsPerBlockHoriz);
-   kwl.add(prefix, "NPPBV", theNumberOfPixelsPerBlockVert);
-   kwl.add(prefix, "NBPP", theNumberOfBitsPerPixelPerBand);
-   kwl.add(prefix, "IDLVL", theDisplayLevel);
-   kwl.add(prefix, "IALVL", theAttachmentLevel);
-   kwl.add(prefix, "ILOC", theImageLocation);
-   kwl.add(prefix, "IMAG", theImageMagnification);
-   kwl.add(prefix, "UDIDL", theUserDefinedImageDataLength);
-   kwl.add(prefix, "UDOFL", theUserDefinedOverflow);
-   kwl.add(prefix, "IXSHDL", theExtendedSubheaderDataLen);
-   kwl.add(prefix, "IXSOFL", theExtendedSubheaderOverflow);
-   kwl.add(prefix, "IMDATOFF", theBlockedImageDataOffset);
-   kwl.add(prefix, "BMRLNTH", theBlockMaskRecordLength);
+   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/src/ossim/support_data/ossimNitfJ2klraTag.cpp b/src/ossim/support_data/ossimNitfJ2klraTag.cpp
index 1d16d29..c6faaeb 100644
--- a/src/ossim/support_data/ossimNitfJ2klraTag.cpp
+++ b/src/ossim/support_data/ossimNitfJ2klraTag.cpp
@@ -27,16 +27,12 @@
 RTTI_DEF1(ossimNitfJ2klraTag, "ossimNitfJ2klraTag", ossimNitfRegisteredTag);
 
 ossimNitfJ2klraTag::ossimNitfJ2klraTag()
-   : m_layer(1)
+   : ossimNitfRegisteredTag(std::string("J2KLRA"), 0),
+     m_layer(1)
 {
    clearFields();
 }
 
-ossimString ossimNitfJ2klraTag::getRegisterTagName() const
-{
-   return ossimString("J2KLRA");
-}
-
 void ossimNitfJ2klraTag::parseStream(std::istream& in)
 {
    clearFields();
@@ -70,7 +66,10 @@ void ossimNitfJ2klraTag::parseStream(std::istream& in)
       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)
@@ -133,18 +132,21 @@ void ossimNitfJ2klraTag::clearFields()
    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 += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
    
    out << setiosflags(ios::left)
-       << pfx << std::setw(24) << "CETAG:"     << getRegisterTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"       << getSizeInBytes() << "\n"
+       << 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"
diff --git a/src/ossim/support_data/ossimNitfLocalCartographicTag.cpp b/src/ossim/support_data/ossimNitfLocalCartographicTag.cpp
index 467d42c..5ba8f89 100644
--- a/src/ossim/support_data/ossimNitfLocalCartographicTag.cpp
+++ b/src/ossim/support_data/ossimNitfLocalCartographicTag.cpp
@@ -1,5 +1,4 @@
 //*******************************************************************
-// Copyright (C) 2004 Intelligence Data Systems. 
 //
 // LICENSE: LGPL
 //
@@ -9,7 +8,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfLocalCartographicTag.cpp 9094 2006-06-13 19:12:40Z dburken $
+// $Id: ossimNitfLocalCartographicTag.cpp 22013 2012-12-19 17:37:20Z dburken $
 
 #include <sstream>
 #include <iostream>
@@ -19,6 +18,7 @@
 RTTI_DEF1(ossimNitfLocalCartographicTag, "ossimNitfLocalCartographicTag", ossimNitfRegisteredTag);
 
 ossimNitfLocalCartographicTag::ossimNitfLocalCartographicTag()
+   : ossimNitfRegisteredTag(std::string("MAPLOB"), 43)
 {
 }
 
@@ -26,11 +26,6 @@ ossimNitfLocalCartographicTag::~ossimNitfLocalCartographicTag()
 {
 }
 
-ossimString ossimNitfLocalCartographicTag::getRegisterTagName()const
-{
-   return "MAPLOB";
-}
-
 void ossimNitfLocalCartographicTag::parseStream(std::istream& in)
 {
    clearFields();
@@ -51,12 +46,6 @@ void ossimNitfLocalCartographicTag::writeStream(std::ostream& out)
    out.write(theNorthingReferenceOrigin, 15);
 }
 
-
-ossim_uint32 ossimNitfLocalCartographicTag::getSizeInBytes()const
-{
-   return 43;
-}
-
 void ossimNitfLocalCartographicTag::clearFields()
 {
    memset(theLengthUnits, ' ', 3);
diff --git a/src/ossim/support_data/ossimNitfLocalGeographicTag.cpp b/src/ossim/support_data/ossimNitfLocalGeographicTag.cpp
index 10ba1ef..c9135b9 100644
--- a/src/ossim/support_data/ossimNitfLocalGeographicTag.cpp
+++ b/src/ossim/support_data/ossimNitfLocalGeographicTag.cpp
@@ -9,7 +9,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfLocalGeographicTag.cpp 14713 2009-06-13 16:58:31Z dburken $
+// $Id: ossimNitfLocalGeographicTag.cpp 22013 2012-12-19 17:37:20Z dburken $
 #include <ossim/support_data/ossimNitfLocalGeographicTag.h>
 #include <iomanip>
 #include <sstream>
@@ -17,6 +17,7 @@
 RTTI_DEF1(ossimNitfLocalGeographicTag, "ossimNitfLocalGeographicTag", ossimNitfRegisteredTag);
 
 ossimNitfLocalGeographicTag::ossimNitfLocalGeographicTag()
+   : ossimNitfRegisteredTag(std::string("GEOLOB"), 48)
 {
    clearFields();
 }
@@ -25,11 +26,6 @@ ossimNitfLocalGeographicTag::~ossimNitfLocalGeographicTag()
 {
 }
 
-ossimString ossimNitfLocalGeographicTag::getRegisterTagName()const
-{
-   return "GEOLOB";
-}
-
 void ossimNitfLocalGeographicTag::parseStream(std::istream& in)
 {
    in.read(theLonDensity, 9);
@@ -46,11 +42,6 @@ void ossimNitfLocalGeographicTag::writeStream(std::ostream& out)
    out.write(theLatOrigin, 15);
 }
 
-ossim_uint32 ossimNitfLocalGeographicTag::getSizeInBytes()const
-{
-   return 48;
-}
-
 void ossimNitfLocalGeographicTag::clearFields()
 {
    memset(theLonDensity, ' ', 9);
diff --git a/src/ossim/support_data/ossimNitfMstgtaTag.cpp b/src/ossim/support_data/ossimNitfMstgtaTag.cpp
index 53732f9..445e6b0 100644
--- a/src/ossim/support_data/ossimNitfMstgtaTag.cpp
+++ b/src/ossim/support_data/ossimNitfMstgtaTag.cpp
@@ -25,7 +25,7 @@
 RTTI_DEF1(ossimNitfMstgtaTag, "ossimNitfMstgtaTag", ossimNitfRegisteredTag);
 
 ossimNitfMstgtaTag::ossimNitfMstgtaTag()
-   : ossimNitfRegisteredTag()
+   : ossimNitfRegisteredTag(std::string("MSTGTA"), 101)
 {
    clearFields();
 }
@@ -34,11 +34,6 @@ ossimNitfMstgtaTag::~ossimNitfMstgtaTag()
 {
 }
 
-ossimString ossimNitfMstgtaTag::getRegisterTagName() const
-{
-   return "MSTGTA";
-}
-
 void ossimNitfMstgtaTag::parseStream(std::istream& in)
 {
    clearFields();
@@ -75,11 +70,6 @@ void ossimNitfMstgtaTag::writeStream(std::ostream& out)
    out.write(theTgtLoc, TGT_LOC_SIZE);
 }
 
-ossim_uint32 ossimNitfMstgtaTag::getSizeInBytes()const
-{
-   return 101;
-}
-
 void ossimNitfMstgtaTag::clearFields()
 {
    // BCS-N's to '0's, BCS-A's to ' '(spaces)
@@ -119,13 +109,13 @@ std::ostream& ossimNitfMstgtaTag::print(
    std::ostream& out, const std::string& prefix) const
 {
    std::string pfx = prefix;
-   pfx += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
    
    out << setiosflags(std::ios::left)
        << pfx << std::setw(24) << "CETAG:"
-       << getRegisterTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getSizeInBytes() << "\n"
+       << 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"
diff --git a/src/ossim/support_data/ossimNitfPiaimcTag.cpp b/src/ossim/support_data/ossimNitfPiaimcTag.cpp
index 9a1037c..f2a10f9 100644
--- a/src/ossim/support_data/ossimNitfPiaimcTag.cpp
+++ b/src/ossim/support_data/ossimNitfPiaimcTag.cpp
@@ -15,7 +15,7 @@
 // http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
 //
 //----------------------------------------------------------------------------
-// $Id: ossimNitfPiaimcTag.cpp 14291 2009-04-13 22:40:32Z dburken $
+// $Id: ossimNitfPiaimcTag.cpp 22013 2012-12-19 17:37:20Z dburken $
 
 #include <cstring> /* for memcpy */
 #include <iostream>
@@ -51,15 +51,11 @@ RTTI_DEF1(ossimNitfPiaimcTag,
           ossimNitfRegisteredTag);
 
 ossimNitfPiaimcTag::ossimNitfPiaimcTag()
+   : ossimNitfRegisteredTag(std::string("PIAIMC"), 362)
 {
    clearFields();
 }
 
-ossimString ossimNitfPiaimcTag::getRegisterTagName() const
-{
-   return ossimString("PIAIMC");
-}
-
 void ossimNitfPiaimcTag::parseStream(std::istream& in)
 {
    clearFields();
@@ -108,11 +104,6 @@ void ossimNitfPiaimcTag::writeStream(std::ostream& out)
    out.write(theSattrack,   SATTRACK_SIZE);
 }
 
-ossim_uint32 ossimNitfPiaimcTag::getSizeInBytes()const
-{
-   return 362;
-}
-
 void ossimNitfPiaimcTag::clearFields()
 {
    memcpy(theCloudcvr, "999",   CLOUDCVR_SIZE);
@@ -160,12 +151,12 @@ std::ostream& ossimNitfPiaimcTag::print(std::ostream& out,
                                         const std::string& prefix) const
 {
    std::string pfx = prefix;
-   pfx += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
    
    out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:" << getRegisterTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getSizeInBytes() << "\n"
+       << 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"
diff --git a/src/ossim/support_data/ossimNitfProjectionParameterTag.cpp b/src/ossim/support_data/ossimNitfProjectionParameterTag.cpp
index 8f3048f..7831558 100644
--- a/src/ossim/support_data/ossimNitfProjectionParameterTag.cpp
+++ b/src/ossim/support_data/ossimNitfProjectionParameterTag.cpp
@@ -8,13 +8,13 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfProjectionParameterTag.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
+// $Id: ossimNitfProjectionParameterTag.cpp 22013 2012-12-19 17:37:20Z dburken $
 #include <ossim/support_data/ossimNitfProjectionParameterTag.h>
 #include <sstream>
 #include <iomanip>
 
 ossimNitfProjectionParameterTag::ossimNitfProjectionParameterTag()
-:ossimNitfRegisteredTag()
+   :ossimNitfRegisteredTag(std::string("PRJPSB"), 0 )
 {
    clearFields();
 }
@@ -23,11 +23,6 @@ ossimNitfProjectionParameterTag::~ossimNitfProjectionParameterTag()
 {
 }
 
-ossimString ossimNitfProjectionParameterTag::getRegisterTagName()const
-{
-   return "PRJPSB";
-}
-
 void ossimNitfProjectionParameterTag::parseStream(std::istream& in)
 {
    clearFields();
@@ -48,6 +43,9 @@ void ossimNitfProjectionParameterTag::parseStream(std::istream& in)
    }
    in.read(theFalseXOrigin, 15);
    in.read(theFalseYOrigin, 15);
+
+   // Set the base tag length.
+   setTagLength( getSizeInBytes() );
 }
 
 void ossimNitfProjectionParameterTag::writeStream(std::ostream& out)
@@ -87,7 +85,7 @@ std::ostream& ossimNitfProjectionParameterTag::print(
 
    out << setiosflags(std::ios::left)
        << pfx << std::setw(24) << "CETAG:" << getRegisterTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getSizeInBytes() << "\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";
@@ -122,6 +120,9 @@ void ossimNitfProjectionParameterTag::clearFields()
    theNumberOfParameters[1] = '\0';
    theFalseXOrigin[15] = '\0';
    theFalseYOrigin[15] = '\0';
+
+   // Set the base tag length.
+   setTagLength( 0 );
 }
 
 void ossimNitfProjectionParameterTag::clearParameters()
diff --git a/src/ossim/support_data/ossimNitfRegisteredTag.cpp b/src/ossim/support_data/ossimNitfRegisteredTag.cpp
index 0666959..c3ae575 100644
--- a/src/ossim/support_data/ossimNitfRegisteredTag.cpp
+++ b/src/ossim/support_data/ossimNitfRegisteredTag.cpp
@@ -9,7 +9,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfRegisteredTag.cpp 18413 2010-11-11 19:56:22Z gpotts $
+// $Id: ossimNitfRegisteredTag.cpp 22013 2012-12-19 17:37:20Z dburken $
 
 #include <iostream>
 #include <sstream>
@@ -20,14 +20,55 @@
 RTTI_DEF2(ossimNitfRegisteredTag, "ossimNitfRegisteredTag", ossimObject, ossimPropertyInterface)
 
 ossimNitfRegisteredTag::ossimNitfRegisteredTag()
-   : ossimObject(),
-     ossimPropertyInterface(),
-     theRegisteredTagName()
+   : 
+   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 */)
 {
 }
@@ -73,4 +114,3 @@ bool ossimNitfRegisteredTag::saveState(ossimKeywordlist& kwl, const ossimString&
    
    return result;
 }
-
diff --git a/src/ossim/support_data/ossimNitfRegisteredTagFactory.cpp b/src/ossim/support_data/ossimNitfRegisteredTagFactory.cpp
index 846b3af..bbe5cbd 100644
--- a/src/ossim/support_data/ossimNitfRegisteredTagFactory.cpp
+++ b/src/ossim/support_data/ossimNitfRegisteredTagFactory.cpp
@@ -9,7 +9,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfRegisteredTagFactory.cpp 18883 2011-02-09 15:20:25Z dburken $
+// $Id: ossimNitfRegisteredTagFactory.cpp 20689 2012-03-14 18:31:20Z gpotts $
 
 #include <ossim/support_data/ossimNitfRegisteredTagFactory.h>
 
@@ -34,7 +34,10 @@
 #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>
 
 RTTI_DEF1(ossimNitfRegisteredTagFactory, "ossimNitfRegisteredTagFactory", ossimNitfTagFactory);
 
@@ -60,6 +63,10 @@ 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";
 
 ossimNitfRegisteredTagFactory::ossimNitfRegisteredTagFactory()
 {
@@ -166,6 +173,21 @@ ossimRefPtr<ossimNitfRegisteredTag> ossimNitfRegisteredTagFactory::create(
    {
       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;
+   }
    return NULL;
 }
diff --git a/src/ossim/support_data/ossimNitfRpcATag.cpp b/src/ossim/support_data/ossimNitfRpcATag.cpp
index bd28da7..14626a1 100644
--- a/src/ossim/support_data/ossimNitfRpcATag.cpp
+++ b/src/ossim/support_data/ossimNitfRpcATag.cpp
@@ -1,5 +1,4 @@
 //*******************************************************************
-// Copyright (C) 2000 Intelligence Data Systems. 
 //
 // LICENSE: LGPL
 //
@@ -11,7 +10,7 @@
 // Rational Polynomial Coefficient extension.
 //
 //********************************************************************
-// $Id: ossimNitfRpcATag.cpp 9094 2006-06-13 19:12:40Z dburken $
+// $Id: ossimNitfRpcATag.cpp 22013 2012-12-19 17:37:20Z dburken $
 
 #include <ossim/support_data/ossimNitfRpcATag.h>
 
@@ -20,9 +19,6 @@ RTTI_DEF1(ossimNitfRpcATag, "ossimNitfRpcATag", ossimNitfRpcBase);
 ossimNitfRpcATag::ossimNitfRpcATag()
    : ossimNitfRpcBase()
 {
-}
-
-ossimString ossimNitfRpcATag::getRegisterTagName() const
-{
-   return ossimString("RPC00A");
+   // Set the tag name in base.
+   setTagName(std::string("RPC00A"));
 }
diff --git a/src/ossim/support_data/ossimNitfRpcBTag.cpp b/src/ossim/support_data/ossimNitfRpcBTag.cpp
index 0a31d67..1656db2 100644
--- a/src/ossim/support_data/ossimNitfRpcBTag.cpp
+++ b/src/ossim/support_data/ossimNitfRpcBTag.cpp
@@ -1,5 +1,4 @@
 //*******************************************************************
-// Copyright (C) 2000 Intelligence Data Systems. 
 //
 // LICENSE: LGPL
 //
@@ -9,7 +8,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfRpcBTag.cpp 9094 2006-06-13 19:12:40Z dburken $
+// $Id: ossimNitfRpcBTag.cpp 22013 2012-12-19 17:37:20Z dburken $
 
 #include <ossim/support_data/ossimNitfRpcBTag.h>
 
@@ -18,9 +17,6 @@ RTTI_DEF1(ossimNitfRpcBTag, "ossimNitfRpcBTag", ossimNitfRpcBase);
 ossimNitfRpcBTag::ossimNitfRpcBTag()
    : ossimNitfRpcBase()
 {
-}
-
-ossimString ossimNitfRpcBTag::getRegisterTagName() const
-{
-   return ossimString("RPC00B");
+   // Set the tag name in base.
+   setTagName(std::string("RPC00B"));
 }
diff --git a/src/ossim/support_data/ossimNitfRpcBase.cpp b/src/ossim/support_data/ossimNitfRpcBase.cpp
index 9699acf..587b026 100644
--- a/src/ossim/support_data/ossimNitfRpcBase.cpp
+++ b/src/ossim/support_data/ossimNitfRpcBase.cpp
@@ -10,7 +10,7 @@
 // Rational Polynomial Coefficient extension.
 //
 //********************************************************************
-// $Id: ossimNitfRpcBase.cpp 17206 2010-04-25 23:20:40Z dburken $
+// $Id: ossimNitfRpcBase.cpp 22013 2012-12-19 17:37:20Z dburken $
 
 #include <algorithm>
 #include <iostream>
@@ -44,7 +44,11 @@ RTTI_DEF1(ossimNitfRpcBase, "ossimNitfRpcBase", ossimNitfRegisteredTag);
 
 
 ossimNitfRpcBase::ossimNitfRpcBase()
+   : ossimNitfRegisteredTag()
 {
+   // Set the tag length in base.
+   setTagLength(1041);
+   
    clearFields();
 }
 
@@ -140,11 +144,6 @@ void ossimNitfRpcBase::writeStream(std::ostream& out)
    }
 }
 
-ossim_uint32 ossimNitfRpcBase::getSizeInBytes()const
-{
-   return 1041;
-}
-
 void ossimNitfRpcBase::clearFields()
 {
    theSuccess[0] = '1';
@@ -701,12 +700,12 @@ std::ostream& ossimNitfRpcBase::print(std::ostream& out,
                                       const std::string& prefix) const
 {
    std::string pfx = prefix;
-   pfx += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
 
    out << setiosflags(std::ios::left)
        << pfx << std::setw(24) << "CETAG:"
-       << getRegisterTagName() << "\n"
+       << getTagName() << "\n"
        << pfx << std::setw(24) << "CEL:"
        << getSizeInBytes() << "\n"
        << pfx << std::setw(24) << "SUCCESS:"
diff --git a/src/ossim/support_data/ossimNitfSensraTag.cpp b/src/ossim/support_data/ossimNitfSensraTag.cpp
index a617aad..489928f 100644
--- a/src/ossim/support_data/ossimNitfSensraTag.cpp
+++ b/src/ossim/support_data/ossimNitfSensraTag.cpp
@@ -9,7 +9,7 @@
 // Description: Nitf support class for SENSRA - Sensor parameters extension.
 // 
 //********************************************************************
-// $Id: ossimNitfSensraTag.cpp 14659 2009-06-05 17:37:39Z dburken $
+// $Id: ossimNitfSensraTag.cpp 22013 2012-12-19 17:37:20Z dburken $
 
 #include <istream>
 #include <iomanip>
@@ -19,6 +19,7 @@ RTTI_DEF1(ossimNitfSensraTag, "ossimNitfSensraTag", ossimNitfRegisteredTag);
 
 
 ossimNitfSensraTag::ossimNitfSensraTag()
+   : ossimNitfRegisteredTag(std::string("SENSRA"), 132)
 {
    clearFields();
 }
@@ -27,11 +28,6 @@ ossimNitfSensraTag::~ossimNitfSensraTag()
 {
 }
 
-ossimString ossimNitfSensraTag::getRegisterTagName()const
-{
-   return "SENSRA";
-}
-
 void ossimNitfSensraTag::parseStream(std::istream& in)
 {
    clearFields();
@@ -90,11 +86,6 @@ void ossimNitfSensraTag::writeStream(std::ostream& out)
    out.write(theSpotNum, SPOT_NUM_SIZE);
 }
 
-ossim_uint32 ossimNitfSensraTag::getSizeInBytes()const
-{
-   return 132;
-}
-
 void ossimNitfSensraTag::clearFields()
 {
    memset(theRefRow, ' ', REF_ROW_SIZE);
@@ -152,13 +143,13 @@ std::ostream& ossimNitfSensraTag::print(
    std::ostream& out, const std::string& prefix) const
 {
    std::string pfx = prefix;
-   pfx += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
    
    out << std::setiosflags(std::ios::left)
        << pfx << std::setw(24) << "CETAG:"
-       << getRegisterTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:" << getSizeInBytes() << "\n"
+       << 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"
diff --git a/src/ossim/support_data/ossimNitfStdidcTag.cpp b/src/ossim/support_data/ossimNitfStdidcTag.cpp
index 8d9e48a..6802bcf 100644
--- a/src/ossim/support_data/ossimNitfStdidcTag.cpp
+++ b/src/ossim/support_data/ossimNitfStdidcTag.cpp
@@ -11,7 +11,7 @@
 // See:  STDI-000_v2.1 Table 7-3 for detailed description.
 // 
 //********************************************************************
-// $Id: ossimNitfStdidcTag.cpp 14241 2009-04-07 19:59:23Z dburken $
+// $Id: ossimNitfStdidcTag.cpp 22013 2012-12-19 17:37:20Z dburken $
 
 #include <iostream>
 #include <iomanip>
@@ -38,6 +38,7 @@ static const ossimString LOCATION_KW = "LOCATION";
 
 
 ossimNitfStdidcTag::ossimNitfStdidcTag()
+   : ossimNitfRegisteredTag(std::string("STDIDC"), 89)
 {
    clearFields();
 }
@@ -46,11 +47,6 @@ ossimNitfStdidcTag::~ossimNitfStdidcTag()
 {
 }
 
-ossimString ossimNitfStdidcTag::getRegisterTagName()const
-{
-   return "STDIDC";
-}
-
 void ossimNitfStdidcTag::parseStream(std::istream& in)
 {
    clearFields();
@@ -97,11 +93,6 @@ void ossimNitfStdidcTag::writeStream(std::ostream& out)
    out.write(theField18,      FIELD18_SIZE);
 }
 
-ossim_uint32 ossimNitfStdidcTag::getSizeInBytes()const
-{
-   return 89;
-}
-
 void ossimNitfStdidcTag::clearFields()
 {
    memset(theAcqDate,      ' ', ACQ_DATE_SIZE);
@@ -345,13 +336,13 @@ std::ostream& ossimNitfStdidcTag::print(std::ostream& out,
                                         const std::string& prefix) const
 {
    std::string pfx = prefix;
-   pfx += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
    
    out << setiosflags(std::ios::left)
        << pfx << std::setw(24) << "CETAG:"
-       << getRegisterTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getSizeInBytes() << "\n"
+       << 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"
diff --git a/src/ossim/support_data/ossimNitfTagInformation.cpp b/src/ossim/support_data/ossimNitfTagInformation.cpp
index 0aa5cd4..d707216 100644
--- a/src/ossim/support_data/ossimNitfTagInformation.cpp
+++ b/src/ossim/support_data/ossimNitfTagInformation.cpp
@@ -6,12 +6,13 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfTagInformation.cpp 16997 2010-04-12 18:53:48Z dburken $
+// $Id: ossimNitfTagInformation.cpp 22013 2012-12-19 17:37:20Z dburken $
 
 #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 <ossim/base/ossimCommon.h>
 #include <sstream>
 #include <iomanip>
 #include <cstring> // for memset
@@ -35,20 +36,34 @@ void ossimNitfTagInformation::parseStream(std::istream &in)
       in.read(theTagLength, 5);
       theTagDataOffset = in.tellg();
 
-      theTagData = ossimNitfTagFactoryRegistry::instance()->
-         create(getTagName());
+      theTagData = ossimNitfTagFactoryRegistry::instance()->create(getTagName());
 
       if (theTagData.valid())
       {
          if (theTagData->getClassName() == "ossimNitfUnknownTag")
          {
-            ossimNitfUnknownTag* tag = PTR_CAST(ossimNitfUnknownTag,
-                                                theTagData.get());
-            if (tag)
-            {
-               tag->setTagName(getTagName());
-               tag->setTagLength(getTagLength());
-            }
+            // 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);
diff --git a/src/ossim/support_data/ossimNitfTextHeaderV2_1.cpp b/src/ossim/support_data/ossimNitfTextHeaderV2_1.cpp
index e01aeaf..8d16daa 100644
--- a/src/ossim/support_data/ossimNitfTextHeaderV2_1.cpp
+++ b/src/ossim/support_data/ossimNitfTextHeaderV2_1.cpp
@@ -173,7 +173,7 @@ void ossimNitfTextHeaderV2_1::clearFields()
    theTextDeclassificationType[2] = '\0';
    theTextDeclassificationDate[8] = '\0';
    theTextDeclassificationExemption[4] = '\0';
-   theTextSecurityDowngrade[2] = '\0';
+   theTextSecurityDowngrade[1] = '\0';
    theTextSecurityDowngradeDate[8] = '\0';;
    theTextClassificationText[43] = '\0';;			
    theTextClassificationAthorityType[1] = '\0';
diff --git a/src/ossim/support_data/ossimNitfUnknownTag.cpp b/src/ossim/support_data/ossimNitfUnknownTag.cpp
index e6a8a18..7061810 100644
--- a/src/ossim/support_data/ossimNitfUnknownTag.cpp
+++ b/src/ossim/support_data/ossimNitfUnknownTag.cpp
@@ -12,7 +12,7 @@
 // the tag factories.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimNitfUnknownTag.cpp 14241 2009-04-07 19:59:23Z dburken $
+// $Id: ossimNitfUnknownTag.cpp 22013 2012-12-19 17:37:20Z dburken $
 
 #include <ostream>
 #include <iomanip>
@@ -24,63 +24,50 @@
 RTTI_DEF1(ossimNitfUnknownTag, "ossimNitfUnknownTag", ossimNitfRegisteredTag);
 
 ossimNitfUnknownTag::ossimNitfUnknownTag()
-   : theTagName(),
-     theTagLength(0),
-     theTagData(NULL)
-   
+   : m_tagData(0)
 {
 }
 
 ossimNitfUnknownTag::~ossimNitfUnknownTag()
 {
-   if (theTagData)
+   if (m_tagData)
    {
-      delete [] theTagData;
-      theTagData = NULL;
+      delete [] m_tagData;
+      m_tagData = 0;
    }
 }
 
-ossimString ossimNitfUnknownTag::getRegisterTagName() const
-{
-   return theTagName;
-}
-
 void ossimNitfUnknownTag::parseStream(std::istream& in)
 {
-   if (theTagLength)
+   if (m_tagLength)
    {
-      if (theTagData)
+      if (m_tagData)
       {
-         delete [] theTagData;
+         delete [] m_tagData;
       }
 
-      theTagData = new char[theTagLength+1];
+      m_tagData = new char[m_tagLength+1];
       
-      in.read(theTagData, theTagLength);
+      in.read(m_tagData, m_tagLength);
 
-      theTagData[theTagLength] = '\0';
+      m_tagData[m_tagLength] = '\0';
    }
 }
 
 void ossimNitfUnknownTag::writeStream(std::ostream& out)
 {
-   if (theTagLength && theTagData)
+   if (m_tagLength && m_tagData)
    {
-      out.write(theTagData, theTagLength);
+      out.write(m_tagData, m_tagLength);
    }
 }
 
-ossim_uint32 ossimNitfUnknownTag::getSizeInBytes()const
-{
-   return theTagLength;
-}
-
 void ossimNitfUnknownTag::clearFields()
 {
-   if (theTagData)
+   if (m_tagData)
    {
-      delete [] theTagData;
-      theTagData = NULL;
+      delete [] m_tagData;
+      m_tagData = 0;
    }
 }
 
@@ -88,17 +75,17 @@ std::ostream& ossimNitfUnknownTag::print(std::ostream& out,
                                          const std::string& prefix) const
 {
    std::string pfx = prefix;
-   pfx += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
 
    out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:" << getRegisterTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getSizeInBytes() << "\n"
+       << pfx << std::setw(24) << "CETAG:" << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
        << pfx << std::setw(24) << "unformatted_tag_data: ";
    
    if (tagDataIsAscii())
    {
-      out << theTagData << "\n";
+      out << m_tagData << "\n";
    }
    else
    {
@@ -108,32 +95,26 @@ std::ostream& ossimNitfUnknownTag::print(std::ostream& out,
    return out;
 }
 
-void ossimNitfUnknownTag::setTagName(const ossimString& tagName)
-{
-   theTagName = tagName;
-}
-
-
 void ossimNitfUnknownTag::setTagLength(ossim_uint32 length)
 {
-   if (theTagData)
+   if (m_tagData)
    {
-      delete [] theTagData;
-      theTagData = NULL;
+      delete [] m_tagData;
+      m_tagData = 0;
    }
-   theTagLength = length;
+   m_tagLength = length;
 }
 
 bool ossimNitfUnknownTag::tagDataIsAscii() const
 {
-   if ( (theTagLength == 0) || !theTagData )
+   if ( (m_tagLength == 0) || !m_tagData )
    {
       return false;
    }
 
-   for (ossim_uint32 i = 0; i < theTagLength; ++i)
+   for (ossim_uint32 i = 0; i < m_tagLength; ++i)
    {
-      int c = theTagData[i];
+      int c = m_tagData[i];
       if (isascii(c) == false)
       {
          return false;
diff --git a/src/ossim/support_data/ossimNitfUse00aTag.cpp b/src/ossim/support_data/ossimNitfUse00aTag.cpp
index ae25ce2..cce55f9 100644
--- a/src/ossim/support_data/ossimNitfUse00aTag.cpp
+++ b/src/ossim/support_data/ossimNitfUse00aTag.cpp
@@ -10,7 +10,7 @@
 // Exploitation Usability extension.
 // 
 //********************************************************************
-// $Id: ossimNitfUse00aTag.cpp 14241 2009-04-07 19:59:23Z dburken $
+// $Id: ossimNitfUse00aTag.cpp 22013 2012-12-19 17:37:20Z dburken $
 
 #include <iostream>
 #include <iomanip>
@@ -34,6 +34,7 @@ static const ossimString SUNAZ_KW = "SUNAZ";
 
 
 ossimNitfUse00aTag::ossimNitfUse00aTag()
+   : ossimNitfRegisteredTag(std::string("USE00A"), 107) 
 {
    clearFields();
 }
@@ -42,11 +43,6 @@ ossimNitfUse00aTag::~ossimNitfUse00aTag()
 {
 }
 
-ossimString ossimNitfUse00aTag::getRegisterTagName()const
-{
-   return "USE00A";
-}
-
 void ossimNitfUse00aTag::parseStream(std::istream& in)
 {
    clearFields();
@@ -105,11 +101,6 @@ void ossimNitfUse00aTag::writeStream(std::ostream& out)
    out.write(theSunAz, SUN_AZ_SIZE);
 }
 
-ossim_uint32 ossimNitfUse00aTag::getSizeInBytes()const
-{
-   return 107;
-}
-
 void ossimNitfUse00aTag::clearFields()
 {
    memset(theAngleToNorth, ' ', ANGLE_TO_NORTH_SIZE);
@@ -448,12 +439,12 @@ std::ostream& ossimNitfUse00aTag::print(std::ostream& out,
                                         const std::string& prefix) const
 {
    std::string pfx = prefix;
-   pfx += getRegisterTagName();
+   pfx += getTagName();
    pfx += ".";
 
    out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:" << getRegisterTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getSizeInBytes() << "\n"
+       << 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"
diff --git a/src/ossim/support_data/ossimNitfVqCompressionHeader.cpp b/src/ossim/support_data/ossimNitfVqCompressionHeader.cpp
index 26220be..68f30c1 100644
--- a/src/ossim/support_data/ossimNitfVqCompressionHeader.cpp
+++ b/src/ossim/support_data/ossimNitfVqCompressionHeader.cpp
@@ -7,7 +7,7 @@
 // Description: Nitf support class
 // 
 //********************************************************************
-// $Id: ossimNitfVqCompressionHeader.cpp 18413 2010-11-11 19:56:22Z gpotts $
+// $Id: ossimNitfVqCompressionHeader.cpp 19682 2011-05-31 14:21:20Z dburken $
 
 #include <iostream>
 #include <sstream>
@@ -236,7 +236,7 @@ std::ostream& ossimNitfVqCompressionHeader::print(
       {
          std::string tblPfx = pfx;
          tblPfx += "table";
-         tblPfx += ossimString::toString(idx);
+         tblPfx += ossimString::toString(idx).string();
          tblPfx += ".";
 
          out << tblPfx << std::setw(24) << "id:"
@@ -277,7 +277,7 @@ bool ossimNitfVqCompressionHeader::saveState(ossimKeywordlist& kwl, const ossimS
          for(ossim_uint32 idx = 0; idx < theTable.size()-1; ++idx)
          {
             std::string tblPfx = "table";
-            tblPfx += ossimString::toString(idx);
+            tblPfx += ossimString::toString(idx).string();
             tblPfx += ".";
             
             out << tblPfx<< "id:"
diff --git a/src/ossim/support_data/ossimNmeaMessage.cpp b/src/ossim/support_data/ossimNmeaMessage.cpp
new file mode 100644
index 0000000..47d6d4b
--- /dev/null
+++ b/src/ossim/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 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/src/ossim/support_data/ossimNmeaMessageSequencer.cpp b/src/ossim/support_data/ossimNmeaMessageSequencer.cpp
new file mode 100644
index 0000000..1e989e0
--- /dev/null
+++ b/src/ossim/support_data/ossimNmeaMessageSequencer.cpp
@@ -0,0 +1,85 @@
+#include <ossim/support_data/ossimNmeaMessageSequencer.h>
+#include <fstream>
+#include <sstream>
+
+ossimNmeaMessageSequencer::ossimNmeaMessageSequencer()
+:m_inputStream(0)
+{
+   
+}
+
+ossimNmeaMessageSequencer::ossimNmeaMessageSequencer(const ossimFilename& file)
+:m_inputStream(0)
+{
+   initialize(file);
+}
+
+ossimNmeaMessageSequencer::ossimNmeaMessageSequencer(const std::string& str)
+:m_inputStream(0)
+{
+   initialize(str);
+}
+
+
+ossimNmeaMessageSequencer::~ossimNmeaMessageSequencer()
+{
+   destroy();
+}
+
+void ossimNmeaMessageSequencer::initialize(const ossimFilename& file)
+{
+   destroy();
+   m_inputStream = new std::ifstream(file.c_str());
+}
+
+void ossimNmeaMessageSequencer::initialize(const std::string& str)
+{
+   destroy();
+   m_inputStream = new std::istringstream(str);
+}
+
+void ossimNmeaMessageSequencer::destroy()
+{
+   if(m_inputStream)
+   {
+      delete m_inputStream;
+      m_inputStream = 0;
+   }
+}
+
+bool ossimNmeaMessageSequencer::next(ossimNmeaMessage& msg)
+{
+   bool result = false;
+   
+   try {
+      msg.parseMessage(*m_inputStream);
+      result = true;
+   } 
+   catch (...) 
+   {
+      result = false;
+   }
+   
+   return result;
+}
+
+bool ossimNmeaMessageSequencer::valid()const
+{
+   bool result = false;
+   
+   if(m_inputStream)
+   {
+      result = m_inputStream->good();
+   }
+   
+   return result;
+}
+
+void ossimNmeaMessageSequencer::reset()
+{
+   if(m_inputStream)
+   {
+      m_inputStream->clear();
+      m_inputStream->seekg(0);
+   }
+}
diff --git a/src/ossim/support_data/ossimPpjFrameSensorFile.cpp b/src/ossim/support_data/ossimPpjFrameSensorFile.cpp
new file mode 100644
index 0000000..f17c17e
--- /dev/null
+++ b/src/ossim/support_data/ossimPpjFrameSensorFile.cpp
@@ -0,0 +1,293 @@
+#include <ossim/support_data/ossimPpjFrameSensorFile.h>
+#include <ossim/base/ossimXmlNode.h>
+#include <fstream>
+#include <ossim/matrix/newmatio.h>
+#include <ossim/base/ossimEcefPoint.h>
+
+ossimPpjFrameSensorFile::ossimPpjFrameSensorFile()
+:m_radialDistortion(2),
+m_tangentialDistortion(2),
+m_averageProjectedHeight(0.0)
+{
+   reset();
+}
+
+const ossimString& ossimPpjFrameSensorFile::getBaseName()const
+{
+   return m_fileBaseName;
+}
+
+ossim_int64 ossimPpjFrameSensorFile::getImageNumber()const
+{
+   return m_imageNumber;
+}
+
+const ossimDpt& ossimPpjFrameSensorFile::getPrincipalPoint()const
+{
+   return m_principalPoint;
+}
+const ossimGpt& ossimPpjFrameSensorFile::getPlatformPosition()const
+{
+   return m_platformPosition;
+}
+
+const NEWMAT::Matrix& ossimPpjFrameSensorFile::getExtrinsic()const
+{
+   return m_extrinsicMatrix;
+}
+
+const NEWMAT::Matrix& ossimPpjFrameSensorFile::getIntrinsic()const
+{
+   return m_intrinsicMatrix;
+}
+
+const ossimDpt& ossimPpjFrameSensorFile::getImageSize()const
+{
+   return m_imageSize;
+}
+
+const ossimPpjFrameSensorFile::DoubleArrayType& ossimPpjFrameSensorFile::getRadialDistortion()const
+{
+   return m_radialDistortion;
+}
+
+const ossimPpjFrameSensorFile::DoubleArrayType& ossimPpjFrameSensorFile::getTangentialDistortion()const
+{
+   return m_tangentialDistortion;
+}
+
+double ossimPpjFrameSensorFile::getAverageProjectedHeight()const
+{
+   return m_averageProjectedHeight;
+}
+
+void ossimPpjFrameSensorFile::reset()
+{
+   m_ppjXml = 0;
+   m_principalPoint = ossimDpt(0.0,0.0);
+   m_platformPosition = ossimGpt(0.0,0.0);
+   m_fileBaseName = "";
+   m_imageNumber = -1;
+   m_radialDistortion[0] = 0.0;
+   m_radialDistortion[1] = 0.0;
+   m_tangentialDistortion[0] = 0.0;
+   m_tangentialDistortion[1] = 0.0;
+   m_intrinsicMatrix = NEWMAT::Matrix(3,3);
+   m_extrinsicMatrix = NEWMAT::Matrix(4,4);
+   std::fill(m_intrinsicMatrix.Store(), m_intrinsicMatrix.Store() + 9, 0.0);
+   std::fill(m_extrinsicMatrix.Store(), m_extrinsicMatrix.Store() + 16, 0.0);
+   m_extrinsicMatrix[0][0] = 1.0;
+   m_extrinsicMatrix[1][1] = 1.0;
+   m_extrinsicMatrix[2][2] = 1.0;
+   m_extrinsicMatrix[3][3] = 1.0;
+   m_imageSize.makeNan();
+   m_averageProjectedHeight = 0.0;
+   m_pointMapList.clear();
+}
+
+bool ossimPpjFrameSensorFile::readFile(const ossimFilename& file)
+{
+   bool result = false;
+   std::ifstream in(file.c_str(), std::ios::in|std::ios::binary);
+   if(in.good()&&readStream(in))
+   {
+
+      result = true;
+   }
+
+   return result;
+}
+
+bool  ossimPpjFrameSensorFile::readStream(std::istream& is)
+{
+   reset();
+   m_ppjXml = new ossimXmlDocument;
+   if(m_ppjXml->read(is))
+   {
+      ossimRefPtr<ossimXmlNode> root = m_ppjXml->getRoot();
+      if(root.valid()&&(root->getTag() == "pearlProjectionFile"))
+      {
+         ossimRefPtr<ossimXmlNode> image = root->findFirstNode("image");
+         if(image.valid())
+         {
+            ossimRefPtr<ossimXmlNode> sensorData     = image->findFirstNode("sensorData");
+            ossimRefPtr<ossimXmlNode> namingData     = image->findFirstNode("namingData");
+            ossimRefPtr<ossimXmlNode> projectionData = image->findFirstNode("projectionData");
+            if(namingData.valid())
+            {
+               ossimRefPtr<ossimXmlNode> fileBaseName = namingData->findFirstNode("fileBaseName");
+               ossimRefPtr<ossimXmlNode> imageNumber  = namingData->findFirstNode("imageNumber");
+               if(fileBaseName.valid())
+               {
+                  m_fileBaseName = fileBaseName->getText();
+               }
+               if(imageNumber.valid())
+               {
+                  m_imageNumber = imageNumber->getText().toInt64();
+               }
+            }
+            if(projectionData.valid())
+            {
+               const ossimXmlNode::ChildListType& childNodes = projectionData->getChildNodes();
+               ossim_uint32 nNodes = childNodes.size();
+               ossim_uint32 idx = 0;
+               ossim_uint32 averageHeightDivisor = 0;
+               for(idx = 0; idx < nNodes; ++idx)
+               {
+                  if(childNodes[idx]->getAttributeValue("type").downcase() == "basic")
+                  {
+                     ossimRefPtr<ossimXmlNode> pixelPointX = childNodes[idx]->findFirstNode("pixelPointX");
+                     ossimRefPtr<ossimXmlNode> pixelPointY = childNodes[idx]->findFirstNode("pixelPointY");
+                     ossimRefPtr<ossimXmlNode> ecefX = childNodes[idx]->findFirstNode("ecefX");
+                     ossimRefPtr<ossimXmlNode> ecefY = childNodes[idx]->findFirstNode("ecefY");
+                     ossimRefPtr<ossimXmlNode> ecefZ = childNodes[idx]->findFirstNode("ecefZ");
+
+                     if(pixelPointX.valid()&&pixelPointY.valid()&ecefX.valid()&&ecefY.valid()&&ecefZ.valid())
+                     {
+                        PointMap pointMap;
+                        pointMap.m_type       = BASIC_POINT_TYPE;
+                        pointMap.m_point      = ossimDpt3d(ecefX->getText().toDouble(), ecefY->getText().toDouble(), ecefZ->getText().toDouble());
+                        pointMap.m_pixelPoint = ossimDpt(pixelPointX->getText().toDouble(),pixelPointY->getText().toDouble());
+
+                        ossimGpt gpt(ossimEcefPoint(pointMap.m_point.x, pointMap.m_point.y, pointMap.m_point.z));
+                        m_averageProjectedHeight += gpt.height();
+                        ++averageHeightDivisor;
+                        m_pointMapList.push_back(pointMap);
+                     }
+                  }
+               }
+               if(averageHeightDivisor > 0) m_averageProjectedHeight /= static_cast<double>(averageHeightDivisor); 
+            }
+            if(sensorData.valid())
+            {
+               ossimRefPtr<ossimXmlNode> sensorSize      = sensorData->findFirstNode("sensorSize");
+               ossimRefPtr<ossimXmlNode> cameraIntrinsic = sensorData->findFirstNode("cameraIntrinsic");
+               ossimRefPtr<ossimXmlNode> cameraExtrinsic = sensorData->findFirstNode("cameraExtrinsic");
+               if(sensorSize.valid())
+               {
+                  ossimRefPtr<ossimXmlNode> width  = sensorSize->findFirstNode("SensorWidth");
+                  ossimRefPtr<ossimXmlNode> height = sensorSize->findFirstNode("SensorHeight");
+                  if(width.valid()&&height.valid())
+                  {
+                     m_imageSize.x = width->getText().toDouble();
+                     m_imageSize.y = height->getText().toDouble();
+                  }
+                  else
+                  {
+                     m_ppjXml = 0;
+                  }
+               }
+               else
+               {
+                  m_ppjXml = 0;
+               }
+               if(m_ppjXml.valid()&&cameraExtrinsic.valid())
+               {
+                  if(cameraExtrinsic->getChildNodes().size() == 4)
+                  {
+                     m_extrinsicMatrix = NEWMAT::Matrix(4,4);
+                     std::vector<ossimString> inRow1 = cameraExtrinsic->getChildNodes()[0]->getText().split(" ");
+                     std::vector<ossimString> inRow2 = cameraExtrinsic->getChildNodes()[1]->getText().split(" ");
+                     std::vector<ossimString> inRow3 = cameraExtrinsic->getChildNodes()[2]->getText().split(" ");
+                     std::vector<ossimString> inRow4 = cameraExtrinsic->getChildNodes()[3]->getText().split(" ");
+
+                     if((inRow1.size() ==4)&&
+                        (inRow2.size() ==4)&&
+                        (inRow3.size() ==4)&&
+                        (inRow4.size() ==4))
+                     {
+                        m_extrinsicMatrix << inRow1[0].toDouble() << inRow1[1].toDouble() << inRow1[2].toDouble() 
+                                          << inRow1[3].toDouble() 
+                                          << inRow2[0].toDouble() << inRow2[1].toDouble() << inRow2[2].toDouble() 
+                                          << inRow2[3].toDouble()
+                                          << inRow3[0].toDouble() << inRow3[1].toDouble() << inRow3[2].toDouble() 
+                                          << inRow3[3].toDouble()
+                                          << inRow4[0].toDouble() << inRow4[1].toDouble() << inRow4[2].toDouble() 
+                                          << inRow4[3].toDouble();
+                        NEWMAT::ColumnVector v(4);
+                        v[0] = v[1] = v[2] = 0.0;
+                        v[3] = 1.0;
+                        NEWMAT::ColumnVector result = m_extrinsicMatrix*v;
+                        m_platformPosition = ossimEcefPoint(result[0], result[1], result[2]);
+                        //m_platformPosition;
+                     }
+                     else
+                     {
+                        m_ppjXml = 0;
+                     }
+
+                  } // end  if(cameraExtrinsic->getChildNodes().size() == 4)
+                  else
+                  {
+                     m_ppjXml = 0;
+                  }
+
+                  if(m_ppjXml.valid())
+                  {
+                     if(cameraIntrinsic.valid())
+                     {
+                        m_intrinsicMatrix = NEWMAT::Matrix(3,3);
+                        std::vector<ossimString> inRow1 = cameraIntrinsic->getChildNodes()[0]->getText().split(" ");
+                        std::vector<ossimString> inRow2 = cameraIntrinsic->getChildNodes()[1]->getText().split(" ");
+                        std::vector<ossimString> inRow3 = cameraIntrinsic->getChildNodes()[2]->getText().split(" ");
+                        if((inRow1.size() ==3)&&
+                           (inRow2.size() ==3)&&
+                           (inRow3.size() ==3))
+                        {
+                           m_principalPoint.x = inRow1[2].toDouble();
+                           m_principalPoint.y = inRow2[2].toDouble();
+                           m_intrinsicMatrix << inRow1[0].toDouble() << inRow1[1].toDouble() << m_principalPoint.x
+                                             << inRow2[0].toDouble() << inRow2[1].toDouble() << m_principalPoint.y
+                                             << inRow3[0].toDouble() << inRow3[1].toDouble() << inRow3[2].toDouble(); 
+                        }
+                        else
+                        {
+                           m_ppjXml = 0;
+                        }
+                     } // end if(cameraIntrinsic .....)
+                     else
+                     {
+                        m_ppjXml = 0;
+                     }
+                  } // end if m_ppjXml ...
+               } // end if(m_ppjXml.valid()&&cameraExtrinsic.valid())
+               else
+               {
+                  m_ppjXml = 0;
+               }
+            }
+            else
+            {
+               m_ppjXml = 0;
+            }
+         }
+         else
+         {
+            m_ppjXml = 0;
+         }
+      }
+      else
+      {
+         m_ppjXml = 0;
+      }
+   }
+   else
+   {
+      m_ppjXml = 0;
+   }
+
+
+   return m_ppjXml.valid();
+}
+
+// Hidden from use...
+ossimPpjFrameSensorFile::ossimPpjFrameSensorFile(const ossimPpjFrameSensorFile& /* src */)
+{
+}
+
+ossimPpjFrameSensorFile& ossimPpjFrameSensorFile::operator=(
+   const ossimPpjFrameSensorFile& /* src */)
+{
+   return *this;
+}
+
diff --git a/src/ossim/support_data/ossimQuickbirdMetaData.cpp b/src/ossim/support_data/ossimQuickbirdMetaData.cpp
index 1e2556c..6a3934a 100644
--- a/src/ossim/support_data/ossimQuickbirdMetaData.cpp
+++ b/src/ossim/support_data/ossimQuickbirdMetaData.cpp
@@ -13,13 +13,13 @@
 //********************************************************************
 // $Id: ossimQuickbirdMetaData.cpp 14431 2009-04-30 21:58:33Z dburken $
 
-#include <cstdio>
-#include <iostream>
 #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);
@@ -41,10 +41,10 @@ ossimQuickbirdMetaData::ossimQuickbirdMetaData()
    theSatElevation(0.0),
    theTDILevel(0),
    theAbsCalFactors(),
-   theBandNameList("Unknown")
+   theBandNameList("Unknown"),
+   theImageSize()
 {
-   //theBitsPerPixel = ossim_0;
-   //theTDILevel = 0;
+   theImageSize.makeNan();
    theAbsCalFactors.clear();
 }
 
@@ -84,15 +84,15 @@ void ossimQuickbirdMetaData::clearFields()
    theBitsPerPixel = 0;
    theBandId = "Unknown";
    theSatID = "Unknown";
-   theTLCDate = "Unknown",
-      theSunAzimuth = 0.0;
+   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
@@ -100,7 +100,7 @@ std::ostream& ossimQuickbirdMetaData::print(std::ostream& out) const
 
    out << "\n----------------- Info on Quickbird Image -------------------"
        << "\n  "
-       << "\n  Generation date :   " << theGenerationDate
+       << "\n  Generation date:    " << theGenerationDate
        << "\n  Band Id:            " << theBandId
        << "\n  Bits per pixel:     " << theBitsPerPixel
        << "\n  Sat Id:             " << theSatID
@@ -109,7 +109,7 @@ std::ostream& ossimQuickbirdMetaData::print(std::ostream& out) const
        << "\n  Sun Elevation:      " << theSunElevation
        << "\n  Sat Azimuth:        " << theSatAzimuth
        << "\n  Sat Elevation:      " << theSatElevation
-       << "\n  Band name list   :  " << theBandNameList
+       << "\n  Band name list:     " << theBandNameList
        << "\n  TDI Level:          " << theTDILevel
        << "\n  abs Calibration Factors:   " 
        << std::endl;
@@ -117,9 +117,10 @@ std::ostream& ossimQuickbirdMetaData::print(std::ostream& out) const
    {
       out<<theAbsCalFactors[i] << "   ";
    }
-   out<< "\n"
-      << "\n---------------------------------------------------------"
-      << "\n  " << std::endl;
+   out << "\n  Image Size:         " << theImageSize
+       << "n"
+       << "\n---------------------------------------------------------"
+       << "\n  " << std::endl;
    return out;
 }
 
@@ -187,16 +188,16 @@ bool ossimQuickbirdMetaData::saveState(ossimKeywordlist& kwl,
 
    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);
-	   }
+      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
+   else if(!theAbsCalFactors.empty())
    {
       kwl.add(prefix,
               "absCalFactor",
@@ -294,22 +295,22 @@ bool ossimQuickbirdMetaData::loadState(const ossimKeywordlist& kwl,
    lookup = kwl.find(prefix, "band_name_list");
    if (lookup)
    {
-	   theBandNameList= 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();
-	      }
-	  }
+      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")
    {
@@ -386,6 +387,13 @@ bool ossimQuickbirdMetaData::parseMetaData(const ossimFilename& data_file)
       }
    }
 
+   // 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:
    //---
@@ -434,20 +442,20 @@ bool ossimQuickbirdMetaData::parseMetaData(const ossimFilename& data_file)
    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;
+      ++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(" ");
+      std::vector<ossimString> bandList;
+      bandList = theBandNameList.split(" ");
       theAbsCalFactors = std::vector<double>(bandList.size(), 1.);
       for(unsigned int j=0; j<bandList.size(); j++)
       {
@@ -532,28 +540,28 @@ bool ossimQuickbirdMetaData::parseMetaData(const ossimFilename& data_file)
    // TLCTime:
    //---
    if(getEndOfLine( strptr, ossimString("\n\tTLCTime ="), "%11c %s", temp))
-	   theTLCDate = ossimString(temp).before("\";");
+      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;
-		   }
+      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
@@ -575,9 +583,9 @@ bool ossimQuickbirdMetaData::parseMetaData(const ossimFilename& data_file)
       }
    }
 
-   //***
+   //---
    // Sun Elevation:
-   //***
+   //---
    if(getEndOfLine( filebuf, ossimString("\n\tsunEl ="), "%9c %s", temp))
         theSunElevation = ossimString(temp).before(";").toFloat64();
    else
@@ -599,11 +607,11 @@ bool ossimQuickbirdMetaData::parseMetaData(const ossimFilename& data_file)
       }
    }
 
-   //***
+   //---
    // Sun Azimuth:
-   //***
+   //---
    if(getEndOfLine( strptr, ossimString("\n\tsunAz ="), "%9c %s", temp))
-        theSunAzimuth = ossimString(temp).before(";").toFloat64();
+      theSunAzimuth = ossimString(temp).before(";").toFloat64();
    else
    {
       if(getEndOfLine( strptr, ossimString("\n\tmeanSunAz ="), "%13c %s", temp))
@@ -623,11 +631,11 @@ bool ossimQuickbirdMetaData::parseMetaData(const ossimFilename& data_file)
       }
    }
 
-   //***
+   //---
    // Sun Elevation:
-   //***
+   //---
    if(getEndOfLine( filebuf, ossimString("\n\tsunEl ="), "%9c %s", temp))
-        theSunElevation = ossimString(temp).before(";").toFloat64();
+      theSunElevation = ossimString(temp).before(";").toFloat64();
    else
    {
       if(getEndOfLine( filebuf, ossimString("\n\tmeanSunEl ="), "%13c %s", temp))
@@ -648,11 +656,11 @@ bool ossimQuickbirdMetaData::parseMetaData(const ossimFilename& data_file)
    }
 
 
-   //***
+   //---
    // Sat Azimuth:
-   //***
+   //---
    if(getEndOfLine( strptr, ossimString("\n\tsatAz ="), "%9c %s", temp))
-        theSatAzimuth = ossimString(temp).before(";").toFloat64();
+      theSatAzimuth = ossimString(temp).before(";").toFloat64();
    else
    {
       if(getEndOfLine( strptr, ossimString("\n\tmeanSatAz ="), "%13c %s", temp))
@@ -672,11 +680,11 @@ bool ossimQuickbirdMetaData::parseMetaData(const ossimFilename& data_file)
       }
    }
    
-   //***
+   //---
    // Sat Elevation:
-   //***
+   //---
    if(getEndOfLine( filebuf, ossimString("\n\tsatEl ="), "%9c %s", temp))
-        theSatElevation = ossimString(temp).before(";").toFloat64();
+      theSatElevation = ossimString(temp).before(";").toFloat64();
    else
    {
       if(getEndOfLine( filebuf, ossimString("\n\tmeanSatEl ="), "%13c %s", temp))
@@ -803,3 +811,8 @@ bool ossimQuickbirdMetaData::getEndOfLine( char * fileBuf,
     
    return true;
 }
+
+const ossimIpt& ossimQuickbirdMetaData::getImageSize() const
+{
+   return theImageSize;
+}
diff --git a/src/ossim/support_data/ossimQuickbirdTile.cpp b/src/ossim/support_data/ossimQuickbirdTile.cpp
index 47e50ef..563070a 100644
--- a/src/ossim/support_data/ossimQuickbirdTile.cpp
+++ b/src/ossim/support_data/ossimQuickbirdTile.cpp
@@ -1,16 +1,16 @@
 //*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
 //
 // License:  See top level LICENSE.txt file.
 //
 // Author:  Garrett Potts
 //
 //*******************************************************************
-//  $Id: ossimQuickbirdTile.cpp 9094 2006-06-13 19:12:40Z dburken $
+//  $Id: ossimQuickbirdTile.cpp 19682 2011-05-31 14:21:20Z dburken $
 
 #include <ossim/support_data/ossimQuickbirdTile.h>
 #include <ossim/base/ossimTrace.h>
 #include <ossim/base/ossimNotifyContext.h>
+#include <iostream>
 
 static const ossimTrace traceDebug(ossimString("ossimQuickbirdTile:debug"));
 
@@ -28,7 +28,7 @@ bool ossimQuickbirdTile::open(const ossimFilename tileFile)
          << std::endl;
    }
    
-   std::ifstream in(tileFile, std::ios::in|std::ios::binary);
+   std::ifstream in(tileFile.c_str(), std::ios::in|std::ios::binary);
 
    if(!in)
    {
@@ -53,8 +53,7 @@ bool ossimQuickbirdTile::open(const ossimFilename tileFile)
       ossimString line;
       ossimString name;
       ossimString value;
-      std::getline(in,
-                   line);
+      std::getline(in, line.string());
 
       while(!in.eof()&&!in.bad()&&(in.good())&&
             (theErrorStatus==ossimErrorCodes::OSSIM_OK))
@@ -136,7 +135,7 @@ bool ossimQuickbirdTile::open(const ossimFilename tileFile)
             }
             setErrorStatus();
          }
-         std::getline(in, line);
+         std::getline(in, line.string());
       }
    }
 
@@ -171,8 +170,7 @@ void ossimQuickbirdTile::parseTileGroup(std::istream& in,
          (name != "END_GROUP"))
    {
       line = "";
-      std::getline(in,
-                   line);
+      std::getline(in, line.string());
 
       parseNameValue(name, value, line);
       name = name.upcase();
@@ -351,8 +349,7 @@ void ossimQuickbirdTile::parseTileGroup(std::istream& in,
    
    if(theErrorStatus == ossimErrorCodes::OSSIM_OK)
    {
-      theTileMap.insert(make_pair(info.theFilename,
-                                  info));
+      theTileMap.insert(std::make_pair(info.theFilename.string(), info));
    }
 }
 
@@ -369,7 +366,8 @@ void ossimQuickbirdTile::parseNameValue(ossimString& name,
 bool ossimQuickbirdTile::getInfo(ossimQuickbirdTileInfo& result,
                                  const ossimFilename& filename)const
 {
-   std::map<ossimString,ossimQuickbirdTileInfo>::const_iterator iter =  theTileMap.find(filename);
+   std::map<std::string,ossimQuickbirdTileInfo>::const_iterator iter =
+      theTileMap.find(filename.string());
 
    if(iter != theTileMap.end())
    {
diff --git a/src/ossim/support_data/ossimRpfComponentIdLut.cpp b/src/ossim/support_data/ossimRpfComponentIdLut.cpp
new file mode 100644
index 0000000..2972fcf
--- /dev/null
+++ b/src/ossim/support_data/ossimRpfComponentIdLut.cpp
@@ -0,0 +1,152 @@
+//----------------------------------------------------------------------------
+//
+// File:     ossimRpfComponentIdLut.cpp
+// 
+// License:  See top level LICENSE.txt file.
+// 
+// Author:   David Burken
+//
+// Description:
+//
+//  Lookup table for mapping RPF component ID's to strings.
+//
+// See MIL-STD-2411-1, section 5.1.1 for detailed information.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimRpfComponentIdLut.cpp 20324 2011-12-06 22:25:23Z dburken $
+
+#include <ossim/support_data/ossimRpfComponentIdLut.h>
+
+ossimRpfComponentIdLut* ossimRpfComponentIdLut::theInstance = 0;
+
+ossimRpfComponentIdLut* ossimRpfComponentIdLut::instance()
+{
+   if (!theInstance)
+   {
+      theInstance = new ossimRpfComponentIdLut;
+   }
+   return theInstance;
+}
+
+ossimRpfComponentIdLut::ossimRpfComponentIdLut()
+{
+   //---
+   // Complete initialization of data member "theTable".
+   // Note:  ID's defined in ossimRpfConstants.h file.
+   //---
+   ossimKeyValueMap entry;
+   
+   entry.init(OSSIM_RPF_HEADER_COMPONENT,
+              "RPF_HEADER_COMPONENT");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_LOCATION_COMPONENT,
+              "RPF_LOCATION_COMPONENT");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_COVERAGE_SECTION_SUBHEADER,
+              "RPF_COVERAGE_SECTION_SUBHEADER");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_COMPRESSION_SECTION_SUBHEADER,
+              "RPF_COMPRESSION_SECTION_SUBHEADER");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_COMPRESION_LOOKUP_SUBSECTION,
+              "RPF_COMPRESION_LOOKUP_SUBSECTION");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_COMPRESION_PARAMETER_SUBSECTION,
+              "RPF_COMPRESION_PARAMETER_SUBSECTION");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_COLOR_GRAYSCALE_SECTION_SUBHEADER,
+              "RPF_COLOR_GRAYSCALE_SECTION_SUBHEADER");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_COLORMAP_SUBSECTION,
+              "RPF_COLORMAP_SUBSECTION");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_IMAGE_DESCRIPTION_SUBHEADER,
+              "RPF_IMAGE_DESCRIPTION_SUBHEADER");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_IMAGE_DISPLAY_PARAMETERS_SUBHEADER,
+              "RPF_IMAGE_DISPLAY_PARAMETERS_SUBHEADER");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_MASK_SUBSECTION,
+              "RPF_MASK_SUBSECTION");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_COLOR_CONVERTER_SUBSECTION,
+              "RPF_COLOR_CONVERTER_SUBSECTION");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_SPATIAL_DATA_SUBSECTION,
+              "RPF_SPATIAL_DATA_SUBSECTION");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_ATTRIBUTE_SECTION_SUBHEADER,
+              "RPF_ATTRIBUTE_SECTION_SUBHEADER");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_ATTRIBUTE_SUBSECTION,
+              "RPF_ATTRIBUTE_SUBSECTION");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_EXPLICIT_AREAL_COVERAGE_TABLE,
+              "RPF_EXPLICIT_AREAL_COVERAGE_TABLE");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_RELATED_IMAGES_SECTION_SUBHEADER,
+              "RPF_RELATED_IMAGES_SECTION_SUBHEADER");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_RELATED_IMAGES_SUBSECTION,
+              "RPF_RELATED_IMAGES_SUBSECTION");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_REPLACE_UPDATE_SECTION_SUBHEADER,
+              "RPF_REPLACE_UPDATE_SECTION_SUBHEADER");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_REPLACE_UPDATE_TABLE,
+              "RPF_REPLACE_UPDATE_TABLE");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_BOUNDARY_RECT_SECTION_SUBHEADER,
+              "RPF_BOUNDARY_RECT_SECTION_SUBHEADER");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_BOUNDARY_RECT_TABLE,
+              "RPF_BOUNDARY_RECT_TABLE");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_FRAME_FILE_INDEX_SECTION_SUBHEADER,
+              "RPF_FRAME_FILE_INDEX_SECTION_SUBHEADER");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_FRAME_FILE_INDEX_SUBSECTION,
+              "RPF_FRAME_FILE_INDEX_SUBSECTION");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_COLOR_TABLE_INDEX_SECTION_SUBHEADER,
+              "RPF_COLOR_TABLE_INDEX_SECTION_SUBHEADER");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_RPF_COLOR_TABLE_INDEX_RECORD,
+              "RPF_COLOR_TABLE_INDEX_RECORD");
+   theTable.push_back(entry);
+}
+
+ossimRpfComponentIdLut::~ossimRpfComponentIdLut()
+{
+   theInstance = 0;
+}
+
+ossimKeyword ossimRpfComponentIdLut::getKeyword() const
+{
+   return ossimKeyword("rpf_component_id", "");
+}
diff --git a/src/ossim/support_data/ossimRpfFrame.cpp b/src/ossim/support_data/ossimRpfFrame.cpp
index a2e93ab..2dd0a4f 100644
--- a/src/ossim/support_data/ossimRpfFrame.cpp
+++ b/src/ossim/support_data/ossimRpfFrame.cpp
@@ -10,10 +10,7 @@
 //              rpf file.
 //
 //********************************************************************
-// $Id: ossimRpfFrame.cpp 17206 2010-04-25 23:20:40Z dburken $
-
-#include <istream>
-#include <ostream>
+// $Id: ossimRpfFrame.cpp 20324 2011-12-06 22:25:23Z dburken $
 
 #include <ossim/support_data/ossimRpfFrame.h>
 #include <ossim/support_data/ossimRpfHeader.h>
@@ -33,17 +30,20 @@
 #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)
+std::ostream& operator <<(std::ostream& out, const ossimRpfFrame& data)
 {
    data.print(out);
    
@@ -61,7 +61,10 @@ ossimRpfFrame::ossimRpfFrame()
     theCompressionSection(0),
     theColorGrayscaleSubheader(0),
     theColorConverterSubsection(0),
-    theNitfFile(0)
+    theNitfFile(0),
+    theSubframeMaskTable(0),
+    theSubframeTransparencyMaskTable(0),
+    theReplaceUpdateTable(0)
 {
 }
 
@@ -70,8 +73,7 @@ ossimRpfFrame::~ossimRpfFrame()
    deleteAll();
 }
 
-std::ostream& ossimRpfFrame::print(std::ostream& out,
-                                   const std::string& prefix) const
+std::ostream& ossimRpfFrame::print(std::ostream& out, const std::string& prefix) const
 {
    if (traceDebug())
    {
@@ -85,6 +87,11 @@ std::ostream& ossimRpfFrame::print(std::ostream& out,
 
    out << prefix << "filename: " << theFilename << "\n";
 
+   if ( theReplaceUpdateTable.valid() )
+   {
+      theReplaceUpdateTable->print(out, prefix);
+   }
+
    if (traceDebug())
    {
       if(theCoverage)
@@ -197,6 +204,8 @@ std::ostream& ossimRpfFrame::print(std::ostream& out,
             }
          }
       }
+
+
       
       out << "end_rpf_frame_print:\n";
       
@@ -264,6 +273,12 @@ ossimErrorCode ossimRpfFrame::parseFile(const ossimFilename& filename,
       {
          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))
@@ -1039,3 +1054,68 @@ ossimErrorCode ossimRpfFrame::populateMasks(istream& in)
    
    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/ossim/support_data/ossimRpfFrameFileReader.cpp b/src/ossim/support_data/ossimRpfFrameFileReader.cpp
index 328e37e..390eef2 100644
--- a/src/ossim/support_data/ossimRpfFrameFileReader.cpp
+++ b/src/ossim/support_data/ossimRpfFrameFileReader.cpp
@@ -1,5 +1,4 @@
 //*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
 //
 // LICENSE:  See top level LICENSE.txt file.
 //
@@ -8,16 +7,15 @@
 // Description: Rpf support class
 // 
 //********************************************************************
-// $Id: ossimRpfFrameFileReader.cpp 16997 2010-04-12 18:53:48Z dburken $
-
-#include <fstream>
-#include <ostream>
+// $Id: ossimRpfFrameFileReader.cpp 19682 2011-05-31 14:21:20Z dburken $
 
 #include <ossim/support_data/ossimRpfFrameFileReader.h>
 #include <ossim/support_data/ossimRpfHeader.h>
 #include <ossim/support_data/ossimNitfFile.h>
 #include <ossim/support_data/ossimNitfTagInformation.h>
 #include <ossim/support_data/ossimNitfFileHeader.h>
+#include <fstream>
+#include <ostream>
 
 std::ostream& operator<<(std::ostream& out, const ossimRpfFrameFileReader& data)
 {
@@ -37,7 +35,7 @@ ossimRpfFrameFileReader::~ossimRpfFrameFileReader()
 
 ossimErrorCode ossimRpfFrameFileReader::parseFile(const ossimFilename& fileName)
 {
-   std::ifstream in(fileName, ios::in | ios::binary);
+   std::ifstream in(fileName.c_str(), ios::in | ios::binary);
    ossimRefPtr<ossimNitfFile> nitfFile = new ossimNitfFile;
 
    if(!in)
diff --git a/src/ossim/support_data/ossimRpfHeader.cpp b/src/ossim/support_data/ossimRpfHeader.cpp
index ab052f5..191e6e1 100644
--- a/src/ossim/support_data/ossimRpfHeader.cpp
+++ b/src/ossim/support_data/ossimRpfHeader.cpp
@@ -9,7 +9,7 @@
 // Description: This class extends the stl's string class.
 //
 //********************************************************************
-// $Id: ossimRpfHeader.cpp 17004 2010-04-13 00:49:30Z gpotts $
+// $Id: ossimRpfHeader.cpp 22013 2012-12-19 17:37:20Z dburken $
 
 #include <cstring>
 #include <iostream>
@@ -54,6 +54,7 @@ static const ossimString SECURITY_RELEASE_MARKING_KW = "SecurityReleaseMarking";
 
 ossimRpfHeader::ossimRpfHeader()
    :
+   ossimNitfRegisteredTag(std::string("RPFHDR"), 48),
    m_littleBigEndianIndicator(0x00),
    m_headerSectionLength(48),
    m_fileName(),
@@ -83,6 +84,7 @@ ossimRpfHeader::ossimRpfHeader()
 
 ossimRpfHeader::ossimRpfHeader(const ossimRpfHeader& obj)
    :
+   ossimNitfRegisteredTag(std::string("RPFHDR"), 48),
    m_littleBigEndianIndicator(obj.m_littleBigEndianIndicator),
    m_headerSectionLength(obj.m_headerSectionLength),
    m_fileName(),
@@ -132,11 +134,6 @@ ossimRpfHeader::~ossimRpfHeader()
    }
 }
 
-ossimString ossimRpfHeader::getRegisterTagName()const
-{
-   return ossimString("RPFHDR");
-}
-
 void ossimRpfHeader::parseStream(std::istream& in)
 {
    if(in)
@@ -265,11 +262,6 @@ std::ostream& ossimRpfHeader::print(std::ostream& out, const std::string& prefix
    return out;
 }
 
-ossim_uint32 ossimRpfHeader::getSizeInBytes()const
-{
-   return 48;
-}
-
 ossimByteOrder ossimRpfHeader::getByteOrder()const
 {
    return ( (m_littleBigEndianIndicator==0x00) ? OSSIM_BIG_ENDIAN : OSSIM_LITTLE_ENDIAN);
diff --git a/src/ossim/support_data/ossimRpfLocationSection.cpp b/src/ossim/support_data/ossimRpfLocationSection.cpp
index 5a611db..3b89862 100644
--- a/src/ossim/support_data/ossimRpfLocationSection.cpp
+++ b/src/ossim/support_data/ossimRpfLocationSection.cpp
@@ -9,17 +9,17 @@
 // Description: Rpf support class
 //
 //********************************************************************
-// $Id: ossimRpfLocationSection.cpp 16997 2010-04-12 18:53:48Z dburken $
-
-#include <istream>
-#include <ostream>
-#include <iterator>
+// $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");
 
@@ -60,6 +60,8 @@ std::ostream& ossimRpfComponentLocationRecord::print(
 {
    out << prefix << "ComponentId:             "
        << m_componentId << "\n"
+       << prefix << "ComponentIdString:       "
+       << ossimRpfComponentIdLut::instance()->getEntryString(m_componentId) << "\n"
        << prefix << "ComponentLength:         "
        << m_componentLength   << "\n"
        << prefix << "ComponentLocation:       "
diff --git a/src/ossim/support_data/ossimRpfReplaceUpdateRecord.cpp b/src/ossim/support_data/ossimRpfReplaceUpdateRecord.cpp
new file mode 100644
index 0000000..cbcd2c9
--- /dev/null
+++ b/src/ossim/support_data/ossimRpfReplaceUpdateRecord.cpp
@@ -0,0 +1,135 @@
+//----------------------------------------------------------------------------
+//
+// File:     ossimRpfReplaceUpdateRecord.cpp
+// 
+// License:  See top level LICENSE.txt file.
+// 
+// Author:   David Burken
+//
+// Description:
+//
+// RPF replace/update section subheader record.
+//
+// See MIL-STD-2411 for detailed information.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimRpfReplaceUpdateRecord.cpp 20324 2011-12-06 22:25:23Z dburken $
+
+#include <ossim/support_data/ossimRpfReplaceUpdateRecord.h>
+#include <ossim/support_data/ossimNitfCommon.h>
+#include <cstring> /* for memset, memcpy */
+#include <istream>
+#include <ostream>
+
+std::ostream& operator <<(std::ostream& out, const ossimRpfReplaceUpdateRecord& data)
+{
+   return data.print(out);
+}
+
+ossimRpfReplaceUpdateRecord::ossimRpfReplaceUpdateRecord()
+   :
+   m_updateStatus(0)
+{
+   clearFields();
+}
+
+ossimRpfReplaceUpdateRecord::ossimRpfReplaceUpdateRecord(const ossimRpfReplaceUpdateRecord& obj)
+   :
+   m_updateStatus(obj.m_updateStatus)
+{
+   memcpy(m_newFile, obj.m_newFile, 13);
+   memcpy(m_oldFile, obj.m_oldFile, 13);
+}
+
+const ossimRpfReplaceUpdateRecord& ossimRpfReplaceUpdateRecord::operator=(
+   const ossimRpfReplaceUpdateRecord& rhs)
+{
+   if ( this != &rhs )
+   {
+      memcpy(m_newFile, rhs.m_newFile, 13);
+      memcpy(m_oldFile, rhs.m_oldFile, 13);
+      m_updateStatus = rhs.m_updateStatus;      
+   }
+   return *this;
+}
+
+ossimErrorCode ossimRpfReplaceUpdateRecord::parseStream( std::istream& in )
+{
+   ossimErrorCode status = ossimErrorCodes::OSSIM_OK;
+   if( in.good() )
+   {
+      clearFields();
+      in.read((char*)&m_newFile, 12);
+      in.read((char*)&m_oldFile, 12);
+      in.read((char*)&m_updateStatus, 1);
+   }
+
+   if ( in.fail() )
+   {
+      status = ossimErrorCodes::OSSIM_ERROR;
+   }
+   
+   return status;
+}
+
+void ossimRpfReplaceUpdateRecord::writeStream(std::ostream& out)
+{
+   out.write((char*)&m_newFile, 12);
+   out.write((char*)&m_oldFile, 12);
+   out.write((char*)&m_updateStatus, 1);
+}
+
+std::ostream& ossimRpfReplaceUpdateRecord::print(std::ostream& out,
+                                                 const std::string& prefix,
+                                                 ossim_uint32 recordNumber)const
+{
+   std::string pfx = prefix;
+   pfx += "replace_update_record";
+   pfx += ossimString::toString(recordNumber).string();
+   pfx += ".";
+   out << pfx << "new_file: "   << m_newFile << "\n"
+       << pfx << "old_file: " << m_oldFile << "\n"
+       << pfx << "update_status: " << int(m_updateStatus)
+       << std::endl;
+   return out;
+}
+
+void ossimRpfReplaceUpdateRecord::getNewFilename(std::string& file) const
+{
+   file = m_newFile;
+}
+
+void ossimRpfReplaceUpdateRecord::getOldFilename(std::string& file) const
+{
+   file = m_oldFile;
+}
+
+ossim_uint8 ossimRpfReplaceUpdateRecord::getUpdateStatus() const
+{
+   return m_updateStatus;
+}
+
+void ossimRpfReplaceUpdateRecord::setNewFilename(const std::string& file)
+{
+   ossimNitfCommon::setField( m_newFile, ossimString(file), 12 );
+}
+
+void ossimRpfReplaceUpdateRecord::setOldFilename(const std::string& file)
+{
+   ossimNitfCommon::setField( m_oldFile, ossimString(file), 12 );
+}
+
+void ossimRpfReplaceUpdateRecord::setUpdateStatus(ossim_uint8 status)
+{
+   m_updateStatus = status;
+}
+
+void ossimRpfReplaceUpdateRecord::clearFields()
+{
+   memset(m_newFile, ' ', 12);
+   memset(m_oldFile, ' ', 12);   
+   m_updateStatus = 0;
+
+   m_newFile[12] = '\0';
+   m_oldFile[12] = '\0';
+}
diff --git a/src/ossim/support_data/ossimRpfReplaceUpdateSectionSubheader.cpp b/src/ossim/support_data/ossimRpfReplaceUpdateSectionSubheader.cpp
new file mode 100644
index 0000000..559e32b
--- /dev/null
+++ b/src/ossim/support_data/ossimRpfReplaceUpdateSectionSubheader.cpp
@@ -0,0 +1,163 @@
+//----------------------------------------------------------------------------
+//
+// File:     ossimRpfReplaceUpdateSectionSubheader.cpp
+// 
+// License:  See top level LICENSE.txt file.
+// 
+// Author:   David Burken
+//
+// Description:
+//
+// RPF replace/update section subheader record.
+//
+// See MIL-STD-2411 for detailed information.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimRpfReplaceUpdateSectionSubheader.cpp 20324 2011-12-06 22:25:23Z dburken $
+
+#include <ossim/support_data/ossimRpfReplaceUpdateSectionSubheader.h>
+#include <ossim/base/ossimCommon.h> /* ossim::byteOrder() */
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimTrace.h>
+#include <istream>
+#include <ostream>
+
+// Static trace for debugging
+static ossimTrace traceDebug("ossimRpfReplaceUpdateSectionSubheader:debug");
+
+std::ostream& operator <<(std::ostream& out, const ossimRpfReplaceUpdateSectionSubheader& data)
+{
+   return data.print(out);
+}
+
+ossimRpfReplaceUpdateSectionSubheader::ossimRpfReplaceUpdateSectionSubheader()
+   :
+   m_tableOffset(0),
+   m_numberOfRecords(0),
+   m_recordLength(0)
+{
+}
+
+ossimRpfReplaceUpdateSectionSubheader::ossimRpfReplaceUpdateSectionSubheader(
+   const ossimRpfReplaceUpdateSectionSubheader& obj)
+   :
+   m_tableOffset(obj.m_tableOffset),
+   m_numberOfRecords(obj.m_numberOfRecords),
+   m_recordLength(obj.m_recordLength)
+{
+}
+
+const ossimRpfReplaceUpdateSectionSubheader& ossimRpfReplaceUpdateSectionSubheader::operator=(
+   const ossimRpfReplaceUpdateSectionSubheader& rhs)
+{
+   if ( this != &rhs )
+   {
+      m_tableOffset     = rhs.m_tableOffset;
+      m_numberOfRecords = rhs.m_numberOfRecords;
+      m_recordLength    = rhs.m_recordLength;
+   }
+   return *this;
+}
+
+ossimRpfReplaceUpdateSectionSubheader::~ossimRpfReplaceUpdateSectionSubheader()
+{
+}
+
+ossimErrorCode ossimRpfReplaceUpdateSectionSubheader::parseStream(std::istream& in,
+                                                                  ossimByteOrder byteOrder)
+{
+   if(in)
+   {
+      in.read((char*)&m_tableOffset, 4);
+      in.read((char*)&m_numberOfRecords, 2);
+      in.read((char*)&m_recordLength, 2);
+
+      if( ossim::byteOrder() != byteOrder )
+      {
+         ossimEndian anEndian;
+         anEndian.swap(m_tableOffset);
+         anEndian.swap(m_numberOfRecords);
+         anEndian.swap(m_recordLength);
+      }
+   }
+   else
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+
+   if ( traceDebug() )
+   {
+      print( ossimNotify(ossimNotifyLevel_NOTICE) );
+   }
+   
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+void ossimRpfReplaceUpdateSectionSubheader::writeStream(std::ostream& out)
+{
+   if( ossim::byteOrder() != OSSIM_BIG_ENDIAN)
+   {
+      // Swap to big endian.
+      ossimEndian anEndian;
+      anEndian.swap(m_tableOffset);
+      anEndian.swap(m_numberOfRecords);
+      anEndian.swap(m_recordLength);
+   } 
+
+   out.write((char*)&m_tableOffset, 4);
+   out.write((char*)&m_numberOfRecords, 2);
+   out.write((char*)&m_recordLength, 2);
+   
+   if( ossim::byteOrder() != OSSIM_BIG_ENDIAN)
+   {
+      // Swap back to native byte order.
+      ossimEndian anEndian;
+      anEndian.swap(m_tableOffset);
+      anEndian.swap(m_numberOfRecords);
+      anEndian.swap(m_recordLength);
+   }
+}
+std::ostream& ossimRpfReplaceUpdateSectionSubheader::print(std::ostream& out) const
+{
+   out << "ossimRpfReplaceUpdateSectionSubheader DEBUG:"
+       << "\ntable_offset:      " << m_tableOffset
+       << "\nnumber_of_records: " << m_numberOfRecords
+       << "\nrecord_length:     " << m_recordLength
+       << std::endl;
+
+   return out;
+}
+
+ossim_uint32 ossimRpfReplaceUpdateSectionSubheader::getOffset() const
+{
+   return m_tableOffset;
+}
+
+ossim_uint16 ossimRpfReplaceUpdateSectionSubheader::getNumberOfRecords() const
+{
+   return m_numberOfRecords;
+}
+
+ossim_uint16 ossimRpfReplaceUpdateSectionSubheader::getRecordLength() const
+{
+   return m_recordLength;
+}
+
+void ossimRpfReplaceUpdateSectionSubheader::setNumberOfRecords(ossim_uint16 count)
+{
+   m_numberOfRecords = count;
+}
+
+void ossimRpfReplaceUpdateSectionSubheader::setRecordLength(ossim_uint16 length)
+{
+   m_recordLength = length;
+}
+
+void ossimRpfReplaceUpdateSectionSubheader::clearFields()
+{
+   m_tableOffset     = 0;
+   m_numberOfRecords = 0;
+   m_recordLength    = 0;
+}
+
+
diff --git a/src/ossim/support_data/ossimRpfReplaceUpdateTable.cpp b/src/ossim/support_data/ossimRpfReplaceUpdateTable.cpp
new file mode 100644
index 0000000..7017c19
--- /dev/null
+++ b/src/ossim/support_data/ossimRpfReplaceUpdateTable.cpp
@@ -0,0 +1,62 @@
+//----------------------------------------------------------------------------
+//
+// File:     ossimRpfReplaceUpdateTable.cpp
+// 
+// License:  See top level LICENSE.txt file.
+// 
+// Author:   David Burken
+//
+// Description:
+//
+// Holds a table of RPF replace/update section subheader records.
+//
+// See MIL-STD-2411 for detailed information.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimRpfReplaceUpdateTable.cpp 20324 2011-12-06 22:25:23Z dburken $
+
+#include <ossim/support_data/ossimRpfReplaceUpdateTable.h>
+#include <iostream>
+
+ossimRpfReplaceUpdateTable::ossimRpfReplaceUpdateTable()
+   :
+   m_table(0)
+{
+}
+
+ossimRpfReplaceUpdateTable::ossimRpfReplaceUpdateTable(const ossimRpfReplaceUpdateTable& obj)
+   :
+   m_table(obj.m_table)
+{
+}
+
+const ossimRpfReplaceUpdateTable& ossimRpfReplaceUpdateTable::operator=(
+   const ossimRpfReplaceUpdateTable& rhs)
+{
+   if ( this != &rhs )
+   {
+      m_table = rhs.m_table;
+   }
+   return *this;
+}
+
+void ossimRpfReplaceUpdateTable::addRecord(const ossimRpfReplaceUpdateRecord& record)
+{
+   m_table.push_back(record);
+}
+
+void ossimRpfReplaceUpdateTable::clear()
+{
+   m_table.clear();
+}
+
+std::ostream& ossimRpfReplaceUpdateTable::print( std::ostream& out,
+                                                 const std::string& prefix ) const
+{
+   ossim_uint32 size = static_cast<ossim_uint32>( m_table.size() );
+   for (ossim_uint32 i = 0; i < size; ++i)
+   {
+      m_table[i].print(out, prefix, i);
+   }
+   return out;
+}
diff --git a/src/ossim/support_data/ossimRpfToc.cpp b/src/ossim/support_data/ossimRpfToc.cpp
index 66bef5b..f0a1e0e 100644
--- a/src/ossim/support_data/ossimRpfToc.cpp
+++ b/src/ossim/support_data/ossimRpfToc.cpp
@@ -9,10 +9,7 @@
 // Description: Rpf support class
 // 
 //********************************************************************
-// $Id: ossimRpfToc.cpp 18044 2010-09-06 14:20:52Z dburken $
-
-#include <iostream>
-#include <fstream>
+// $Id: ossimRpfToc.cpp 21214 2012-07-03 16:20:11Z dburken $
 
 #include <ossim/support_data/ossimRpfToc.h>
 #include <ossim/base/ossimErrorCodes.h>
@@ -32,6 +29,8 @@
 #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");
 
@@ -190,7 +189,7 @@ void ossimRpfToc::createTocAndCopyFrames( const ossimFilename& dotRpfFile,
 
    // Open the dot rpf file.
    std::ifstream* dotRpfStr = new std::ifstream;
-   dotRpfStr->open(dotRpfFile, ios_base::in);
+   dotRpfStr->open(dotRpfFile.c_str(), ios_base::in);
    if ( !dotRpfStr->good() )
    {
       delete dotRpfStr;
@@ -328,8 +327,8 @@ void ossimRpfToc::createTocAndCopyFrames( const ossimFilename& dotRpfFile,
    ossimRefPtr<ossimProperty> prop = new ossimStringProperty();
    ossimString field;
    ossimString s;
-   std::streampos fileHeaderLength = 0;
-   std::streampos fileLength = 0;
+   // std::streampos fileHeaderLength = 0;
+   // std::streampos fileLength = 0;
       
    ossimRefPtr<ossimNitfFileHeaderV2_0> fileHdr = new ossimNitfFileHeaderV2_0();
    
@@ -644,7 +643,7 @@ std::ostream& ossimRpfToc::print(std::ostream& out,
             if ( (scale.contains("OVERVIEW")) == false ||
                  printOverviews )
             {
-               std::string entryPrefix = prefix;
+               ossimString entryPrefix = prefix;
                entryPrefix += "image";
                entryPrefix += ossimString::toString(prefixIndex);
                entryPrefix += ".";
diff --git a/src/ossim/support_data/ossimRpfTocEntry.cpp b/src/ossim/support_data/ossimRpfTocEntry.cpp
index 2ea5379..1bd712e 100644
--- a/src/ossim/support_data/ossimRpfTocEntry.cpp
+++ b/src/ossim/support_data/ossimRpfTocEntry.cpp
@@ -7,7 +7,11 @@
 // Author: Garrett Potts
 //
 //*************************************************************************
-// $Id: ossimRpfTocEntry.cpp 18362 2010-11-01 15:20:47Z dburken $
+// $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>
@@ -18,10 +22,6 @@
 #include <ossim/projection/ossimMapProjection.h>
 #include <ossim/support_data/ossimRpfFrameEntry.h>
 
-#include <istream>
-#include <ostream>
-#include <iterator>
-
 std::ostream& operator <<(std::ostream& out,
                           const ossimRpfTocEntry& data)
 {
@@ -45,6 +45,15 @@ ossimErrorCode ossimRpfTocEntry::parseStream(
       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;
 }
 
@@ -87,7 +96,7 @@ ossim_uint32 ossimRpfTocEntry::getNumberOfLines() const
 
 ossim_uint32 ossimRpfTocEntry::getNumberOfSamples() const
 {
-   return theBoundaryInformation.getNumberOfFramesHorizontal() * 1536;
+   return theNumSamples;
 }
 
 ossim_uint32 ossimRpfTocEntry::getNumberOfBands() const
@@ -184,33 +193,26 @@ bool ossimRpfTocEntry::isEmpty()const
 
 ossimRefPtr<ossimImageGeometry> ossimRpfTocEntry::getImageGeometry() const
 {
-   ossimRefPtr<ossimImageGeometry> geom =  new ossimImageGeometry;
-
-   ossimRpfBoundaryRectRecord boundaryInfo = getBoundaryInformation();
 
-   ossimGpt ul(boundaryInfo.getCoverage().getUlLat(),
-               boundaryInfo.getCoverage().getUlLon());
-
-   ossim_float64 lines = getNumberOfLines();
-   ossim_float64 samps = getNumberOfSamples();
+   ossimGpt ul(theBoundaryInformation.getCoverage().getUlLat(), 
+               theBoundaryInformation.getCoverage().getUlLon());
 
    // Decimal degrees per pixel:
    ossimDpt ddpp;
    getDecimalDegreesPerPixel(ddpp);
    
-   // Tie point - Shifted to point:
+   // 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 of the image aligning to tie point.
-   // ossimGpt origin((ul.latd()+lr.latd())*.5, (ul.lond()+lr.lond())*.5, 0.0);
-   ossimGpt origin( tie.latd() - (std::floor(lines/2.0) * ddpp.y),
-                    tie.lond() + (std::floor(samps/2.0) * ddpp.x) );
+   // 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 = boundaryInfo.getZone();
+   int z = theBoundaryInformation.getZone();
    
    if (z == 74) z--; // Fix J to a zone.
    if (z > 64) z -= 64; // Below the equator
@@ -236,6 +238,7 @@ ossimRefPtr<ossimImageGeometry> ossimRpfTocEntry::getImageGeometry() const
    mapProj->setUlTiePoints(tie);
 
    // Give projection to the geometry object.
+   ossimRefPtr<ossimImageGeometry> geom =  new ossimImageGeometry;
    geom->setProjection( mapProj.get() );
 
    return geom;
diff --git a/src/ossim/support_data/ossimSpotDimapSupportData.cpp b/src/ossim/support_data/ossimSpotDimapSupportData.cpp
index 80d7590..363d75e 100644
--- a/src/ossim/support_data/ossimSpotDimapSupportData.cpp
+++ b/src/ossim/support_data/ossimSpotDimapSupportData.cpp
@@ -9,13 +9,8 @@
 // Contains definition of class ossimSpotDimapSupportData.
 //
 //*****************************************************************************
-// $Id: ossimSpotDimapSupportData.cpp 18140 2010-09-27 11:17:57Z gpotts $
+// $Id: ossimSpotDimapSupportData.cpp 20609 2012-02-27 12:05:13Z gpotts $
 
-
-#include <iostream>
-#include <cstdio>
-#include <cstdlib>
-#include <iterator>
 #include <ossim/support_data/ossimSpotDimapSupportData.h>
 #include <ossim/base/ossimFilename.h>
 #include <ossim/base/ossimXmlDocument.h>
@@ -26,6 +21,10 @@
 #include <ossim/base/ossimKeywordNames.h>
 #include <ossim/base/ossimTrace.h>
 #include <ossim/base/ossimNotifyContext.h>
+#include <cstdio>
+#include <cstdlib>
+#include <iostream>
+#include <iterator>
 #include <sstream>
 
 // Define Trace flags for use within this file:
@@ -260,12 +259,12 @@ bool ossimSpotDimapSupportData::loadXmlFile(const ossimFilename& file,
    if(in.good()&&(fileSize > 0))
    {
       char buf[100];
-	  fullBuffer.resize(fileSize);
+      fullBuffer.resize(fileSize);
       in.read(buf, ossim::min((ossim_int64)100, fileSize));
       if(!in.fail())
       {
          ossimString testString = ossimString(buf,
-                                  buf + in.gcount());
+                                              buf + in.gcount());
          if(testString.contains("xml"))
          {
             in.seekg(0);
@@ -295,7 +294,7 @@ bool ossimSpotDimapSupportData::loadXmlFile(const ossimFilename& file,
    {
 
       xmlDocument = new ossimXmlDocument;
-      std::istringstream inStringStream(bufferedIo);
+      std::istringstream inStringStream(bufferedIo.string());
       if(!xmlDocument->read(inStringStream))
       {
          return false;
@@ -323,22 +322,22 @@ bool ossimSpotDimapSupportData::loadXmlFile(const ossimFilename& file,
    xmlDocument->findNodes(xpath, xml_nodes);
    if (xml_nodes.size() == 0)
    {
-     setErrorStatus();
-     if(traceDebug())
-       {
+      setErrorStatus();
+      if(traceDebug())
+      {
 	 ossimNotify(ossimNotifyLevel_DEBUG)
-	   << "DEBUG:\n Not a SPOT DIMAP file format."<< std::endl;
-       }
-     return false;
+            << "DEBUG:\n Not a SPOT DIMAP file format."<< std::endl;
+      }
+      return false;
    }
    if ( xml_nodes[0]->getText() != "SPOT" && xml_nodes[0]->getText() != "Spot" && xml_nodes[0]->getText() != "spot" )
-     {
-       if(traceDebug())
-	 {
-	   ossimNotify(ossimNotifyLevel_DEBUG)
-	     << "DEBUG:\n Not a SPOT DIMAP file format."<< std::endl;
-	 }
-       return false;
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG:\n Not a SPOT DIMAP file format."<< std::endl;
+      }
+      return false;
    }
 
 
@@ -427,12 +426,12 @@ bool ossimSpotDimapSupportData::loadXmlFile(const ossimFilename& file,
 
    if (parsePart4(xmlDocument) == false)
    {
-     ossimNotify(ossimNotifyLevel_FATAL)
+      ossimNotify(ossimNotifyLevel_FATAL)
          << MODULE << " DEBUG:"
          << "ossimSpotDimapSupportData::loadXmlFile:"
          << "\nPart 4 initialization failed.  Returning false"
          << std::endl;
-     return false;
+      return false;
    }
 
    if (traceDebug())
@@ -907,7 +906,7 @@ void ossimSpotDimapSupportData::getGeoPosPoint (ossim_uint32 point,
                                                 ossimDpt& ip,
                                                 ossimGpt& gp) const
 {
-   if ((point >= 0) && point < theGeoPosImagePoints.size())
+   if (point < theGeoPosImagePoints.size())
    {
       ip = theGeoPosImagePoints [point];
       gp = theGeoPosGroundPoints[point];
@@ -1481,11 +1480,11 @@ bool ossimSpotDimapSupportData::loadState(const ossimKeywordlist& kwl,
    tempString = kwl.find(prefix,"pixel_lookat_angle_x");
    if(tempString != "")
    {
-      std::istringstream in(tempString);
+      std::istringstream in(tempString.string());
       ossimString tempValue;
       for(idx = 0; idx < thePixelLookAngleX.size();++idx)
       {
-         in >> tempValue;
+         in >> tempValue.string();
          thePixelLookAngleX[idx] = tempValue.toDouble();
       }
    }
@@ -1495,26 +1494,25 @@ bool ossimSpotDimapSupportData::loadState(const ossimKeywordlist& kwl,
    tempString = kwl.find(prefix,"pixel_lookat_angle_y");
    if(tempString != "")
    {
-      std::istringstream in(tempString);
+      std::istringstream in(tempString.string());
       ossimString tempValue;
       for(idx = 0; idx < thePixelLookAngleY.size();++idx)
       {
-         in >> tempValue;
+         in >> tempValue.string();
          thePixelLookAngleY[idx] = tempValue.toDouble();
       }
    }
 
-
    total =  ossimString(kwl.find(prefix,"number_of_attitude_samples")).toUInt32();
    theAttitudeSamples.resize(total);
    tempString = kwl.find(prefix,"attitude_samples");
    if(tempString != "")
    {
-      std::istringstream in(tempString);
+      std::istringstream in(tempString.string());
       ossimString x, y, z;
       for(idx = 0; idx < theAttitudeSamples.size();++idx)
       {
-         in >> x >> y >> z;
+         in >> x.string() >> y.string() >> z.string();
          theAttitudeSamples[idx] =ossimDpt3d(x.toDouble(), y.toDouble(), z.toDouble());
       }
    }
@@ -1524,11 +1522,11 @@ bool ossimSpotDimapSupportData::loadState(const ossimKeywordlist& kwl,
    tempString = kwl.find(prefix,"attitude_sample_times");
    if(tempString != "")
    {
-      std::istringstream in(tempString);
+      std::istringstream in(tempString.string());
       ossimString tempValue;
       for(idx = 0; idx < theAttSampTimes.size();++idx)
       {
-         in >> tempValue;
+         in >> tempValue.string();
          theAttSampTimes[idx] = tempValue.toDouble();
       }
    }
@@ -1538,11 +1536,11 @@ bool ossimSpotDimapSupportData::loadState(const ossimKeywordlist& kwl,
    tempString = kwl.find(prefix,"position_ecf_samples");
    if(tempString != "")
    {
-      std::istringstream in(tempString);
+      std::istringstream in(tempString.string());
       ossimString x, y, z;
       for(idx = 0; idx < thePosEcfSamples.size();++idx)
       {
-         in >> x >> y >> z;
+         in >> x.string() >> y.string() >> z.string();
          thePosEcfSamples[idx] = ossimDpt3d(x.toDouble(), y.toDouble(), z.toDouble());
       }
    }
@@ -1552,11 +1550,11 @@ bool ossimSpotDimapSupportData::loadState(const ossimKeywordlist& kwl,
    tempString = kwl.find(prefix,"velocity_ecf_samples");
    if(tempString != "")
    {
-      std::istringstream in(tempString);
+      std::istringstream in(tempString.string());
       ossimString x, y, z;
       for(idx = 0; idx < theVelEcfSamples.size();++idx)
       {
-         in >> x >> y >> z;
+         in >> x.string() >> y.string() >> z.string();
          theVelEcfSamples[idx] = ossimDpt3d(x.toDouble(), y.toDouble(), z.toDouble());
       }
    }
@@ -1566,11 +1564,11 @@ bool ossimSpotDimapSupportData::loadState(const ossimKeywordlist& kwl,
    tempString = kwl.find(prefix,"ephemeris_sample_times");
    if(tempString != "")
    {
-      std::istringstream in(tempString);
+      std::istringstream in(tempString.string());
       ossimString tempValue;
       for(idx = 0; idx < theEphSampTimes.size();++idx)
       {
-         in >> tempValue;
+         in >> tempValue.string();
          theEphSampTimes[idx] = tempValue.toDouble();
       }
    }
@@ -1606,39 +1604,39 @@ bool ossimSpotDimapSupportData::loadState(const ossimKeywordlist& kwl,
    tempString = kwl.find(prefix,"physical_bias");
    if(tempString != "")
    {
-     std::istringstream in(tempString);
-     ossimString tempValue;
-     for(idx = 0; idx < thePhysicalBias.size();++idx)
-     {
-       in >> tempValue;
-       thePhysicalBias[idx] = tempValue.toDouble();
-     }
+      std::istringstream in(tempString.string());
+      ossimString tempValue;
+      for(idx = 0; idx < thePhysicalBias.size();++idx)
+      {
+         in >> tempValue.string();
+         thePhysicalBias[idx] = tempValue.toDouble();
+      }
    }
 
    thePhysicalGain.resize(theNumBands);
    tempString = kwl.find(prefix,"physical_gain");
    if(tempString != "")
    {
-     std::istringstream in(tempString);
-     ossimString tempValue;
-     for(idx = 0; idx < thePhysicalGain.size();++idx)
-     {
-       in >> tempValue;
-       thePhysicalGain[idx] = tempValue.toDouble();
-     }
+      std::istringstream in(tempString.string());
+      ossimString tempValue;
+      for(idx = 0; idx < thePhysicalGain.size();++idx)
+      {
+         in >> tempValue.string();
+         thePhysicalGain[idx] = tempValue.toDouble();
+      }
    }
 
    theSolarIrradiance.resize(theNumBands);
    tempString = kwl.find(prefix,"solar_irradiance");
    if(tempString != "")
    {
-     std::istringstream in(tempString);
-     ossimString tempValue;
-     for(idx = 0; idx < theSolarIrradiance.size();++idx)
-     {
-       in >> tempValue;
-       theSolarIrradiance[idx] = tempValue.toDouble();
-     }
+      std::istringstream in(tempString.string());
+      ossimString tempValue;
+      for(idx = 0; idx < theSolarIrradiance.size();++idx)
+      {
+         in >> tempValue.string();
+         theSolarIrradiance[idx] = tempValue.toDouble();
+      }
    }
 
    return true;
@@ -1646,11 +1644,11 @@ bool ossimSpotDimapSupportData::loadState(const ossimKeywordlist& kwl,
 
 ossimGpt ossimSpotDimapSupportData::createGround(const ossimString& s)const
 {
-   std::istringstream in(s);
+   std::istringstream in(s.string());
    ossimString lat, lon, height;
    ossimString code;
 
-   in >> lat >> lon >> height >> code;
+   in >> lat.string() >> lon.string() >> height.string() >> code.string();
 
    return ossimGpt(lat.toDouble(),
                    lon.toDouble(),
@@ -1661,11 +1659,11 @@ ossimGpt ossimSpotDimapSupportData::createGround(const ossimString& s)const
 
 ossimDpt ossimSpotDimapSupportData::createDpt(const ossimString& s)const
 {
-   std::istringstream in(s);
+   std::istringstream in(s.string());
    ossimString x, y;
    ossimString code;
 
-   in >> x >> y;
+   in >> x.string() >> y.string();
 
    return ossimDpt(x.toDouble(), y.toDouble());
 
@@ -2405,8 +2403,8 @@ bool ossimSpotDimapSupportData::parsePart3(
 
    return true;
 }
-bool ossimSpotDimapSupportData::parsePart4(
-                                           ossimRefPtr<ossimXmlDocument> xmlDocument)
+
+bool ossimSpotDimapSupportData::parsePart4(ossimRefPtr<ossimXmlDocument> xmlDocument)
 {
   ossimString xpath;
   std::vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
@@ -2673,55 +2671,55 @@ bool ossimSpotDimapSupportData::initSceneSource(
 
    //---
    // Fetch viewing angle:
-   /*
-    * From the SPOT Dimap documentation (Dimap Generic 1.0), VIEWING_ANGLE
-    * (the scene instrumental viewing angle) is ONLY available for SPOT5 data.
-    * FROM SPOT: You can use use incidence angle to calculate viewing angle
-    * (called look direction as well).
-    * FIX (see below): need theSatelliteAltitude and theIncidenceAngle. The
-    * equation is shown below where RT is the mean value of WGS84 ellipsoid 
-    * semi-axis.
-    *
-    * */
+   //
+   // From the SPOT Dimap documentation (Dimap Generic 1.0), VIEWING_ANGLE
+   // (the scene instrumental viewing angle) is ONLY available for SPOT5 data.
+   // FROM SPOT: You can use use incidence angle to calculate viewing angle
+   // (called look direction as well).
+   // FIX (see below): need theSatelliteAltitude and theIncidenceAngle. The
+   // equation is shown below where RT is the mean value of WGS84 ellipsoid 
+   // semi-axis.
    //---
-   if(this->theSensorID == "Spot 5") {
-   xml_nodes.clear();
-   xpath = "/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/VIEWING_ANGLE";
-   xmlDocument->findNodes(xpath, xml_nodes);
-   if (xml_nodes.size() == 0)
+   if(this->theSensorID == "Spot 5")
    {
-      setErrorStatus();
-      if(traceDebug())
+      xml_nodes.clear();
+      xpath = "/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/VIEWING_ANGLE";
+      xmlDocument->findNodes(xpath, xml_nodes);
+      if (xml_nodes.size() == 0)
       {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG:\nCould not find: " << xpath
-            << std::endl;
+         setErrorStatus();
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "DEBUG:\nCould not find: " << xpath
+               << std::endl;
+         }
+         return false;
       }
-      return false;
+      theViewingAngle = xml_nodes[0]->getText().toDouble();
    }
-   theViewingAngle = xml_nodes[0]->getText().toDouble();
-   } else {
-       xml_nodes.clear();
-       xpath = "/Dimap_Document/Data_Strip/Ephemeris/SATELLITE_ALTITUDE";
-
-       theViewingAngle = -1.0;
-       xmlDocument->findNodes(xpath, xml_nodes);
-   if (xml_nodes.size() == 0)
+   else
    {
-      setErrorStatus();
-      if(traceDebug())
+      xml_nodes.clear();
+      xpath = "/Dimap_Document/Data_Strip/Ephemeris/SATELLITE_ALTITUDE";
+      
+      theViewingAngle = -1.0;
+      xmlDocument->findNodes(xpath, xml_nodes);
+      if (xml_nodes.size() == 0)
       {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG:\nCould not find: " << xpath
-            << std::endl;
+         setErrorStatus();
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "DEBUG:\nCould not find: " << xpath
+               << std::endl;
+         }
+         return false;
       }
-      return false;
-   }
-       //compute VIEWING_ANGLE
-       double theSatelliteAltitude =  xml_nodes[0]->getText().toDouble();
-       double RT = 63710087714.0;
-       theViewingAngle = asin((RT/(RT+theSatelliteAltitude))*sin(theIncidenceAngle));
-
+      //compute VIEWING_ANGLE
+      double theSatelliteAltitude =  xml_nodes[0]->getText().toDouble();
+      double RT = 63710087714.0;
+      theViewingAngle = asin((RT/(RT+theSatelliteAltitude))*sin(theIncidenceAngle));
    }
 
    //---
@@ -2869,53 +2867,6 @@ bool ossimSpotDimapSupportData::initFramePoints(
    }
    theSceneOrientation = xml_nodes[0]->getText().toDouble();  
 
-   //---
-   // Fetch viewing angle:
-   /*
-    * From the SPOT Dimap documentation (Dimap Generic 1.0), VIEWING_ANGLE
-    * (the scene instrumental viewing angle) is ONLY available for SPOT5 data.
-    * WORKAROUND: if SPOT1 or SPOT4 data, then set VIEWING_ANGLE to -1.0
-    * */
-   //---
-   if(this->theSensorID == "Spot 5") {
-   xml_nodes.clear();
-   xpath = "/Dimap_Document/Dataset_Sources/Source_Information/Scene_Source/VIEWING_ANGLE";
-   xmlDocument->findNodes(xpath, xml_nodes);
-   if (xml_nodes.size() == 0)
-   {
-      setErrorStatus();
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG:\nCould not find: " << xpath
-            << std::endl;
-      }
-      return false;
-   }
-   theViewingAngle = xml_nodes[0]->getText().toDouble();
-   } else {
-       theViewingAngle = -1.0;
-   }
-
-   //---
-   // Fetch Step Count:
-   //---
-   xml_nodes.clear();
-   xpath = "/Dimap_Document/Data_Strip/Sensor_Configuration/Mirror_Position/STEP_COUNT";
-   xmlDocument->findNodes(xpath, xml_nodes);
-   if (xml_nodes.size() == 0)
-   {
-      setErrorStatus();
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG:\nCould not find: " << xpath
-            << std::endl;
-      }
-      return false;
-   }
-   theStepCount = xml_nodes[0]->getText().toInt();
-   
    return true;
 }
 
diff --git a/src/ossim/support_data/ossimSrcRecord.cpp b/src/ossim/support_data/ossimSrcRecord.cpp
index 31b81e3..b947463 100644
--- a/src/ossim/support_data/ossimSrcRecord.cpp
+++ b/src/ossim/support_data/ossimSrcRecord.cpp
@@ -27,13 +27,12 @@ ossimSrcRecord::ossimSrcRecord()
 //*************************************************************************************************
 // Constructs given an in-memory KWL and entry index.
 //*************************************************************************************************
-ossimSrcRecord::ossimSrcRecord(const ossimKeywordlist& src_kwl, ossim_uint32 index)
+ossimSrcRecord::ossimSrcRecord(const ossimKeywordlist& src_kwl, ossim_uint32 index, ossimString prefix_str)
 :  m_entryIndex(-1),
    m_weight(0.0),
    m_isVectorData(false),
    m_isRgbData(false)
 {
-   ossimString prefix_str = "image";
    prefix_str += ossimString::toString(index) + ".";
    const char* prefix = prefix_str.chars();
 
diff --git a/src/ossim/support_data/ossimSrtmSupportData.cpp b/src/ossim/support_data/ossimSrtmSupportData.cpp
index 0b676f5..5679d08 100644
--- a/src/ossim/support_data/ossimSrtmSupportData.cpp
+++ b/src/ossim/support_data/ossimSrtmSupportData.cpp
@@ -9,7 +9,7 @@
 // Support data class for a Shuttle Radar Topography Mission (SRTM) file.
 //
 //----------------------------------------------------------------------------
-// $Id: ossimSrtmSupportData.cpp 18693 2011-01-17 18:49:15Z dburken $
+// $Id: ossimSrtmSupportData.cpp 21527 2012-08-26 16:50:49Z dburken $
 
 #include <cmath>
 #include <fstream>
@@ -100,6 +100,7 @@ bool ossimSrtmSupportData::setFilename(const ossimFilename& srtmFile,
    theMaxPixelValue = DEFAULT_MAX;
    
    // See if we have an ossim metadata file to initialize from.
+   bool outputOmd     = false;
    bool loadedFromOmd = false;
    
    ossimFilename omdFile = theFile;
@@ -126,17 +127,20 @@ bool ossimSrtmSupportData::setFilename(const ossimFilename& srtmFile,
          clear();
          return false;
       }
+      outputOmd = true;
    }
 
-   bool outputOmd = false;
    if (scanForMinMax)
    {
-      outputOmd = true;
       // These could have been picked up in the loadOmd.
       if ( (theMinPixelValue == DEFAULT_MIN) ||
            (theMaxPixelValue == DEFAULT_MAX) )
       {
-         if (!computeMinMax())
+         if ( computeMinMax() )
+         {
+            outputOmd = true;
+         }
+         else
          {
             if(traceDebug())
             {
@@ -296,6 +300,11 @@ bool ossimSrtmSupportData::saveState(ossimKeywordlist& kwl,
            true);
 
    kwl.add(prefix,
+           ossimKeywordNames::NUMBER_BANDS_KW,
+           1,
+           true);
+
+   kwl.add(prefix,
            ossimKeywordNames::NUMBER_LINES_KW,
            theNumberOfLines,
            true);
@@ -407,17 +416,17 @@ bool ossimSrtmSupportData::loadState(const ossimKeywordlist& kwl,
 bool ossimSrtmSupportData::loadOmd(const ossimKeywordlist& kwl,
                                    const char* prefix)
 {
-   ossimString bandPrefix;
+   std::string pfx;
+   std::string bandPrefix;
    
-   if (prefix)
+   if (prefix) // Cannot give null to std::string.
    {
+      pfx        = prefix;
       bandPrefix = prefix;
    }
    bandPrefix += "band1.";
    
-   ossimString s; // For numeric conversions.
-   
-   const char* lookup;
+   ossimString value;
 
    //---
    // Look for the min and max first since they could have been populated by
@@ -426,37 +435,33 @@ bool ossimSrtmSupportData::loadOmd(const ossimKeywordlist& kwl,
    //---
    
    // Not an error if not present.
-   lookup = kwl.find(bandPrefix, ossimKeywordNames::MIN_VALUE_KW);
-   if (lookup)
+   value.string() = kwl.findKey(bandPrefix, std::string(ossimKeywordNames::MIN_VALUE_KW));
+   if ( value.size() )
    {
-      s = lookup;
-      theMinPixelValue = static_cast<ossim_sint16>(s.toInt());
+      theMinPixelValue = value.toFloat64();
    }
-
+   
    // Not an error if not present.
-   lookup = kwl.find(bandPrefix.c_str(), ossimKeywordNames::MAX_VALUE_KW);
-   if (lookup)
+   value.string() = kwl.findKey(bandPrefix.c_str(), std::string(ossimKeywordNames::MAX_VALUE_KW));
+   if ( value.size() )
    {
-      s = lookup;
-      theMaxPixelValue = static_cast<ossim_sint16>(s.toInt());
+      theMaxPixelValue = value.toFloat64();
    }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_LINES_KW);
-   if (lookup)
+   
+   value.string() = kwl.findKey(pfx, std::string(ossimKeywordNames::NUMBER_LINES_KW));
+   if ( value.size() )
    {
-      s = lookup;
-      theNumberOfLines = s.toUInt32();
+      theNumberOfLines = value.toUInt32();
    }
    else
    {
       return false;
    }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_SAMPLES_KW);
-   if (lookup)
+   
+   value.string() = kwl.findKey(pfx, std::string(ossimKeywordNames::NUMBER_SAMPLES_KW));
+   if ( value.size() )
    {
-      s = lookup;
-      theNumberOfSamples = s.toUInt32();
+      theNumberOfSamples = value.toUInt32();
    }
    else
    {
@@ -467,22 +472,20 @@ bool ossimSrtmSupportData::loadOmd(const ossimKeywordlist& kwl,
    // Special case the tie point was stored as the upper left so we must
    // subtract one.
    //---
-   lookup = kwl.find(prefix, ossimKeywordNames::TIE_POINT_LAT_KW);
-   if (lookup)
+   value.string() = kwl.findKey(pfx, std::string(ossimKeywordNames::TIE_POINT_LAT_KW));
+   if ( value.size() )
    {
-      s = lookup;
-      theSouthwestLatitude = s.toDouble() - 1.0;
+      theSouthwestLatitude = value.toFloat64() - 1.0;
    }
    else
    {
       return false;
    }
 
-   lookup = kwl.find(prefix, ossimKeywordNames::TIE_POINT_LON_KW);
-   if (lookup)
+   value.string() = kwl.findKey(pfx, std::string(ossimKeywordNames::TIE_POINT_LON_KW));
+   if ( value.size() )
    {
-      s = lookup;
-      theSouthwestLongitude = s.toDouble();
+      theSouthwestLongitude = value.toFloat64();
    }
    else
    {
@@ -494,8 +497,7 @@ bool ossimSrtmSupportData::loadOmd(const ossimKeywordlist& kwl,
    if (scalar != ossimLookUpTable::NOT_FOUND)
    {
       theScalarType = (ossimScalarType)scalar;
-      if((theScalarType != OSSIM_FLOAT32)&&
-         (theScalarType != OSSIM_SINT16))
+      if((theScalarType != OSSIM_FLOAT32) && (theScalarType != OSSIM_SINT16))
       {
          return false;
       }
@@ -504,45 +506,6 @@ bool ossimSrtmSupportData::loadOmd(const ossimKeywordlist& kwl,
    {
       return false;
    }
-
-   //---
-   // Note:
-   // Getting spacing from keyword list was causing a error in the
-   // ossimSrtmHandler::getHeightAboveMSLTemplate where:
-   // 
-   // double yi = (theNwCornerPost.lat - gpt.lat) / theLatSpacing;
-   //
-   // resulted in: 3599.999999997120085
-   //
-   // when it should have been:
-   // 3600.0
-   //
-   // (drb)
-   //---
-   
-//    lookup = kwl.find(prefix,
-//                      ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON);
-//    if (lookup)
-//    {
-//       s = lookup;
-//       theLonSpacing = s.toDouble();
-//    }
-//    else
-//    {
-//       return false;
-//    }
-
-//    lookup = kwl.find(prefix,
-//                      ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT);
-//    if (lookup)
-//    {
-//       s = lookup;
-//       theLatSpacing = s.toDouble();
-//    }
-//    else
-//    {
-//       return false;
-//    }
    
    theLatSpacing = 1.0 / (theNumberOfLines   - 1);
    theLonSpacing = 1.0 / (theNumberOfSamples - 1);
diff --git a/src/ossim/support_data/ossimTiffInfo.cpp b/src/ossim/support_data/ossimTiffInfo.cpp
index e3a4fe3..e4964ee 100644
--- a/src/ossim/support_data/ossimTiffInfo.cpp
+++ b/src/ossim/support_data/ossimTiffInfo.cpp
@@ -9,7 +9,7 @@
 // Description: TIFF Info object.
 // 
 //----------------------------------------------------------------------------
-// $Id$
+// $Id: ossimTiffInfo.cpp 2673 2011-06-06 14:57:24Z david.burken $
 
 #include <ossim/support_data/ossimTiffInfo.h>
 
@@ -56,6 +56,7 @@ 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";
@@ -66,6 +67,7 @@ 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()
@@ -282,7 +284,7 @@ std::ostream& ossimTiffInfo::print(std::ostream& out) const
 
    // Capture the original flags then set float output to full precision.
    std::ios_base::fmtflags f = out.flags();
-   out << setiosflags(std::ios::fixed) << std::setprecision(15);
+   out << std::setprecision(15);
    
    // Image File Directory (IFD) loop.
    ossim_int32 ifdIndex = 0;
@@ -572,10 +574,10 @@ std::ostream& ossimTiffInfo::print(std::ostream& out) const
    return out;
 }
 
-std::ostream& ossimTiffInfo::print(std::ifstream& inStr,
+std::ostream& ossimTiffInfo::print(std::istream& inStr,
                                    std::ostream& outStr) const
 {
-   static const char MODULE[] = "ossimTiffInfo::print(std::ifstream&, std::ostream&)";
+   static const char MODULE[] = "ossimTiffInfo::print(std::istream&, std::ostream&)";
    if (traceDebug())
    {
       ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG Entered...\n";
@@ -695,7 +697,7 @@ std::ostream& ossimTiffInfo::print(std::ifstream& inStr,
 
    // Capture the original flags then set float output to full precision.
    std::ios_base::fmtflags f = outStr.flags();
-   outStr << setiosflags(std::ios::fixed) << std::setprecision(15);
+   outStr << std::setprecision(15);
    
    // Image File Directory (IFD) loop.
    ossim_int32 ifdIndex = 0;
@@ -851,7 +853,7 @@ std::ostream& ossimTiffInfo::print(std::ifstream& inStr,
          }
 
          if( traceDebug() )
-	 {
+         {
             ossimNotify(ossimNotifyLevel_DEBUG)
                << MODULE << " DEBUG:"
                << "\ntag[" << tagIdx << "]:" << tag
@@ -859,7 +861,7 @@ std::ostream& ossimTiffInfo::print(std::ifstream& inStr,
                << "\ncount:        " << count
                << "\narray size in bytes: " << arraySizeInBytes
                << "\n";
-	 }
+         }
 
          if (tag == OGEO_KEY_DIRECTORY_TAG)
          {
@@ -1014,11 +1016,11 @@ bool ossimTiffInfo::getImageGeometry(ossimKeywordlist& geomKwl,
    return result;
 }
 
-bool ossimTiffInfo::getImageGeometry(std::ifstream& inStr,
+bool ossimTiffInfo::getImageGeometry(std::istream& inStr,
                                      ossimKeywordlist& geomKwl,
                                      ossim_uint32 entryIndex) const
 {
-   static const char MODULE[] = "ossimTiffInfo::getImageGeometry #2";
+   static const char M[] = "ossimTiffInfo::getImageGeometry #2";
    if (traceDebug())
    {
       ossimNotify(ossimNotifyLevel_DEBUG) << " entered...\n";
@@ -1037,259 +1039,365 @@ bool ossimTiffInfo::getImageGeometry(std::ifstream& inStr,
    ossimKeywordlist gtiffKwl;
    if ( gtiffKwl.parseStream(in) )      
    {
-      //---
-      // Start with a return status of true and set to false if something bad
-      // happens.
-      //---
-      result = true;
+      result = getImageGeometry(gtiffKwl, geomKwl, entryIndex);
+   }
 
-      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 units first.
-      ossimString units = "";
-      getUnits(gtiffPrefix, gtiffKwl, units);
-      
-      // 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;
-      }
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "geomKwl:\n"
+         << geomKwl
+         << M << " exit status = " << (result?"true":"false") << "\n";
+   }
 
-      // Get the samples.
-      ossim_uint32 width = getSamples(gtiffPrefix, gtiffKwl);
-      if (width)
-      {
-         geomKwl.add(geomPrefix.c_str(),
-                     ossimKeywordNames::NUMBER_SAMPLES_KW,
-                     width);
-      }
-      else
-      {
-         result = false;
-      }
+   return result;
+}
 
-      // Add the pixel type.
-      geomKwl.add(geomPrefix.c_str(),
-                  ossimKeywordNames::PIXEL_TYPE_KW,
-                  pixelType.c_str());
+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";
+   }
 
-      // Get the pixel scale.
-      ossimDpt scale;
-      bool hasScale = getPixelScale(gtiffPrefix, gtiffKwl, scale);
+   // Dump the geotiff keys to memory.
+   ostringstream out;
+   printGeoKeys(out, std::string("tiff.image0."),
+                geoKeyLength, geoKeyBlock,
+                geoDoubleLength,geoDoubleBlock,
+                geoAsciiLength,geoAsciiBlock);
 
-      // Get the tie point.
-      std::vector<ossim_float64> ties;
-      getTiePoint(gtiffPrefix, gtiffKwl, ties);
+   // Open an input stream to pass to the keyword list.
+   std::istringstream in( out.str() );
 
-      //---
-      // 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);
+   // 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);
+   }
 
-      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 (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
+   }
+}
 
-            if(tieCount >= 4)
-            {
-               ossimRefPtr<ossimBilinearProjection> proj =
-                  new ossimBilinearProjection;
-               proj->optimizeFit(tieSet);
-               proj->saveState(geomKwl, geomPrefix.c_str());
-               if(traceDebug())
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG)
-                     << MODULE << "Creating a bilinear projection\n";
-               }
-               
-            }
-            else  // Need at least four ties.
-            {
-               result = false;
-            }
-         }
-         else
-         {
-            result = false;
-         }
-         
-      } // matches: else Use tie points block.
-      
-      ossimString pcsCode;
-      bool hasPcsCode = getPcsCode(gtiffPrefix, gtiffKwl, pcsCode);
+// 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);
 
-      // Set the projection type.
-      if (hasPcsCode)
+   //---
+   // 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 )
       {
-         // Add the pcs code.
-         geomKwl.add(geomPrefix.c_str(),
-                     ossimKeywordNames::PCS_CODE_KW,
-                     pcsCode.c_str());
+         ossimProjectionName = "ossimEquDistCylProjection";
       }
-      else
+      geomKwl.add(geomPrefix.c_str(), ossimKeywordNames::TYPE_KW, ossimProjectionName);
+
+      if ( ossimProjectionName == "ossimEquDistCylProjection" )
       {
-         ossimString ossimProjectionName = "";
-         if ( getOssimProjectionName(gtiffPrefix, gtiffKwl,
-                                     ossimProjectionName) == false )
-         {
-            ossimProjectionName = "ossimEquDistCylProjection";
-         }
-         geomKwl.add(geomPrefix.c_str(),
-                     ossimKeywordNames::TYPE_KW,
-                     ossimProjectionName);
+         isGeographic = true;
       }
-      ossimString tmpStr;
-      if ( getStdParallelOne(gtiffPrefix, gtiffKwl, tmpStr) )
+   }
+   
+   // 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 )
       {
-         geomKwl.add(geomPrefix.c_str(),
-                     ossimKeywordNames::STD_PARALLEL_1_KW,
-                     tmpStr);
+         useXfrm = true;
       }
-      
-      if ( getStdParallelTwo(gtiffPrefix, gtiffKwl, tmpStr) )
+   }
+   if (useXfrm)
+   {
+      std::ostringstream out;
+      out << std::setprecision(15); // To avoid truncating.
+      ossim_uint32 idx = 0;
+      for(idx =0; idx < 16; ++idx)
       {
-         geomKwl.add(geomPrefix.c_str(),
-                     ossimKeywordNames::STD_PARALLEL_2_KW,
-                     tmpStr);
+         out << xfrm[idx] << " ";
       }
-      
-      ossimDpt eastingNorthing;
-      if ( getFalseEastingNorthing(gtiffPrefix, gtiffKwl,
-                                   eastingNorthing) )
+      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::FALSE_EASTING_NORTHING_KW,
-                     eastingNorthing.toString());
+                     ossimKeywordNames::TIE_POINT_XY_KW,
+                     tie.toString().c_str());
          geomKwl.add(geomPrefix.c_str(),
-                     ossimKeywordNames::
-                     FALSE_EASTING_NORTHING_UNITS_KW, units);
-      }
-      
-      ossim_float64 tmpDbl;
-      
-      if ( getOriginLat(gtiffPrefix, gtiffKwl, tmpDbl) )
-      {
+                     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::ORIGIN_LATITUDE_KW,
-                     tmpDbl);
+                     ossimKeywordNames::PIXEL_SCALE_UNITS_KW,
+                     units.c_str());
       }
-      if ( getCentralMeridian(gtiffPrefix, gtiffKwl, tmpDbl) )
+      else if (tieCount > 1) // four or better tie points.
       {
-         geomKwl.add(geomPrefix.c_str(),
-                     ossimKeywordNames::CENTRAL_MERIDIAN_KW,
-                     tmpDbl);
+         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;
+         }
       }
-      
-      if ( getScaleFactor(gtiffPrefix, gtiffKwl, tmpDbl) )
+      else
       {
-         geomKwl.add(geomPrefix.c_str(),
-                     ossimKeywordNames::SCALE_FACTOR_KW,
-                     tmpDbl);
+         result = false;
       }
       
-      if ( getGcsDatumCode(gtiffPrefix, gtiffKwl, tmpStr) )
+   } // 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 )
       {
-         geomKwl.add(geomPrefix.c_str(),
-                     ossimKeywordNames::DATUM_KW,
-                     tmpStr.c_str());
+         //---
+         // 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);
       }
-      
-   } // matches: if ( gtiffKwl.parseStream(memStr) )
+   }
+   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
-         << MODULE << " exit status = " << (result?"true":"false") << "\n";
+         << geomKwl << "\n"
+         << M << " exit status = " << (result?"true":"false") << "\n";
    }
    
    return result;
 }
 
-void ossimTiffInfo::readShort(ossim_uint16& s, std::ifstream& str) const
+void ossimTiffInfo::readShort(ossim_uint16& s, std::istream& str) const
 {
    str.read((char*)&s, sizeof(s));
    if (theEndian)
@@ -1298,7 +1406,7 @@ void ossimTiffInfo::readShort(ossim_uint16& s, std::ifstream& str) const
    }
 }
 
-void ossimTiffInfo::readLong(ossim_uint32& l, std::ifstream& str) const
+void ossimTiffInfo::readLong(ossim_uint32& l, std::istream& str) const
 {
    str.read((char*)&l, sizeof(l));
    if (theEndian)
@@ -1307,7 +1415,7 @@ void ossimTiffInfo::readLong(ossim_uint32& l, std::ifstream& str) const
    }
 }
 
-void ossimTiffInfo::readLongLong(ossim_uint64& l, std::ifstream& str) const
+void ossimTiffInfo::readLongLong(ossim_uint64& l, std::istream& str) const
 {
    str.read((char*)&l, sizeof(l));
    if (theEndian)
@@ -1319,7 +1427,7 @@ void ossimTiffInfo::readLongLong(ossim_uint64& l, std::ifstream& str) const
 
 
 bool ossimTiffInfo::getOffset(
-   std::streamoff& offset, std::ifstream& str, ossim_uint16 version) const
+   std::streamoff& offset, std::istream& str, ossim_uint16 version) const
 {
    bool status = true;
    if  (version == 42)
@@ -1342,7 +1450,7 @@ bool ossimTiffInfo::getOffset(
 }
 
 bool ossimTiffInfo::getValue(ossim_uint64& value,
-                             std::ifstream& str,
+                             std::istream& str,
                              WordType type,
                              ossim_uint16 version) const
 {
@@ -1437,7 +1545,7 @@ ossim_uint16 ossimTiffInfo::getTypeByteSize(ossim_uint16 type) const
    return result;
 }
 
-void ossimTiffInfo::eatValue(std::ifstream& str, ossim_uint16 version) const
+void ossimTiffInfo::eatValue(std::istream& str, ossim_uint16 version) const
 {
    if (version == 42)
    {
@@ -1565,8 +1673,21 @@ std::ostream& ossimTiffInfo::print(std::ostream& out,
             {
                out <<"range error!\n";
             }
-            break;
          }
+         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
@@ -1701,19 +1822,43 @@ std::ostream& ossimTiffInfo::print(std::ostream& out,
          }
          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: ";
@@ -1940,6 +2085,13 @@ std::ostream& ossimTiffInfo::printValue(std::ostream& out,
 {
    switch (type)
    {
+      case OTIFF_BYTE:
+      {
+         ossim_uint8 v;
+         getArrayValue(v, valueArray, 0);
+         out << (ossim_uint16)v << "\n";
+         break;
+      }
       case OTIFF_SHORT:
       {
          ossim_uint16 v;
@@ -1968,9 +2120,15 @@ std::ostream& ossimTiffInfo::printValue(std::ostream& out,
          
          getArrayValue(num, valueArray, 0);
          getArrayValue(den, valueArray, 1);
-         
-         // out << num << " / " << den << "\n";
-         out << (num/den) << "\n";
+
+         if ( den )
+         {
+            out << (num/den) << "\n";
+         }
+         else
+         {
+            out << num << " / " << den << "\n";
+         }
          
          break;
          
@@ -2025,7 +2183,7 @@ std::ostream& ossimTiffInfo::printArray(std::ostream& out,
          }
          case OTIFF_ASCII:
          {
-            for (ossim_uint64 i = 0; ((i < arraySizeInBytes)&&((char)valueArray[i] != '\0')); ++i)
+            for (ossim_uint64 i = 0; i < arraySizeInBytes; ++i)
             {
                //---
                // Test to avoid putting nulls in the ascii string out.  Added to fix
@@ -2212,7 +2370,7 @@ std::ostream& ossimTiffInfo::printGeoKeys(
 
             case OGEOG_GEODETIC_DATUM_GEO_KEY:// key 2050 Section 6.3.2.2 Codes
             {
-               out << prefix << "geodetic_datum: " << code << "\n";
+               out << prefix << GEODETIC_DATUM_KW << ": " << code << "\n";
                break;
             }
 
@@ -2225,7 +2383,7 @@ std::ostream& ossimTiffInfo::printGeoKeys(
             case OGEOG_LINEAR_UNITS_GEO_KEY:// key 2052  Section 6.3.1.3 Codes
             {
                out << prefix << "linear_units_code: " << code << "\n";
-               printLinearUnits(out, prefix, std::string("linear_units"), code);
+               printLinearUnits(out, prefix, LINEAR_UNITS_KW, code);
                break;
             }
             
@@ -2577,6 +2735,21 @@ std::ostream& ossimTiffInfo::printGeoKeys(
                }
                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
             {               
@@ -2600,7 +2773,7 @@ std::ostream& ossimTiffInfo::printGeoKeys(
             case OVERTICAL_UNITS_GEO_KEY: // key 4099  Section 6.3.1.3 Codes
             {
                out << prefix << "vertical_units_code: " << code << "\n";
-               printLinearUnits(out, prefix, std::string("vertical_units"), code);
+               printLinearUnits(out, prefix, VERTICAL_UNITS_KW, code);
                break;
             }
  
@@ -2650,6 +2823,7 @@ std::ostream& ossimTiffInfo::printGeoKeys(
    return out;
 }
 
+
 std::ostream& ossimTiffInfo::printModelType(std::ostream& out,
                                             const std::string& prefix,
                                             ossim_uint16 code) const
@@ -2687,7 +2861,7 @@ std::ostream& ossimTiffInfo::printRasterType(std::ostream& out,
    }
    else if (code == 2)
    {
-      out << "pixels_is_point\n";
+      out << "pixel_is_point\n";
    }
    else
    {
@@ -3144,52 +3318,74 @@ bool ossimTiffInfo::getFloats(const ossimString& line,
    return result;
 }
 
-bool ossimTiffInfo::getGcsDatumCode(const ossimString& gtiffPrefix,
-                                    const ossimKeywordlist& gtiffKwl,
-                                    ossimString& pcsCode) const
+bool ossimTiffInfo::getDatumCode(const ossimString& gtiffPrefix,
+                                 const ossimKeywordlist& gtiffKwl,
+                                 ossimString& datumCode) const
 {
    bool result = false;
-
-   pcsCode.clear();
    
-   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), ossimKeywordNames::GCS_CODE_KW);
+   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 );
+   }
 
-      switch(code)
+   if ( !result )
+   {
+      // Try GCS_CODE_KW:
+      lookup = gtiffKwl.find(gtiffPrefix.c_str(), ossimKeywordNames::GCS_CODE_KW);
+      if ( lookup )
       {
-         case 4267:
-         {
-            pcsCode = "NAS-C";
-            break;
-         }
-         case 4269:
-         {
-            pcsCode = "NAR-C";
-            break;
-         }
-         case 4322:
-         {
-            pcsCode = "WGD";
-            break;
-         }
-         case 4326:
-         {
-            pcsCode = "WGE";
-            break;
-         }
-         
-      } // matches: switch(code)
+         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: if (lookup)
+   } // matches: switch(code)
 
-   if ( pcsCode.size() )
+   if ( datumCode.size() )
    {
       result = true;
    }
-   
    return result;
 }
 
@@ -3198,20 +3394,59 @@ bool ossimTiffInfo::getPcsCode(const ossimString& gtiffPrefix,
                                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;
+         }
+      }
+      
+   }
 
-      // See if we handle this code in our projection factories.
-      ossimRefPtr<ossimProjection>  proj = 
-         ossimEpsgProjectionFactory::instance()->createProjection(pcsCode);
-      if (proj.valid())
+   if (result == false)
+   {
+      // Check for key "pcs_citation":
+      lookup = gtiffKwl.find(gtiffPrefix.c_str(), "pcs_citation");
+      if ( lookup )
       {
-         proj = 0;
-         result = true;
+         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;
 }
 
@@ -3275,6 +3510,20 @@ bool ossimTiffInfo::getLinearUnits(const ossimString& gtiffPrefix,
    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
@@ -3464,7 +3713,7 @@ bool ossimTiffInfo::getOriginLat(const ossimString& gtiffPrefix,
    bool result = false;
 
    //---
-   // Not sure of the order of precidence here.
+   // Not sure of the order of precedence here.
    //---
    const char* projOriginLatGeoKey =
       gtiffKwl.find(gtiffPrefix.c_str(), ORIGIN_LATITUDE_KW.c_str());
@@ -3516,7 +3765,7 @@ bool ossimTiffInfo::getCentralMeridian(const ossimString& gtiffPrefix,
    bool result = false;
 
    //---
-   // Not sure of the order of precidence here.
+   // Not sure of the order of precedence here.
    //---
    const char* projCenterLongGeoKey =
       gtiffKwl.find(gtiffPrefix.c_str(), CENTER_LONGITUDE_KW.c_str());
diff --git a/src/ossim/support_data/ossimTiffWorld.cpp b/src/ossim/support_data/ossimTiffWorld.cpp
index 0de2eb1..0fabd67 100644
--- a/src/ossim/support_data/ossimTiffWorld.cpp
+++ b/src/ossim/support_data/ossimTiffWorld.cpp
@@ -9,13 +9,7 @@
 // Description: Container class for a tiff world file data.
 //
 //********************************************************************
-// $Id: ossimTiffWorld.cpp 18700 2011-01-19 20:21:28Z dburken $
-
-#include <iostream>
-#include <fstream>
-#include <iomanip>
-using namespace std;
-#include <math.h>
+// $Id: ossimTiffWorld.cpp 19682 2011-05-31 14:21:20Z dburken $
 
 #include <ossim/base/ossimConstants.h>
 #include <ossim/base/ossimDirectory.h>
@@ -24,6 +18,11 @@ using namespace std;
 #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()
@@ -66,7 +65,7 @@ bool ossimTiffWorld::open(const ossimFilename& file, ossimPixelType ptype, ossim
    bool result = false;
 
    ifstream is;
-   is.open(file);
+   is.open(file.c_str());
 
    if( !is.is_open() )
    {
diff --git a/src/ossim/support_data/ossimWavelength.cpp b/src/ossim/support_data/ossimWavelength.cpp
new file mode 100644
index 0000000..2289847
--- /dev/null
+++ b/src/ossim/support_data/ossimWavelength.cpp
@@ -0,0 +1,204 @@
+//----------------------------------------------------------------------------
+//
+// 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 }
+   //---
+   bool result = false;
+   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/ossim/support_data/ossimXmpInfo.cpp b/src/ossim/support_data/ossimXmpInfo.cpp
new file mode 100644
index 0000000..6cd7c21
--- /dev/null
+++ b/src/ossim/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/ossim/util/ossimBatchTest.cpp b/src/ossim/util/ossimBatchTest.cpp
new file mode 100644
index 0000000..00451ee
--- /dev/null
+++ b/src/ossim/util/ossimBatchTest.cpp
@@ -0,0 +1,1268 @@
+//----------------------------------------------------------------------------
+//
+// 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_allIsDisabled(false),
+   m_templateModeActive(false)
+{
+
+}
+
+//**************************************************************************************************
+// 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() )
+      {
+         m_allIsDisabled = true;
+         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() )
+      {
+         m_allIsDisabled = true;
+         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() )
+      {
+         m_allIsDisabled = true;
+         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() )
+      {
+         m_allIsDisabled = true;
+         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;
+
+   if ( m_allIsDisabled )
+      disableAllKwl(kwl);
+
+   // 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 << "Wrote: " << logFile << 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\nProcessing Test: " << testName << "\n";
+   m_logStr << "\n\nProcessing Test: " << 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...
+      }
+   }
+
+   m_logStr << "end_test: " << testName << "\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 )
+            {
+               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
+
+//**************************************************************************************************
+void ossimBatchTest::disableAllKwl(ossimKeywordlist& kwl)
+{
+   if ( kwl.getSize() )
+   {
+      // Get the number of test:
+      ossimString regExpStr = "test[0-9]+\\.";
+      const ossim_uint32 COUNT = kwl.getNumberOfSubstringKeys(regExpStr);
+      const ossim_uint32 MAX_INDEX = COUNT + 1000;
+      ossimString prefixBase = "test";
+      ossim_uint32 index = 0;
+      ossim_uint32 processedIndexes = 0;
+      
+      while ( processedIndexes < COUNT )
+      {
+         ossimString prefix =  prefixBase + ossimString::toString(index) + ".";
+         const char* lookup = kwl.find( prefix, "name" );
+         if (lookup)
+         {
+            kwl.add(prefix.c_str(), "enabled", "0", true);
+            kwl.add(prefix.c_str(), "run_clean_commands", "0", true);
+            kwl.add(prefix.c_str(), "run_expected_results_commands", "0", true);
+            kwl.add(prefix.c_str(), "run_test_commands", "0", true);
+            kwl.add(prefix.c_str(), "run_postprocessing_commands", "0", true);
+            ++processedIndexes;
+         }
+         ++index;
+         if ( index >= MAX_INDEX ) break; 
+      }
+   }
+   
+} // End: disableAllKwl(ossimKeywordlist& kwl)
+
+
+//**************************************************************************************************
+//! 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/src/ossim/util/ossimChipperUtil.cpp b/src/ossim/util/ossimChipperUtil.cpp
new file mode 100644
index 0000000..03d00c1
--- /dev/null
+++ b/src/ossim/util/ossimChipperUtil.cpp
@@ -0,0 +1,3861 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimChipperUtil.cpp
+// 
+// License:  LGPL
+// 
+// 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 22257 2013-05-01 19:21:35Z 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/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/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/ossimBumpShadeTileSource.h>
+#include <ossim/imaging/ossimFilterResampler.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/ossimScalarRemapper.h>
+#include <ossim/imaging/ossimTwoColorView.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 <sstream>
+#include <string>
+
+static ossimTrace traceDebug("ossimChipperUtil:debug");
+static ossimTrace traceLog("ossimChipperUtil:log");
+static ossimTrace traceOptions("ossimChipperUtil:options");
+
+static const char APPLICATION_NAME_KW[]     = "application_name";
+static const char COLOR_BLUE_KW[]           = "color_blue";
+static const char COLOR_GREEN_KW[]          = "color_green";
+static const char COLOR_RED_KW[]            = "color_red";
+static const char CUT_CENTER_LAT_KW[]       = "cut_center_latitude";
+static const char CUT_CENTER_LON_KW[]       = "cut_center_longitude";
+static const char CUT_CENTER_HEIGHT_KW[]    = "cut_center_height";  // pixels
+static const char CUT_CENTER_WIDTH_KW[]     = "cut_center_width";   // pixels
+static const char CUT_CENTER_RADIUS_KW[]    = "cut_center_radius";  // meters
+static const char CUT_MAX_LAT_KW[]          = "cut_maximum_latitude";
+static const char CUT_MAX_LON_KW[]          = "cut_maximum_longitude";
+static const char CUT_MIN_LAT_KW[]          = "cut_minimum_latitude";
+static const char CUT_MIN_LON_KW[]          = "cut_minimum_longitude";
+static const char DEM_KW[]                  = "dem";
+static const char GAIN_KW[]                 = "gain";
+static const char FILE_KW[]                 = "file";
+static const char HISTO_OP_KW[]             = "hist-op";
+static const char IMG_KW[]                  = "image";
+static const char LUT_FILE_KW[]             = "lut_file";
+static const char DEGREES_X_KW[]            = "degrees_x";
+static const char DEGREES_Y_KW[]            = "degrees_y";
+static const char METERS_KW[]               = "meters";
+static const char NORTH_UP_KW[]             = "north_up"; // bool
+static const char OP_KW[]                   = "operation";
+static const char OUTPUT_RADIOMETRY_KW[]    = "output_radiometry";
+static const char RESAMPLER_FILTER_KW[]     = "resampler_filter";
+static const char ROTATION_KW[]             = "rotation";
+static const char SCALE_2_8_BIT_KW[]        = "scale_2_8_bit";
+static const char SNAP_TIE_TO_ORIGIN_KW[]   = "snap_tie_to_origin";
+static const char SRC_FILE_KW[]             = "src_file";
+static const char SRS_KW[]                  = "srs";
+static const char THUMBNAIL_RESOLUTION_KW[] = "thumbnail_resolution"; // pixels
+static const char TRUE_KW[]                 = "true";
+static const char UP_IS_UP_KW[]             = "up_is_up"; // bool
+static const char WRITER_KW[]               = "writer";
+static const char WRITER_PROPERTY_KW[]      = "writer_property";
+
+static const char TWOCMV_OLD_INPUT_BAND_KW[]      = "2cmv_old_input_band";
+static const char TWOCMV_NEW_INPUT_BAND_KW[]      = "2cmv_new_input_band";
+static const char TWOCMV_RED_OUTPUT_SOURCE_KW[]   = "2cmv_red_output_source";
+static const char TWOCMV_GREEN_OUTPUT_SOURCE_KW[] = "2cmv_green_output_source";
+static const char 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)
+{
+   m_kwl->setExpandEnvVarsFlag(true);
+}
+
+ossimChipperUtil::~ossimChipperUtil()
+{
+}
+
+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("--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("--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.");
+   
+   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("--histogram-op", "<operation>\nHistogram operation to perform. Valid operations are \"auto-minmax\", \"std-stretch-1\", \"std-stretch-2\" and \"std-stretch-3\".");
+
+   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\", \"2cmv\"(two color multi view) and \"ortho\".\nchip = input projection = output projection(image space), single image operation only." );
+
+   au->addCommandLineOption("--options-keyword-list","<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("--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.\nSee ossim-info ----resampler-filters"); 
+
+   au->addCommandLineOption("-r or --rotate", "<degrees>\nRotate image by degrees. \"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("--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 an output reference frame/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("-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("--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");
+   
+} // End: ossimChipperUtil::addArguments
+
+bool ossimChipperUtil::initialize(ossimArgumentParser& ap)
+{
+   static const char MODULE[] = "ossimChipperUtil::initialize(ossimArgumentParser&)";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+   
+
+   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();
+
+   ossimString tempString1;
+   ossimArgumentParser::ossimParameter stringParam1(tempString1);
+   ossimString tempString2;
+   ossimArgumentParser::ossimParameter stringParam2(tempString2);
+   ossimString tempString3;
+   ossimArgumentParser::ossimParameter stringParam3(tempString3);
+   ossimString tempString4;
+   ossimArgumentParser::ossimParameter stringParam4(tempString4);
+   double tempDouble1;
+   ossimArgumentParser::ossimParameter doubleParam1(tempDouble1);
+   double tempDouble2;
+   ossimArgumentParser::ossimParameter doubleParam2(tempDouble2);
+
+   ossim_uint32 demIdx  = 0;
+   ossim_uint32 imgIdx  = 0;
+   ossim_uint32 propIdx = 0;
+   ossimString  key     = "";
+   
+   // Extract optional arguments and stuff them in a keyword list.
+   if( ap.read("--azimuth", stringParam1) )
+   {
+      m_kwl->add( ossimKeywordNames::AZIMUTH_ANGLE_KW, tempString1.c_str() );
+   }
+
+   if (ap.read("-b", stringParam1) || ap.read("--bands", stringParam1))
+   {
+      m_kwl->add( ossimKeywordNames::BANDS_KW, tempString1.c_str() );
+   }   
+   
+   if( ap.read("--central-meridian", stringParam1) )
+   {
+      m_kwl->add( ossimKeywordNames::CENTRAL_MERIDIAN_KW, tempString1.c_str() );
+   }
+
+   if( ap.read("--color", stringParam1, stringParam2, stringParam3) )
+   {
+      m_kwl->add( COLOR_RED_KW,   tempString1.c_str() );
+      m_kwl->add( COLOR_GREEN_KW, tempString2.c_str() );
+      m_kwl->add( COLOR_BLUE_KW,  tempString3.c_str() );
+   }
+
+   if( ap.read("--color-table", stringParam1) )
+   {
+      m_kwl->add( LUT_FILE_KW, tempString1.c_str() );
+   }
+
+   if( ap.read("--cut-bbox-ll", stringParam1, stringParam2, stringParam3, stringParam4) )
+   {
+      m_kwl->add( CUT_MIN_LAT_KW, tempString1.c_str() );
+      m_kwl->add( CUT_MIN_LON_KW, tempString2.c_str() );
+      m_kwl->add( CUT_MAX_LAT_KW, tempString3.c_str() );
+      m_kwl->add( CUT_MAX_LON_KW, tempString4.c_str() );
+   }
+   
+   if( ap.read("--cut-center-llwh", stringParam1, stringParam2, stringParam3, stringParam4) )
+   {
+      m_kwl->add( CUT_CENTER_LAT_KW,    tempString1.c_str() );
+      m_kwl->add( CUT_CENTER_LON_KW,    tempString2.c_str() );
+      m_kwl->add( CUT_CENTER_WIDTH_KW,  tempString3.c_str() );
+      m_kwl->add( CUT_CENTER_HEIGHT_KW, tempString4.c_str() );
+   }
+
+   if( ap.read("--cut-center-llr", stringParam1, stringParam2, stringParam3) )
+   {
+      m_kwl->add( CUT_CENTER_LAT_KW,    tempString1.c_str() );
+      m_kwl->add( CUT_CENTER_LON_KW,    tempString2.c_str() );
+      m_kwl->add( CUT_CENTER_RADIUS_KW, tempString3.c_str() );
+   }
+
+   int num_params = ap.numberOfParams("--degrees", doubleParam1);
+   if (num_params == 1)
+   {
+      ap.read("--degrees", doubleParam1);
+      m_kwl->add( DEGREES_X_KW, tempDouble1 );
+      m_kwl->add( DEGREES_Y_KW, tempDouble1 );
+   }
+   else if (num_params == 2)
+   {
+      ap.read("--degrees", doubleParam1, doubleParam2);
+      m_kwl->add( DEGREES_X_KW, tempDouble1 );
+      m_kwl->add( DEGREES_Y_KW, tempDouble2 );
+   }   
+
+   if ( ap.read("--elevation", stringParam1) )
+   {
+      m_kwl->add( ossimKeywordNames::ELEVATION_ANGLE_KW, tempString1.c_str() );
+   }
+
+   if ( ap.read("-e", stringParam1) || ap.read("--entry", stringParam1) )
+   {
+      m_kwl->add( ossimKeywordNames::ENTRY_KW, tempString1.c_str() );
+   }
+
+   if ( ap.read("--exaggeration", stringParam1) )
+   {
+      m_kwl->add( GAIN_KW, tempString1.c_str() );
+   }
+
+   if ( ap.read("--histogram-op", stringParam1) )
+   {
+      m_kwl->add( HISTO_OP_KW, tempString1.c_str() );
+   }
+
+   while( ap.read("--input-dem", stringParam1) )
+   {
+      key = DEM_KW;
+      key += ossimString::toString(demIdx);
+      key += ".";
+      key += FILE_KW;
+      m_kwl->add( key, tempString1.c_str() );
+      ++demIdx;
+   }
+   
+   while( ap.read("--input-img", stringParam1) )
+   {
+      key = IMG_KW;
+      key += ossimString::toString(imgIdx);
+      key += ".";
+      key += FILE_KW;
+      m_kwl->add(key, tempString1.c_str() );
+      ++imgIdx;
+   }
+
+   if( ap.read("--input-src", stringParam1) )
+   {
+      m_kwl->add( SRC_FILE_KW, tempString1.c_str() );
+   }
+
+   if( ap.read("--meters", stringParam1) )
+   {
+      m_kwl->add( METERS_KW, tempString1.c_str() );
+   }
+
+   if ( ap.read("-n") || ap.read("--north-up") )
+   {
+      m_kwl->add( NORTH_UP_KW, TRUE_KW);
+   }
+
+   if( ap.read("--op", stringParam1) )
+   {
+      m_kwl->add( OP_KW, tempString1.c_str() );
+   }
+
+   if( ap.read("--options-keyword-list", 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->add( ossimKeywordNames::ORIGIN_LATITUDE_KW, tempString1.c_str() );
+   }
+
+   if(ap.read("--output-radiometry", stringParam1))
+   {
+      m_kwl->add( OUTPUT_RADIOMETRY_KW, tempString1.c_str() );
+   }
+
+   if( ap.read("--projection", stringParam1) )
+   {
+      m_kwl->add( ossimKeywordNames::PROJECTION_KW, tempString1.c_str() );
+   }
+
+   if( ap.read("--resample-filter", stringParam1) )
+   {
+      m_kwl->add( RESAMPLER_FILTER_KW, tempString1.c_str() );
+   }
+
+   if ( ap.read("-r", stringParam1) || ap.read("--rotate", stringParam1) )
+   {
+      m_kwl->add( ROTATION_KW, tempString1.c_str() );
+   }
+
+   if ( ap.read("--scale-to-8-bit") )
+   {
+      m_kwl->add( SCALE_2_8_BIT_KW, TRUE_KW);
+   }
+
+   if ( ap.read("--snap-tie-to-origin") )
+   {
+      m_kwl->add( SNAP_TIE_TO_ORIGIN_KW, TRUE_KW);
+   }
+   
+   if( ap.read("--srs", stringParam1) )
+   {
+      if ( tempString1.contains("EPSG:") )
+      {
+         tempString1.gsub( ossimString("EPSG:"), ossimString("") );
+      }
+      m_kwl->add( SRS_KW, tempString1.c_str() );
+   }
+
+   if( ap.read("-t", stringParam1) || ap.read("--thumbnail", stringParam1) )
+   {
+      m_kwl->add( THUMBNAIL_RESOLUTION_KW, tempString1.c_str() );
+   }
+
+   if ( ap.read("-u") || ap.read("--up-is-up") )
+   {
+      m_kwl->add( UP_IS_UP_KW, TRUE_KW);
+   }
+
+   if( ap.read("-w", stringParam1) || ap.read("--writer", stringParam1) )
+   {
+      m_kwl->add( WRITER_KW, tempString1); 
+   }
+
+   while (ap.read("--writer-prop", stringParam1))
+   {
+      key = WRITER_PROPERTY_KW;
+      key += ossimString::toString(propIdx);
+      m_kwl->add(key, tempString1.c_str() );
+      ++propIdx;
+   }
+   
+   if( ap.read("--2cmv-old-input-band", stringParam1) )
+   {
+      m_kwl->add( TWOCMV_OLD_INPUT_BAND_KW, tempString1.c_str() );
+   }
+
+   if( ap.read("--2cmv-new-input-band", stringParam1) )
+   {
+      m_kwl->add( TWOCMV_NEW_INPUT_BAND_KW, tempString1.c_str() );
+   }
+   if( ap.read("--2cmv-red-output-source", stringParam1) )
+   {
+      m_kwl->add( TWOCMV_RED_OUTPUT_SOURCE_KW, tempString1.c_str() );
+   }
+   
+   if( ap.read("--2cmv-green-output-source", stringParam1) )
+   {
+      m_kwl->add( TWOCMV_GREEN_OUTPUT_SOURCE_KW, tempString1.c_str() );
+   }
+   
+   if( ap.read("--2cmv-blue-output-source", stringParam1) )
+   {
+      m_kwl->add( TWOCMV_BLUE_OUTPUT_SOURCE_KW, tempString1.c_str() );
+   }
+
+   // 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->add( key, file.c_str() );
+            ++demIdx;
+         }
+         else if ( isSrcFile(file) ) 
+         {
+            if ( m_kwl->find( SRC_FILE_KW ) ) // --input-src used also
+            {
+               std::string errMsg = MODULE;
+               errMsg += "ERROR Multiple src files passed in.  Please combine into one.";
+               throw ossimException(errMsg);
+            }
+            
+            m_kwl->add( SRC_FILE_KW, file.c_str() );
+         }
+         else // Add as an input image.
+         {
+            key = IMG_KW;
+            key += ossimString::toString(imgIdx);
+            key += ".";
+            key += FILE_KW;
+            m_kwl->add(key, file.c_str() );
+            ++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()
+{
+   static const char MODULE[] = "ossimChipperUtil::initialize()";
+
+   if ( traceOptions() )
+   {
+      ossimFilename optionsFile;
+      getOutputFilename(optionsFile);
+      optionsFile = optionsFile.noExtension();
+      optionsFile += "-options.kwl";
+      ossimString comment = " Can be use for --options-keyword-list argument.";
+      m_kwl->write( optionsFile.c_str(), comment.c_str() );
+   } 
+
+   // Determine the operation to do.
+   std::string op = m_kwl->findKey( std::string(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 == "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 )
+   {
+      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) << MODULE << " exited...\n";
+   }
+
+} // End: void ossimChipperUtil::initialize()
+
+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";
+   }
+
+   const char* lookup = 0;  // used throughout...
+
+   ossimRefPtr<ossimImageSource> source = 0;
+
+   if ( hasBumpShadeArg() )
+   {
+      // 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->find( GAIN_KW );
+      if ( lookup )
+      {
+         gain = ossimString::toFloat64(lookup);
+      }
+      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->find( ossimKeywordNames::AZIMUTH_ANGLE_KW );
+      if ( lookup )
+      {
+         ossim_float64 f = ossimString::toFloat64(lookup);
+         if ( (f >= 0) && (f <= 360) )
+         {
+            azimuthAngle = f;
+         }
+      }
+      bumpShade->setAzimuthAngle(azimuthAngle);
+
+      // Set the elevation angle.
+      ossim_float64 elevationAngle = 45.0;
+      lookup = m_kwl->find( ossimKeywordNames::ELEVATION_ANGLE_KW );
+      if ( lookup )
+      {
+         ossim_float64 f = ossimString::toFloat64(lookup);
+         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->find( COLOR_RED_KW );
+         if ( lookup )
+         {
+            r = ossimString(lookup).toUInt8();
+         }
+         lookup = m_kwl->find( COLOR_GREEN_KW );
+         if ( lookup )
+         {
+            g = ossimString(lookup).toUInt8();
+         }
+         lookup = m_kwl->find( COLOR_BLUE_KW );
+         if ( lookup )
+         {
+            b = ossimString(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();
+   }
+   else if ( m_operation == OSSIM_CHIPPER_OP_COLOR_RELIEF )
+   {
+      source = combineLayers();
+      if ( hasLutFile() )
+      {
+         source = addIndexToRgbLutFilter( source );
+      }
+      else
+      {
+         // No LUT file provided, so doing the default 8-bit linear stretch:
+         if ( source->getOutputScalarType() != OSSIM_UINT8 )
+         {
+            source = addScalarRemapper( source, OSSIM_UINT8 );
+         }
+      }
+   }
+   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 = combine2CmvLayers(); // Two Color Multiview.
+   }
+
+   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.
+      //---
+      ossimIrect aoi;
+      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();
+      }
+
+      // Set up the writer.
+      ossimRefPtr<ossimImageFileWriter> writer = createNewWriter();
+
+      // Connect the writer.
+      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.
+      //---
+      if ( !aoi.hasNans() )
+      {
+         writer->setAreaOfInterest(aoi);
+      }
+      
+      if (writer->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
+      {
+         // Add a listener to get percent complete.
+         ossimStdOutProgress prog(0, true);
+         writer->addListener(&prog);
+
+         if ( traceLog() )
+         {
+            ossimKeywordlist logKwl;
+            writer->saveStateOfAllInputs(logKwl);
+            
+            ossimFilename logFile;
+            getOutputFilename(logFile);
+            logFile.setExtension("log");
+            ossimKeywordlist kwl;
+            writer->saveStateOfAllInputs(kwl);
+            kwl.write(logFile.c_str() );
+         }
+         
+         // Write the file:
+         writer->execute();
+
+         writer->removeListener(&prog);
+      }
+   }
+   
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }   
+}
+
+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);
+   ossim_uint32 maxIndex = demCount + 1000; // 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;
+      const char* lookup = m_kwl->find( key.c_str() );
+      if ( lookup )
+      {
+         ossimFilename f = lookup;
+         addDemSource(f);
+         ++foundRecords;
+      }
+      ++i;
+      if ( i >= maxIndex ) break;
+   }
+
+   if ( m_srcKwl.valid() )
+   {
+      // Add stuff from src keyword list.
+      demCount = m_srcKwl->numberOf(DEM_KW);
+      maxIndex = demCount + 1000;
+      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)
+{
+   static const char MODULE[] = "ossimChipperUtil::addDemSource(const ossimFilename&)";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimRefPtr<ossimSingleImageChain> ic = createChain(file);
+   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);
+   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);
+   ossim_uint32 maxIndex = imgCount + 1000; // 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;
+      const char* lookup = m_kwl->find( key.c_str() );
+      if ( lookup )
+      {
+         ossimFilename f = lookup;
+         addImgSource(f);
+         ++foundRecords;
+      }
+      ++i;
+      if ( i >= maxIndex ) break;
+   }
+
+   if ( m_srcKwl.valid() )
+   {
+      // Add stuff from src keyword list.
+      imgCount = m_srcKwl->numberOf(IMG_KW);
+      maxIndex = imgCount + 1000;
+      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)
+{
+   static const char MODULE[] = "ossimChipperUtil::addImgSource";
+   
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimRefPtr<ossimSingleImageChain> ic = createChain(file);
+   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);
+   if ( ic.valid() )
+   {
+      m_imgLayer.push_back(ic);
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exiting...\n";
+   }
+}
+
+ossimRefPtr<ossimSingleImageChain> ossimChipperUtil::createChain(const ossimFilename& file) const
+{
+   static const char MODULE[] = "ossimChipperUtil::createChain(const ossimFilename&";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered..." << "\nfile: " << file << "\n";
+   }   
+   
+   ossimRefPtr<ossimSingleImageChain> ic = 0;
+
+   if ( file.size() )
+   {
+      if ( file.exists() )
+      {
+         ic = new ossimSingleImageChain;
+         if ( ic->open( file ) )
+         {
+            // Set the entry if not zero.
+            ossim_uint32 entryIndex = getEntryNumber();
+            if ( entryIndex )
+            {
+               if ( setChainEntry( ic, entryIndex ) == false )
+               {
+                  std::ostringstream errMsg;
+                  errMsg << MODULE << " ERROR:\nEntry " << entryIndex << " out of range!"
+                         << std::endl;
+                  throw ossimException( errMsg.str() );
+               }
+            }
+
+            // Bands selection: Two pieces here and then after the initialize of chain.
+            std::vector<ossim_uint32> bandList(0);
+            getBandList( bandList );
+            if ( bandList.size() == 3 )
+            {
+               if ( ( bandList[0] == 0 ) && ( bandList[1] == 1 ) && ( bandList[2] == 2 ) )
+               {
+                  ic->setThreeBandFlag( true );
+                  
+                  bandList.clear(); // Clear list as we don't need now.
+               }
+               else if ( ( bandList[0] == 2 ) && ( bandList[1] == 1 ) && ( bandList[2] == 0 ) )
+               {
+                  ic->setThreeBandReverseFlag( true );
+                  
+                  bandList.clear(); // Clear list as we don't need now.
+               }
+            }
+            
+            //---
+            // If multiple inputs and scaleToEightBit do it at the end of the processing
+            // chain to alleviate un-even stretches 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.
+            ic->setAddHistogramFlag( hasHistogramOperation() );
+
+            // Create the chain.
+            ic->createRenderedChain();
+
+            // Band selection: Do this post creation of chain if needed.
+            if ( bandList.size() )
+            {
+               ic->setBandSelection( bandList );
+            }
+
+            // Set the filter type if needed.
+            const char* lookup = m_kwl->find( RESAMPLER_FILTER_KW );
+            if ( lookup )
+            {
+               ic->getImageRenderer()->getResampler()->setFilterType(ossimString(lookup));
+            }
+
+            // Histogram setup.
+            if ( hasHistogramOperation() )
+            {
+               setupChainHistogram( ic );
+            }
+         }
+      }
+   }
+
+   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) 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.
+      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.
+      const char* lookup = m_kwl->find( RESAMPLER_FILTER_KW );
+      if ( lookup )
+      {
+         ic->getImageRenderer()->getResampler()->setFilterType(ossimString(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";
+   }
+
+   const char* op  = m_kwl->find(ossimKeywordNames::PROJECTION_KW);
+   const char* srs = m_kwl->find(SRS_KW);
+   
+   if ( op && srs )
+   {
+      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)
+   {
+      proj = getNewProjectionFromSrsCode( ossimString(srs) );
+   }
+   else if (op)
+   {
+      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 || m_kwl->find(METERS_KW) || m_kwl->find(DEGREES_X_KW))
+   {
+      // 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;
+               }
+               
+               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,
+                                                         1.0,1.0, //scale x and y
+                                                         0.0, 0.0, // translate x,y
+                                                         midPt.x, midPt.y); // pivot point
+
+               if ( m_kwl->find(METERS_KW) || m_kwl->find(DEGREES_X_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()
+{
+   ossimDpt scale;
+   scale.makeNan();
+   
+   if ( isIdentity() && m_ivt.valid() && m_geom.valid() )
+   {
+      // Check for GSD spec. Degrees/pixel takes priority over meters/pixel:
+      const char* lookup = m_kwl->find(DEGREES_X_KW);
+      if ( lookup )
+      {
+         ossimDpt outputDpp;
+         outputDpp.makeNan();
+
+         outputDpp.x = ossimString::toFloat64(lookup);
+
+         lookup = m_kwl->find(DEGREES_Y_KW);
+         if ( lookup )
+         {
+            outputDpp.y = ossimString::toFloat64(lookup);
+         }
+         
+         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 = outputDpp.x/inputDpp.x;
+               scale.y = outputDpp.y/inputDpp.y;
+            }
+         }
+      }
+      else
+      {
+         lookup = m_kwl->find(METERS_KW);
+         if ( lookup )
+         {
+            ossimDpt outputMpp;
+            outputMpp.makeNan();
+            outputMpp.x = ossimString::toFloat64(lookup);
+            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 = outputMpp.x/inputMpp.x;
+                  scale.y = outputMpp.y/inputMpp.y;
+               }
+            }
+         }
+      }
+   }
+
+   if ( !scale.hasNans() )
+   {
+      m_ivt->scale( scale.x, scale.y );
+   }
+   else
+   {
+      std::string errMsg = "ossimChipperUtil::initializeIvtScale failed!";
+      throw ossimException(errMsg);
+   }
+   
+} // 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();
+
+   // Check for GSD spec. Degrees/pixel takes priority over meters/pixel:
+   const char* lookup = m_kwl->find(DEGREES_X_KW);
+   if ( lookup )
+   {
+      gsd.x = ossimString::toFloat64(lookup);
+
+      lookup = m_kwl->find(DEGREES_Y_KW);
+      if ( lookup )
+      {
+         gsd.y = ossimString::toFloat64(lookup);
+      }
+      if ( !gsd.hasNans() )
+      {
+         mapProj->setDecimalDegreesPerPixel(gsd);
+      }
+   }
+   else
+   {
+      lookup = m_kwl->find(METERS_KW);
+      if ( lookup )
+      {
+         gsd.x = ossimString::toFloat64(lookup);
+         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();
+   const char* lookup = m_kwl->find(ossimKeywordNames::CENTRAL_MERIDIAN_KW);
+   if ( lookup )
+   {
+      result = ossimString::toFloat64(lookup);
+      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();
+   const char* lookup = m_kwl->find(ossimKeywordNames::ORIGIN_LATITUDE_KW);
+   if ( lookup )
+   {
+      result = ossimString::toFloat64(lookup);
+      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 ossimString& 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;
+
+   // 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() )
+   {
+      utm->setZone(origin);
+      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;
+   
+   const char* lookup = m_kwl->find( WRITER_KW );
+   if ( lookup ) // User defined.
+   {
+      writer = ossimImageWriterFactoryRegistry::instance()->createWriter(ossimString(lookup));
+
+      if ( !writer.valid() )
+      {
+         std::string errMsg = MODULE;
+         errMsg += " ERROR creating writer: ";
+         errMsg += lookup;
+         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);
+   for (ossim_uint32 i = 0; i < count; ++i)
+   {
+      ossimString key = WRITER_PROPERTY_KW;
+      key += ossimString::toString(i);
+      lookup = m_kwl->find( key.c_str() );
+      if ( lookup )
+      {
+         ossimString s = lookup;
+         std::vector<ossimString> splitArray;
+         s.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 );
+         }
+      }
+   }
+   
+   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;
+
+   // Loop through dem layers.
+   chainIdx = m_demLayer.begin();
+   while ( chainIdx != m_demLayer.end() )
+   {
+      ossimRefPtr<ossimImageRenderer> resampler = (*chainIdx)->getImageRenderer();
+      if ( resampler.valid() )
+      {
+         resampler->setView( m_geom.get() );
+      }
+      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();
+      if ( resampler.valid() )
+      {
+         resampler->setView( m_geom.get() );
+      }
+      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 = 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 = 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;
+}
+
+ossimRefPtr<ossimImageSource> ossimChipperUtil::combine2CmvLayers()
+{
+   static const char MODULE[] = "ossimChipperUtil::combine2CmvLayers()";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   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();
+      }
+   }
+   
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+   
+   return result;
+}
+
+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 = m_kwl->find( LUT_FILE_KW );
+      if ( lutFile.exists() )
+      {
+         lut->setLut(lutFile);
+         
+         // Connect to dems:
+         lut->connectMyInputTo( source.get() );
+
+         // Note sure about this.  Make option maybe? (drb)
+         lut->setInterpolationType(ossimIndexToRgbLutFilter::ossimIndexToRgbLutFilter_LINEAR);
+         
+         // 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 )
+               {
+                  ossimNotify(ossimNotifyLevel_WARN)
+                     << MODULE << " WARNING:"
+                     << "\nCould not open:  " << f << "\n";
+               }
+            }
+         }
+
+         if ( remapper->getHistogramFile() != ossimFilename::NIL )
+         {
+            const char* lookup = m_kwl->find(HISTO_OP_KW);
+            if (lookup)
+            {
+               result = true;
+               
+               // Enable.
+               remapper->setEnableFlag(true);
+               
+               // Set the histo mode:
+               ossimString op = lookup;
+               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);
+                  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
+{
+   static const char MODULE[] = "ossimChipperUtil::getOutputFilename()";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   } 
+
+   const char* lookup =  m_kwl->find( ossimKeywordNames::OUTPUT_FILE_KW );
+   if ( lookup )
+   {
+      f = lookup;
+   }
+   else
+   {
+      f = ossimFilename::NIL;
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }   
+}
+
+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_geom.valid() )
+      {
+         if ( m_kwl->find( CUT_CENTER_LAT_KW ) ) 
+         {
+            // "Cut Center" with: --cut-center-llwh or --cut-center-llr:
+
+            const char* latStr = m_kwl->find( CUT_CENTER_LAT_KW );
+            const char* lonStr = m_kwl->find( CUT_CENTER_LON_KW );
+            if ( latStr && lonStr )
+            {
+               ossimGpt centerGpt;
+
+               //---
+               // Want the height nan going into worldToLocal call so it gets picked
+               // up by the elevation manager.
+               //---
+               centerGpt.makeNan(); 
+
+               centerGpt.lat = ossimString(latStr).toFloat64();
+               centerGpt.lon = ossimString(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:
+                     const char* widthStr  = m_kwl->find( CUT_CENTER_WIDTH_KW );
+                     const char* heightStr = m_kwl->find( CUT_CENTER_HEIGHT_KW );
+                     if ( widthStr && heightStr )
+                     {
+                        ossim_int32 width  = ossimString(widthStr).toInt32();
+                        ossim_int32 height = ossimString(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: 
+                     {
+                        const char* radiusStr = m_kwl->find( CUT_CENTER_RADIUS_KW );
+                        if ( radiusStr )
+                        {
+                           ossim_float64 radius = ossimString(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 ) ) // --cut-bbox-ll
+         {
+            const char* maxLat = m_kwl->find( CUT_MAX_LAT_KW );
+            const char* maxLon = m_kwl->find( CUT_MAX_LON_KW );
+            const char* minLat = m_kwl->find( CUT_MIN_LAT_KW );
+            const char* minLon = m_kwl->find( CUT_MIN_LON_KW );
+         
+            if ( maxLat && maxLon && minLat && minLon )
+            {
+               ossim_float64 minLatF = ossimString(minLat).toFloat64();
+               ossim_float64 maxLatF = ossimString(maxLat).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;
+               }
+            
+               ossimGpt gpt(0.0, 0.0, 0.0);
+               ossimDpt ulPt;
+               ossimDpt lrPt;
+            
+               // Upper left:
+               gpt.lat = maxLatF;
+               gpt.lon = ossimString(minLon).toFloat64();
+               m_geom->worldToLocal(gpt, ulPt);
+            
+               // Lower right:
+               gpt.lat = minLatF;
+               gpt.lon = ossimString(maxLon).toFloat64();
+               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) );
+            }
+         }
+
+         // If no user defined rect set to scene bounding rect.
+         if ( rect.hasNans() ) 
+         {
+            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 ( 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:
+      //---
+      const char* thumbRes = m_kwl->find(THUMBNAIL_RESOLUTION_KW);
+      if ( thumbRes )
+      {
+         ossim_float64 thumbSize = ossimString(thumbRes).toFloat64();
+         ossim_float64 maxRectDimension =
+            ossim::max( originalRect.width(), originalRect.height() );
+         
+         if ( maxRectDimension > thumbSize )
+         {
+            // Need to adjust scale:
+            
+            // Get the corners:
+            ossimGpt ulGpt;
+            ossimGpt lrGpt;
+            ossimDpt dpt;
+            
+            m_geom->localToWorld(ossimDpt(originalRect.ul()), ulGpt);
+            m_geom->localToWorld(ossimDpt(originalRect.lr()), lrGpt);         
+            
+            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.
+            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.
+            ossim_int32 ts = thumbSize;
+
+            if ( (lr.x - ul.x + 1) > ts )
+            {
+               lr.x = ul.x + ts - 1;
+            }
+            if ( (lr.y - ul.y + 1) > ts )
+            {
+               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->find( ossimKeywordNames::BANDS_KW ) != 0 );
+   }
+   return result;
+}
+
+void ossimChipperUtil::getBandList( std::vector<ossim_uint32>& bandList ) const
+{
+   bandList.clear();
+   if ( m_kwl.valid() )
+   {
+      std::string s = m_kwl->findKey( std::string( ossimKeywordNames::BANDS_KW ) );
+      if ( s.size() )
+      {
+         ossimString os = s;
+         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 ) != 0 );
+   }
+   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 ) ||
+                 m_kwl->find( COLOR_GREEN_KW ) ||
+                 m_kwl->find( COLOR_BLUE_KW ) ||
+                 m_kwl->find( ossimKeywordNames::ELEVATION_ANGLE_KW ) ||
+                 m_kwl->find( GAIN_KW ) );
+   }
+   return result;
+}
+
+bool ossimChipperUtil::hasThumbnailResolution() const
+{
+   bool result = false;
+   if ( m_kwl.valid() )
+   {
+      result = ( m_kwl->find(THUMBNAIL_RESOLUTION_KW) != 0 );
+   }
+   return result;
+}
+
+bool ossimChipperUtil::hasHistogramOperation() const
+{
+   bool result = false;
+   
+   if ( m_kwl.valid() )
+   {
+      result = ( m_kwl->find(HISTO_OP_KW) != 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;
+   const char* lookup = m_kwl->find(OUTPUT_RADIOMETRY_KW);
+   if ( lookup )
+   {
+      scalar = ossimScalarTypeLut::instance()->getScalarTypeFromString( ossimString(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 ( ( m_operation == OSSIM_CHIPPER_OP_COLOR_RELIEF ) || // Always 8 bit...
+        ( getOutputScalarType() == OSSIM_UINT8 ) )
+   {
+      result = true;
+   }
+   return result;
+}
+
+bool ossimChipperUtil::snapTieToOrigin() const
+{
+   return keyIsTrue( std::string(SNAP_TIE_TO_ORIGIN_KW) );
+}
+
+ossim_float64 ossimChipperUtil::getRotation() const
+{
+   ossim_float64 result = ossim::nan();
+   if ( m_kwl.valid() )
+   {
+      std::string value = m_kwl->findKey(std::string(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;
+}
+
+bool ossimChipperUtil::hasSensorModelInput() const
+{
+   bool result = false;
+
+   // Test image layers.
+   std::vector< ossimRefPtr<ossimSingleImageChain> >::const_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() )
+   {
+      result += m_kwl->numberOf(DEM_KW);
+      result += m_kwl->numberOf(IMG_KW);
+   }
+   if ( m_srcKwl.valid() )
+   {
+      result += m_srcKwl->numberOf(DEM_KW);
+      result += m_srcKwl->numberOf(IMG_KW);
+   }
+   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::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)
+      << "\nExample commands:\n"
+
+      << "\n// A 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 --scale-to-8-bit 5V090205P0001912264B220000100282M_001508507.ntf outputs/r39.png\n"
+
+      << "\n// Above command where all options are in a keyword list:\n"
+      << appName << " --options-keyword-list r39-options.kwl\n"
+      << std::endl;
+}
diff --git a/src/ossim/util/ossimElevUtil.cpp b/src/ossim/util/ossimElevUtil.cpp
deleted file mode 100644
index bc3a782..0000000
--- a/src/ossim/util/ossimElevUtil.cpp
+++ /dev/null
@@ -1,2676 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  LGPL
-// 
-// 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$
-
-#include <string>
-
-#include <ossim/util/ossimElevUtil.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/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/ossimStdOutProgress.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimTrace.h>
-
-#include <ossim/imaging/ossimBumpShadeTileSource.h>
-#include <ossim/imaging/ossimFilterResampler.h>
-#include <ossim/imaging/ossimImageFileWriter.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/ossimScalarRemapper.h>
-
-#include <ossim/init/ossimInit.h>
-
-#include <ossim/projection/ossimEquDistCylProjection.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>
-
-static ossimTrace traceDebug   = ossimTrace("ossimElevUtil:debug");
-static ossimTrace traceLog     = ossimTrace("ossimElevUtil:log");
-static ossimTrace traceOptions = ossimTrace("ossimElevUtil:options");
-
-
-static const char COLOR_BLUE_KW[]           = "color_blue";
-static const char COLOR_GREEN_KW[]          = "color_green";
-static const char COLOR_RED_KW[]            = "color_red";
-static const char CUT_CENTER_LAT_KW[]       = "cut_center_latitude";
-static const char CUT_CENTER_LON_KW[]       = "cut_center_longitude";
-static const char CUT_CENTER_HEIGHT_KW[]    = "cut_center_height"; // pixels
-static const char CUT_CENTER_WIDTH_KW[]     = "cut_center_width";  // pixels
-static const char CUT_MAX_LAT_KW[]          = "cut_maximum_latitude";
-static const char CUT_MAX_LON_KW[]          = "cut_maximum_longitude";
-static const char CUT_MIN_LAT_KW[]          = "cut_minimum_latitude";
-static const char CUT_MIN_LON_KW[]          = "cut_minimum_longitude";
-static const char DEM_KW[]                  = "dem";
-static const char GAIN_KW[]                 = "gain";
-static const char FILE_KW[]                 = "file";
-static const char HISTO_OP_KW[]             = "hist-op";
-static const char IMG_KW[]                  = "image";
-static const char LUT_FILE_KW[]             = "lut_file";
-static const char METERS_KW[]               = "meters";
-static const char OP_KW[]                   = "operation";
-static const char RESAMPLER_FILTER_KW[]     = "resampler_filter";
-static const char SCALE_2_8_BIT_KW[]        = "scale_2_8_bit";
-static const char SRC_FILE_KW[]             = "src_file";
-static const char SRS_KW[]                  = "srs";
-static const char THUMBNAIL_RESOLUTION_KW[] = "thumbnail_resolution"; // pixels
-static const char WRITER_KW[]               = "writer";
-static const char WRITER_PROPERTY_KW[]      = "writer_property";
-
-ossimElevUtil::ossimElevUtil()
-   : ossimReferenced(),
-     m_operation(OSSIM_DEM_OP_UNKNOWN),
-     m_kwl(new ossimKeywordlist()),
-     m_srcKwl(0),
-     m_outputProjection(0),
-     m_demLayer(0),
-     m_imgLayer(0)
-{
-   m_kwl->setExpandEnvVarsFlag(true);
-}
-
-ossimElevUtil::~ossimElevUtil()
-{
-}
-
-void ossimElevUtil::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 \"ossimElevUtil:debug\"   - General debug trace to standard out.\n-T \"ossimElevUtil:log\"     - Writes a log file to output-file.log.\n-T \"ossimElevUtil:op [...]
-
-   ossimApplicationUsage* appuse = ap.getApplicationUsage();
-   
-   appuse->setCommandLineUsage(usageString);
-   
-   appuse->setDescription(ap.getApplicationName()+" Utility application for generating elevation products from dem data.");
-   
-   appuse->addCommandLineOption("--azimuth", "<azimuth>\nhillshade option - Light source azimuth angle for bump shade.\nRange: 0 to 360, Default = 180.0");
-
-   appuse->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.");
-
-   appuse->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");
-
-   appuse->addCommandLineOption("--color-table","<color-table.kwl>\nhillshade or color-relief option - Keyword list containing color table for color-relief option.");
-
-   appuse->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.");
-   
-   appuse->addCommandLineOption("--cut-center-llwh","<latitude> <longitude> <width> <height>\nSpecify the center cut in latitude longitude space with width and height in pixels.");
-
-   appuse->addCommandLineOption("--elevation", "<elevation>\nhillshade option - Light source elevation angle for bumb shade.\nRange: 0 to 90, Default = 45.0");
-   
-   appuse->addCommandLineOption("--gain", "<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");
-   
-   appuse->addCommandLineOption("-h or --help", "Display this help and exit.");
-
-   appuse->addCommandLineOption("--histogram-op", "<operation>\nHistogram operation to perform. Valid operations are \"auto-minmax\", \"std-stretch-1\", \"std-stretch-2\" and \"std-stretch-3\".");
-
-   appuse->addCommandLineOption("--input-dem", "<dem> Input dem to process.");
-
-   appuse->addCommandLineOption("--input-img", "<image> Input image to process.");
-   
-   appuse->addCommandLineOption("--input-src","<file.src> Input source file list keyword list with list of dems or images or both to process.");
-   
-   appuse->addCommandLineOption("--meters", "<meters>\nSpecifies an override for the meters per pixel");
-      
-   appuse->addCommandLineOption("--op","<operation>\nOperation to perform. Valid operations are \"color-relief\", \"hillshade\" and \"ortho\".");
-
-   appuse->addCommandLineOption("--options-keyword-list","<options.kwl>  This can be all or part of the application options.  To get a template you can turn on trace to the ossimElevUtil class by adding \"-T ossimElevUtil\" to your command.");
-
-   appuse->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.");
-
-   appuse->addCommandLineOption("--projection", "<output_projection> Can be input, geo, geo-scaled, or utm.\nIf input and multiple sources the projection of the first image will be used.\nIf geo-scaled the origin of latitude will be set to scene center.\nIf utm the zone will be set from the scene center.\nIf --srs is used it takes precident over this option.");
-   
-   appuse->addCommandLineOption(
-      "--resample-filter","<type>\nSpecify what resampler filter to use, e.g. nearest neighbor, bilinear, cubic.\nSee ossim-info ----resampler-filters"); 
-
-   appuse->addCommandLineOption("--scale-to-8-bit","Scales output to eight bits if not already.");
-   
-   appuse->addCommandLineOption("--srs","<src_code>\nSpecify an output reference frame/projection. Example: --srs EPSG:4326");
-
-   appuse->addCommandLineOption("-t or --thumbnail", "<max_dimension>\nSpecify a thumbnail resolution.\nScale will be adjusted so the maximum dimension = argument given.");
-   
-   appuse->addCommandLineOption(
-      "-w or --writer","<writer>\nSpecifies the output writer.  Default uses output file extension to "
-      "determine writer.");
-   
-   appuse->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.");
-}
-
-bool ossimElevUtil::initialize(ossimArgumentParser& ap)
-{
-   static const char MODULE[] = "ossimElevUtil::initialize(ossimArgumentParser&)";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-   
-   //---
-   // Start with clean options keyword list.
-   //---
-   m_kwl->clear();
-   
-   ossimString tempString1;
-   ossimArgumentParser::ossimParameter stringParam1(tempString1);
-   ossimString tempString2;
-   ossimArgumentParser::ossimParameter stringParam2(tempString2);
-   ossimString tempString3;
-   ossimArgumentParser::ossimParameter stringParam3(tempString3);
-   ossimString tempString4;
-   ossimArgumentParser::ossimParameter stringParam4(tempString4);
-
-   if( ap.read("-h") || ap.read("--help") || (ap.argc() == 1) )
-   {
-      // Print the usage from the arg parser.
-      ap.getApplicationUsage()->write( ossimNotify(ossimNotifyLevel_NOTICE) );
-
-      // Print the valid writer types.
-      ossimNotify(ossimNotifyLevel_NOTICE)
-         << "\nValid output writer types for \"-w\" or \"--writer\" option:\n\n";
-      ossimImageWriterFactoryRegistry::instance()->
-         printImageTypeList( ossimNotify(ossimNotifyLevel_NOTICE) );
-      
-      return false; // indicates process should be terminated
-   }   
-
-   //---
-   // Extract optional arguments.
-   //---
-   ossim_uint32 demIdx  = 0;
-   ossim_uint32 imgIdx  = 0;
-   ossim_uint32 propIdx = 0;
-   ossimString  key     = "";
-   
-   //---
-   // Extract optional arguments and stuff them in a keyword list.
-   //---
-   if( ap.read("--azimuth", stringParam1) )
-   {
-      m_kwl->add( ossimKeywordNames::AZIMUTH_ANGLE_KW, tempString1.c_str() );
-   }
-   
-   if( ap.read("--central-meridian") )
-   {
-      m_kwl->add( ossimKeywordNames::CENTRAL_MERIDIAN_KW, tempString1.c_str() );
-   }
-
-   if( ap.read("--color", stringParam1, stringParam2, stringParam3) )
-   {
-      m_kwl->add( COLOR_RED_KW,   tempString1.c_str() );
-      m_kwl->add( COLOR_GREEN_KW, tempString2.c_str() );
-      m_kwl->add( COLOR_BLUE_KW,  tempString3.c_str() );
-   }
-
-   if( ap.read("--color-table", stringParam1) )
-   {
-      m_kwl->add( LUT_FILE_KW, tempString1.c_str() );
-   }
-
-   if( ap.read("--cut-bbox-ll", stringParam1, stringParam2, stringParam3, stringParam4) )
-   {
-      m_kwl->add( CUT_MIN_LAT_KW, tempString1.c_str() );
-      m_kwl->add( CUT_MIN_LON_KW, tempString2.c_str() );
-      m_kwl->add( CUT_MAX_LAT_KW, tempString3.c_str() );
-      m_kwl->add( CUT_MAX_LON_KW, tempString4.c_str() );
-   }
-   
-   if( ap.read("--cut-center-llwh", stringParam1, stringParam2, stringParam3, stringParam4) )
-   {
-      m_kwl->add( CUT_CENTER_LAT_KW,    tempString1.c_str() );
-      m_kwl->add( CUT_CENTER_LON_KW,    tempString2.c_str() );
-      m_kwl->add( CUT_CENTER_WIDTH_KW,  tempString3.c_str() );
-      m_kwl->add( CUT_CENTER_HEIGHT_KW, tempString4.c_str() );
-   }
-
-   if ( ap.read("--histogram-op", stringParam1) )
-   {
-      m_kwl->add( HISTO_OP_KW, tempString1.c_str() );
-   }
-   
-   while( ap.read("--input-dem", stringParam1) )
-   {
-      key = DEM_KW;
-      key += ossimString::toString(demIdx);
-      key += ".";
-      key += FILE_KW;
-      m_kwl->add( key, tempString1.c_str() );
-      ++demIdx;
-   }
-   
-   while( ap.read("--input-img", stringParam1) )
-   {
-      key = IMG_KW;
-      key += ossimString::toString(imgIdx);
-      key += ".";
-      key += FILE_KW;
-      m_kwl->add(key, tempString1.c_str() );
-      ++imgIdx;
-   }
-
-   if( ap.read("--input-src", stringParam1) )
-   {
-      m_kwl->add( SRC_FILE_KW, tempString1.c_str() );
-   }
-   
-   if( ap.read("--elevation", stringParam1) )
-   {
-      m_kwl->add( ossimKeywordNames::ELEVATION_ANGLE_KW, tempString1.c_str() );
-   }
-
-   if( ap.read("--gain", stringParam1) )
-   {
-      m_kwl->add( GAIN_KW, tempString1.c_str() );
-   }
-
-   if( ap.read("--meters", stringParam1) )
-   {
-      m_kwl->add( METERS_KW, tempString1.c_str() );
-   }
-
-   if( ap.read("--op", stringParam1) )
-   {
-      m_kwl->add( OP_KW, tempString1.c_str() );
-   }
-
-   if( ap.read("--options-keyword-list", 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;
-            throw ossimException(errMsg);
-         }
-      }
-      else
-      {
-         std::string errMsg = "ERROR options keyword list file does not exists: ";
-         errMsg += optionsKwl;
-         throw ossimException(errMsg); 
-      }
-   }
-   
-   if( ap.read("--origin-latitude", stringParam1) )
-   {
-      m_kwl->add( ossimKeywordNames::ORIGIN_LATITUDE_KW, tempString1.c_str() );
-   }
-
-   if( ap.read("--projection", stringParam1) )
-   {
-      m_kwl->add( ossimKeywordNames::PROJECTION_KW, tempString1.c_str() );
-   }
-
-   if( ap.read("--origin-latitude", stringParam1) )
-   {
-      m_kwl->add( ossimKeywordNames::ORIGIN_LATITUDE_KW, tempString1.c_str() );
-   }
-
-   if( ap.read("--resample-filter", stringParam1) )
-   {
-      m_kwl->add( RESAMPLER_FILTER_KW, tempString1.c_str() );
-   }
-
-   if ( ap.read("--scale-to-8-bit") )
-   {
-      m_kwl->add( SCALE_2_8_BIT_KW, "true");
-   }
-   
-   if( ap.read("--srs", stringParam1) )
-   {
-      if ( tempString1.contains("EPSG:") )
-      {
-         tempString1.gsub( ossimString("EPSG:"), ossimString("") );
-      }
-      m_kwl->add( SRS_KW, tempString1.c_str() );
-   }
-
-   if( ap.read("-t", stringParam1) || ap.read("--thumbnail", stringParam1) )
-   {
-      m_kwl->add( THUMBNAIL_RESOLUTION_KW, tempString1.c_str() );
-   }   
-
-   if( ap.read("-w", stringParam1) || ap.read("--writer", stringParam1) )
-   {
-      m_kwl->add( WRITER_KW, tempString1); 
-   }
-
-   while (ap.read("--writer-prop", stringParam1))
-   {
-      key = WRITER_PROPERTY_KW;
-      key += ossimString::toString(propIdx);
-      m_kwl->add(key, tempString1.c_str() );
-      ++propIdx;
-   }
-
-   // 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->add( key, file.c_str() );
-            ++demIdx;
-         }
-         else if ( isSrcFile(file) ) 
-         {
-            if ( m_kwl->find( SRC_FILE_KW ) ) // --input-src used also
-            {
-               std::string errMsg = MODULE;
-               errMsg += "ERROR Multiple src files passed in.  Please combine into one.";
-               throw ossimException(errMsg);
-            }
-            
-            m_kwl->add( SRC_FILE_KW, file.c_str() );
-         }
-         else // Add as an input image.
-         {
-            key = IMG_KW;
-            key += ossimString::toString(imgIdx);
-            key += ".";
-            key += FILE_KW;
-            m_kwl->add(key, file.c_str() );
-            ++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 ossimElevUtil::initialize(ossimArgumentParser& ap)
-
-void ossimElevUtil::initialize()
-{
-   static const char MODULE[] = "ossimElevUtil::initialize()";
-
-   if ( traceOptions() )
-   {
-      ossimFilename optionsFile;
-      getOutputFilename(optionsFile);
-      optionsFile = optionsFile.noExtension();
-      optionsFile += "-options.kwl";
-      ossimString comment = " Can be use for --options-keyword-list argument.";
-      m_kwl->write( optionsFile.c_str(), comment.c_str() );
-   } 
-
-   // Determine the operation to do.
-   const char* lookup = m_kwl->find(OP_KW);
-   if ( lookup )
-   {
-      ossimString s = lookup;
-      s.downcase();
-      
-      if ( s == "hillshade" )
-      {
-         m_operation = OSSIM_DEM_OP_HILL_SHADE;
-      }
-      else if ( s == "color-relief" )
-      {
-         m_operation = OSSIM_DEM_OP_COLOR_RELIEF;
-      }
-      else if ( s == "ortho" )
-      {
-         m_operation = OSSIM_DEM_OP_ORTHO;
-      }
-      else
-      {
-         std::string errMsg = "unknown operation: ";
-         errMsg += s;
-         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();
-
-   // Create chains for any dem sources.
-   addDemSources();
-
-   // Create chains for any image sources.
-   addImgSources();
-
-   // Create the output projection.
-   createOutputProjection();
-
-   // Setup the view in all the chains.
-   propagateOutputProjectionToChains();
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-
-} // End: void ossimElevUtil::initialize()
-
-void ossimElevUtil::execute()
-{
-   static const char MODULE[] = "ossimElevUtil::execute";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   const char* lookup = 0;  // used throughout...
-
-   ossimRefPtr<ossimImageSource> source = 0;
-
-   if ( hasBumpShadeArg() )
-   {
-      // 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->find( GAIN_KW );
-      if ( lookup )
-      {
-         gain = ossimString::toFloat64(lookup);
-      }
-      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->find( ossimKeywordNames::AZIMUTH_ANGLE_KW );
-      if ( lookup )
-      {
-         ossim_float64 f = ossimString::toFloat64(lookup);
-         if ( (f >= 0) && (f <= 360) )
-         {
-            azimuthAngle = f;
-         }
-      }
-      bumpShade->setAzimuthAngle(azimuthAngle);
-
-      // Set the elevation angle.
-      ossim_float64 elevationAngle = 45.0;
-      lookup = m_kwl->find( ossimKeywordNames::ELEVATION_ANGLE_KW );
-      if ( lookup )
-      {
-         ossim_float64 f = ossimString::toFloat64(lookup);
-         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->find( COLOR_RED_KW );
-         if ( lookup )
-         {
-            r = ossimString(lookup).toUInt8();
-         }
-         lookup = m_kwl->find( COLOR_GREEN_KW );
-         if ( lookup )
-         {
-            g = ossimString(lookup).toUInt8();
-         }
-         lookup = m_kwl->find( COLOR_BLUE_KW );
-         if ( lookup )
-         {
-            b = ossimString(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();
-   }
-   else if ( m_operation == OSSIM_DEM_OP_COLOR_RELIEF )
-   {
-      source = combineLayers();
-      if ( hasLutFile() )
-      {
-         source = addIndexToRgbLutFilter( source );
-      }
-      else
-      {
-         // No LUT file provided, so doing the default 8-bit linear stretch:
-         source = addScalarRemapper( source );
-      }
-   }
-   else if ( m_operation == OSSIM_DEM_OP_ORTHO )
-   {
-      source = combineLayers();
-   }
-
-   if ( source.valid() )
-   {
-      // This is conditional.  May be set at the ossimSingleImageChain level.
-      if ( scaleToEightBit() && ( source->getOutputScalarType() != OSSIM_UINT8 ) )
-      {
-         source = addScalarRemapper( source );
-      }
-      
-      //---
-      // 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.
-      //---
-      ossimIrect aoi;
-      getAreaOfInterest(source.get(), aoi);
-
-      if ( hasThumbnailResolution() )
-      {
-         // Adjust the projection scale and get the new rect.
-         initializeThumbnailProjection( aoi, aoi );
-      }
-
-      // Set up the writer.
-      ossimRefPtr<ossimImageFileWriter> writer = createNewWriter();
-
-      // Connect the writer.
-      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.
-      //---
-      if ( !aoi.hasNans() )
-      {
-         writer->setAreaOfInterest(aoi);
-      }
-      
-      // Add a listener to get percent complete.
-      ossimStdOutProgress prog(0, true);
-      writer->addListener(&prog);
-
-      if ( traceLog() )
-      {
-         ossimKeywordlist logKwl;
-         writer->saveStateOfAllInputs(logKwl);
-         
-         ossimFilename logFile;
-         getOutputFilename(logFile);
-         logFile.setExtension("log");
-         ossimKeywordlist kwl;
-         writer->saveStateOfAllInputs(kwl);
-         kwl.write( logFile.c_str() );
-      }
-      
-      if (writer->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
-      {
-         //---
-         // Set the view ossimImageGeometry image size so that external geometries
-         // have the correct "image_size" key/value.
-         //---
-         ossimRefPtr<ossimConnectableObject> obj = writer->getInput(0);
-         ossimRefPtr<ossimImageSource> imgSrc = dynamic_cast<ossimImageSource*>(obj.get());
-         if ( imgSrc.valid() )
-         {
-            ossimRefPtr<ossimImageGeometry> geom = imgSrc->getImageGeometry();
-            if ( geom.valid() )
-            {
-               ossimIrect aoi = writer->getAreaOfInterest();
-               geom->setImageSize(aoi.size());
-            }
-         }
-         
-         // Write the file:
-         writer->execute();
-      }
-
-      writer->removeListener(&prog);
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }   
-}
-
-void ossimElevUtil::addDemSources()
-{
-   static const char MODULE[] = "ossimElevUtil::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);
-   ossim_uint32 maxIndex = demCount + 1000; // 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;
-      const char* lookup = m_kwl->find( key.c_str() );
-      if ( lookup )
-      {
-         ossimFilename f = lookup;
-         addDemSource(f);
-         ++foundRecords;
-      }
-      ++i;
-      if ( i >= maxIndex ) break;
-   }
-
-   if ( m_srcKwl.valid() )
-   {
-      // Add stuff from src keyword list.
-      demCount = m_srcKwl->numberOf(DEM_KW);
-      maxIndex = demCount + 1000;
-      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 ossimElevUtil::addDemSource(const ossimFilename& file)
-{
-   static const char MODULE[] = "ossimElevUtil::addDemSource(const ossimFilename&)";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimRefPtr<ossimSingleImageChain> ic = createChain(file);
-   if ( ic.valid() )
-   {
-      m_demLayer.push_back(ic);
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exiting...\n";
-   }
-}
-
-void ossimElevUtil::addDemSource(const ossimSrcRecord& rec)
-{
-   static const char MODULE[] = "ossimElevUtil::addDemSource(const ossimSrcRecord&)";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimRefPtr<ossimSingleImageChain> ic = createChain(rec);
-   if ( ic.valid() )
-   {
-      m_demLayer.push_back(ic);
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exiting...\n";
-   }
-}
-
-void ossimElevUtil::addImgSources()
-{
-   static const char MODULE[] = "ossimElevUtil::addImgSources";
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-   
-   ossim_uint32 imgCount = m_kwl->numberOf(IMG_KW);
-   ossim_uint32 maxIndex = imgCount + 1000; // 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;
-      const char* lookup = m_kwl->find( key.c_str() );
-      if ( lookup )
-      {
-         ossimFilename f = lookup;
-         addImgSource(f);
-         ++foundRecords;
-      }
-      ++i;
-      if ( i >= maxIndex ) break;
-   }
-
-   if ( m_srcKwl.valid() )
-   {
-      // Add stuff from src keyword list.
-      imgCount = m_srcKwl->numberOf(IMG_KW);
-      maxIndex = imgCount + 1000;
-      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 ossimElevUtil::addImgSource(const ossimFilename& file)
-{
-   static const char MODULE[] = "ossimElevUtil::addImgSource";
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimRefPtr<ossimSingleImageChain> ic = createChain(file);
-   if ( ic.valid() )
-   {
-      m_imgLayer.push_back(ic);
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exiting...\n";
-   }
-}
-
-void ossimElevUtil::addImgSource(const ossimSrcRecord& rec)
-{
-   static const char MODULE[] = "ossimElevUtil::addImgSource(const ossimSrcRecord&)";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimRefPtr<ossimSingleImageChain> ic = createChain(rec);
-   if ( ic.valid() )
-   {
-      m_imgLayer.push_back(ic);
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exiting...\n";
-   }
-}
-
-ossimRefPtr<ossimSingleImageChain> ossimElevUtil::createChain(const ossimFilename& file) const
-{
-   static const char MODULE[] = "ossimElevUtil::createChain(const ossimFilename&";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered..."
-         << "\nfile: " << file << "\n";
-   }   
-   
-   ossimRefPtr<ossimSingleImageChain> ic = 0;
-   
-   if ( file.size() )
-   {
-      if ( file.exists() )
-      {
-         ic = new ossimSingleImageChain;
-         if ( ic->open(file) )
-         {
-            //---
-            // If multiple inputs and scaleToEightBit do it at the end of the processing
-            // chain to alleviate un-even stretches 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.
-            ic->setAddHistogramFlag( hasHistogramOperation() );
-
-            // Create the chain.
-            ic->createRenderedChain();
-
-            // Set the filter type if needed.
-            const char* lookup = m_kwl->find( RESAMPLER_FILTER_KW );
-            if ( lookup )
-            {
-               ic->getImageRenderer()->getResampler()->setFilterType(ossimString(lookup));
-            }
-
-            // Histogram setup.
-            if ( hasHistogramOperation() )
-            {
-               setupChainHistogram( ic );
-            }
-         }
-      }
-   }
-
-   if ( !ic.valid() )
-   {
-      std::string errMsg = "Could not open: ";
-      errMsg += file;
-      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> ossimElevUtil::createChain(const ossimSrcRecord& rec) const
-{
-   static const char MODULE[] = "ossimElevUtil::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.
-      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.
-      const char* lookup = m_kwl->find( RESAMPLER_FILTER_KW );
-      if ( lookup )
-      {
-         ic->getImageRenderer()->getResampler()->setFilterType(ossimString(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 ossimElevUtil::createOutputProjection()
-{
-   static const char MODULE[] = "ossimElevUtil::createOutputProjection";
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   // Start with null projection.
-   m_outputProjection  = 0;
-
-   const char* op  = m_kwl->find(ossimKeywordNames::PROJECTION_KW);
-   const char* srs = m_kwl->find(SRS_KW);
-   
-   if ( op && srs )
-   {
-      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;
-   
-   // If an srs code use that first.
-   if (srs)
-   {
-      m_outputProjection = getNewProjectionFromSrsCode( ossimString(srs) );
-   }
-   else if (op)
-   {
-      ossimDemOutputProjection projType = getOutputProjectionType();
-      switch ( projType )
-      {
-         case ossimElevUtil::OSSIM_DEM_PROJ_GEO:
-         {
-            m_outputProjection = getNewGeoProjection();
-            break;
-         }
-         case ossimElevUtil::OSSIM_DEM_PROJ_GEO_SCALED:
-         {
-            m_outputProjection = getNewGeoScaledProjection();
-            break;
-         }
-         case ossimElevUtil::OSSIM_DEM_PROJ_INPUT:
-         {
-            m_outputProjection = getFirstInputProjection();
-            usingInput = true;
-            break;
-         }
-         case ossimElevUtil::OSSIM_DEM_PROJ_UTM:
-         {
-            m_outputProjection = getNewUtmProjection();
-            break;
-         }
-         default:
-         {
-            break; // Just for un-handled type warning.
-         }
-      }
-   }
-
-   // Check for identity projection:
-   ossimRefPtr<ossimMapProjection> inputProj = getFirstInputProjection();   
-   if ( m_outputProjection.valid() && inputProj.valid() )
-   {
-      if ( *(inputProj.get()) == *(m_outputProjection.get()) )
-      {
-         m_outputProjection = inputProj;
-         usingInput = true;
-      }
-   }
-   
-   if ( !m_outputProjection.valid() )
-   {
-      // Try first input. If map projected use that.
-      m_outputProjection = inputProj;
-      if ( m_outputProjection.valid() )
-      {
-         usingInput = true;
-         if ( traceDebug() )
-         {
-            
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "WARNING: No projection set!"
-               << "\nDefaulting to first input's projection.\n";
-         }
-      }
-      else
-      {
-         m_outputProjection = getNewGeoScaledProjection();
-         if ( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "WARNING: No projection set!"
-               << "\nDefaulting to scaled geographic at scene center.\n";
-         }
-      }
-   }
-
-   //---
-   // 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 || m_kwl->find(METERS_KW) )
-   {
-      // Set the scale.
-      initializeProjectionGsd();
-      
-      // Set the tie.
-      intiailizeProjectionTiePoint();
-
-      // Adjust the projection tie and origin.
-      m_outputProjection->snapTiePointToOrigin();
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "using input projection: " << (usingInput?"true":"false")
-         << "\noutput projection:\n";
-
-      m_outputProjection->print(ossimNotify(ossimNotifyLevel_DEBUG));
-
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-}
-
-void ossimElevUtil::intiailizeProjectionTiePoint()
-{
-   static const char MODULE[] = "ossimElevUtil::initializeProjectionTiePoint()";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-   
-   ossimGpt tiePoint;
-   tiePoint.makeNan();
-
-   if ( m_outputProjection.valid() )
-   {
-      getTiePoint(tiePoint);
-      
-      if ( !tiePoint.hasNans() )
-      {
-         m_outputProjection->setUlTiePoints(tiePoint);
-      }
-      else
-      {
-         std::string errMsg = MODULE;
-         errMsg += " tie point has nans!";
-         throw( ossimException(errMsg) );
-      }
-   }
-   else
-   {
-      std::string errMsg = MODULE;
-      errMsg += "m_projection is null!";
-      throw( ossimException(errMsg) ); 
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "projection tie point: " << tiePoint << "\n" << MODULE << " exited...\n";
-   }
-}
-
-void ossimElevUtil::initializeProjectionGsd()
-{
-   static const char MODULE[] = "ossimElevUtil::initializeProjectionGsd()";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimDpt gsd;
-   gsd.makeNan();
-
-   if ( m_outputProjection.valid() )
-   {
-      const char* lookup = m_kwl->find(METERS_KW);
-      if ( lookup )
-      {
-         gsd.x = ossimString::toFloat64(lookup);
-         gsd.y = gsd.x;
-      }
-
-      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() == ossimElevUtil::OSSIM_DEM_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;
-         }
-
-      }
-
-      if ( !gsd.hasNans() )
-      {
-         // Set to input gsd.
-         m_outputProjection->setMetersPerPixel(gsd);
-      }
-      else
-      {
-         std::string errMsg = MODULE;
-         errMsg += "gsd has nans!";
-         throw( ossimException(errMsg) );
-      }
-   }
-   else
-   {
-      std::string errMsg = MODULE;
-      errMsg += "m_projection is null!";
-      throw( ossimException(errMsg) ); 
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "projection gsd: " << gsd << "\n" << MODULE << " exited...\n";
-   }
-}
-
-void ossimElevUtil::getTiePoint(ossimGpt& tie)
-{
-   static const char MODULE[] = "ossimElevUtil::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 ossimElevUtil::getTiePoint(ossimSingleImageChain* chain, ossimGpt& tie)
-{
-   static const char MODULE[] = "ossimElevUtil::getTiePoint(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 ulPt = boundingRect.ul();
-         geom->localToWorld(ulPt, tie);
-
-         tie.hgt = 0.0;
-         
-         if ( tie.hasNans() )
-         {
-            std::string errMsg = MODULE;
-            errMsg += "\ngeom->localToWorld returned nan for chain.";
-            errMsg += "\nChain: ";
-            errMsg += chain->getFilename();
-            throw ossimException(errMsg);
-         }
-      }
-      else
-      {
-         std::string errMsg = MODULE;
-         errMsg += "\nNo geometry for chain: ";
-         errMsg += chain->getFilename();
-         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 ossimElevUtil::getMetersPerPixel(ossimDpt& gsd)
-{
-   static const char MODULE[] = "ossimElevUtil::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 ossimElevUtil::getMetersPerPixel(ossimSingleImageChain* chain, ossimDpt& gsd)
-{
-   static const char MODULE[] = "ossimElevUtil::getMetersPerPixel(ossimSingleImageChain*,ossimDpt&)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   if (chain)
-   {
-      ossimRefPtr<ossimImageGeometry> geom = chain->getImageGeometry();
-      if ( geom.valid() )
-      {
-         gsd = geom->getMetersPerPixel();
-         
-         if ( gsd.hasNans() )
-         {
-            std::string errMsg = MODULE;
-            errMsg += "\ngeom->getMetersPerPixel returned nan for chain.";
-            errMsg += "\nChain: ";
-            errMsg += chain->getFilename();
-            throw ossimException(errMsg);
-         }
-      }
-      else
-      {
-         std::string errMsg = MODULE;
-         errMsg += "\nNo geometry for chain: ";
-         errMsg += chain->getFilename();
-         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";
-   }
-}
-
-void ossimElevUtil::getOrigin(ossimGpt& gpt)
-{
-   static const char MODULE[] = "ossimElevUtil::getOrigin(ossimGpt&)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }     
-
-   gpt.lat = ossim::nan();
-   gpt.lon = ossim::nan();
-   gpt.hgt = 0.0;
-
-   // Latitude:
-   const char* lookup = m_kwl->find(ossimKeywordNames::ORIGIN_LATITUDE_KW);
-   if ( lookup )
-   {
-      ossim_float64 latitude = ossimString::toFloat64(lookup);
-      if ( (latitude >= -90) && (latitude <= 90.0) )
-      {
-         gpt.lat = latitude;
-      }
-      else
-      {
-         std::string errMsg = "origin latitude range error!";
-         errMsg += " Valid range: -90 to 90";
-         throw ossimException(errMsg);
-      }
-   }
-
-   // Longitude:
-   lookup = m_kwl->find(ossimKeywordNames::CENTRAL_MERIDIAN_KW);
-   if ( lookup )
-   {
-      ossim_float64 longitude = ossimString::toFloat64(lookup);
-      if ( (longitude >= -180.0) && (longitude <= -180.0) )
-      {
-         gpt.lon = longitude;
-      }
-      else
-      {
-         std::string errMsg = "central meridian range error!";
-         errMsg += " Valid range: -180 to 180";
-         throw ossimException(errMsg);
-      }
-   }
-
-   if ( gpt.hasNans() )
-   {
-      ossimGpt sceneCenter;
-      getSceneCenter(sceneCenter);
-      if ( ossim::isnan(gpt.lat) )
-      {
-         gpt.lat = sceneCenter.lat;
-      }
-      if ( ossim::isnan(gpt.lon) )
-      {
-         gpt.lon = sceneCenter.lon;
-      }    
-   }
-      
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "origin: " << gpt << "\n" << MODULE << " exited...\n";
-   }
-}
-
-void ossimElevUtil::getSceneCenter(ossimGpt& gpt)
-{
-   static const char MODULE[] = "ossimElevUtil::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::string errMsg = MODULE;
-      errMsg += " range error!";
-      errMsg += "\nlatitude = ";
-      errMsg += ossimString::toString(lat);
-      errMsg += "\nlongitude = ";
-      errMsg += ossimString::toString(lon);
-      throw ossimException(errMsg);
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "scene center: " << gpt << "\n" << MODULE << " exited...\n";
-   }
-}
-
-void ossimElevUtil::getSceneCenter(ossimSingleImageChain* chain, ossimGpt& gpt)
-{
-   static const char MODULE[] =
-      "ossimElevUtil::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();
-            throw ossimException(errMsg);
-         }
-      }
-      else
-      {
-         std::string errMsg = MODULE;
-         errMsg += "\nNo geometry for chain: ";
-         errMsg += chain->getFilename();
-         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> ossimElevUtil::getFirstInputProjection()
-{
-   static const char MODULE[] = "ossimElevUtil::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> ossimElevUtil::getNewGeoProjection()
-{
-   return ossimRefPtr<ossimMapProjection>(new ossimEquDistCylProjection());
-}
-
-ossimRefPtr<ossimMapProjection> ossimElevUtil::getNewGeoScaledProjection()
-{
-   ossimRefPtr<ossimMapProjection> result = getNewGeoProjection();
-   ossimGpt origin;
-   getOrigin(origin);
-   result->setOrigin(origin);
-   return result;
-}
-
-ossimRefPtr<ossimMapProjection> ossimElevUtil::getNewProjectionFromSrsCode(const ossimString& 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> ossimElevUtil::getNewUtmProjection()
-{
-   ossimRefPtr<ossimUtmProjection> utm = new ossimUtmProjection;
-   ossimGpt origin;
-   getOrigin(origin);
-   utm->setZone(origin);
-   utm->setHemisphere(origin);
-   return ossimRefPtr<ossimMapProjection>(utm.get());
-}
-
-ossimRefPtr<ossimImageFileWriter> ossimElevUtil::createNewWriter() const
-{
-   static const char MODULE[] = "ossimElevUtil::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;
-   
-   const char* lookup = m_kwl->find( WRITER_KW );
-   if ( lookup ) // User defined.
-   {
-      writer = ossimImageWriterFactoryRegistry::instance()->createWriter(ossimString(lookup));
-
-      if ( !writer.valid() )
-      {
-         std::string errMsg = MODULE;
-         errMsg += " ERROR creating writer: ";
-         errMsg += lookup;
-         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();
-         throw ossimException(errMsg);
-      }
-   }
-
-   // Set the output name.
-   writer->setFilename( outputFile );
-
-   // Add any writer props.
-   ossim_uint32 count = m_kwl->numberOf(WRITER_PROPERTY_KW);
-   for (ossim_uint32 i = 0; i < count; ++i)
-   {
-      ossimString key = WRITER_PROPERTY_KW;
-      key += ossimString::toString(i);
-      lookup = m_kwl->find( key.c_str() );
-      if ( lookup )
-      {
-         ossimString s = lookup;
-         std::vector<ossimString> splitArray;
-         s.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 );
-         }
-      }
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "writer name: " << writer->getClassName() << "\n"
-         << MODULE << " exited...\n";
-   }
-
-   return writer;
-}
-
-void ossimElevUtil::propagateOutputProjectionToChains()
-{
-   static const char MODULE[] = "ossimElevUtil::propagateOutputProjectionToChains()";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx;
-
-   // Loop through dem layers.
-   chainIdx = m_demLayer.begin();
-   while ( chainIdx != m_demLayer.end() )
-   {
-      ossimRefPtr<ossimImageRenderer> resampler = (*chainIdx)->getImageRenderer();
-      if ( resampler.valid() )
-      {
-         resampler->setView( m_outputProjection.get() );
-      }
-      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();
-      if ( resampler.valid() )
-      {
-         resampler->setView( m_outputProjection.get() );
-      }
-      else
-      {
-         std::string errMsg = MODULE;
-         errMsg += " chain has no resampler!";
-         throw( ossimException(errMsg) );
-      }
-      ++chainIdx;
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-}
-
-ossimRefPtr<ossimImageSource> ossimElevUtil::combineLayers(
-   std::vector< ossimRefPtr<ossimSingleImageChain> >& layers) const
-{
-   static const char MODULE[] = "ossimElevUtil::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 = 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> ossimElevUtil::combineLayers()
-{
-   static const char MODULE[] = "ossimElevUtil::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 = 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;
-}
-
-ossimRefPtr<ossimImageSource> ossimElevUtil::addIndexToRgbLutFilter(
-   ossimRefPtr<ossimImageSource> &source) const
-{
-   static const char MODULE[] = "ossimElevUtil::addIndexToRgbLutFilter(source)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimRefPtr<ossimImageSource> result = 0;
-
-   if ( source.valid() )
-   {
-      ossimRefPtr<ossimIndexToRgbLutFilter> lut = new ossimIndexToRgbLutFilter();
-      ossimFilename lutFile = m_kwl->find( LUT_FILE_KW );
-      if ( lutFile.exists() )
-      {
-         lut->setLut(lutFile);
-         
-         // Connect to dems:
-         lut->connectMyInputTo( source.get() );
-
-         // Note sure about this.  Make option maybe? (drb)
-         lut->setInterpolationType(ossimIndexToRgbLutFilter::ossimIndexToRgbLutFilter_LINEAR);
-         
-         // Set as color source for bump shade.
-         result = lut.get();
-      }
-      else
-      {
-         std::string errMsg = MODULE;
-         errMsg += " color table does not exists: ";
-         errMsg += lutFile;
-         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> ossimElevUtil::addScalarRemapper(
-   ossimRefPtr<ossimImageSource> &source) const
-{
-   static const char MODULE[] = "ossimElevUtil::addScalarRemapper(source)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-   
-   ossimRefPtr<ossimImageSource> result = 0;
-   
-   if ( source.valid() )
-   {
-      if ( source->getOutputScalarType() != OSSIM_UINT8 )
-      {
-         ossimRefPtr<ossimScalarRemapper> remapper = new ossimScalarRemapper();
-         remapper->setOutputScalarType(OSSIM_UINT8);
-         remapper->connectMyInputTo( source.get() );
-         result = remapper.get();
-      }
-      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 ossimElevUtil::setupChainHistogram( ossimRefPtr<ossimSingleImageChain> &chain) const
-{
-   static const char MODULE[] = "ossimElevUtil::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 )
-               {
-                  ossimNotify(ossimNotifyLevel_WARN)
-                     << MODULE << " WARNING:"
-                     << "\nCould not open:  " << f << "\n";
-               }
-            }
-         }
-
-         if ( remapper->getHistogramFile() != ossimFilename::NIL )
-         {
-            const char* lookup = m_kwl->find(HISTO_OP_KW);
-            if (lookup)
-            {
-               result = true;
-               
-               // Enable.
-               remapper->setEnableFlag(true);
-               
-               // Set the histo mode:
-               ossimString op = lookup;
-               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);
-                  ossimNotify(ossimNotifyLevel_WARN)
-                     << MODULE << "\nUnhandled operation: " << op << "\n";
-               }
-            }
-         }
-      }
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-   
-   return result;
-}
-
-void ossimElevUtil::getOutputFilename(ossimFilename& f) const
-{
-   static const char MODULE[] = "ossimElevUtil::getOutputFilename()";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   } 
-
-   const char* lookup =  m_kwl->find( ossimKeywordNames::OUTPUT_FILE_KW );
-   if ( lookup )
-   {
-      f = lookup;
-   }
-   else
-   {
-      f = ossimFilename::NIL;
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }   
-}
-
-void ossimElevUtil::getAreaOfInterest(const ossimImageSource* source, ossimIrect& rect) const
-{
-   static const char MODULE[] = "ossimElevUtil::getAreaOfInterest()";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   // Nan rect for starters.
-   rect.makeNan();
-   
-   if ( source && m_outputProjection.valid() )
-   {
-      if ( m_kwl->find( CUT_CENTER_LAT_KW ) ) // --cut-center-llwh
-      {
-         const char* latStr    = m_kwl->find( CUT_CENTER_LAT_KW );
-         const char* lonStr    = m_kwl->find( CUT_CENTER_LON_KW );   
-         const char* widthStr  = m_kwl->find( CUT_CENTER_WIDTH_KW );
-         const char* heightStr = m_kwl->find( CUT_CENTER_HEIGHT_KW );
-         
-         if ( latStr && lonStr && widthStr && heightStr )
-         {
-            ossimGpt centerGpt(0,0,0);
-            ossimIpt widthHeight(0,0);
-            centerGpt.lat      = ossimString(latStr).toFloat64();
-            centerGpt.lon      = ossimString(lonStr).toFloat64();
-            ossim_int32 width  = ossimString(widthStr).toInt32();
-            ossim_int32 height = ossimString(heightStr).toInt32();
-            
-            if ( !centerGpt.hasNans() )
-            {
-               ossimDpt centerDpt;
-               m_outputProjection->worldToLineSample(centerGpt, centerDpt);
-               if ( !centerDpt.hasNans() )
-               {
-                  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 if ( m_kwl->find( CUT_MAX_LAT_KW ) ) // --cut-bbox-ll
-      {
-         const char* maxLat = m_kwl->find( CUT_MAX_LAT_KW );
-         const char* maxLon = m_kwl->find( CUT_MAX_LON_KW );
-         const char* minLat = m_kwl->find( CUT_MIN_LAT_KW );
-         const char* minLon = m_kwl->find( CUT_MIN_LON_KW );
-         
-         if ( maxLat && maxLon && minLat && minLon )
-         {
-            ossimGpt gpt(0.0, 0.0, 0.0);
-            ossimDpt dpt;
-            
-            // Upper left:
-            gpt.lat = ossimString(maxLat).toFloat64();
-            gpt.lon = ossimString(minLon).toFloat64();
-            m_outputProjection->worldToLineSample(gpt, dpt);
-            ossimIpt ul(dpt);
-            
-            // Lower right:
-            gpt.lat = ossimString(minLat).toFloat64();
-            gpt.lon = ossimString(maxLon).toFloat64();
-            m_outputProjection->worldToLineSample(gpt, dpt);
-            ossimIpt lr(dpt);
-            
-            rect = ossimIrect(ul, lr);
-         }
-      }
-
-      // If no user defined rect set to scene bounding rect.
-      if ( rect.hasNans() ) 
-      {
-         rect = source->getBoundingRect(0);
-      }
-      
-   } // if ( source && m_outputProjection.valid() )
-   else
-   {
-      // Should never happer...
-      std::string errMsg = MODULE;
-      if ( !source )
-      {
-         errMsg += " image source null!";
-      }
-      else
-      {
-         errMsg += " output projection null!";
-      }
-      throw( ossimException(errMsg) );
-   }
-
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "aoi: " << rect << "\n"
-         << MODULE << " exited...\n";
-   }
-}
-
-void ossimElevUtil::initializeThumbnailProjection(const ossimIrect& originalRect,
-                                                ossimIrect& adjustedRect)
-{
-   static const char MODULE[] = "ossimElevUtil::initializeThumbnailProjection";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered...\n"
-         << "origial rect:  " << originalRect << "\n";
-
-      if (m_outputProjection.valid())
-      {
-         m_outputProjection->print(ossimNotify(ossimNotifyLevel_DEBUG));
-      }
-   }
-
-   if ( !originalRect.hasNans() && m_outputProjection.valid() )
-   {
-      //---
-      // Thumbnail setup:
-      //---
-      const char* thumbRes = m_kwl->find(THUMBNAIL_RESOLUTION_KW);
-      if ( thumbRes )
-      {
-         ossim_float64 thumbSize = ossimString(thumbRes).toFloat64();
-         ossim_float64 maxRectDimension =
-            ossim::max( originalRect.width(), originalRect.height() );
-         
-         if ( maxRectDimension > thumbSize )
-         {
-            // Need to adjust scale:
-            
-            // Get the corners:
-            ossimGpt ulGpt;
-            ossimGpt lrGpt;
-            ossimDpt dpt;
-            
-            m_outputProjection->lineSampleToWorld(ossimDpt(originalRect.ul()), ulGpt);
-            m_outputProjection->lineSampleToWorld(ossimDpt(originalRect.lr()), lrGpt);         
-            
-            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.
-            //---
-            m_outputProjection->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.
-            m_outputProjection->worldToLineSample(ulGpt, dpt);
-            ossimIpt ul(dpt);
-            
-            // Get the new lower right in view space.
-            m_outputProjection->worldToLineSample(lrGpt, dpt);
-            ossimIpt lr(dpt);
-
-            // Clamp to thumbnail bounds.
-            ossim_int32 ts = thumbSize;
-
-            if ( (lr.x - ul.x + 1) > ts )
-            {
-               lr.x = ul.x + ts - 1;
-            }
-            if ( (lr.y - ul.y + 1) > ts )
-            {
-               lr.y = ul.y + ts - 1;
-            }
-            
-            adjustedRect = ossimIrect(ul, lr);
-         }
-      }
-      
-   } // if ( !originalRect.hasNans() && m_outputProjection.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_outputProjection.valid())
-      {
-         m_outputProjection->print(ossimNotify(ossimNotifyLevel_DEBUG));
-      }
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-}
-
-bool ossimElevUtil::hasLutFile() const
-{
-   bool result = false;
-   if ( m_kwl.valid() )
-   {
-      result = ( m_kwl->find( LUT_FILE_KW ) != 0 );
-   }
-   return result;
-}
-
-bool ossimElevUtil::hasBumpShadeArg() const
-{
-   bool result = ( m_operation == OSSIM_DEM_OP_HILL_SHADE );
-   if ( !result && m_kwl.valid() )
-   {
-      result = ( m_kwl->find( ossimKeywordNames::AZIMUTH_ANGLE_KW ) ||
-                 m_kwl->find( COLOR_RED_KW ) ||
-                 m_kwl->find( COLOR_GREEN_KW ) ||
-                 m_kwl->find( COLOR_BLUE_KW ) ||
-                 m_kwl->find( ossimKeywordNames::ELEVATION_ANGLE_KW ) ||
-                 m_kwl->find( GAIN_KW ) );
-   }
-   return result;
-}
-
-bool ossimElevUtil::hasThumbnailResolution() const
-{
-   bool result = false;
-   if ( m_kwl.valid() )
-   {
-      result = ( m_kwl->find(THUMBNAIL_RESOLUTION_KW) != 0 );
-   }
-   return result;
-}
-
-bool ossimElevUtil::hasHistogramOperation() const
-{
-   bool result = false;
-   
-   if ( m_kwl.valid() )
-   {
-      result = ( m_kwl->find(HISTO_OP_KW) != 0 );
-   }
-   // No option for this right now.  Only through src file.
-   return result;
-}
-
-bool ossimElevUtil::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 ossimElevUtil::isSrcFile(const ossimFilename& file) const
-{
-   bool result = false;
-   ossimString ext = file.ext();
-   ext.downcase();
-   if ( ext == "src" )
-   {
-      result = true;
-   }
-   return result;
-}
-
-bool ossimElevUtil::scaleToEightBit() const
-{
-   bool result = false;
-   if ( m_operation == OSSIM_DEM_OP_COLOR_RELIEF ) // Always 8 bit...
-   {
-      result = true;
-   }
-   else if ( m_kwl.valid() )
-   {
-      const char* lookup = m_kwl->find(SCALE_2_8_BIT_KW);
-      if ( lookup )
-      {
-         result = ossimString(lookup).toBool();
-      }
-   }
-   return result;
-}
-
-void  ossimElevUtil::initializeSrcKwl()
-{
-   static const char MODULE[] = "ossimElevUtil::initializeSrcKwl";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered...\n";
-   }
-
-   const char* lookup = m_kwl->find(SRC_FILE_KW);
-   if ( lookup )
-   {
-      m_srcKwl = new ossimKeywordlist();
-      m_srcKwl->setExpandEnvVarsFlag(true);
-      if ( m_srcKwl->addFile(lookup) == 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 ossimElevUtil::getNumberOfInputs() const
-{
-   ossim_uint32 result = 0;
-   if ( m_kwl.valid() )
-   {
-      result += m_kwl->numberOf(DEM_KW);
-      result += m_kwl->numberOf(IMG_KW);
-      
-   }
-   if ( m_srcKwl.valid() )
-   {
-      result += m_srcKwl->numberOf(DEM_KW);
-      result += m_srcKwl->numberOf(IMG_KW);
-   }
-   return result;
-}
-
-ossimElevUtil::ossimDemOutputProjection ossimElevUtil::getOutputProjectionType() const
-{
-   ossimDemOutputProjection result = ossimElevUtil::OSSIM_DEM_PROJ_UNKNOWN;
-   const char* op  = m_kwl->find(ossimKeywordNames::PROJECTION_KW);
-   if ( op )
-   {
-      ossimString os = op;
-      os.downcase();
-      if (os == "geo")
-      {
-         result = ossimElevUtil::OSSIM_DEM_PROJ_GEO;
-      }
-      else if (os == "geo-scaled")
-      {
-         result = ossimElevUtil::OSSIM_DEM_PROJ_GEO_SCALED;
-      }
-      else if ( os == "input" )
-      {
-         result = ossimElevUtil::OSSIM_DEM_PROJ_INPUT;
-      }
-      else if ( (os == "utm") || (os == "ossimutmprojection") )
-      {
-         result = ossimElevUtil::OSSIM_DEM_PROJ_UTM;
-      }
-   }
-   return result;
-}
diff --git a/src/ossim/util/ossimFileWalker.cpp b/src/ossim/util/ossimFileWalker.cpp
new file mode 100644
index 0000000..30710c8
--- /dev/null
+++ b/src/ossim/util/ossimFileWalker.cpp
@@ -0,0 +1,504 @@
+//----------------------------------------------------------------------------
+//
+// 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/ossimTrace.h>
+#include <ossim/parallel/ossimJobQueue.h>
+#include <OpenThreads/Thread>
+
+static ossimTrace traceDebug(ossimString("ossimFileWalker:debug"));
+
+ossimFileWalker::ossimFileWalker()
+   : m_processFileCallBackPtr(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_processFileCallBackPtr )
+         {
+            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_processFileCallBackPtr, 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();
+                  }
+               }
+            }
+         }
+
+         ++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_processFileCallBackPtr )
+   {
+      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_processFileCallBackPtr->operator()(rootFile);
+            }
+         }
+      }
+   }
+   
+   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_processFileCallBackPtr, (*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::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("hdr"));
+   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("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("shx"));
+   m_filteredExtensions.push_back(std::string("spec"));
+   m_filteredExtensions.push_back(std::string("statistics"));
+   m_filteredExtensions.push_back(std::string("tfw"));
+   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::registerProcessFileCallback(
+   ossimCallback1<const ossimFilename&>* cb)
+{
+   m_mutex.lock();
+   m_processFileCallBackPtr = cb;
+   m_mutex.unlock();
+}
+
+ossimFileWalker::ossimFileWalkerJob::ossimFileWalkerJob(
+   ossimCallback1<const ossimFilename&>* cb,
+   const ossimFilename& file)
+   : m_processFileCallBackPtr(cb),
+     m_file(file)
+{
+}
+
+void ossimFileWalker::ossimFileWalkerJob::start()
+{
+   if ( m_processFileCallBackPtr && m_file.size() )
+   {
+      m_processFileCallBackPtr->operator()(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/ossim/util/ossimImageUtil.cpp b/src/ossim/util/ossimImageUtil.cpp
new file mode 100644
index 0000000..0891cfe
--- /dev/null
+++ b/src/ossim/util/ossimImageUtil.cpp
@@ -0,0 +1,1511 @@
+//----------------------------------------------------------------------------
+// File: ossimImageUtil.cpp
+// 
+// License:  LGPL
+// 
+// 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/ossimCallback1.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/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 <iomanip>
+#include <string>
+#include <vector>
+
+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 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 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";
+
+//---
+// Call back class to register with ossimFileWalker for call to
+// ossimImageUtil::processFile
+//
+// Placed here as it is unique to this class.
+//---
+class ProcessFileCB: public ossimCallback1<const ossimFilename&>
+{
+public:
+   ProcessFileCB(
+      ossimImageUtil* obj,
+      void (ossimImageUtil::*func)(const ossimFilename&))
+      :
+      m_obj(obj),
+      m_func(func)
+   {}
+      
+   virtual void operator()(const ossimFilename& file) const
+   {
+      (m_obj->*m_func)(file);
+   }
+
+private:
+   ossimImageUtil* m_obj;
+   void (ossimImageUtil::*m_func)(const ossimFilename& file);
+};
+
+
+// Static trace for debugging.  Use -T ossimImageUtil to turn on.
+static ossimTrace traceDebug = ossimTrace("ossimImageUtil:debug");
+
+ossimImageUtil::ossimImageUtil()
+   :
+   m_kwl( new ossimKeywordlist() ),
+   m_fileWalker(0),
+   m_mutex(),
+   m_errorStatus(0)
+{
+}
+
+ossimImageUtil::~ossimImageUtil()
+{
+   if ( m_fileWalker )
+   {
+      delete m_fileWalker;
+      m_fileWalker = 0;
+   }
+}
+
+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);
+
+   // 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("--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("--compression-type", "Compression type can be: deflate, jpeg, lzw, none or packbits");
+
+   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("--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("--of or --output-files", "Output image files we can open, exluding overviews.");
+   
+   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("-o", "Creates overviews. (default=ossim_tiff_box)");
+
+   au->addCommandLineOption("--ot", "<overview_type> Overview type. see list at bottom for valid types. (default=ossim_tiff_box)");
+
+   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("--scanForMinMax", "Turns on min, max scanning when reading tiles. This option assumes the null is known.");
+
+   au->addCommandLineOption("--scanForMinMaxNull", "Turns on min, max, null scanning when reading tiles.  This option tries to find a null value which is useful for float data.");
+
+   au->addCommandLineOption("--writer-prop", "Adds a property to send to the writer. format is name=value");
+   
+} // 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();
+
+      while ( 1 ) //  While forever loop...
+      {
+         // Used throughout below:
+         std::string ts1;
+         ossimArgumentParser::ossimParameter sp1(ts1);
+         std::string ts2;
+         ossimArgumentParser::ossimParameter sp2(ts2);
+
+         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("--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("-i") || ap.read("--internal-overviews") )
+         {
+            setInternalOverviewsFlag( true );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+
+         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("-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("--scanForMinMax" ) )
+         {
+            setScanForMinMax( true );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+
+         if( ap.read("--scanForMinMaxNull" ) )
+         {
+            setScanForMinMaxNull( true );
+            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 += ossimString::toString(i);
+            std::string value = ap[i+1];
+            m_kwl->addPair(kw.string(), value, true);
+         }
+      }
+      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 ossimImageUtil::execute()
+{
+   static const char M[] = "ossimImageUtil::execute()";
+   
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   }
+
+   if ( !m_fileWalker )
+   {
+      m_fileWalker = new ossimFileWalker();
+   }
+   
+   // Get the number of "file*" keywords.
+   ossim_uint32 fileCount = m_kwl->numberOf("file");
+
+   if ( fileCount )
+   {
+      m_fileWalker->initializeDefaultFilterList();
+      
+      m_fileWalker->setNumberOfThreads( getNumberOfThreads() );
+
+      // Must set this so we can stop recursion on directory based images.
+      m_fileWalker->setWaitOnDirFlag( true );
+
+      ossimCallback1<const ossimFilename&>* cb =
+         new ProcessFileCB(this, &ossimImageUtil::processFile);
+
+      m_fileWalker->registerProcessFileCallback(cb);
+      
+      // 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 );
+      }
+      
+      // cleanup:
+      if ( cb )
+      {
+         delete cb;
+         cb = 0;
+      }
+      
+   } // 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 ossimImageUtil::processFile(const ossimFilename& file)
+{
+   static const char M[] = "ossimImageUtil::processFile";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " entered...\n" << "file: " << file << "\n";
+   }
+
+   ossimNotify(ossimNotifyLevel_NOTICE) << "Processing file: " << file << "\n";
+
+   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();
+      }
+
+ 
+      // Set any reader props:
+      ossimPropertyInterface* pi = dynamic_cast<ossimPropertyInterface*>(ih.get());
+      if ( pi ) setProps(pi);
+
+      bool consumedHistogramOptions  = false;
+      bool consumedCmmOptionsOptions = 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, consumedCmmOptionsOptions);
+         }
+      }
+
+      // Build stand alone histogram.  Note the overview sequencer may have computed for us.
+      if ( hasHistogramOption() && !consumedHistogramOptions)
+      {
+         createHistogram( ih );
+      }
+   }
+   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";
+   }
+}
+
+// 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);
+
+         ob->setScanForMinMax( scanForMinMax() );
+         
+         ob->setScanForMinMaxNull( scanForMinMaxNull() );
+         
+         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::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"
+      << "\nNOTES:\n"
+      << "\n  --ch  equals --create-histogram"
+      << "\n  --chf equals --create-histogram-fast"
+      << 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
+{
+   bool result = false;
+   std::string lookup = m_kwl->findKey( CREATE_OVERVIEWS_KW );
+   if ( lookup.size() )
+   {
+      result = ossimString(lookup).toBool();
+   }
+   return result;
+}
+
+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
+{
+   bool result = false;
+   std::string lookup = m_kwl->findKey( REBUILD_OVERVIEWS_KW );
+   if ( lookup.size() )
+   {
+      result = ossimString(lookup).toBool();
+   }
+   return result;
+}
+
+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
+{
+   bool result = false;
+   std::string lookup = m_kwl->findKey( REBUILD_HISTOGRAM_KW );
+   if ( lookup.size() )
+   {
+      result = ossimString(lookup).toBool();
+   }
+   return result;
+}
+
+void ossimImageUtil::setScanForMinMax( bool flag )
+{
+   addOption( SCAN_MIN_MAX_KW, ( flag ? TRUE_KW : FALSE_KW ) ); 
+}
+
+bool ossimImageUtil::scanForMinMax() const
+{
+   bool result = false;
+   std::string lookup = m_kwl->findKey( SCAN_MIN_MAX_KW );
+   if ( lookup.size() )
+   {
+      result = ossimString(lookup).toBool();
+   }
+   return result;
+}
+
+void ossimImageUtil::setScanForMinMaxNull( bool flag )
+{
+   addOption( SCAN_MIN_MAX_NULL_KW, ( flag ? TRUE_KW : FALSE_KW ) ); 
+}
+
+bool ossimImageUtil::scanForMinMaxNull() const
+{
+   bool result = false;
+   std::string lookup = m_kwl->findKey( SCAN_MIN_MAX_NULL_KW );
+   if ( lookup.size() )
+   {
+      result = ossimString(lookup).toBool();
+   }
+   return result;
+}
+
+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
+{
+   bool result = false;
+   std::string lookup = m_kwl->findKey( COPY_ALL_FLAG_KW );
+   if ( lookup.size() )
+   {
+      ossimString os(lookup);
+      result = os.toBool();
+   }
+   return result;
+}
+
+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
+{
+   bool result = false;
+   std::string lookup = m_kwl->findKey( INTERNAL_OVERVIEWS_FLAG_KW );
+   if ( lookup.size() )
+   {
+      ossimString os(lookup);
+      result = os.toBool();
+   }
+   return result;
+}
+
+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
+{
+   bool result = false;
+   std::string lookup = m_kwl->findKey( OUTPUT_FILENAMES_KW );
+   if ( lookup.size() )
+   {
+      ossimString os(lookup);
+      result = os.toBool();
+   }
+   return result;
+}
+
+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
+{
+   bool result = false;
+   std::string lookup = m_kwl->findKey( CREATE_HISTOGRAM_KW );
+   if ( lookup.size() )
+   {
+      result = ossimString(lookup).toBool();
+   }
+   return result;
+}
+
+void ossimImageUtil::setCreateHistogramFastFlag( bool flag )
+{
+   addOption( CREATE_HISTOGRAM_FAST_KW, ( flag ? TRUE_KW : FALSE_KW ) );
+}
+
+bool ossimImageUtil::createHistogramFast() const
+{
+   bool result = false;
+   std::string lookup = m_kwl->findKey( CREATE_HISTOGRAM_FAST_KW );
+   if ( lookup.size() )
+   {
+      result = ossimString(lookup).toBool();
+   }
+   return result;
+}
+
+void ossimImageUtil::setCreateHistogramR0Flag( bool flag )
+{
+   addOption( CREATE_HISTOGRAM_R0_KW, ( flag ? TRUE_KW : FALSE_KW ) );
+}
+
+bool ossimImageUtil::createHistogramR0() const
+{   bool result = false;
+   std::string lookup = m_kwl->findKey( CREATE_HISTOGRAM_R0_KW );
+   if ( lookup.size() )
+   {
+      result = ossimString(lookup).toBool();
+   }
+   return result;
+}
+
+bool ossimImageUtil::hasHistogramOption() const
+{
+   return ( createHistogram() || createHistogramFast() || createHistogramR0() );
+}
+
+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();
+}
diff --git a/src/ossim/util/ossimInfo.cpp b/src/ossim/util/ossimInfo.cpp
index 43bc435..ffd4a30 100644
--- a/src/ossim/util/ossimInfo.cpp
+++ b/src/ossim/util/ossimInfo.cpp
@@ -12,7 +12,7 @@
 // Utility class for getting information from the ossim library.
 // 
 //----------------------------------------------------------------------------
-// $Id$
+// $Id: ossimInfo.cpp 22282 2013-06-09 14:57:06Z dburken $
 
 #include <ossim/util/ossimInfo.h>
 #include <ossim/base/ossimArgumentParser.h>
@@ -40,6 +40,7 @@
 #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>
@@ -50,6 +51,8 @@
 #include <iomanip>
 #include <vector>
 
+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";
@@ -64,21 +67,27 @@ 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 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 UP_IS_UP_KW[]             = "up_is_up_angel";
+static const char WRITERS_KW[]              = "writers_kw";
 static const char WRITER_PROPS_KW[]         = "writer_props";
 
 // Static trace for debugging.  Use -T ossimInfo to turn on.
@@ -103,7 +112,13 @@ void ossimInfo::addArguments(ossimArgumentParser& ap)
    au->setCommandLineUsage(usageString);
 
    // Set the command line options:
-   au->addCommandLineOption("--configuration", "Displays configuration info.");
+   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.");
 
@@ -136,6 +151,8 @@ void ossimInfo::addArguments(ossimArgumentParser& ap)
    au->addCommandLineOption("--mtrs2ft-us-survey", "<meters> Gives feet from meters (0.3048006096 meters per foot).");   
    
    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.");
    
@@ -146,16 +163,24 @@ void ossimInfo::addArguments(ossimArgumentParser& ap)
    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("-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("--writer-props", "Prints writers and properties.");
+
+   au->addCommandLineOption("--writers", "Prints list of available writers.");
    
 } // void ossimInfo::addArguments(ossimArgumentParser& ap)
 
@@ -183,6 +208,8 @@ bool ossimInfo::initialize(ossimArgumentParser& ap)
       //---
       m_kwl->clear();
 
+      bool requiresInputImage = false;
+      
       while ( 1 ) //  While forever loop...
       {
          // Used throughout below:
@@ -192,7 +219,34 @@ bool ossimInfo::initialize(ossimArgumentParser& ap)
          ossimArgumentParser::ossimParameter sp2(ts2);
          const char TRUE_KW[] = "true";
 
-         if( ap.read("--configuration") )
+         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 )
@@ -221,6 +275,7 @@ bool ossimInfo::initialize(ossimArgumentParser& ap)
          if( ap.read("-d") )
          {
             m_kwl->add( DUMP_KW, TRUE_KW );
+            requiresInputImage = true;
             if ( ap.argc() < 2 )
             {
                break;
@@ -231,6 +286,7 @@ bool ossimInfo::initialize(ossimArgumentParser& ap)
          {
             m_kwl->add( DUMP_KW, TRUE_KW );
             m_kwl->add( DUMP_NO_OVERVIEWS_KW, TRUE_KW );
+            requiresInputImage = true;
             if ( ap.argc() < 2 )
             {
                break;
@@ -292,6 +348,7 @@ bool ossimInfo::initialize(ossimArgumentParser& ap)
          if( ap.read("-i") )
          {
             m_kwl->add( IMAGE_INFO_KW, TRUE_KW );
+            requiresInputImage = true;
             if ( ap.argc() < 2 )
             {
                break;
@@ -301,6 +358,7 @@ bool ossimInfo::initialize(ossimArgumentParser& ap)
          if( ap.read("-m") )
          {
             m_kwl->add( METADATA_KW, TRUE_KW );
+            requiresInputImage = true;
             if ( ap.argc() < 2 )
             {
                break;
@@ -344,9 +402,19 @@ bool ossimInfo::initialize(ossimArgumentParser& ap)
             }
          }
 
+         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;
@@ -356,6 +424,7 @@ bool ossimInfo::initialize(ossimArgumentParser& ap)
          if( ap.read("--palette") )
          {
             m_kwl->add( PALETTE_KW, TRUE_KW );
+            requiresInputImage = true;
             if ( ap.argc() < 2 )
             {
                break;
@@ -389,6 +458,16 @@ bool ossimInfo::initialize(ossimArgumentParser& ap)
             }
          }
 
+         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());
@@ -397,6 +476,15 @@ bool ossimInfo::initialize(ossimArgumentParser& ap)
                break;
             }
          }
+
+         if( ap.read("--reader-props") )
+         {
+            m_kwl->add( READER_PROPS_KW, TRUE_KW );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
          
          if( ap.read("--resampler-filters") )
          {
@@ -407,6 +495,15 @@ bool ossimInfo::initialize(ossimArgumentParser& ap)
             }
          }
 
+         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 );
@@ -425,6 +522,15 @@ bool ossimInfo::initialize(ossimArgumentParser& ap)
             }
          }
 
+         if( ap.read("--writers") )
+         {
+            m_kwl->add( WRITERS_KW, TRUE_KW );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+         
          // End of arg parsing.
          ap.reportRemainingOptionsAsUnrecognized();
          if ( ap.errors() )
@@ -443,6 +549,14 @@ bool ossimInfo::initialize(ossimArgumentParser& ap)
          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() )
@@ -581,6 +695,17 @@ void ossimInfo::execute()
             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 )
          {
@@ -618,6 +743,17 @@ void ossimInfo::execute()
             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 )
@@ -630,6 +766,17 @@ void ossimInfo::execute()
             }
          }
 
+         lookup = m_kwl->find(WRITERS_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            if ( value.toBool() )
+            {
+               printWriters();
+            }
+         }
+
          lookup = m_kwl->find(WRITER_PROPS_KW);
          if ( lookup )
          {
@@ -686,12 +833,35 @@ ossim_uint32 ossimInfo::executeImageOptions(const ossimFilename& file)
       }
       dumpImage(file, dnoFlag);
    }
-
-   bool metaDataFlag  = false;
-   bool paletteFlag   = false;
-   bool imageInfoFlag = false;
-   bool imageGeomFlag = false;
    
+   bool centerGroundFlag = false;
+   bool centerImageFlag  = false;
+   bool imageCenterFlag  = false;
+   bool imageRectFlag    = false;
+   bool metaDataFlag     = false;
+   bool paletteFlag      = false;
+   bool imageInfoFlag    = false;
+   bool imageGeomFlag    = 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 )
@@ -709,6 +879,24 @@ ossim_uint32 ossimInfo::executeImageOptions(const ossimFilename& file)
       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:
@@ -726,7 +914,6 @@ ossim_uint32 ossimInfo::executeImageOptions(const ossimFilename& file)
    // Image geometry info:
    // Defaulted on if no image options set.
    //---
-   
    lookup = m_kwl->find( GEOM_INFO_KW );
    if ( lookup )
    {
@@ -734,6 +921,17 @@ ossim_uint32 ossimInfo::executeImageOptions(const ossimFilename& file)
       value = lookup;
       imageGeomFlag = 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 )
@@ -742,7 +940,7 @@ ossim_uint32 ossimInfo::executeImageOptions(const ossimFilename& file)
       imageGeomFlag = true;
    }
 
-   if ( metaDataFlag || paletteFlag || imageInfoFlag || imageGeomFlag )
+   if ( centerGroundFlag || centerImageFlag || imageCenterFlag || imageRectFlag || metaDataFlag || paletteFlag || imageInfoFlag || imageGeomFlag || upIsUpFlag )
    {
       // Requires open image.
       if ( m_img.valid() == false )
@@ -752,6 +950,27 @@ ossim_uint32 ossimInfo::executeImageOptions(const ossimFilename& file)
 
       // Output keyword list.
       ossimKeywordlist okwl;
+
+      if ( centerGroundFlag )
+      {
+         getCenterGround(okwl);
+      }
+
+      if ( centerImageFlag )
+      {
+         getCenterImage(okwl);
+      }
+
+      if ( imageCenterFlag )
+      {
+         getCenterGround(okwl);
+         getCenterImage(okwl);
+      }
+
+      if ( imageRectFlag )
+      {
+         getImageRect(okwl);
+      }
     
       if ( metaDataFlag )
       {
@@ -772,6 +991,16 @@ ossim_uint32 ossimInfo::executeImageOptions(const ossimFilename& file)
       {
          getImageGeometryInfo(okwl, dnoFlag);
       }
+
+      if ( imageRectFlag )
+      {
+         getImageRect(okwl);
+      }
+
+      if ( upIsUpFlag )
+      {
+         getUpIsUpAngle( okwl );
+      }
       
       lookup = m_kwl->find( OUTPUT_FILE_KW );
       ossimFilename outputFile;
@@ -861,15 +1090,62 @@ ossim_uint32 ossimInfo::executeImageOptions(const ossimFilename& file)
    return consumedKeys;
 }
 
+void ossimInfo::getImageInfo(const ossimFilename& file,
+                             bool dumpFlag,
+                             bool dnoFlag,
+                             bool imageGeomFlag,
+                             bool imageInfoFlag,
+                             bool metaDataFlag,
+                             bool paletteFlag,
+                             ossimKeywordlist& kwl)
+{
+   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) ;
+         }
+      }
+   }
+}
+
 void ossimInfo::openImage(const ossimFilename& file)
 {
-   m_img = ossimImageHandlerRegistry::instance()->open(file);
-   if ( m_img.valid() == false )
+   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;
+      errMsg += file.string();
       throw ossimException(errMsg);
    }
+   return result;
 }
 
 void ossimInfo::closeImage()
@@ -901,12 +1177,40 @@ void ossimInfo::dumpImage(const ossimFilename& file, bool dnoFlag) const
    }
 }
 
+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;
-      m_img->getPropertyList(list);
+      ih->getPropertyList(list);
       std::vector< ossimRefPtr< ossimProperty > >::const_iterator i = list.begin();
       while (i != list.end())
       {
@@ -944,46 +1248,63 @@ void ossimInfo::getImageMetadata(ossimKeywordlist& kwl) const
          ++i;
       }
       
-   } // if ( m_img.valid() )
-}
+   } // if ( ih )
+
+} // End: getImageMetadata(ossimImageHandler* ih, ossimKeywordlist& kwl)
 
 void ossimInfo::getImagePalette(ossimKeywordlist& kwl)
 {
    if ( m_img.valid() )
    {
-      if(m_img->getLut().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;
-         m_img->getEntryList(entryList);
-         for(entryIdx = 0; entryIdx < m_img->getNumberOfEntries();++entryIdx)
+         ih->getEntryList(entryList);
+         for(entryIdx = 0; entryIdx < ih->getNumberOfEntries();++entryIdx)
          {
-            m_img->setCurrentEntry(entryList[entryIdx]);
+            ih->setCurrentEntry(entryList[entryIdx]);
             ossimString prefix = "image";
             prefix = prefix + ossimString::toString(entryList[entryIdx]) + ".lut.";
-            if(m_img->getLut().valid())
+            if(ih->getLut().valid())
             {
-               m_img->getLut()->saveState(kwl, prefix);
+               ih->getLut()->saveState(kwl, prefix);
             }
          }
       }
       
-   } // if ( m_img.valid() )
+   } // 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;
-      m_img->getEntryList(entryList);
+      ih->getEntryList(entryList);
 
       std::vector<ossim_uint32>::const_iterator i = entryList.begin();
       while ( i != entryList.end() )
       {
-         if ( getImageInfo( (*i), kwl, dnoFlag ) )
+         if ( getImageInfo( ih, (*i), kwl, dnoFlag ) )
          {
             ++numEntries;
          }
@@ -992,16 +1313,27 @@ void ossimInfo::getImageInfo(ossimKeywordlist& kwl, bool dnoFlag)
       
       kwl.add(ossimKeywordNames::NUMBER_ENTRIES_KW, numEntries, true);
 
-   } // if ( m_img.valid() )
+   } // if ( ih )
 }
    
-bool ossimInfo::getImageInfo(ossim_uint32 entry, ossimKeywordlist& kwl, bool dnoFlag)
+bool ossimInfo::getImageInfo( ossim_uint32 entry, ossimKeywordlist& kwl, bool dnoFlag )
 {
    bool result = false;
-   
    if ( m_img.valid() )
    {
-      if ( m_img->setCurrentEntry(entry) )
+      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 )
@@ -1016,72 +1348,97 @@ bool ossimInfo::getImageInfo(ossim_uint32 entry, ossimKeywordlist& kwl, bool dno
          {
             result = true;
 
+            // Entry number:
             ossimString prefix = "image";
             prefix = prefix + ossimString::toString(entry) + ".";
-            kwl.add(prefix, ossimKeywordNames::ENTRY_KW, entry, true);
-            kwl.add(prefix, "image_handler", m_img->getClassName().c_str(), true);
-            if (m_img->getOverview())
+            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);
+
+            // 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_handler",
-                       m_img->getOverview()->getClassName().c_str(), true);
+               kwl.add(prefix, "overview.type",
+                       ih->getOverview()->getClassName().c_str(), true);
             }
             
-            ossimDrect boundingRect = m_img->getBoundingRect();
+            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 = m_img->getNumberOfInputBands();
+            const ossim_uint32 BANDS = ih->getNumberOfInputBands();
             kwl.add(prefix,ossimKeywordNames::NUMBER_INPUT_BANDS_KW, BANDS, true);
             kwl.add(prefix,ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW,
-                    m_img->getNumberOfOutputBands(), true);
+                    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 = m_img->getOutputScalarType();
+            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", m_img->getNullPixelValue(i), true);
-               kwl.add(prefix, band+"min_value", m_img->getMinPixelValue(i), true);
-               kwl.add(prefix, band+"max_value", m_img->getMaxPixelValue(i), true);
+               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", m_img->getNumberOfDecimationLevels(), true);
+            kwl.add(prefix,"number_decimation_levels", ih->getNumberOfDecimationLevels(), true);
             
          } // if ( outputEntry )
          
-      } // if ( m_img->setCurrentEntry(entry) )
+      } // if ( ih->setCurrentEntry(entry) )
       
-   } // if ( m_img.valid() )
+   } // if ( ih )
    
    return result;
-}
-
 
+} // End: ossimInfo::getImageInfo( ih, entry...
 
 void ossimInfo::getImageGeometryInfo(ossimKeywordlist& kwl, bool dnoFlag)
 {
    if ( m_img.valid() )
    {
-      ossim_uint32 numEntries = 0;
+      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;
-      m_img->getEntryList(entryList);
+      ih->getEntryList(entryList);
 
       std::vector<ossim_uint32>::const_iterator i = entryList.begin();
       while ( i != entryList.end() )
       {
-         if ( getImageGeometryInfo( (*i), kwl, dnoFlag ) )
+         if ( getImageGeometryInfo( ih, (*i), kwl, dnoFlag ) )
          {
             ++numEntries;
          }
@@ -1090,16 +1447,29 @@ void ossimInfo::getImageGeometryInfo(ossimKeywordlist& kwl, bool dnoFlag)
       
       kwl.add(ossimKeywordNames::NUMBER_ENTRIES_KW, numEntries, true);
 
-   } // if ( m_img.valid() )
+   } // if ( ih )
 }
    
 bool ossimInfo::getImageGeometryInfo(ossim_uint32 entry, ossimKeywordlist& kwl, bool dnoFlag)
 {
-   bool result = false;
-   
+   bool result = false; 
    if ( m_img.valid() )
    {
-      if ( m_img->setCurrentEntry(entry) )
+      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 )
@@ -1112,13 +1482,13 @@ bool ossimInfo::getImageGeometryInfo(ossim_uint32 entry, ossimKeywordlist& kwl,
 
          if ( outputEntry )
          {
-            ossimRefPtr<ossimImageGeometry> geom = m_img->getImageGeometry();
+            ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
             if(geom.valid())
             {
                result = true;
                
                ossimString prefix = "image";
-               prefix = prefix + ossimString::toString(entry) + ".";
+               prefix = prefix + ossimString::toString(entry) + ossimString(".geometry.");
                
                geom->saveState(kwl, prefix);
                
@@ -1130,7 +1500,7 @@ bool ossimInfo::getImageGeometryInfo(ossim_uint32 entry, ossimKeywordlist& kwl,
                ossimGpt lrg;
                ossimGpt urg;
 
-               ossimDrect outputRect = m_img->getBoundingRect();
+               ossimDrect outputRect = ih->getBoundingRect();
 
                geom->localToWorld(outputRect.ul(), ulg);
                geom->localToWorld(outputRect.ll(), llg);
@@ -1190,27 +1560,292 @@ bool ossimInfo::getImageGeometryInfo(ossim_uint32 entry, ossimKeywordlist& kwl,
 
          } // if ( outputEntry )
 
-      } // if ( m_img->setCurrentEntry(entry) )
+      } // if ( ih->setCurrentEntry(entry) )
 
-   } // if ( m_img.valid() )
+      if ( !result )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "No geometry for file " << ih->getFilename() << std::endl;
+      }
+      
+   } // if ( ih )
+   
+   return result;
 
-   if ( !result )
+} // End: ossimInfo::getImageGeometryInfo( ih, entry...
+
+void ossimInfo::getCenterImage(ossimKeywordlist& kwl)
+{
+   if ( m_img.valid() )
    {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "No geometry for file " << m_img->getFilename() << std::endl;
+      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;
+      }
+   } 
+}
    
-   return result;
+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::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 )
+}
+   
+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 = m_img->getProperty(s);
+      ossimRefPtr<ossimProperty> prop = ih->getProperty(s);
       if (prop.valid())
       {
          ossimString s;
@@ -1493,7 +2128,7 @@ std::ostream& ossimInfo::outputHeight(const ossimGpt& gpt, std::ostream& out) co
    }
    else
    {
-      out << "Did not find cell for point!" << "\n";
+      out << "Did not find cell for point: " << gpt << "\n";
    }
    
    out << "MSL to ellipsoid delta: ";
@@ -1576,6 +2211,24 @@ std::ostream& ossimInfo::testPlugin(const ossimFilename& plugin, std::ostream& o
    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));
@@ -1600,6 +2253,16 @@ std::ostream& ossimInfo::printProjections(std::ostream& out) const
    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));
@@ -1620,6 +2283,17 @@ std::ostream& ossimInfo::printResamplerFilters(std::ostream& out) const
    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::printWriterProps() const
 {
    printWriterProps(ossimNotify(ossimNotifyLevel_INFO));
diff --git a/src/ossim/util/ossimRpfUtil.cpp b/src/ossim/util/ossimRpfUtil.cpp
index 0985523..a6ec92f 100644
--- a/src/ossim/util/ossimRpfUtil.cpp
+++ b/src/ossim/util/ossimRpfUtil.cpp
@@ -13,9 +13,6 @@
 //----------------------------------------------------------------------------
 // $Id$
 
-#include <ctime>
-#include <iomanip>
-
 #include <ossim/util/ossimRpfUtil.h>
 #include <ossim/base/ossimDrect.h>
 #include <ossim/base/ossimFilename.h>
@@ -24,6 +21,8 @@
 #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");
 
@@ -58,7 +57,7 @@ void ossimRpfUtil::writeDotRpfFiles( const ossimFilename& aDotTocFile,
    {
       std::string e = MODULE;
       e += " ERROR:\nCould not open: ";
-      e+= aDotTocFile;
+      e+= aDotTocFile.string();
       throw ossimException(e);
    }
 
@@ -91,7 +90,7 @@ void ossimRpfUtil::writeDotRpfFiles( const ossimFilename& aDotTocFile,
       {
          std::string e = MODULE;
          e += " ERROR:  Null entry: ";
-         e += ossimString::toString(entry);
+         e += ossimString::toString(entry).string();
          throw ossimException(e);
       }
    }
@@ -147,12 +146,12 @@ void ossimRpfUtil::writeDotRpfFile( const ossimRpfToc* toc,
    
    // Open the file to write.
    std::ofstream os;
-   os.open(outFile, ios::out);
+   os.open(outFile.c_str(), ios::out);
    if ( os.good() == false )
    {
       std::string errMsg = MODULE;
       errMsg += "ERROR could not open: ";
-      errMsg += outFile;
+      errMsg += outFile.string();
       throw ossimException(errMsg);
    }
    
@@ -170,7 +169,7 @@ void ossimRpfUtil::writeDotRpfFile( const ossimRpfToc* toc,
    if( geom.valid() == false)
    {
       std::string errMsg = "ERROR could not get geometry.";
-      errMsg += outFile;
+      errMsg += outFile.string();
       throw ossimException(errMsg);  
    }
 
diff --git a/src/ossim/vec/ossimVpfBoundingRecordTable.cpp b/src/ossim/vec/ossimVpfBoundingRecordTable.cpp
index f196244..6f56f11 100644
--- a/src/ossim/vec/ossimVpfBoundingRecordTable.cpp
+++ b/src/ossim/vec/ossimVpfBoundingRecordTable.cpp
@@ -31,12 +31,12 @@ bool ossimVpfBoundingRecordTable::openTable(const ossimFilename& tableName)
          {
             result = true;
             reset();
-            long n = 1;
+            ossim_int32 n = 1;
             
-            float xmin;
-            float ymin;
-            float xmax;
-            float ymax;
+            ossim_float32 xmin;
+            ossim_float32 ymin;
+            ossim_float32 xmax;
+            ossim_float32 ymax;
             
             row_type row;
             for(int rowIdx = 1; rowIdx < getNumberOfRows(); ++rowIdx)
diff --git a/src/ossim/vec/ossimVpfDatabase.cpp b/src/ossim/vec/ossimVpfDatabase.cpp
index f77ebd5..09a2548 100644
--- a/src/ossim/vec/ossimVpfDatabase.cpp
+++ b/src/ossim/vec/ossimVpfDatabase.cpp
@@ -6,7 +6,7 @@
 // Description: This class extends the stl's string class.
 //
 //********************************************************************
-// $Id: ossimVpfDatabase.cpp 9963 2006-11-28 21:11:01Z gpotts $
+// $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>
@@ -39,8 +39,8 @@ bool ossimVpfDatabase::openDatabase(const ossimFilename& filename)
 
    // 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");
+   theDatabaseHeaderTable   = ossimFilename(tempFilename.path()).dirCat("dht");
+   theLibraryAttributeTable = ossimFilename(tempFilename.path()).dirCat("lat");
 
    if(theDatabaseHeaderTable.exists() &&
       theLibraryAttributeTable.exists())
@@ -48,7 +48,6 @@ bool ossimVpfDatabase::openDatabase(const ossimFilename& filename)
       ossimVpfTable table;
       // now lets see if they are valid tables
       result = table.openTable(theDatabaseHeaderTable);
-      
       if(result&&
          !ossimVpfDatabaseHeaderTableValidator().isValid(table))
       {
diff --git a/src/ossim/vec/ossimVpfFeatureClassSchema.cpp b/src/ossim/vec/ossimVpfFeatureClassSchema.cpp
index 00edac2..c3be940 100644
--- a/src/ossim/vec/ossimVpfFeatureClassSchema.cpp
+++ b/src/ossim/vec/ossimVpfFeatureClassSchema.cpp
@@ -8,7 +8,7 @@
 // Author: Garrett Potts
 //
 //********************************************************************
-// $Id: ossimVpfFeatureClassSchema.cpp 9094 2006-06-13 19:12:40Z dburken $
+// $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>
@@ -55,7 +55,7 @@ void ossimVpfFeatureClassSchema::closeTable()
 void ossimVpfFeatureClassSchema::getFeatureClasses(std::vector<ossimString>& featureClassArray)const
 {
    featureClassArray.clear();
-   std::map<ossimString, ossimVpfFeatureClassSchemaNode>::const_iterator featureClassIter = theFeatureClassMap.begin();
+   std::map<ossimString, ossimVpfFeatureClassSchemaNode, ossimStringLtstr>::const_iterator featureClassIter = theFeatureClassMap.begin();
 
    while(featureClassIter != theFeatureClassMap.end())
    {
@@ -67,7 +67,7 @@ void ossimVpfFeatureClassSchema::getFeatureClasses(std::vector<ossimString>& fea
 bool ossimVpfFeatureClassSchema::getFeatureClassNode(const ossimString& featureClass,
                                                      ossimVpfFeatureClassSchemaNode& featureClassNode)const
 {
-   std::map<ossimString, ossimVpfFeatureClassSchemaNode>::const_iterator fIter = theFeatureClassMap.find(featureClass);
+   std::map<ossimString, ossimVpfFeatureClassSchemaNode, ossimStringLtstr>::const_iterator fIter = theFeatureClassMap.find(featureClass);
 
    if(fIter != theFeatureClassMap.end())
    {
diff --git a/src/ossim/vec/ossimVpfTable.cpp b/src/ossim/vec/ossimVpfTable.cpp
index 43cfef2..9103132 100644
--- a/src/ossim/vec/ossimVpfTable.cpp
+++ b/src/ossim/vec/ossimVpfTable.cpp
@@ -9,7 +9,7 @@
 //              vpf file.
 //
 //********************************************************************
-// $Id: ossimVpfTable.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
+// $Id: ossimVpfTable.cpp 19636 2011-05-24 16:48:45Z gpotts $
 #include <ossim/vec/ossimVpfTable.h>
 #include <ossim/vec/vpf.h>
 #include <ossim/base/ossimErrorCodes.h>
@@ -205,7 +205,7 @@ ossimString ossimVpfTable::getColumnValueAsString(row_type& row,
                                                   long columnNumber)const
 {
    ossimString result;
-   long n=1;
+   ossim_int32 n=1;
    switch(theTableInformation->header[columnNumber].type)
    {
    case 'T': // it's of type text so
@@ -445,10 +445,10 @@ void ossimVpfTable::print(std::ostream& out)const
       // was grabbed from the vhcl map server software.
       vpf_table_type& table = *theTableInformation;
 
-      long       i,j,k,n;
-      short int  ival=0,*iptr=NULL;
-      long       lval=0,*lptr=NULL;
-      float      fval=0,*fptr=NULL;
+      ossim_int32       i,j,k,n;
+      ossim_int16  ival=0,*iptr=NULL;
+      ossim_int32       lval=0,*lptr=NULL;
+      ossim_float32      fval=0,*fptr=NULL;
       date_type  dval,*dptr=NULL;
       id_triplet_type kval={0,0,0}, *kptr=NULL;
       coordinate_type cval={0,0}, *cptr=NULL;
@@ -526,7 +526,7 @@ void ossimVpfTable::print(std::ostream& out)const
 	       }
                else
                {
-		  lptr = (long*)get_table_element(j,row,table,NULL,&n);
+		  lptr = (ossim_int32*)get_table_element(j,row,table,NULL,&n);
 		  for (k=0;k<n;k++)
                   {
 		     if (!is_vpf_null_float(lptr[k]))
diff --git a/src/ossim/version-config.cpp b/src/ossim/version-config.cpp
index 5f6c3e3..9c5e5b6 100644
--- a/src/ossim/version-config.cpp
+++ b/src/ossim/version-config.cpp
@@ -55,7 +55,6 @@ int main(int argc, char* argv[])
    std::string releaseVersion = "0";
    std::string::size_type pos1 = std::string::npos;
    std::string::size_type pos2 = std::string::npos;
-   std::string::size_type pos3 = std::string::npos;
    
    pos1 = versionNumber.find(".", 0);
    if(pos1 != std::string::npos)
diff --git a/src/ossim/video/ossimVideoGeometry.cpp b/src/ossim/video/ossimVideoGeometry.cpp
new file mode 100644
index 0000000..423d288
--- /dev/null
+++ b/src/ossim/video/ossimVideoGeometry.cpp
@@ -0,0 +1,19 @@
+//**************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer, SPADAC Inc.
+//
+// DESCRIPTION: Defines base class for full video geometry
+// 
+//**************************************************************************************************
+//  $Id: ossimVideoGeometry.cpp 2665 2011-06-03 20:16:45Z oscar.kramer $
+
+#include <ossim/video/ossimVideoGeometry.h>
+
+//*************************************************************************************************
+// Default constructor. This is a pure virtual base class with protected default constructor
+//*************************************************************************************************
+
+// EVENTUALLY POPULATE WITH COMMON VIDEO GEOMETRY CODE
diff --git a/src/ossim/video/ossimVideoHandler.cpp b/src/ossim/video/ossimVideoHandler.cpp
new file mode 100644
index 0000000..e1630aa
--- /dev/null
+++ b/src/ossim/video/ossimVideoHandler.cpp
@@ -0,0 +1,43 @@
+//**************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer, SPADAC Inc.
+//
+// DESCRIPTION: Interface for all ossim Video types
+// 
+//**************************************************************************************************
+//  $Id: ossimVideoHandler.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
+
+#include <ossim/video/ossimVideoHandler.h>
+
+RTTI_DEF1(ossimVideoHandler, "ossimVideoHandler", ossimVideoSource)
+
+//*************************************************************************************************
+// Protected constructor. This is a pure virtual base class with protected default constructor
+//*************************************************************************************************
+ossimVideoHandler::ossimVideoHandler()
+   :
+   m_currentFrameTime (0),
+   m_videoDuration (0),
+   m_frameRate (ossim::nan())
+{ }
+
+//*************************************************************************************************
+// Protected constructor. This is a pure virtual base class with protected default constructor
+//*************************************************************************************************
+void ossimVideoHandler::rewind()
+{
+   seek(0, SEEK_ABSOLUTE);
+}
+
+//*************************************************************************************************
+//! Returns TRUE if video file named is successfully opened.
+//*************************************************************************************************
+bool ossimVideoHandler::open(const ossimFilename& videoFile)
+{
+   m_videoFilename = videoFile;
+   return open();
+}
+
diff --git a/src/ossim/video/ossimVideoImageHandler.cpp b/src/ossim/video/ossimVideoImageHandler.cpp
new file mode 100644
index 0000000..e4a4d46
--- /dev/null
+++ b/src/ossim/video/ossimVideoImageHandler.cpp
@@ -0,0 +1,127 @@
+//**************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer, SPADAC Inc.
+//
+// DESCRIPTION: 
+// 
+//**************************************************************************************************
+//  $Id$
+
+#include <ossim/video/ossimVideoImageHandler.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+
+RTTI_DEF1(ossimVideoImageHandler, "ossimVideoImageHandler", ossimImageHandler)
+
+//*************************************************************************************************
+// Constructor
+//*************************************************************************************************
+ossimVideoImageHandler::ossimVideoImageHandler() 
+:  m_currentFrameNumber (-1)
+{
+}
+
+//*************************************************************************************************
+// Closes "image" by detaching from the video
+//*************************************************************************************************
+void ossimVideoImageHandler::close()
+{
+   m_video = 0;
+   m_videoGeometry = 0;
+}
+
+//*************************************************************************************************
+// Returns list of all frames available in the video.
+//*************************************************************************************************
+void ossimVideoImageHandler::getEntryList(std::vector<ossim_uint32>& entryList) const
+{
+   entryList.clear();
+   ossim_uint32 num_frames = getNumberOfEntries();
+   for (ossim_uint32 i=0; i<num_frames; ++i)
+      entryList.push_back(i);
+}
+
+//*************************************************************************************************
+// Indirectly sets the frame time given a frame index from the start frame.
+//! Returns false if frame time is outside of allowable range.
+//*************************************************************************************************
+bool ossimVideoImageHandler::setCurrentEntry(ossim_uint32 frame_number)
+{
+   if (!m_video.valid())
+      return false;
+
+   ossim_float64 frameTime = m_video->computeFrameTime(frame_number);
+   if (m_video->seek(frameTime, ossimVideoSource::SEEK_ABSOLUTE))
+   {
+      m_currentFrameNumber = frame_number;
+      return true;
+   }
+
+   return false;
+}
+
+//*************************************************************************************************
+// Converts frame time to frame index using frame rate:
+//*************************************************************************************************
+ossim_uint32 ossimVideoImageHandler::getCurrentEntry() const
+{
+   if (m_currentFrameNumber < 0 )
+      return 0;
+
+   return m_currentFrameNumber;
+}
+
+//*************************************************************************************************
+// Determines total number of frames using frame rate and video duration:
+//*************************************************************************************************
+ossim_uint32 ossimVideoImageHandler::getNumberOfEntries() const
+{
+   if (!m_video.valid())
+      return 0;
+
+   ossim_uint32 num_frames = (ossim_uint32) m_video->computeFrameNumber(m_video->duration());
+   return num_frames;
+}
+
+//*************************************************************************************************
+// Returns number of lines per video frame.
+//*************************************************************************************************
+ossim_uint32 ossimVideoImageHandler::getNumberOfLines(ossim_uint32 resLevel) const
+{
+   // Only full-image res level = 0 presently supported:
+   if (!m_video.valid() || (resLevel != 0))
+      return 0;
+
+   return m_video->frameSize().line;
+}
+
+//*************************************************************************************************
+// Returns number of lines per video frame.
+//*************************************************************************************************
+ossim_uint32 ossimVideoImageHandler::getNumberOfSamples(ossim_uint32 resLevel) const
+{
+   // Only full-image res level = 0 presently supported:
+   if (!m_video.valid() || (resLevel != 0))
+      return 0;
+
+   return m_video->frameSize().samp;
+}
+
+//*************************************************************************************************
+// Returns Image Geometry for current frame.
+//*************************************************************************************************
+ossimRefPtr<ossimImageGeometry> ossimVideoImageHandler::getImageGeometry()
+{
+   if (theGeometry.valid())
+      return theGeometry;
+
+   // Only full-image res level = 0 presently supported:
+   if (!m_video.valid() || !m_videoGeometry.valid())
+      return NULL;
+
+   theGeometry = m_videoGeometry->getImageGeometry(m_video->computeFrameTime(m_currentFrameNumber));
+   return theGeometry;
+}
diff --git a/src/ossim/video/ossimVideoImageSource.cpp b/src/ossim/video/ossimVideoImageSource.cpp
new file mode 100644
index 0000000..5f62000
--- /dev/null
+++ b/src/ossim/video/ossimVideoImageSource.cpp
@@ -0,0 +1,212 @@
+//**************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer, SPADAC Inc.
+//
+// DESCRIPTION: Defines pure virtual base class for individual video frame image handler 
+// 
+//**************************************************************************************************
+//  $Id: ossimVideoImageSource.cpp 2695 2011-06-08 21:12:15Z oscar.kramer $
+
+#include <ossim/video/ossimVideoImageSource.h>
+#include <ossim/video/ossimVideoSource.h>
+#include <ossim/video/ossimVideoGeometry.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+
+RTTI_DEF1(ossimVideoImageSource, "ossimVideoImageSource", ossimImageSource)
+
+   //*************************************************************************************************
+//! Default Constructor
+//*************************************************************************************************
+ossimVideoImageSource::ossimVideoImageSource()
+: m_frameTime (-1.0)
+{
+}
+
+//*************************************************************************************************
+//! Constructor used when accessing a common video object (versus instantiating a new video for
+//! each frame.
+//*************************************************************************************************
+ossimVideoImageSource::ossimVideoImageSource(ossimVideoSource* /* video */, 
+                                             const double& frame_time_seconds)
+:  m_frameTime (-1.0)
+{
+   initialize();
+   setFrameTime(frame_time_seconds);
+}
+
+//*************************************************************************************************
+//! Common initialization code for all construction methods.
+//*************************************************************************************************
+void ossimVideoImageSource::initialize()
+{
+   ossimVideoSource* video = dynamic_cast<ossimVideoSource*>(getInput());
+   if (!video)
+      return;
+
+   // Establish the frame rect:
+   ossimIpt frame_size (video->frameSize());
+   m_frameRect = ossimIrect(0, 0, frame_size.x-1, frame_size.y-1);
+  	
+   // Initialize the tile data buffer:
+   m_tile = ossimImageDataFactory::instance()->create(this, this);
+   m_tile->setWidth(frame_size.x);
+
+   m_tile->setHeight(frame_size.y);
+   m_tile->initialize();
+}
+
+#if 0
+/*
+GARRETT: this is from when I derived this class from ossimImageHandler instead of ossimImageSource.
+I'm leaving these out but it may be convenient to allow OSSIM to consider a video as a multi-entry
+file. Give some thought to the merits of deriving from ossimImageHandler. What about reader factory 
+and registry? If a user specifies a video file, should the image handler registry pick it up? 
+*/
+//*************************************************************************************************
+// Indirectly sets the frame time given a frame index from the start frame.
+//! Returns false if frame time is outside of allowable range.
+//*************************************************************************************************
+bool ossimVideoImageSource::setCurrentEntry(ossim_uint32 frame_number)
+{
+   if (!m_video)
+      return false;
+
+   ossim_float64 frame_rate = m_video->videoFrameRate();
+   ossim_float64 frameTime =  frame_number / frame_rate;
+   return setFrameTime(frameTime);
+}
+
+//*************************************************************************************************
+// Converts frame time to frame index using frame rate:
+//*************************************************************************************************
+ossim_uint32 ossimVideoImageSource::getCurrentEntry() const
+{
+   if (!m_video)
+      return 0;
+
+   ossim_float64 frame_rate = m_video->videoFrameRate();
+   if (frame_rate == 0.0)
+      return 0;
+
+   ossim_uint32 current_frame = m_frameTime/frame_rate;
+   return current_frame;
+}
+
+//*************************************************************************************************
+// Determines total number of frames using frame rate and video duration:
+//*************************************************************************************************
+ossim_uint32 ossimVideoImageSource::getNumberOfEntries() const
+{
+   if (!m_video)
+      return 0;
+
+   ossim_float64 frames_per_sec = m_video->videoFrameRate();
+   if (frames_per_sec == 0.0)
+      return 0;
+
+   ossim_float64 duration = m_video->duration();
+
+   ossim_uint32 num_frames = (ossim_uint32) (duration * frames_per_sec);
+   return num_frames;
+}
+#endif
+
+//*************************************************************************************************
+// Sets the time stamp (in seconds from start of video) for the frame of interest.
+//! Returns false if frame time is outside of allowable range.
+//*************************************************************************************************
+bool ossimVideoImageSource::setFrameTime(const double& frameTime)
+{
+   ossimVideoSource* video = dynamic_cast<ossimVideoSource*>(getInput());
+   if (!video)
+      return false;
+
+   // If the requested frame number corresponds with the current active frame, we're done:
+   if (frameTime == m_frameTime)
+      return true;
+
+   // Check that it is not past the last frame. Use video geometry's duration as it is more accurate
+   m_frameTime = frameTime;
+   if (m_frameTime > video->duration())
+   {
+      m_frameTime = 0;
+      return false;
+   }
+
+   // Seek to that frame:
+   video->seek(m_frameTime, ossimVideoSource::SEEK_ABSOLUTE);
+
+   return true;
+}
+
+//*************************************************************************************************
+// Returns number of lines per video frame.
+//*************************************************************************************************
+ossim_uint32 ossimVideoImageSource::getNumberOfLines(ossim_uint32 resLevel) const
+{
+   // Only full-image res level = 0 presently supported:
+   if (resLevel != 0)
+      return 0;
+
+   return m_frameRect.height();
+}
+
+//*************************************************************************************************
+// Returns number of lines per video frame.
+//*************************************************************************************************
+ossim_uint32 ossimVideoImageSource::getNumberOfSamples(ossim_uint32 resLevel) const
+{
+   // Only full-image res level = 0 presently supported:
+   if (resLevel != 0)
+      return 0;
+
+   return m_frameRect.width();
+}
+
+//*************************************************************************************************
+// Returns the populated geometry for this frame
+//*************************************************************************************************
+ossimRefPtr<ossimImageGeometry> ossimVideoImageSource::getImageGeometry()
+{
+   ossimVideoSource* video = dynamic_cast<ossimVideoSource*>(getInput());
+   if (!video)
+      return NULL;
+
+   ossimRefPtr<ossimVideoGeometry> video_geometry = video->getVideoGeometry();
+   if (!video_geometry.valid())
+      return NULL;
+
+   return video_geometry->getImageGeometry(m_frameTime);
+}
+
+//*************************************************************************************************
+// From ossimConnectableObject base class. Returns true if object is an ossimVideoSource.
+//*************************************************************************************************
+bool ossimVideoImageSource::canConnectMyInputTo(ossim_int32 inputIndex,
+                                                const ossimConnectableObject* object) const
+{
+   return ( (!object || PTR_CAST(ossimVideoSource, object)) && (inputIndex == 0) );
+}
+
+//*************************************************************************************************
+//! Video frames have no overviews, only full-res.
+//*************************************************************************************************
+void ossimVideoImageSource::getDecimationFactor(ossim_uint32 resLevel, ossimDpt& result) const
+{
+   result = ossimDpt(0.0, 0.0);
+   if (resLevel == 0)
+      result = ossimDpt(1.0, 1.0);
+}
+
+//*************************************************************************************************
+//! Video frames have no overviews, only full-res.
+//*************************************************************************************************
+void ossimVideoImageSource::getDecimationFactors(std::vector<ossimDpt>& decimations) const
+{
+   decimations.clear();
+   decimations.push_back(ossimDpt(1.0, 1.0));
+}
diff --git a/src/ossim/video/ossimVideoSource.cpp b/src/ossim/video/ossimVideoSource.cpp
new file mode 100644
index 0000000..9f4aa42
--- /dev/null
+++ b/src/ossim/video/ossimVideoSource.cpp
@@ -0,0 +1,184 @@
+//**************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer, SPADAC Inc.
+//
+// DESCRIPTION: Interface for all ossim Video types
+// 
+//**************************************************************************************************
+//  $Id: ossimVideoSource.cpp 2695 2011-06-08 21:12:15Z oscar.kramer $
+
+#include <ossim/video/ossimVideoSource.h>
+#include <ossim/video/ossimVideoGeometry.h>
+#include <ossim/video/ossimVideoImageHandler.h>
+#include <ossim/video/ossimVideoImageSource.h>
+
+RTTI_DEF1(ossimVideoSource, "ossimVideoSource", ossimSource)
+
+   //*************************************************************************************************
+// Protected constructor. This is a pure virtual base class with protected default constructor
+//*************************************************************************************************
+ossimVideoSource::ossimVideoSource()
+{ }
+
+//*************************************************************************************************
+// Rewind command is passed down the chain until a video handler can process it.
+//*************************************************************************************************
+void ossimVideoSource::rewind()
+{
+   ossimVideoSource* inter = PTR_CAST(ossimVideoSource, getInput(0));
+   if (inter)
+      inter->rewind();
+}
+
+//*************************************************************************************************
+//! Seeks to the frame at time specified, according to the seekType (relative to active frame or
+//! absolute time from start of video). Returns TRUE if successful. 
+//*************************************************************************************************
+bool ossimVideoSource::seek(ossim_float64 reference_time_sec, SeekType seekType)
+{
+   ossimVideoSource* inter = PTR_CAST(ossimVideoSource, getInput(0));
+   if (inter)
+      return inter->seek(reference_time_sec, seekType);
+   
+   return false;
+}
+
+//*************************************************************************************************
+//! Seeks to start of next frame. Returns TRUE if successful.
+//*************************************************************************************************
+bool ossimVideoSource::nextFrame()
+{
+   ossimVideoSource* inter = PTR_CAST(ossimVideoSource, getInput(0));
+   if (inter)
+      return inter->nextFrame();
+
+   return false;
+}
+
+//*************************************************************************************************
+//! Total length of video in seconds.
+//*************************************************************************************************
+ossim_float64 ossimVideoSource::duration() const 
+{
+   ossimVideoSource* inter = PTR_CAST(ossimVideoSource, getInput(0));
+   if (inter)
+      return inter->duration();
+
+   return 0.0;
+}
+
+//*************************************************************************************************
+//! Time in seconds from start of video of the current active frame, or NAN if no active frame.
+//*************************************************************************************************
+ossim_float64 ossimVideoSource::currentFrameTime() const
+{
+   ossimVideoSource* inter = PTR_CAST(ossimVideoSource, getInput(0));
+   if (inter)
+      return inter->currentFrameTime();
+
+   return 0.0;
+}
+
+//*************************************************************************************************
+//! Nominal frames per second.
+//*************************************************************************************************
+ossim_float64 ossimVideoSource::videoFrameRate() const
+{
+   ossimVideoSource* inter = PTR_CAST(ossimVideoSource, getInput(0));
+   if (inter)
+      return inter->videoFrameRate();
+
+   return 0.0;
+}
+
+//*************************************************************************************************
+//! Access to video geometry object.
+//*************************************************************************************************
+const ossimRefPtr<ossimVideoGeometry> ossimVideoSource::getVideoGeometry() const
+{
+   ossimVideoSource* inter = PTR_CAST(ossimVideoSource, getInput(0));
+   if (inter)
+      return inter->getVideoGeometry();
+
+   return NULL;
+}
+
+//*************************************************************************************************
+//! Access to current active frame.
+//*************************************************************************************************
+const ossimRefPtr<ossimVideoImageHandler> ossimVideoSource::getCurrentFrame() const
+{
+   //STUB
+   return NULL;
+}
+
+//*************************************************************************************************
+//! Total number of frames in video.
+//*************************************************************************************************
+ossim_uint32 ossimVideoSource::getNumberOfFrames() const
+{
+   // Base class implementation just computes number of frames from duration:
+   ossim_uint32 num_frames = (ossim_uint32) computeFrameNumber(duration());
+   return num_frames;
+}
+
+//*************************************************************************************************
+//! Utility method for computing frame number from frame time.
+//*************************************************************************************************
+int ossimVideoSource::computeFrameNumber(double seconds_from_start) const
+{
+   double frame_rate = videoFrameRate();
+   if (frame_rate > 0.0)
+      return (int) seconds_from_start*frame_rate;
+   // else
+   return -1;
+}
+
+//*************************************************************************************************
+//! Utility method for computing frame time from frame number.
+//*************************************************************************************************
+double ossimVideoSource::computeFrameTime(ossim_uint32 frame_count)  const
+{
+   double frame_rate = videoFrameRate();
+   if (frame_rate > 0.0)
+      return frame_count/frame_rate;
+   // else
+   return ossim::nan();
+}
+
+//*************************************************************************************************
+//! Connections only to other video sources are allowed.
+//*************************************************************************************************
+bool ossimVideoSource::canConnectMyInputTo(ossim_int32 index, 
+                                           const ossimConnectableObject* object) const
+{
+   if (object && (index == 0) && PTR_CAST(ossimVideoSource, object))
+      return true;
+   // else
+   return false;
+}
+
+//*************************************************************************************************
+//! Presently can only connect into an image chain via an ossimVideoImageSource bridge, or
+//! to another video source for video chains. Returns TRUE if connection possible.
+//*************************************************************************************************
+bool ossimVideoSource::canConnectMyOutputTo(ossim_int32 index, 
+                                            const ossimConnectableObject* object) const
+{
+   if (!object || (index != 0))
+      return false;
+
+   if (PTR_CAST(ossimVideoSource, object))
+      return true;
+
+   if (PTR_CAST(ossimVideoImageSource, object))
+      return true;
+
+   if (PTR_CAST(ossimVideoImageHandler, object))
+      return true;
+
+   return false;
+}
diff --git a/src/ossim/vpfutil/vpfclip.c b/src/ossim/vpfutil/vpfclip.c
index 0436d5e..7826197 100644
--- a/src/ossim/vpfutil/vpfclip.c
+++ b/src/ossim/vpfutil/vpfclip.c
@@ -120,8 +120,8 @@ static int box_intersection( line_segment_type lseg,
 
 /* 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( long int id, coordinate_type *coord,
-			       long int ncoord, row_type row,
+static void write_edge_record( ossim_int32 id, coordinate_type *coord,
+			       ossim_int32 ncoord, row_type row,
 			       vpf_table_type *table )
 {
    int ID_, COORD_;
@@ -174,7 +174,7 @@ void vpf_edge_clip( char *covpath, extent_type extent, char *outpath )
    vpf_table_type in, out;
    row_type row;
    edge_rec_type inedge, outedge;
-   long int i,j,n,id;
+   ossim_int32 i,j,n,id;
    line_segment_type lseg;
    coordinate_type coord;
    char path[255], *def;
diff --git a/src/ossim/vpfutil/vpfcntnt.c b/src/ossim/vpfutil/vpfcntnt.c
index 9891359..8a1caa1 100644
--- a/src/ossim/vpfutil/vpfcntnt.c
+++ b/src/ossim/vpfutil/vpfcntnt.c
@@ -95,9 +95,9 @@
 void vpf_dump_table( char *tablename, char *outname )
 {
    vpf_table_type table;
-   long int   i,j,k,n;
+   ossim_int32   i,j,k,n;
    int        ival,*iptr;
-   long int   lval,*lptr;
+   ossim_int32   lval,*lptr;
    float      fval,*fptr;
    date_type  dval,*dptr;
    id_triplet_type kval, *kptr;
@@ -157,7 +157,7 @@ void vpf_dump_table( char *tablename, char *outname )
 		  else
 		     fprintf(fp,"(null)\n");
 	       } else {
-		  lptr = (long int*)get_table_element(j,row,table,NULL,&n);
+		  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]);
@@ -290,7 +290,7 @@ void vpf_dump_table( char *tablename, char *outname )
 void vpf_dump_doc_table( char *tablename, char *outname )
 {
    vpf_table_type table;
-   long int   i,n;
+   ossim_int32   i,n;
    char       *buf;
    row_type   row;
    FILE       *fp;
diff --git a/src/ossim/vpfutil/vpfdict.c b/src/ossim/vpfutil/vpfdict.c
index ce15842..6836e5f 100644
--- a/src/ossim/vpfutil/vpfdict.c
+++ b/src/ossim/vpfutil/vpfdict.c
@@ -63,7 +63,7 @@ void feature_class_dictionary( int fc, library_type lib )
    FILE               *out;
    row_type           row;
    float              fval;
-   long int           ival,n;
+   ossim_int32           ival,n;
 
    hidemousecursor();
    time_cursor();
diff --git a/src/ossim/vpfutil/vpfdisp.c b/src/ossim/vpfutil/vpfdisp.c
index a9da049..b43e610 100644
--- a/src/ossim/vpfutil/vpfdisp.c
+++ b/src/ossim/vpfutil/vpfdisp.c
@@ -174,7 +174,7 @@ void vpf_display_record( row_type row,
    vpf_table_type vdt;
    row_type vdtrow;
    int found;
-   long int l, lval, count, *lptr;
+   ossim_int32 l, lval, count, *lptr;
    short int s,sval,*sptr;
    float f,*fptr;
    date_type date;
@@ -473,7 +473,7 @@ void vpf_display_record( row_type row,
  *   Parameters:
  *A
  *    fc      <input> == (int) feature class number.
- *    row     <input> == (long int) row of the attribute table.
+ *    row     <input> == (ossim_int32) row of the attribute table.
  *    library <input> == (library_type *) VPF library structure.
  *    fp      <input> == (FILE *) pointer to the output file.
  *E
@@ -485,7 +485,7 @@ void vpf_display_record( row_type row,
  *E
  *************************************************************************/
 void display_attributes( int fc,
-			 long int row,
+			 ossim_int32 row,
 			 library_type *library,
 			 FILE *fp )
 {
diff --git a/src/ossim/vpfutil/vpfdraw.c b/src/ossim/vpfutil/vpfdraw.c
index 67e0268..ee63207 100644
--- a/src/ossim/vpfutil/vpfdraw.c
+++ b/src/ossim/vpfutil/vpfdraw.c
@@ -98,7 +98,7 @@ typedef struct {
 int draw_edge_coordinates( edge_rec_type *edge_rec )
 {
    int xscr,yscr, xprev,yprev, x1,y1,x2,y2, mbrx2, wrap;
-   register long int i;
+   register ossim_int32 i;
    extent_type mbr;
    coordinate_type coord;
 
@@ -279,7 +279,7 @@ int draw_edge_row( row_type row, vpf_table_type table )
  *
  *   Parameters:
  *A
- *     rownum   <input>==(long int)row number of the edge primitive table.
+ *     rownum   <input>==(ossim_int32)row number of the edge primitive table.
  *     table    <input>==(vpf_table_type) edge table.
  *     return  <output>==(int) 0 if the user escapes, 1 upon successful
  *                          completion.
@@ -291,7 +291,7 @@ int draw_edge_row( row_type row, vpf_table_type table )
  *    Barry Michaels   August 1991                           DOS Turbo C
  *E
  *************************************************************************/
-int draw_edge( long int rownum, vpf_table_type table )
+int draw_edge( ossim_int32 rownum, vpf_table_type table )
 {
    int stat;
    row_type row;
@@ -335,7 +335,7 @@ int draw_edge( long int rownum, vpf_table_type table )
 int draw_point_row( row_type row, vpf_table_type table )
 {
    int xscr,yscr, coord_pos;
-   long int n;
+   ossim_int32 n;
    coordinate_type pnt;
 
    coord_pos = table_pos("COORDINATE",table);
@@ -370,7 +370,7 @@ int draw_point_row( row_type row, vpf_table_type table )
  *
  *   Parameters:
  *A
- *     rownum      <input>==(long int) row number of the entity node
+ *     rownum      <input>==(ossim_int32) row number of the entity node
  *                          primitive table.
  *     table       <input>==(vpf_table_type) entity noe primitive table.
  *     return     <output>==(int) 0 if the user escapes, 1 upon successful
@@ -383,7 +383,7 @@ int draw_point_row( row_type row, vpf_table_type table )
  *    Barry Michaels   August 1991                        DOS Turbo C
  *E
  *************************************************************************/
-int draw_point( long int rownum, vpf_table_type table )
+int draw_point( ossim_int32 rownum, vpf_table_type table )
 {
    int stat;
    row_type row;
@@ -426,7 +426,7 @@ int draw_point( long int rownum, vpf_table_type table )
 int draw_text_row( row_type row, vpf_table_type table )
 {
    int xscr,yscr, shape_pos, text_pos;
-   long int n, nshape;
+   ossim_int32 n, nshape;
    coordinate_type *shape_line;
    char *text;
    struct viewporttype vp;
@@ -474,7 +474,7 @@ int draw_text_row( row_type row, vpf_table_type table )
  *
  *   Parameters:
  *A
- *     rownum      <input>==(long int) row number of the text table.
+ *     rownum      <input>==(ossim_int32) row number of the text table.
  *     table       <input>==(vpf_table_type) text primitive table.
  *     return     <output>==(int) 0 if the user escapes, 1 upon successful
  *                          completion.
@@ -486,7 +486,7 @@ int draw_text_row( row_type row, vpf_table_type table )
  *    Barry Michaels   August 1991                        DOS Turbo C
  *E
  *************************************************************************/
-int draw_text( long int rownum, vpf_table_type table )
+int draw_text( ossim_int32 rownum, vpf_table_type table )
 {
    int stat;
    row_type row;
@@ -639,7 +639,7 @@ void gen_polygon_edge( edge_rec_type edge_rec,
 		       Shademap *poly,
 		       int wrap )
 {
-   register long int i,start,end,inc;
+   register ossim_int32 i,start,end,inc;
    int xscr,yscr;
    IPoint pnt, make_ipoint();
    coordinate_type coord;
@@ -732,8 +732,8 @@ void draw_polygon_edge( edge_rec_type edge_rec )
  *
  *   Parameters:
  *A
- *     face_id    <input>==(long int) row id of the specified face.
- *     start_edge <input>==(long int) row id of the edge that starts the
+ *     face_id    <input>==(ossim_int32) row id of the specified face.
+ *     start_edge <input>==(ossim_int32) row id of the edge that starts the
  *                         loop.
  *     edgetable  <input>==(vpf_table_type) VPF edge primitive table.
  *E
@@ -744,12 +744,12 @@ void draw_polygon_edge( edge_rec_type edge_rec )
  *    Barry Michaels   May 1991                           DOS Turbo C
  *E
  *************************************************************************/
-void trace_polygon_loop(long int face_id,
-			long int start_edge,
+void trace_polygon_loop(ossim_int32 face_id,
+			ossim_int32 start_edge,
 			vpf_table_type edgetable )
 {
   edge_rec_type edge_rec;
-  long int next, prevnode;
+  ossim_int32 next, prevnode;
   boolean done=FALSE;
   IPoint make_ipoint();
 
@@ -893,10 +893,10 @@ void trace_polygon_loop(long int face_id,
  *   Parameters:
  *A
  *     edge_rec   <input>==(edge_rec_type *) VPF edge record.
- *     prev_node  <inout>==(long int *) the previous node visited.  This
+ *     prev_node  <inout>==(ossim_int32 *) the previous node visited.  This
  *                         value is updated by this function.
- *     face_id    <input>==(long int) row id of the specified face.
- *     next_polygon_edge <output>==(long int) the next edge id.  A value of -1
+ *     face_id    <input>==(ossim_int32) row id of the specified face.
+ *     next_polygon_edge <output>==(ossim_int32) the next edge id.  A value of -1
  *                         indicates a topology error.
  *E
  *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@@ -906,10 +906,10 @@ void trace_polygon_loop(long int face_id,
  *    Barry Michaels   May 1991                           DOS Turbo C
  *E
  *************************************************************************/
-long int next_polygon_edge( edge_rec_type *edge_rec, long int *prevnode,
-			    long int face_id )
+ossim_int32 next_polygon_edge( edge_rec_type *edge_rec, ossim_int32 *prevnode,
+			    ossim_int32 face_id )
 {
-   long int next;
+   ossim_int32 next;
 
    if ( (edge_rec->right == face_id) && (edge_rec->left == face_id) ) {
       /* Dangle - go the opposite direction to continue along the boundary */
@@ -955,8 +955,8 @@ long int next_polygon_edge( edge_rec_type *edge_rec, long int *prevnode,
  *
  *   Parameters:
  *A
- *     face_id    <input>==(long int) row id of the specified face.
- *     start_edge <input>==(long int) row id of the edge that starts the
+ *     face_id    <input>==(ossim_int32) row id of the specified face.
+ *     start_edge <input>==(ossim_int32) row id of the edge that starts the
  *                         loop.
  *     edgetable  <input>==(vpf_table_type) VPF edge primitive table.
  *     poly       <inout>==(Shademap *) polygon shade structure.
@@ -970,14 +970,14 @@ long int next_polygon_edge( edge_rec_type *edge_rec, long int *prevnode,
  *    Barry Michaels   May 1991                           DOS Turbo C
  *E
  *************************************************************************/
-void draw_polygon_loop(long int face_id,
-		       long int start_edge,
+void draw_polygon_loop(ossim_int32 face_id,
+		       ossim_int32 start_edge,
 		       vpf_table_type edgetable,
 		       Shademap *poly,
 		       int wrap )
 {
   edge_rec_type edge_rec;
-  long int next, prevnode;
+  ossim_int32 next, prevnode;
   boolean done=FALSE;
   IPoint make_ipoint();
   int xscr,yscr, color;
@@ -1258,7 +1258,7 @@ void draw_face_row( row_type row,
 		color_type c3,
 		color_type c4 )
 {
-   long int count;
+   ossim_int32 count;
    int  spx1,spy1,spx2,spy2,  rowid,ring;
    extent_type shade_box;
    Pattern  pattern;
@@ -1349,7 +1349,7 @@ void draw_face_row( row_type row,
  *
  *   Parameters:
  *A
- *     row_num   <input>==(long int) row id of the specified face.
+ *     row_num   <input>==(ossim_int32) row id of the specified face.
  *     facetable <input>==(vpf_table_type) VPF face primitive table.
  *     ringtable <input>==(vpf_table_type) VPF ring primitive table.
  *     edgetable <input>==(vpf_table_type) VPF edge primitive table.
@@ -1367,7 +1367,7 @@ void draw_face_row( row_type row,
  *    Barry Michaels   May 1991                           DOS Turbo C
  *E
  *************************************************************************/
-void draw_face( long int rownum,
+void draw_face( ossim_int32 rownum,
 		vpf_table_type facetable,
 		vpf_table_type ringtable,
 		vpf_table_type edgetable,
@@ -1406,8 +1406,8 @@ void draw_face( long int rownum,
  *
  *   Parameters:
  *A
- *     face_id    <input>==(long int) row id of the specified face.
- *     start_edge <input>==(long int) row id of the edge that starts the
+ *     face_id    <input>==(ossim_int32) row id of the specified face.
+ *     start_edge <input>==(ossim_int32) row id of the edge that starts the
  *                         loop.
  *     edgetable <input>==(vpf_table_type) VPF edge primitive table.
  *E
@@ -1418,12 +1418,12 @@ void draw_face( long int rownum,
  *    Barry Michaels   May 1991                           DOS Turbo C
  *E
  *************************************************************************/
-void outline_polygon_loop(long int face_id,
-			  long int start_edge,
+void outline_polygon_loop(ossim_int32 face_id,
+			  ossim_int32 start_edge,
 			  vpf_table_type edgetable)
 {
   edge_rec_type edge_rec;
-  long int next, prevnode;
+  ossim_int32 next, prevnode;
   boolean done=FALSE;
   IPoint make_ipoint();
 
@@ -1499,7 +1499,7 @@ void outline_polygon_loop(long int face_id,
  *
  *   Parameters:
  *A
- *     face_id   <input>==(long int) row id of the specified face.
+ *     face_id   <input>==(ossim_int32) row id of the specified face.
  *     facetable <input>==(vpf_table_type) VPF facemitive table.
  *     ringtable <input>==(vpf_table_type) VPF ringmitive table.
  *     edgetable <input>==(vpf_table_type) VPF edge primitive table.
@@ -1514,7 +1514,7 @@ void outline_polygon_loop(long int face_id,
  *    Barry Michaels   May 1991                           DOS Turbo C
  *E
  *************************************************************************/
-void outline_face( long int face_id,
+void outline_face( ossim_int32 face_id,
 		   vpf_table_type facetable,
 		   vpf_table_type ringtable,
 		   vpf_table_type edgetable,
@@ -1566,7 +1566,7 @@ void outline_face( long int face_id,
  *
  *   Parameters:
  *A
- *     face_id  <input>==(long int) id of the face to be outlined.
+ *     face_id  <input>==(ossim_int32) id of the face to be outlined.
  *     fname    <input>==(char *) file name of the face primitive table.
  *     color    <input>==(int) color to outline the face.
  *     inner    <input>==(int) if TRUE, draw inner rings;
@@ -1579,7 +1579,7 @@ void outline_face( long int face_id,
  *    Barry Michaels   May 1991                           DOS Turbo C
  *E
  *************************************************************************/
-void outline_face_table( long int face_id, char *fname,
+void outline_face_table( ossim_int32 face_id, char *fname,
 			 int color, int inner )
 {
    vpf_table_type facetable, ringtable, edgetable;
diff --git a/src/ossim/vpfutil/vpfmisc.c b/src/ossim/vpfutil/vpfmisc.c
index 3535f74..d216473 100644
--- a/src/ossim/vpfutil/vpfmisc.c
+++ b/src/ossim/vpfutil/vpfmisc.c
@@ -416,14 +416,14 @@ void displaymessage( char *s, ... )
    }
    va_end(arglist);
    for (i=0;i<nlines;i++) {
-       fprintf(stderr, text[i]);
+       fprintf(stderr, "%s", text[i]);
    }
    free(text);
 }
 
 void display_message(char *str)
 {
-    fprintf(stderr, str);
+   fprintf(stderr, "%s", str);
 }
 
 
diff --git a/src/ossim/vpfutil/vpfnear.c b/src/ossim/vpfutil/vpfnear.c
index eacca1e..92a2c84 100644
--- a/src/ossim/vpfutil/vpfnear.c
+++ b/src/ossim/vpfutil/vpfnear.c
@@ -211,7 +211,7 @@ float distance( double lat1, double lon1, double lat2, double lon2,
 float distance_to_edge_rec( float x, float y, edge_rec_type edge_rec,
 			    int dec_degrees )
 {
-   register long int i;
+   register ossim_int32 i;
    line_segment_type lseg;
    float xint,yint, d, dseg, d1, d2;
    coordinate_type coord1, coord2;
@@ -271,7 +271,7 @@ float distance_to_edge_rec( float x, float y, edge_rec_type edge_rec,
  *A
  *    x           <input> == (float) given point x coordinate.
  *    y           <input> == (float) given point y coordinate
- *    edge_id     <input> == (long int) specified edge.
+ *    edge_id     <input> == (ossim_int32) specified edge.
  *    edgetable   <input> == (vpf_table_type) given edge table.
  *    dec_degrees <input> == (float) flag to indicate if coordinates are
  *                                   in decimal degrees.
@@ -286,7 +286,7 @@ float distance_to_edge_rec( float x, float y, edge_rec_type edge_rec,
  *E
  *************************************************************************/
 float distance_to_edge( float x, float y,
-			long int edge_id,
+			ossim_int32 edge_id,
 			vpf_table_type edgetable,
 			int dec_degrees )
 {
@@ -323,7 +323,7 @@ float distance_to_edge( float x, float y,
  *A
  *    x           <input> == (float) given point x coordinate.
  *    y           <input> == (float) given point y coordinate
- *    edge_id    <input> == (long int) specified edge id.
+ *    edge_id    <input> == (ossim_int32) specified edge id.
  *    fname      <input> == (char *) path to valid VPF edge table.
  *    dec_degrees <output> == (int) flag to indicate if coordinates are
  *                                  in decimal degrees.
@@ -338,7 +338,7 @@ float distance_to_edge( float x, float y,
  *E
  *************************************************************************/
 float distance_to_edge_table( float x, float y,
-			      long int edge_id,
+			      ossim_int32 edge_id,
 			      char *fname, int dec_degrees )
 {
    vpf_table_type edgetable;
diff --git a/src/ossim/vpfutil/vpfprim.c b/src/ossim/vpfutil/vpfprim.c
index 19d0724..a7fe9a9 100644
--- a/src/ossim/vpfutil/vpfprim.c
+++ b/src/ossim/vpfutil/vpfprim.c
@@ -60,12 +60,12 @@
 #include <ossim/vpfutil/vpfprim.h>
 
 /* Compute the offset from the start of the row to the given field */
-static long int row_offset( int field, row_type row, vpf_table_type table) 
+static ossim_int32 row_offset( int field, row_type row, vpf_table_type table) 
 {
-   long int offset,n,size;
+   ossim_int32 offset,n,size;
    int i;
    id_triplet_type key;
-   int keysize[] = {0,sizeof(char),sizeof(short int),sizeof(long int)};
+   int keysize[] = {0,sizeof(char),sizeof(short int),sizeof(ossim_int32)};
 
    if (field < 0 || field >= table.nfields) return -1;
 
@@ -73,7 +73,7 @@ static long int row_offset( int field, row_type row, vpf_table_type table)
    for (i=0;i<field;i++) {
       switch (table.header[i].type) {
 	 case 'I':
-	    offset += sizeof(long int)*row[i].count;
+	    offset += sizeof(ossim_int32)*row[i].count;
 	    break;
 	 case 'S':
 	    offset += sizeof(short int)*row[i].count;
@@ -147,7 +147,7 @@ static long int row_offset( int field, row_type row, vpf_table_type table)
 edge_rec_type create_edge_rec( row_type row, vpf_table_type edge_table )
 {
    edge_rec_type edge;
-   long int count,i;
+   ossim_int32 count,i;
    int rowid,start,end,right,left,rightfwd,leftfwd,coord;
    id_triplet_type key;
    tri_coordinate_type *Zcoord;
@@ -283,7 +283,7 @@ edge_rec_type create_edge_rec( row_type row, vpf_table_type edge_table )
       edge.fp = edge_table.fp;
       edge.startpos = index_pos(edge.id,edge_table) +
 		      row_offset(coord,row,edge_table) +
-		      (long int)sizeof(long int);
+		      (ossim_int32)sizeof(ossim_int32);
       edge.pos = -1;
    }
 
@@ -314,7 +314,7 @@ edge_rec_type create_edge_rec( row_type row, vpf_table_type edge_table )
  *
  *   Parameters:
  *A
- *    id         <input> == (long int) edge id number.
+ *    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
@@ -325,7 +325,7 @@ edge_rec_type create_edge_rec( row_type row, vpf_table_type edge_table )
  *    Barry Michaels    April 1991                      DOS Turbo C
  *E
  *************************************************************************/
-edge_rec_type read_edge( long int  id,
+edge_rec_type read_edge( ossim_int32  id,
 			 vpf_table_type edge_table )
 {
    edge_rec_type edge;
@@ -492,14 +492,14 @@ coordinate_type next_edge_coordinate( edge_rec_type *edge_rec )
    return coord;
 }
 
-coordinate_type get_edge_coordinate( long int n,
+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;
-   long int size;
+   ossim_int32 size;
 
    if (n < 0)
       return first_edge_coordinate(edge_rec);
@@ -582,7 +582,7 @@ coordinate_type get_edge_coordinate( long int n,
  *
  *   Parameters:
  *A
- *    id           <input> == (long int) face id number.
+ *    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
@@ -593,12 +593,12 @@ coordinate_type get_edge_coordinate( long int n,
  *    Barry Michaels    April 1991                      DOS Turbo C
  *E
  *************************************************************************/
-face_rec_type read_face( long int  id,
+face_rec_type read_face( ossim_int32  id,
 			 vpf_table_type face_table )
 {
    face_rec_type face;
    int rowid,ring;
-   long int count;
+   ossim_int32 count;
    row_type row;
 
    rowid = table_pos( "ID", face_table );
@@ -648,7 +648,7 @@ face_rec_type read_next_face( vpf_table_type face_table )
 {
    face_rec_type face;
    int rowid,ring;
-   long int count;
+   ossim_int32 count;
    row_type row;
 
    rowid = table_pos( "ID", face_table );
@@ -683,7 +683,7 @@ face_rec_type read_next_face( vpf_table_type face_table )
  *
  *   Parameters:
  *A
- *    id           <input> == (long int) ring id number.
+ *    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
@@ -694,12 +694,12 @@ face_rec_type read_next_face( vpf_table_type face_table )
  *    Barry Michaels    April 1991                      DOS Turbo C
  *E
  *************************************************************************/
-ring_rec_type read_ring( long int  id,
+ring_rec_type read_ring( ossim_int32  id,
 			 vpf_table_type ring_table )
 {
    ring_rec_type ring;
    int rowid,face,edge;
-   long int count;
+   ossim_int32 count;
    row_type row;
 
    rowid = table_pos( "ID", ring_table );
@@ -754,7 +754,7 @@ ring_rec_type read_next_ring( vpf_table_type ring_table )
 {
    ring_rec_type ring;
    int rowid,face,edge;
-   long int count;
+   ossim_int32 count;
    row_type row;
 
    rowid = table_pos( "ID", ring_table );
@@ -797,7 +797,7 @@ ring_rec_type read_next_ring( vpf_table_type ring_table )
  *
  *   Parameters:
  *A
- *    id            <input> == (long int) point id number.
+ *    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
@@ -808,12 +808,12 @@ ring_rec_type read_next_ring( vpf_table_type ring_table )
  *    Barry Michaels    April 1991                      DOS Turbo C
  *E
  *************************************************************************/
-point_rec_type read_point( long int  id,
+point_rec_type read_point( ossim_int32  id,
 			   vpf_table_type point_table )
 {
    point_rec_type point;
    int rowid,face,coord;
-   long int count;
+   ossim_int32 count;
    coordinate_type c;
    tri_coordinate_type Zcoord;
    double_coordinate_type Bcoord;
@@ -898,7 +898,7 @@ point_rec_type read_next_point( vpf_table_type point_table )
 {
    point_rec_type point;
    int rowid,face,coord;
-   long int count;
+   ossim_int32 count;
    coordinate_type c;
    tri_coordinate_type Zcoord;
    double_coordinate_type Bcoord;
@@ -970,7 +970,7 @@ point_rec_type read_next_point( vpf_table_type point_table )
  *
  *   Parameters:
  *A
- *    id           <input> == (long int) annotation id.
+ *    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
@@ -981,12 +981,12 @@ point_rec_type read_next_point( vpf_table_type point_table )
  *    Barry Michaels    April 1991                      DOS Turbo C
  *E
  *************************************************************************/
-anno_rec_type read_anno( long int id,
+anno_rec_type read_anno( ossim_int32 id,
 			 vpf_table_type anno_table )
 {
    anno_rec_type anno;
    int rowid,text,coord;
-   long int count;
+   ossim_int32 count;
    coordinate_type *c;
    tri_coordinate_type *Zcoord;
    double_coordinate_type *Bcoord;
@@ -1077,7 +1077,7 @@ anno_rec_type read_next_anno( vpf_table_type anno_table )
 {
    anno_rec_type anno;
    int rowid,text,coord;
-   long int count;
+   ossim_int32 count;
    coordinate_type *c;
    tri_coordinate_type *Zcoord;
    double_coordinate_type *Bcoord;
diff --git a/src/ossim/vpfutil/vpfptply.c b/src/ossim/vpfutil/vpfptply.c
index adb1bb3..30315df 100644
--- a/src/ossim/vpfutil/vpfptply.c
+++ b/src/ossim/vpfutil/vpfptply.c
@@ -38,15 +38,15 @@
  *        float *xint, float *yint );
  *    int intersect_polygon_edge( float x, float y, edge_rec_type edge_rec );
  *    int intersect_polygon_loop( float x, float y,
- *        int face_id, long int start_edge,
+ *        int face_id, ossim_int32 start_edge,
  *        vpf_table_type edgetable );
  *    int point_in_face( float x, float y,
- *	  long int face_id,
+ *	  ossim_int32 face_id,
  *        vpf_table_type facetable,
  *        vpf_table_type ringtable,
  *        vpf_table_type edgetable );
  *    int point_in_face_table( float x, float y,
- *	  long int face_id,
+ *	  ossim_int32 face_id,
  *        char *fname );
  *E
  **************************************************************************/
@@ -280,7 +280,7 @@ int intersect( line_segment_type l1, line_segment_type l2,
  **************************************************************************/
 int intersect_polygon_edge( float x, float y, edge_rec_type edge_rec )
 {
-   register long int i;
+   register ossim_int32 i;
    line_segment_type lseg, pseg;
    int n;
    float xint,yint;
@@ -328,17 +328,17 @@ int intersect_polygon_edge( float x, float y, edge_rec_type edge_rec )
  *    x  <input> == (float) test point x coordinate.
  *    y  <input> == (float) test point y coordinate.
  *    face_id <input> == (int) given polygon loop.
- *    start_edge <input> == (long int) one edge of the polygon loop.
+ *    start_edge <input> == (ossim_int32) one edge of the polygon loop.
  *    edge_table <input> == (vpf_table_type) VPF edge table.
  *    intersect_polygon_loop <output> == (int) number of intersections.
  *E
  **************************************************************************/
 int intersect_polygon_loop( float x, float y,
-			    int face_id, long int start_edge,
+			    int face_id, ossim_int32 start_edge,
 			    vpf_table_type edgetable )
 {
    edge_rec_type edge_rec;
-   long int next, prevnode;
+   ossim_int32 next, prevnode;
    VPF_BOOLEAN done = FALSE;
    int n;
 
@@ -389,7 +389,7 @@ int intersect_polygon_loop( float x, float y,
  *A
  *    x         <input> == (float) x coordinate of given point.
  *    y         <input> == (float) y coordinate of given point.
- *    face_id   <input> == (long int) given face.
+ *    face_id   <input> == (ossim_int32) given face.
  *    facetable <input> == (vpf_table_type) VPF face table.
  *    ringtable <input> == (vpf_table_type) VPF ring table.
  *    edgetable <input> == (vpf_table_type) VPF edge table.
@@ -399,7 +399,7 @@ int intersect_polygon_loop( float x, float y,
  *E
  **************************************************************************/
 int point_in_face( float x, float y,
-		   long int face_id,
+		   ossim_int32 face_id,
 		   vpf_table_type facetable,
 		   vpf_table_type ringtable,
 		   vpf_table_type edgetable )
@@ -461,7 +461,7 @@ static void dirpath( char *path )
  *A
  *    x        <input> == (float) given point x coordinate.
  *    y        <input> == (float) given point y coordinate.
- *    face_id  <input> == (long int) face.
+ *    face_id  <input> == (ossim_int32) face.
  *    fname    <input> == (char *) pathname to VPF face file.
  *    point_in_face_table <output> == VPF_BOOLEAN:
  *                                            1 --> point is inside
@@ -469,7 +469,7 @@ static void dirpath( char *path )
  *E
  **************************************************************************/
 int point_in_face_table( float x, float y,
-			 long int face_id,
+			 ossim_int32 face_id,
 			 char *fname )
 {
    vpf_table_type facetable, ringtable, edgetable;
diff --git a/src/ossim/vpfutil/vpfquery.c b/src/ossim/vpfutil/vpfquery.c
index abf0f1f..14b8afd 100644
--- a/src/ossim/vpfutil/vpfquery.c
+++ b/src/ossim/vpfutil/vpfquery.c
@@ -108,7 +108,7 @@ typedef struct {
 } expr_type;
 
 
-static void *memalloc( unsigned long int size )
+static void *memalloc( ossim_uint32 size )
 {
    void *ptr;
 
@@ -663,15 +663,15 @@ static int strcompare( char *val1, char *val2, char op )
  *
  *   Purpose:
  *P
- *     This function compares two long integers with the given logical
+ *     This function compares two ossim_int32 integers with the given logical
  *     operator.
  *E
  *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  *
  *   Parameters:
  *A
- *    val1    <input>==(long int) first buffer to compare.
- *    val2    <input>==(long int) second buffer to compare.
+ *    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
@@ -694,7 +694,7 @@ static int strcompare( char *val1, char *val2, char op )
  *    None
  *E
  *************************************************************************/
-static int icompare( long int val1, long int val2, char op )
+static int icompare( ossim_int32 val1, ossim_int32 val2, char op )
 {
    int result;
 
@@ -741,8 +741,8 @@ static int icompare( long int val1, long int val2, char op )
  *
  *   Parameters:
  *A
- *    val1    <input>==(long int) first buffer to compare.
- *    val2    <input>==(long int) second buffer to compare.
+ *    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
@@ -844,22 +844,22 @@ static int fcompare( float val1, float val2, char op )
  *
  *   Functions Called:
  *F
- *    set_type set_init( long int n ) SET.C
- *    void set_insert( long int element, set_type set ) SET.C
+ *    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( long int field_number,
+ *    void *get_table_element( ossim_int32 field_number,
  * 			 row_type row,
  *			 vpf_table_type table,
  *			 void *value,
- *			 long int  *count ) VPFREAD.C
+ *			 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( long int val1, long int 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
@@ -870,9 +870,9 @@ set_type query_table( char *expression, vpf_table_type table )
    row_type row;
    position_type pos;
    expr_type expr;
-   register long int i;
+   register ossim_int32 i;
    int boolval=FALSE, booltemp=0, join = OR;
-   long int lval, lval2, count;
+   ossim_int32 lval, lval2, count;
    float fval, fval2;
    char tval, tval2, *tptr;
    linked_list_type exprlist;
diff --git a/src/ossim/vpfutil/vpfread.c b/src/ossim/vpfutil/vpfread.c
index 81d0ec6..e960441 100644
--- a/src/ossim/vpfutil/vpfread.c
+++ b/src/ossim/vpfutil/vpfread.c
@@ -88,7 +88,7 @@ extern int STORAGE_BYTE_ORDER;
  */
 static char * get_line (FILE *fp)
 {
-  long int CurrentChar,   /* This is an int because fgetc returns an int */
+  ossim_int32 CurrentChar,   /* This is an int because fgetc returns an int */
       count ,
       NextBlock = 256 ,
       LineAllocation = 0 ;
@@ -124,18 +124,18 @@ static char * get_line (FILE *fp)
         return (char *) NULL ;
       }
     }  
-    if ( ( CurrentChar == (long int) LINE_CONTINUE ) ) {
+    if ( ( CurrentChar == (ossim_int32) LINE_CONTINUE ) ) {
       CurrentChar = fgetc(fp ) ;        /* read character after backslash */
       /* A newline will be ignored and thus skipped over */
-      if ( CurrentChar == (long int) SPACE )  /* Assume line continue error */
-        while ( fgetc (fp) != (long int) SPACE ) ;
-      else if (CurrentChar != (long int) NEW_LINE ) {
+      if ( CurrentChar == (ossim_int32) SPACE )  /* Assume line continue error */
+        while ( fgetc (fp) != (ossim_int32) SPACE ) ;
+      else if (CurrentChar != (ossim_int32) NEW_LINE ) {
         /* copy it if not new line */
         CurrentLine[count++] = (char) LINE_CONTINUE ;
         CurrentLine[count] = (char) CurrentChar ;
       } else
         count -- ;      /* Decrement the counter on a newline character */
-    } else if (CurrentChar == (long int) NEW_LINE )     /* We're done */
+    } else if (CurrentChar == (ossim_int32) NEW_LINE )     /* We're done */
         break;
     else
       CurrentLine[count] = (char)CurrentChar;
@@ -150,9 +150,9 @@ static char * get_line (FILE *fp)
 
 /* #if UNIX */
 
-long int VpfRead ( void *to, VpfDataType type, long int count, FILE *from )
+ossim_int32 VpfRead ( void *to, VpfDataType type, ossim_int32 count, FILE *from )
 {
-  long int retval=0 , i ;
+  ossim_int32 retval=0 , i ;
 
   switch ( type ) {
   case VpfChar:
@@ -175,15 +175,15 @@ long int VpfRead ( void *to, VpfDataType type, long int count, FILE *from )
   case VpfInteger:
     {
       if (STORAGE_BYTE_ORDER != MACHINE_BYTE_ORDER) {
-	long int itemp,
-	  *iptr = (long int *) to ;
+	ossim_int32 itemp,
+	  *iptr = (ossim_int32 *) to ;
 	for ( i=0; i < count; i++ ) {
-	  retval = (long)fread ( &itemp, sizeof (long int), 1, from ) ;
+	  retval = (long)fread ( &itemp, sizeof (ossim_int32), 1, from ) ;
 	  swap_four ( (char*)&itemp, (char*)iptr ) ;
 	  iptr++ ;
 	}
       } else {
-	retval = (long)fread ( to, sizeof (long int), count, from ) ;
+	retval = (long)fread ( to, sizeof (ossim_int32), count, from ) ;
       }
     }  
     break ;
@@ -375,7 +375,7 @@ char *read_text_defstr ( FILE *infile, FILE * outerr )
 int add_null_values ( char *name, vpf_table_type table, FILE * fpout )
 {
   FILE *nullfp;
-  long int  i , ptr ;
+  ossim_int32  i , ptr ;
   char *cval, *line, *field ;
  
   nullfp = fopen( name, "r");
@@ -440,9 +440,9 @@ int add_null_values ( char *name, vpf_table_type table, FILE * fpout )
  *
  *   Parameters:
  *A
- *    row_number <input> == (long int) row number in the table.
+ *    row_number <input> == (ossim_int32) row number in the table.
  *    table      <input> == (vpf_table_type) VPF table structure.
- *    return    <output> == (long int) length of the table row or 0 on error.
+ *    return    <output> == (ossim_int32) length of the table row or 0 on error.
  *E
  *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  *
@@ -471,11 +471,11 @@ int add_null_values ( char *name, vpf_table_type table, FILE * fpout )
  *    This module should be ANSI C compatible.
  *E
  *************************************************************************/
-long int index_length( long int row_number,
+ossim_int32 index_length( ossim_int32 row_number,
 		       vpf_table_type table )
 {
-   long int   recsize,len=0;
-   unsigned long int ulen;
+   ossim_int32   recsize,len=0;
+   ossim_uint32 ulen;
    long  int pos;
 
    STORAGE_BYTE_ORDER = table.byte_order;
@@ -489,14 +489,14 @@ long int index_length( long int row_number,
 	 break;
       case DISK:
 	 recsize = sizeof(index_cell);
-	 fseek( table.xfp, (long int)(row_number*recsize), SEEK_SET );
+	 fseek( table.xfp, (ossim_int32)(row_number*recsize), SEEK_SET );
 
 	 if ( ! Read_Vpf_Int(&pos,table.xfp,1) ) {
-	   len = (long int)0 ;
+	   len = (ossim_int32)0 ;
 	 }
 
 	 if ( ! Read_Vpf_Int(&ulen,table.xfp,1) ) {
-	   return (long int)0 ;
+	   return (ossim_int32)0 ;
 	 }
 	 len = ulen;
 	 break;
@@ -508,7 +508,7 @@ long int index_length( long int row_number,
 	   /* Just an error check, should never get here in writing */
 	   fprintf(stderr,"\nindex_length: error trying to access row %d",
 		   (int)row_number ) ;
-	   len = (long int)0 ;
+	   len = (ossim_int32)0 ;
 	}
 	break;
    }
@@ -530,9 +530,9 @@ long int index_length( long int row_number,
  *
  *   Parameters:
  *A
- *    row_number <input> == (long int) row number in the table.
+ *    row_number <input> == (ossim_int32) row number in the table.
  *    table      <input> == (vpf_table_type) VPF table structure.
- *    return    <output> == (long int) position of the table row 
+ *    return    <output> == (ossim_int32) position of the table row 
  *                          or zero on error.
  *E
  *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@@ -562,11 +562,11 @@ long int index_length( long int row_number,
  *    This module should be ANSI C compatible.
  *E
  *************************************************************************/
-long int index_pos( long int row_number,
+ossim_int32 index_pos( ossim_int32 row_number,
 		    vpf_table_type table )
 {
-   long int   recsize;
-   unsigned long int pos=0;
+   ossim_int32   recsize;
+   ossim_uint32 pos=0;
 
    STORAGE_BYTE_ORDER = table.byte_order;
 
@@ -579,9 +579,9 @@ long int index_pos( long int row_number,
 	 break;
       case DISK:
 	 recsize = sizeof(index_cell);
-	 fseek( table.xfp, (long int)(row_number*recsize), SEEK_SET );
+	 fseek( table.xfp, (ossim_int32)(row_number*recsize), SEEK_SET );
 	 if ( ! Read_Vpf_Int(&pos,table.xfp,1) ) {
-	   pos = (unsigned long int)0 ;
+	   pos = (ossim_uint32)0 ;
 	 }
 	 break;
       case RAM:
@@ -592,7 +592,7 @@ long int index_pos( long int row_number,
 	   /* Just an error check, should never get here in writing */
 	   fprintf(stderr,"\nindex_length: error trying to access row %d",
 		   (int)row_number ) ;
-	   pos = (unsigned long int)0;
+	   pos = (ossim_uint32)0;
 	 }
 	 break;
    }
@@ -601,12 +601,12 @@ long int index_pos( long int row_number,
 
 #if 0
 /* Compute the offset from the start of the row to the given field */
-static long int row_offset( int field, row_type row, vpf_table_type table)
+static ossim_int32 row_offset( int field, row_type row, vpf_table_type table)
 {
-   long int offset,n,size;
+   ossim_int32 offset,n,size;
    int i;
    id_triplet_type key;
-   int keysize[] = {0,sizeof(char),sizeof(short int),sizeof(long int)};
+   int keysize[] = {0,sizeof(char),sizeof(short int),sizeof(ossim_int32)};
 
    if (field < 0 || field >= table.nfields) return -1;
 
@@ -614,7 +614,7 @@ static long int row_offset( int field, row_type row, vpf_table_type table)
    for (i=0;i<field;i++) {
       switch (table.header[i].type) {
 	 case 'I':
-	    offset += sizeof(long int)*row[i].count;
+	    offset += sizeof(ossim_int32)*row[i].count;
 	    break;
 	 case 'S':
 	    offset += sizeof(short int)*row[i].count;
@@ -722,12 +722,12 @@ id_triplet_type read_key( vpf_table_type table )
       case 1:
 
 	 Read_Vpf_Char (&ucval, table.fp, 1 ) ;
-	 key.id = (long int)ucval;
+	 key.id = (ossim_int32)ucval;
 	 break;
       case 2:
 
 	 Read_Vpf_Short (&uival, table.fp, 1 ) ;
-	 key.id = (long int)uival;
+	 key.id = (ossim_int32)uival;
 	 break;
       case 3:
 
@@ -739,11 +739,11 @@ id_triplet_type read_key( vpf_table_type table )
      break;
    case 1:
      Read_Vpf_Char (&ucval, table.fp, 1 ) ;
-     key.tile = (long int)ucval;
+     key.tile = (ossim_int32)ucval;
      break;
    case 2:
      Read_Vpf_Short (&uival, table.fp, 1 ) ;
-     key.tile = (long int)uival;
+     key.tile = (ossim_int32)uival;
      break;
    case 3:
      Read_Vpf_Int (&(key.tile), table.fp, 1 ) ;
@@ -755,11 +755,11 @@ id_triplet_type read_key( vpf_table_type table )
      break;
    case 1:
      Read_Vpf_Char (&ucval, table.fp, 1 ) ;
-     key.exid = (long int)ucval;
+     key.exid = (ossim_int32)ucval;
      break;
    case 2:
      Read_Vpf_Short (&uival, table.fp, 1 ) ;
-     key.exid = (long int)uival;
+     key.exid = (ossim_int32)uival;
      break;
    case 3:
      Read_Vpf_Int (&(key.exid), table.fp, 1 ) ;
@@ -814,10 +814,10 @@ id_triplet_type read_key( vpf_table_type table )
  *************************************************************************/
 row_type read_next_row( vpf_table_type table )
 {
-   register long int i,j;
-   long int      status;
+   register ossim_int32 i,j;
+   ossim_int32      status;
    char     *tptr;
-   long int size,count;
+   ossim_int32 size,count;
    row_type row;
    id_triplet_type * keys;
    coordinate_type dummycoord;
@@ -859,7 +859,7 @@ row_type read_next_row( vpf_table_type table )
 	    }
 	    break;
 	 case 'I':
-	    row[i].ptr = (long int *)vpfmalloc(count*sizeof(long int));
+	    row[i].ptr = (ossim_int32 *)vpfmalloc(count*sizeof(ossim_int32));
 	    Read_Vpf_Int (row[i].ptr, table.fp, count ) ;
 	    break;
 	 case 'S':
@@ -980,9 +980,9 @@ row_type read_next_row( vpf_table_type table )
 row_type rowcpy( row_type origrow,
 		 vpf_table_type table )
 {
-   register long int i;
-   long int      count;
-   long int size;
+   register ossim_int32 i;
+   ossim_int32      count;
+   ossim_int32 size;
    row_type row;
 
    row = (row_type)vpfmalloc(table.nfields * sizeof(column_type));
@@ -1001,8 +1001,8 @@ row_type rowcpy( row_type origrow,
 	    }
 	    break;
 	 case 'I':
-	    size = count*sizeof(long int);
-	    row[i].ptr = (long int *)vpfmalloc(size);
+	    size = count*sizeof(ossim_int32);
+	    row[i].ptr = (ossim_int32 *)vpfmalloc(size);
 	    memcpy(row[i].ptr,origrow[i].ptr,size);
 	    break;
 	 case 'S':
@@ -1080,7 +1080,7 @@ row_type rowcpy( row_type origrow,
  *
  *   Parameters:
  *A
- *    row_number <input> == (long int) row number.
+ *    row_number <input> == (ossim_int32) row number.
  *    table      <input> == (vpf_table_type) vpf table structure.
  *    return    <output> == (row_type) row that was read in.
  *E
@@ -1100,7 +1100,7 @@ row_type rowcpy( row_type origrow,
  *
  *   Functions Called:
  *F
- *    long int index_pos()                             VPFTABLE.C
+ *    ossim_int32 index_pos()                             VPFTABLE.C
  *    row_type read_next_row()                         VPFTABLE.C
  *E
  *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@@ -1110,10 +1110,10 @@ row_type rowcpy( row_type origrow,
  *    This module should be ANSI C compatible.
  *E
  *************************************************************************/
-row_type read_row( long int row_number,
+row_type read_row( ossim_int32 row_number,
 		   vpf_table_type table )
 {
-   long int fpos;
+   ossim_int32 fpos;
 
    fpos = index_pos(row_number,table);
 
@@ -1168,7 +1168,7 @@ row_type read_row( long int row_number,
 void free_row( row_type row,
 	       vpf_table_type table)
 {
-   register long int i;
+   register ossim_int32 i;
 
    if (!row) return;
    for (i=0;i<table.nfields;i++)
@@ -1192,7 +1192,7 @@ void free_row( row_type row,
  *
  *   Parameters:
  *A
- *    row_number <input> == (long int) row number in range [1 .. table.nrows].
+ *    row_number <input> == (ossim_int32) row number in range [1 .. table.nrows].
  *    table      <input> == (vpf_table_type) vpf table structure.
  *    return    <output> == (row_type) returned row.
  *E
@@ -1222,7 +1222,7 @@ void free_row( row_type row,
  *    This module should be ANSI C compatible.
  *E
  *************************************************************************/
-row_type get_row( long int row_number,
+row_type get_row( ossim_int32 row_number,
 		  vpf_table_type table )
 {
    row_type row;
@@ -1253,7 +1253,7 @@ row_type get_row( long int row_number,
  *A
  *    field_name <input> == (char *) field name.
  *    table      <input> == (vpf_table_type) VPF table structure.
- *    table_pos  <output> == (long int) returned column number.
+ *    table_pos  <output> == (ossim_int32) returned column number.
  *                          UNIX returns -1 if not exists
  *E
  *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@@ -1281,10 +1281,10 @@ row_type get_row( long int row_number,
  *    This module should be ANSI C compatible.
  *E
  *************************************************************************/
-long int table_pos( const char* field_name, vpf_table_type table )
+ossim_int32 table_pos( const char* field_name, vpf_table_type table )
 {
-   register long int i;
-   long int col;
+   register ossim_int32 i;
+   ossim_int32 col;
    char altfn[256];
 
    col = -1;
@@ -1319,11 +1319,11 @@ long int table_pos( const char* field_name, vpf_table_type table )
  *
  *   Parameters:
  *A
- *    field_number <input> == (long int) field column number.
+ *    field_number <input> == (ossim_int32) field column number.
  *    row          <input> == (row_type) vpf table row.
  *    table        <input> == (vpf_table_type) VPF table structure.
  *    value       <output> == (void *) pointer to a single element value.
- *    count       <output> == (long int *) pointer to the array size for a
+ *    count       <output> == (ossim_int32 *) pointer to the array size for a
  *                                    multiple element value.
  *    return      <output> == (void *) returned multiple element value.
  *E
@@ -1352,13 +1352,13 @@ long int table_pos( const char* field_name, vpf_table_type table )
  *    This module should be ANSI C compatible.
  *E
  *************************************************************************/
-void *get_table_element( long int field_number,
+void *get_table_element( ossim_int32 field_number,
 			 row_type row,
 			 vpf_table_type table,
 			 void *value,
-			 long int  *count )
+			 ossim_int32  *count )
 {
-   long int   col;
+   ossim_int32   col;
    char     * tptr;
    void     * retvalue;
 
@@ -1390,11 +1390,11 @@ void *get_table_element( long int field_number,
 	 break;
       case 'I':
 	 if (table.header[col].count == 1) {
-	    memcpy(value,row[col].ptr,sizeof(long int));
+	    memcpy(value,row[col].ptr,sizeof(ossim_int32));
 	 } else {
-	    retvalue = (long int *)vpfmalloc(row[col].count*
-					     sizeof(long int));
-	    memcpy(retvalue,row[col].ptr,row[col].count*sizeof(long int));
+	    retvalue = (ossim_int32 *)vpfmalloc(row[col].count*
+					     sizeof(ossim_int32));
+	    memcpy(retvalue,row[col].ptr,row[col].count*sizeof(ossim_int32));
 	 }
 	 break;
       case 'S':
@@ -1513,10 +1513,10 @@ void *get_table_element( long int field_number,
  *   Parameters:
  *A
  *    field_name <input> == (char *) field name.
- *    row_number <input> == (long int) row_number.
+ *    row_number <input> == (ossim_int32) row_number.
  *    table      <input> == (vpf_table_type) VPF table structure.
  *    value     <output> == (void *) pointer to a single element value.
- *    count     <output> == (long int *) pointer to the array size for a multiple
+ *    count     <output> == (ossim_int32 *) pointer to the array size for a multiple
  *                                  element value.
  *    return    <output> == (void *) returned multiple element value.
  *                          or NULL if field_name could not be found
@@ -1550,12 +1550,12 @@ void *get_table_element( long int field_number,
  *E
  *************************************************************************/
 void *named_table_element( char           * field_name,
-			   long int         row_number,
+			   ossim_int32         row_number,
 			   vpf_table_type   table,
 			   void           * value,
-			   long int       * count )
+			   ossim_int32       * count )
 {
-   long int     col;
+   ossim_int32     col;
    row_type     row;
    void       * retvalue;
 
@@ -1593,12 +1593,12 @@ void *named_table_element( char           * field_name,
  *
  *   Parameters:
  *A
- *    field_number <input> == (long int) field number (offset from
+ *    field_number <input> == (ossim_int32) field number (offset from
  *                                   first field in table).
- *    row_number <input> == (long int) row_number.
+ *    row_number <input> == (ossim_int32) row_number.
  *    table      <input> == (vpf_table_type) VPF table structure.
  *    value     <output> == (void *) pointer to a single element value.
- *    count     <output> == (long int *) pointer to the array size for a multiple
+ *    count     <output> == (ossim_int32 *) pointer to the array size for a multiple
  *                                  element value.
  *    return    <output> == (void *) returned multiple element value or
  *                          NULL of the field number is invalid
@@ -1629,11 +1629,11 @@ void *named_table_element( char           * field_name,
  *    This module should be ANSI C compatible.
  *E
  *************************************************************************/
-void *table_element( long int         field_number,
-		     long int         row_number,
+void *table_element( ossim_int32         field_number,
+		     ossim_int32         row_number,
 		     vpf_table_type   table,
 		     void           * value,
-		     long int       * count )
+		     ossim_int32       * count )
 {
    row_type    row;
    void      * retvalue;
diff --git a/src/ossim/vpfutil/vpfrelat.c b/src/ossim/vpfutil/vpfrelat.c
index 22d4eff..69922e8 100644
--- a/src/ossim/vpfutil/vpfrelat.c
+++ b/src/ossim/vpfutil/vpfrelat.c
@@ -123,7 +123,7 @@ linked_list_type fcs_relate_list( char *fcname, char *start_table,
    set_type fcset, set1, set2;
    char tablename[255], *buf, expr[255];
    row_type row;
-   long int rownum,n;
+   ossim_int32 rownum,n;
    int TABLE1_, KEY1_, TABLE2_, KEY2_;
 
    rlist = ll_init();
@@ -220,10 +220,10 @@ linked_list_type fcs_relate_list( char *fcname, char *start_table,
  *
  *   Parameters:
  *A
- *    srchval <input> == (long int) specified search value.
+ *    srchval <input> == (ossim_int32) specified search value.
  *    field   <input> == (int) table sort field.
  *    table   <input> == (vpf_table_type) VPF table.
- *    vpf_binary_search <output> == (long int) first matching row.
+ *    vpf_binary_search <output> == (ossim_int32) first matching row.
  *E
  *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  *
@@ -232,11 +232,11 @@ linked_list_type fcs_relate_list( char *fcname, char *start_table,
  *    Barry Michaels  DOS Turbo C
  *E
  *************************************************************************/
-long int vpf_binary_search( long int srchval,
+ossim_int32 vpf_binary_search( ossim_int32 srchval,
 			    int field,
 			    vpf_table_type table )
 {
-   long int left,right, ival, rowid, n;
+   ossim_int32 left,right, ival, rowid, n;
    row_type row;
 
    left = 1;
@@ -280,11 +280,11 @@ long int vpf_binary_search( long int srchval,
  *    Barry Michaels  DOS Turbo C
  *E
  *************************************************************************/
-long int related_row( void *keyval1,
+ossim_int32 related_row( void *keyval1,
 		      vpf_table_type table2, char *key2,
 		      int sort_flag )
 {
-   long int rowid, i, ival, kval, n;
+   ossim_int32 rowid, i, ival, kval, n;
    row_type row;
    int KEY2_;
    char cval, *tval;
@@ -369,7 +369,7 @@ linked_list_type related_rows( void *keyval1,
 {
    linked_list_type rowlist;
    set_type rowset;
-   long int rowid, i, ival, kval, n, start,end;
+   ossim_int32 rowid, i, ival, kval, n, start,end;
    row_type row = 0;
    int KEY2_;
    char cval, *tval;
@@ -524,7 +524,7 @@ fcrel_type select_feature_class_relate( int fcnum,
 {
    int storage, cov;
    vpf_table_type fcs;
-   long int i;
+   ossim_int32 i;
    char path[255], covpath[255];
    position_type p;
    vpf_relate_struct rcell;
@@ -636,11 +636,11 @@ fcrel_type select_feature_class_relate( int fcnum,
  *    Barry Michaels  DOS Turbo C
  *E
  *************************************************************************/
-long int fc_row_number( row_type row, fcrel_type fcrel, long int tile )
+ossim_int32 fc_row_number( row_type row, fcrel_type fcrel, ossim_int32 tile )
 {
    row_type relrow;
-   long int count;
-   long int i, rownum, keyval;
+   ossim_int32 count;
+   ossim_int32 i, rownum, keyval;
    id_triplet_type triplet_keyval;
    int KEY1_, KEY_;
    position_type p;
@@ -743,12 +743,12 @@ long int fc_row_number( row_type row, fcrel_type fcrel, long int tile )
  *************************************************************************/
 linked_list_type fc_row_numbers( row_type row,
 				 fcrel_type fcrel,
-				 long int tile,
+				 ossim_int32 tile,
 				 ThematicIndex *idx )
 {
    row_type relrow;
-   long int count;
-   long int n, rownum, keyval;
+   ossim_int32 count;
+   ossim_int32 n, rownum, keyval;
    id_triplet_type triplet_keyval;
    int KEY1_, KEY_;
    position_type p, prow, pkey;
diff --git a/src/ossim/vpfutil/vpfselec.c b/src/ossim/vpfutil/vpfselec.c
index f5af24e..2e0ed71 100644
--- a/src/ossim/vpfutil/vpfselec.c
+++ b/src/ossim/vpfutil/vpfselec.c
@@ -129,7 +129,7 @@ set_type read_selected_features( view_type *view, int themenum )
       selset.buf = NULL;
       return selset;
    }
-   fread( &selset.size, sizeof(long int), 1, fp );
+   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 );
@@ -206,7 +206,7 @@ void save_selected_features( view_type *view, int themenum,
    /* Write the set */
    fp = fopen(path,"wb");
    if (!fp) return;
-   fwrite( &(selset.size), sizeof(long int), 1, fp );
+   fwrite( &(selset.size), sizeof(ossim_int32), 1, fp );
    if (!selset.diskstorage) {
       fwrite( selset.buf, sizeof(char), (selset.size/8L)+1L, fp );
    } else {
@@ -320,7 +320,7 @@ set_type bounding_select( char *path, extent_type mapextent,
 {
    vpf_table_type table;
    set_type set;
-   long int i, count;
+   ossim_int32 i, count;
    extent_type box, pextent;
    double x1,y1,x2,y2;
    row_type row;
@@ -497,8 +497,8 @@ set_type *get_selected_primitives( view_type *view,
    char *brname[] = {"","ebr","fbr","tbr","nbr","cbr"};
    set_type feature_rows, primitive_rows, tile_features;
    set_type *primitives;
-   long int prim_rownum, count, tile;
-   register long int i,j, pclass, start,end;
+   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;
@@ -777,7 +777,7 @@ set_type *get_selected_primitives( view_type *view,
  *     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>==(long int) tile number.
+ *     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.
@@ -796,7 +796,7 @@ set_type get_selected_tile_primitives( library_type *library,
 				       fcrel_type fcrel,
 				       set_type feature_rows,
 				       map_environment_type *mapenv,
-				       long int tile,
+				       ossim_int32 tile,
 				       char *tiledir,
 				       int *status )
 {
@@ -807,8 +807,8 @@ set_type get_selected_tile_primitives( library_type *library,
    char *brname[] = {"","ebr","fbr","tbr","nbr","cbr"};
    set_type primitive_rows, tile_features;
    set_type primitives;
-   long int prim_rownum;
-   register long int i,pclass, start,end;
+   ossim_int32 prim_rownum;
+   register ossim_int32 i,pclass, start,end;
    char path[255], covpath[255];
    linked_list_type primlist;
    position_type p;
@@ -984,14 +984,14 @@ set_type get_selected_tile_primitives( library_type *library,
 #endif
 
 #if __MSDOS__
-static long int filesize( char *file )
+static ossim_int32 filesize( char *file )
 {
    struct stat s;
    stat(file,&s);
-   return (long int)s.st_size;
+   return (ossim_int32)s.st_size;
 }
 
-static long int available_space( char *drive )
+static ossim_int32 available_space( char *drive )
 {
    struct dfree disktable;
    int disknum;
@@ -1000,9 +1000,9 @@ static long int available_space( char *drive )
 
    disknum=toupper(drive[0])-'A'+1;
    getdfree(disknum,&disktable);
-   return (long int) disktable.df_avail *
-	  (long int) disktable.df_sclus *
-	  (long int) disktable.df_bsec;
+   return (ossim_int32) disktable.df_avail *
+	  (ossim_int32) disktable.df_sclus *
+	  (ossim_int32) disktable.df_bsec;
 }
 #endif
 
@@ -1048,10 +1048,10 @@ int draw_selected_features( view_type *view,
    vpf_table_type rngtable,edgtable,fbrtable, tile_table;
    row_type row;
    char *ptable[] = {"","edg","fac","txt","end","cnd"};
-   register long int i, j, p, pclass, tile;
+   register ossim_int32 i, j, p, pclass, tile;
    int display_order[] = {FACE,EDGE,ENTITY_NODE,CONNECTED_NODE,TEXT};
-   register long int starttile, endtile, startprim, endprim;
-   long int count;
+   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;
diff --git a/src/ossim/vpfutil/vpfspx.c b/src/ossim/vpfutil/vpfspx.c
index 3150a68..64f0d42 100644
--- a/src/ossim/vpfutil/vpfspx.c
+++ b/src/ossim/vpfutil/vpfspx.c
@@ -52,7 +52,7 @@
 #endif
 #endif
 #include <ossim/vpfutil/set.h>
-
+#include <ossim/base/ossimConstants.h>
 /******* cellmap definitions **/
 #define  START     0
 #define  NUMFEAT   1
@@ -74,10 +74,10 @@
 
 typedef struct {
    int fd;                     /* File descriptor */
-   long int maplen;            /* Number of cells in the tree */
-   long int cellmap[1023][2];  /* The tree of cells */
-   long int buf[1023][2];      /* Buffer for one cell */
-   long int shift;             /* Size of data before real cell records */
+   ossim_int32 maplen;            /* Number of cells in the tree */
+   ossim_int32 cellmap[1023][2];  /* The tree of cells */
+   ossim_int32 buf[1023][2];      /* Buffer for one cell */
+   ossim_int32 shift;             /* Size of data before real cell records */
    unsigned char box[4];       /* Search box */
 } spx_type;
 
@@ -157,7 +157,7 @@ static int is_over( unsigned char box1[4], unsigned char box2[4] )
  *
  *   Parameters:
  *A
- *    num  <input>==(long int) record number.
+ *    num  <input>==(ossim_int32) record number.
  *    spx  <input>==(spx_type *) spatial index record structure.
  *    set <output>==(set_type) search set to be updated.
  *E
@@ -168,7 +168,7 @@ static int is_over( unsigned char box1[4], unsigned char box2[4] )
  *    Mody Buchbinder  Jul 1991
  *E
  *************************************************************************/
-static void get_record(long int num, spx_type *spx, set_type set )
+static void get_record(ossim_int32 num, spx_type *spx, set_type set )
 {
    long offset;
    int j,index;
@@ -177,7 +177,7 @@ static void get_record(long int num, spx_type *spx, set_type set )
    index  = num -1;
    offset = spx->cellmap[index][0] + spx->shift;
    lseek(spx->fd,offset,SEEK_SET);
-   read(spx->fd,spx->buf,2*spx->cellmap[index][NUMFEAT]*sizeof(long int));
+   read(spx->fd,spx->buf,2*spx->cellmap[index][NUMFEAT]*sizeof(ossim_int32));
 
    for(j=0;j<spx->cellmap[index][NUMFEAT];j++) {
       memcpy(&box,&(spx->buf[j][BOUND]),4*sizeof(unsigned char));
@@ -204,7 +204,7 @@ static void get_record(long int num, spx_type *spx, set_type set )
  *
  *   Parameters:
  *A
- *    record <input>==(long int) record number.
+ *    record <input>==(ossim_int32) record number.
  *    level  <input>==(int) level of the index tree.
  *    bnd    <input>==(unsigned char[4]) bounding box.
  *    spx    <input>==(spx_type *) spatial index record structure.
@@ -217,7 +217,7 @@ static void get_record(long int num, spx_type *spx, set_type set )
  *    Mody Buchbinder  Jul 1991
  *E
  *************************************************************************/
-static void search_cell( long int record, int level, unsigned char bnd[4],
+static void search_cell( ossim_int32 record, int level, unsigned char bnd[4],
 			 spx_type *spx, set_type set )
 {
    int i;
@@ -304,8 +304,8 @@ set_type spatial_index_search( char *fname,
 /*                       int  1 - 4 -> boundaries of coverage     */
 /*                       int  5 -> size of tree in records - each */
 /*                                 record = 2 integers (8 byte)   */
-   read(spx.fd,head,6*sizeof(long int));
-   spx.shift = 6*sizeof(long int);
+   read(spx.fd,head,6*sizeof(ossim_int32));
+   spx.shift = 6*sizeof(ossim_int32);
    spx.maplen = head[CELLMAP_SIZE];
 
    set = set_init(head[TOTAL_NUMBER]+1L);
@@ -323,14 +323,14 @@ set_type spatial_index_search( char *fname,
 
 /* read the cell tree */
 
-   if( (size_t)read(spx.fd,spx.cellmap,2*spx.maplen*sizeof(long int)) !=
-       (2*spx.maplen*sizeof(long int)) )
+   if( (size_t)read(spx.fd,spx.cellmap,2*spx.maplen*sizeof(ossim_int32)) !=
+       (2*spx.maplen*sizeof(ossim_int32)) )
    {
       close(spx.fd);
       return set;
    }
 
-   spx.shift += 2*spx.maplen*sizeof(long int);
+   spx.shift += 2*spx.maplen*sizeof(ossim_int32);
 
 /* translate search box to 1 byte numbers */
    xf = (float)(255.0 / (bnd[XMAX] - bnd[XMIN]));
diff --git a/src/ossim/vpfutil/vpftable.c b/src/ossim/vpfutil/vpftable.c
index 0f8209d..1b548da 100644
--- a/src/ossim/vpfutil/vpftable.c
+++ b/src/ossim/vpfutil/vpftable.c
@@ -188,9 +188,9 @@ int is_vpf_null_double( double num )
 
 /***********Mody B**********/
 /* get string until delimeter */
-static char *cpy_del(char *src, char delimiter, long int *ind )
+static char *cpy_del(char *src, char delimiter, ossim_int32 *ind )
 {
-  long int i, skipchar ;
+  ossim_int32 i, skipchar ;
   char *temp, *tempstr ;
 
   /* remove all blanks ahead of good data */
@@ -259,7 +259,7 @@ static char *cpy_del(char *src, char delimiter, long int *ind )
   return tempstr;
 }
 /***********Mody B*********/
-char *get_string(long int *ind,char *src,char delimeter )
+char *get_string(ossim_int32 *ind,char *src,char delimeter )
 { char *temp;
   temp  = cpy_del(&src[*ind],delimeter, ind);
   if( ! strcmp ( temp, TEXT_NULL ))
@@ -267,7 +267,7 @@ char *get_string(long int *ind,char *src,char delimeter )
   return temp;
 }
 /**********Mody B*************/
-char vpf_get_char(long int *ind, char *src)
+char vpf_get_char(ossim_int32 *ind, char *src)
 {  char temp;
    while ( src[*ind] == SPACE || src[*ind] == TAB ) (*ind)++ ;
    temp  = src[*ind];
@@ -275,9 +275,9 @@ char vpf_get_char(long int *ind, char *src)
    return temp;
 }
 /***********Mody B***********/
-long int get_number(long int *ind, char *src,char delimeter)
+ossim_int32 get_number(ossim_int32 *ind, char *src,char delimeter)
 {  char *temp;
-   long int  num;
+   ossim_int32  num;
    temp  = cpy_del(&src[*ind],delimeter, ind);
    if (strchr(temp, VARIABLE_COUNT ) == NULL)
       num = atoi(temp);
@@ -304,7 +304,7 @@ long int get_number(long int *ind, char *src,char delimeter)
  *   Parameters:
  *A
  *    table <inout> == (vpf_table_type *) vpf table structure.
- *    ddlen <input> == (long int) length of the table's data definition.
+ *    ddlen <input> == (ossim_int32) length of the table's data definition.
  *
  *    return value is the record length if all items are fixed length, or
  *    -1 if the record contains variable length items
@@ -336,18 +336,18 @@ long int get_number(long int *ind, char *src,char delimeter)
  *    This module should be ANSI C compatible.
  *E
  *************************************************************************/
-long int parse_data_def( vpf_table_type *table )
+ossim_int32 parse_data_def( vpf_table_type *table )
 {
-   register long int n,i;
-   long int p, k;
+   register ossim_int32 n,i;
+   ossim_int32 p, k;
    char *buf,*des,*nar,*vdt, *tdx, *doc, byte ;/*temporary storage */
    char end_of_rec;
    int status;
-   long int ddlen;
-   long int reclen = 0;
+   ossim_int32 ddlen;
+   ossim_int32 reclen = 0;
 #if UNIX
    /* just for backward compat check */
-   long int bkcompat = 1 ;
+   ossim_int32 bkcompat = 1 ;
 #endif
 
    if ( table->mode == Read ) {
@@ -371,13 +371,13 @@ long int parse_data_def( vpf_table_type *table )
 	swap_four((char *)&k,(char *)&ddlen);
      }
      if ( ddlen < 0 ) {
-       return (long int)0 ;
+       return (ossim_int32)0 ;
      }
 
      STORAGE_BYTE_ORDER = table->byte_order;
 
      /* header without first 4 bytes */
-     table->ddlen = ddlen + sizeof (long int) ;
+     table->ddlen = ddlen + sizeof (ossim_int32) ;
      buf = (char *)vpfmalloc((ddlen+3)*sizeof(char));
      buf[0] = byte; /* already have the first byte of the buffer */
      Read_Vpf_Char(&buf[1],table->fp,ddlen-1) ;
@@ -435,7 +435,7 @@ long int parse_data_def( vpf_table_type *table )
 
      if ( i == 0 )
        if ( ossim_strcasecmp ( table->header[0].name, "ID" ) ) {
-	      return (long int)0 ;
+	      return (ossim_int32)0 ;
        }
 
      if(table->header[i].count == -1)
@@ -448,7 +448,7 @@ long int parse_data_def( vpf_table_type *table )
      switch (table->header[i].type) {
      case 'I':
        if ( reclen >= 0 )
-	 reclen += (sizeof(long int)*table->header[i].count);
+	 reclen += (sizeof(ossim_int32)*table->header[i].count);
        table->header[i].nullval.Int = NULLINT ;
        break;
      case 'S':
@@ -521,7 +521,7 @@ long int parse_data_def( vpf_table_type *table )
        break ;
      } /** switch type **/
 
-     if (status) return (long int)0;
+     if (status) return (ossim_int32)0;
 
      table->header[i].keytype     = vpf_get_char  (&p,buf);
      des = get_string(&p,buf, FIELD_SEPERATOR );
@@ -598,7 +598,7 @@ long int parse_data_def( vpf_table_type *table )
 #define DISPLAY_STRING 0x09
 
 #ifdef __MSDOS__
-static int vpfhandler(long int errval, long int ax, long int bp, long int si)
+static int vpfhandler(ossim_int32 errval, ossim_int32 ax, ossim_int32 bp, ossim_int32 si)
 {
    if (ax < 0) {
       bdosptr(DISPLAY_STRING,"device error$", 0);
@@ -659,7 +659,7 @@ FILE *vpfopencheck( const char *filename,
 		   "in data drive",
 		   "                                                      "};
 */
-   long int retry = 0;
+   ossim_int32 retry = 0;
 #ifdef __MSDOS__
    extern char home[255];
    void interrupt (*doshandler)();
@@ -767,12 +767,12 @@ vpf_table_type vpf_open_table( const char * tablename,
    vpf_table_type   table;
    char             tablepath[255],
 		  * idxname;
-   long int         i,
+   ossim_int32         i,
 		    j;
-   long int         tablesize,
+   ossim_int32         tablesize,
 		    idxsize,
 		    memsize;
-   unsigned long int ulval;
+   ossim_uint32 ulval;
    char            * diskname = "VPF data disc";
 
    strcpy(tablepath,tablename);
@@ -933,7 +933,7 @@ vpf_table_type vpf_open_table( const char * tablename,
 
     table.storage = (storage_type)DISK;
 #ifdef __MSDOS__
-   memsize = (long int)min(farcoreleft(),__64K);
+   memsize = (ossim_int32)min(farcoreleft(),__64K);
 #else
    memsize = MAXINT;
 #endif
@@ -996,7 +996,7 @@ vpf_table_type vpf_open_table( const char * tablename,
  *************************************************************************/
 void vpf_close_table( vpf_table_type *table )
 {
-   register long int i;
+   register ossim_int32 i;
 
    if (table->status != OPENED) {
       return;
@@ -1061,10 +1061,10 @@ void vpf_close_table( vpf_table_type *table )
 
 
 
-long int is_vpf_table( const char *fname )
+ossim_int32 is_vpf_table( const char *fname )
 {
    FILE *fp;
-   long int n, ok;
+   ossim_int32 n, ok;
 
    fp = fopen( fname, "rb" );
    if (!fp) {
diff --git a/src/ossim/vpfutil/vpftidx.c b/src/ossim/vpfutil/vpftidx.c
index 5e323ce..037ab7c 100644
--- a/src/ossim/vpfutil/vpftidx.c
+++ b/src/ossim/vpfutil/vpftidx.c
@@ -47,36 +47,36 @@
  *    set_type search_gazetteer_index (ThematicIndex *idx,
  *				       char * query_str ) ;
  *
- *    long int read_gazetteer_index_directory (
+ *    ossim_int32 read_gazetteer_index_directory (
  *					ThematicIndexDirectory ** gid,
  *					ThematicIndexHeader     * gi,
  *					FILE * idx_fp);
  *
- *    long int write_thematic_index_header ( ThematicIndexHeader h ,
+ *    ossim_int32 write_thematic_index_header ( ThematicIndexHeader h ,
  *					     FILE *fp ) ;
  *
- *    long int read_thematic_index_header ( ThematicIndexHeader *h ,
+ *    ossim_int32 read_thematic_index_header ( ThematicIndexHeader *h ,
  *					    FILE *fp ) ;
  *
- *    long int write_thematic_index_directory (
+ *    ossim_int32 write_thematic_index_directory (
  *				       ThematicIndexHeader h ,
  *				       ThematicIndexDirectory *d,
- *				       long int size,
+ *				       ossim_int32 size,
  *				       FILE *fp ) ;
  *
- *    long int write_gazetteer_index_directory (
+ *    ossim_int32 write_gazetteer_index_directory (
  *				       ThematicIndexHeader h ,
  *				       ThematicIndexDirectory *d,
- *				       long int size,
+ *				       ossim_int32 size,
  *				       FILE *fp ) ;
  *
- *    long int create_thematic_index ( char indextype,
+ *    ossim_int32 create_thematic_index ( char indextype,
  *				       char *tablename,
  *				       char *idxname ,
  *				       char *columnname,
  *				       char *idx_set );
  *
- *    long int create_gazetteer_index (char *tablename,
+ *    ossim_int32 create_gazetteer_index (char *tablename,
  *				       char *idx_fname ,
  *				       char *columnname,
  *				       char *idx_set);
@@ -109,7 +109,7 @@
 void *vpfmalloc(unsigned long size);
 
 #define Whimper(str) {\
-      return ((long int)0) ; }
+      return ((ossim_int32)0) ; }
 
 #define SWhimper(str) {\
       set_type err; err = set_init (1) ;\
@@ -137,7 +137,7 @@ void *vpfmalloc(unsigned long size);
  * That first byte is what must be stored as the value of Header.nbytes
  */
 
-#define DIR_ON_DISK_INCR (2 * sizeof(long int))
+#define DIR_ON_DISK_INCR (2 * sizeof(ossim_int32))
 
 /*************************************************************************
  *
@@ -202,7 +202,7 @@ void *vpfmalloc(unsigned long size);
  *    This module should be ANSI C compatible.  developed on UNIX
  *E
  *************************************************************************/
-long int create_thematic_index ( char indextype,
+ossim_int32 create_thematic_index ( char indextype,
 		 	         char *tablename,
 				 char *idxname ,
 				 char *columnname,
@@ -211,7 +211,7 @@ long int create_thematic_index ( char indextype,
    unsigned int i;
    unsigned int column_length;
    FILE           *ifp ;
-   long int	 j,tablepos,k,
+   ossim_int32	 j,tablepos,k,
       keycolumn = 0 ,	/* 1 if key column */
       itemp , n,
       idsize ,		/* either 2 or 4 bytes */
@@ -278,10 +278,10 @@ long int create_thematic_index ( char indextype,
   /* Determine the id_data_size. This will save 50% of file size  */
 
   if ( table.nrows > MAX_ID ) {
-    h.id_data_type = 'I' ;		/* long ints */
-    idsize = sizeof ( long int ) ;
+    h.id_data_type = 'I' ;		/* ossim_int32s */
+    idsize = sizeof ( ossim_int32 ) ;
   } else {
-    h.id_data_type = 'S' ;		/* long ints */
+    h.id_data_type = 'S' ;		/* ossim_int32s */
     idsize = sizeof ( short int ) ;
   }
 
@@ -306,7 +306,7 @@ long int create_thematic_index ( char indextype,
     datasize = sizeof ( date_type ) ;
     Whimper ("Not implemented yet") ;
   case 'I':
-    datasize = sizeof ( long int ) ;
+    datasize = sizeof ( ossim_int32 ) ;
     break ;
   case 'K':				/* treat keys like integers */
     Whimper ("Cannot make index on key column") ;
@@ -511,12 +511,12 @@ long int create_thematic_index ( char indextype,
 
   h.table_nrows = table.nrows ;
 
-  if ( write_thematic_index_header ( h, ifp ) == (long int)0 )
+  if ( write_thematic_index_header ( h, ifp ) == (ossim_int32)0 )
     Whimper ( "error writing index header" ) ;
 
   /* Now write out the rest of the header directory */
 
-  if ( write_thematic_index_directory ( h, d, idsize, ifp ) == (long int)0 )
+  if ( write_thematic_index_directory ( h, d, idsize, ifp ) == (ossim_int32)0 )
     Whimper ( "error writing index directory" ) ;
 
   /* now write the data */
@@ -602,7 +602,7 @@ long int create_thematic_index ( char indextype,
 set_type read_thematic_index ( char *idxname,
 			       char *value )
 {
-  long int 			i , ival = 0, Match = -1;
+  ossim_int32 			i , ival = 0, Match = -1;
   short int			sval = 0;
   float				fval = 0.0 ;
   double			dval = 0.0 , atof () ;
@@ -619,7 +619,7 @@ set_type read_thematic_index ( char *idxname,
     SWhimper ( hack ) ;
   }
 
-  if ( read_thematic_index_header ( &h, ifp ) == (long int)0 )
+  if ( read_thematic_index_header ( &h, ifp ) == (ossim_int32)0 )
     SWhimper ( "error reading index header" ) ;
 
   if ( h.index_type == 'G' ) {
@@ -631,7 +631,7 @@ set_type read_thematic_index ( char *idxname,
   if ( value ) 		/* search for pattern */
     switch ( h.column_type ) {			/* using address */
     case	'I':
-      memcpy ( &ival, value, sizeof (long int)) ;
+      memcpy ( &ival, value, sizeof (ossim_int32)) ;
       break ;
     case	'S':
       memcpy ( &sval, value, sizeof (short int)) ;
@@ -730,7 +730,7 @@ set_type read_thematic_index ( char *idxname,
   else
     for ( i=0 ; i < d.num_items; i++ ) {
       Read_Vpf_Short ( &sval, ifp, 1 ) ;
-      set_insert ( (long int) sval, s ) ;
+      set_insert ( (ossim_int32) sval, s ) ;
     }
 
   fclose ( ifp ) ;
@@ -803,12 +803,12 @@ ThematicIndex open_thematic_index ( char *idxname )
     OWhimper ( hack ) ;
   }
 
-  if ( read_thematic_index_header ( &idx.h, idx.fp ) == (long int)0 )
+  if ( read_thematic_index_header ( &idx.h, idx.fp ) == (ossim_int32)0 )
     OWhimper ( "error reading index header" ) ;
 
   if ( idx.h.index_type == 'G' ) {
     /* gazetteer_index  */
-     if (read_gazetteer_index_directory(&idx.gid,&idx.h,idx.fp) == (long int)0) {
+     if (read_gazetteer_index_directory(&idx.gid,&idx.h,idx.fp) == (ossim_int32)0) {
 	   fclose(idx.fp);
 	   idx.fp = NULL;
      }
@@ -873,7 +873,7 @@ ThematicIndex open_thematic_index ( char *idxname )
 set_type search_thematic_index ( ThematicIndex *idx,
 				 char *value )
 {
-  long int 			i , ival = 0, Match = -1;
+  ossim_int32 			i , ival = 0, Match = -1;
   short int			sval = 0;
   float				fval = 0.0 ;
   double			dval = 0.0 , atof () ;
@@ -896,7 +896,7 @@ set_type search_thematic_index ( ThematicIndex *idx,
   if ( value ) 		/* search for pattern */
     switch ( idx->h.column_type ) {			/* using address */
     case	'I':
-      memcpy ( &ival, value, sizeof (long int)) ;
+      memcpy ( &ival, value, sizeof (ossim_int32)) ;
       break ;
     case	'S':
       memcpy ( &sval, value, sizeof (short int)) ;
@@ -996,7 +996,7 @@ set_type search_thematic_index ( ThematicIndex *idx,
   else
     for ( i=0 ; i < d.num_items; i++ ) {
       Read_Vpf_Short ( &sval, idx->fp, 1 ) ;
-      set_insert ( (long int) sval, s ) ;
+      set_insert ( (ossim_int32) sval, s ) ;
     }
 
   return s ;					/* also return set */
@@ -1121,23 +1121,23 @@ void close_thematic_index ( ThematicIndex *idx )
  *E
  *************************************************************************/
 
-long int create_gazetteer_index (char *tablename,
+ossim_int32 create_gazetteer_index (char *tablename,
 				 char *idx_fname ,
 				 char *columnname,
 				 char *idx_set)
 {
   vpf_table_type t;
   row_type       r;
-  long int       c;
+  ossim_int32       c;
   FILE         * idx_fp;
   ThematicIndexHeader
                  gi;
   ThematicIndexDirectory
                * gid;
   set_type     * idx_bit_sets;
-  register long int   i,
+  register ossim_int32   i,
                       j;
-  unsigned long int l,
+  ossim_uint32 l,
                     set_byte_size;
 
   t = vpf_open_table(tablename, disk, "rb", NULL);
@@ -1215,7 +1215,7 @@ long int create_gazetteer_index (char *tablename,
 
   vpf_close_table(&t);
 
-  if (write_thematic_index_header(gi, idx_fp) == (long int)0) {
+  if (write_thematic_index_header(gi, idx_fp) == (ossim_int32)0) {
     fclose(idx_fp);
     for (i = 0; i < gi.nbins; i++)
       set_nuke(&idx_bit_sets[i]);
@@ -1347,12 +1347,12 @@ set_type read_gazetteer_index (char *idx_fname, char *query_str )
   if (idx_fp == NULL)
     return query_set;
 
-  if (read_thematic_index_header (&gi, idx_fp) == (long int)0) {
+  if (read_thematic_index_header (&gi, idx_fp) == (ossim_int32)0) {
     fclose(idx_fp);
     return query_set;
   }
 
-  if (read_gazetteer_index_directory (&gid, &gi, idx_fp) == (long int)0) {
+  if (read_gazetteer_index_directory (&gid, &gi, idx_fp) == (ossim_int32)0) {
     fclose(idx_fp);
     return query_set;
   }
@@ -1584,7 +1584,7 @@ set_type search_gazetteer_index (ThematicIndex *idx, char *query_str )
  *    This module should be ANSI C compatible.
  *E
  *************************************************************************/
-long int read_gazetteer_index_directory(
+ossim_int32 read_gazetteer_index_directory(
 				   ThematicIndexDirectory **gid,
 				   ThematicIndexHeader     *gi,
 				   FILE                    *idx_fp)
@@ -1592,7 +1592,7 @@ long int read_gazetteer_index_directory(
   int i;
 
 #if UNIX
-  if ( fseek ( idx_fp,sizeof (ThematicIndexHeader)-sizeof(long int), 0 )!= 0 )
+  if ( fseek ( idx_fp,sizeof (ThematicIndexHeader)-sizeof(ossim_int32), 0 )!= 0 )
 #else
   if (fseek(idx_fp, sizeof (ThematicIndexHeader), 0) != 0)
 #endif
@@ -1607,7 +1607,7 @@ long int read_gazetteer_index_directory(
     if ( ( ! Read_Vpf_Char(  &( (*gid)[i].value.cval ),   idx_fp, 1) ) ||
 	 ( ! Read_Vpf_Int(   &( (*gid)[i].start_offset ), idx_fp, 1) ) ||
 	 ( ! Read_Vpf_Int(   &( (*gid)[i].num_items ),    idx_fp, 1) )) {
-      return (long int)0 ;
+      return (ossim_int32)0 ;
     }
   }
   return 1;
@@ -1658,9 +1658,9 @@ long int read_gazetteer_index_directory(
  *************************************************************************/
 
 #define RWhimper() {\
-   return (long int)0 ; }
+   return (ossim_int32)0 ; }
 
-long int read_thematic_index_header ( ThematicIndexHeader *h, FILE *ifp ) 
+ossim_int32 read_thematic_index_header ( ThematicIndexHeader *h, FILE *ifp ) 
 {
   if ( fseek ( ifp, 0, 0 ) != 0 ) 	/* rewind, just in case */
     return 0 ;				/* error */
@@ -1732,9 +1732,9 @@ long int read_thematic_index_header ( ThematicIndexHeader *h, FILE *ifp )
  *************************************************************************/
 
 #define WWhimper() {\
-   return (long int)0 ; }
+   return (ossim_int32)0 ; }
 
-long int write_thematic_index_header ( ThematicIndexHeader h, FILE *ifp ) 
+ossim_int32 write_thematic_index_header ( ThematicIndexHeader h, FILE *ifp ) 
 {
   if ( fseek ( ifp, 0, 0 ) != 0 ) 	/* rewind, just in case */
     WWhimper() ;				/* error */
@@ -1778,7 +1778,7 @@ long int write_thematic_index_header ( ThematicIndexHeader h, FILE *ifp )
  *A
  *	h < input > == (ThematicIndexHeader) header structure
  *	d < input > == (ThematicIndexDirectory *) directory array structure
- *	idsize < input > == (long int) size of each data element.
+ *	idsize < input > == (ossim_int32) size of each data element.
  *		for T indexes, this is either 2 bytes or 4 bytes
  *		for G indexes, it will be num_in_set (set) 
  *			       or the size of the bit array.
@@ -1811,11 +1811,11 @@ long int write_thematic_index_header ( ThematicIndexHeader h, FILE *ifp )
  *************************************************************************/
 
 #define WTWhimper() {\
-   return (long int)0 ; }
+   return (ossim_int32)0 ; }
 
-long int write_thematic_index_directory ( ThematicIndexHeader h, 
+ossim_int32 write_thematic_index_directory ( ThematicIndexHeader h, 
 					  ThematicIndexDirectory *d,
-					  long int idsize , /* size of data */
+					  ossim_int32 idsize , /* size of data */
 					  FILE *ifp )
 {
   long	int	offset = h.nbytes ,
@@ -1823,7 +1823,7 @@ long int write_thematic_index_directory ( ThematicIndexHeader h,
 
   /* rewind, just in case */
 #if UNIX
-  if ( fseek ( ifp, sizeof (ThematicIndexHeader)-sizeof(long int), 0 ) != 0 )
+  if ( fseek ( ifp, sizeof (ThematicIndexHeader)-sizeof(ossim_int32), 0 ) != 0 )
 #else
   if ( fseek ( ifp, sizeof (ThematicIndexHeader), 0 ) != 0 )
 #endif
@@ -1887,7 +1887,7 @@ long int write_thematic_index_directory ( ThematicIndexHeader h,
  *A
  *	h < input > == (ThematicIndexHeader) header structure 
  *	d < input > == (ThematicIndexDirectory *) directory array structure
- *	idsize < input > == (long int) size of each data element.
+ *	idsize < input > == (ossim_int32) size of each data element.
  *		for T indexes, this is either 2 bytes or 4 bytes
  *		for G indexes, it will be num_in_set (set) 
  *			       or the size of the bit array.
@@ -1920,11 +1920,11 @@ long int write_thematic_index_directory ( ThematicIndexHeader h,
  *************************************************************************/
 
 #define WTGWhimper() {\
-  return (long int)0 ; }
+  return (ossim_int32)0 ; }
 
-long int write_gazetteer_index_directory ( ThematicIndexHeader h, 
+ossim_int32 write_gazetteer_index_directory ( ThematicIndexHeader h, 
 					  ThematicIndexDirectory *d, 
-					  long int idsize , /* size of data */
+					  ossim_int32 idsize , /* size of data */
 					  FILE *ifp )
 {
   long	int	offset = h.nbytes ,
diff --git a/src/ossim/vpfutil/vpfwrite.c b/src/ossim/vpfutil/vpfwrite.c
index 612dd3f..bedcb5b 100644
--- a/src/ossim/vpfutil/vpfwrite.c
+++ b/src/ossim/vpfutil/vpfwrite.c
@@ -109,7 +109,7 @@ extern int STORAGE_BYTE_ORDER;
  *A
  *    key     <input> == (id_triplet_type) id triplet key.
  *    fp      <input> == (FILE *) input file pointer.
- *    return <output> == (long int) size of the key.
+ *    return <output> == (ossim_int32) size of the key.
  *E
  *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  *
@@ -136,11 +136,11 @@ extern int STORAGE_BYTE_ORDER;
  *    This module should be ANSI C compatible.
  *E
  *************************************************************************/
-long int write_key( id_triplet_type key, FILE *fp )
+ossim_int32 write_key( id_triplet_type key, FILE *fp )
 {
-  long int size = 0 ;	/* to count size of key write */
+  ossim_int32 size = 0 ;	/* to count size of key write */
   unsigned char tint ;
-  short int tshort ;
+  ossim_int16 tshort ;
 
    /* Assume that any count value has been written before this */
    /* Only write one key in this subroutine, do not write more */
@@ -159,11 +159,11 @@ long int write_key( id_triplet_type key, FILE *fp )
    case 2:
      tshort = (short) key.id ;
      Write_Vpf_Short ( &tshort, fp, 1 ) ;
-     size += sizeof ( short int ) ;
+     size += sizeof ( ossim_int16 ) ;
      break;
    case 3:
      Write_Vpf_Int (&(key.id), fp, 1 ) ;
-     size += sizeof ( long int ) ;
+     size += sizeof ( ossim_int32 ) ;
      break;
    }
 
@@ -178,11 +178,11 @@ long int write_key( id_triplet_type key, FILE *fp )
    case 2:
      tshort = (short) key.tile ;
      Write_Vpf_Short ( &tshort, fp, 1 ) ;
-     size += sizeof ( short int ) ;
+     size += sizeof ( ossim_int16 ) ;
      break;
    case 3:
      Write_Vpf_Int (&(key.tile), fp, 1 ) ;
-     size += sizeof ( long int ) ;
+     size += sizeof ( ossim_int32 ) ;
      break;
    }
 
@@ -197,11 +197,11 @@ long int write_key( id_triplet_type key, FILE *fp )
    case 2:
      tshort = (short) key.exid ;
      Write_Vpf_Short ( &tshort, fp, 1 ) ;
-     size += sizeof ( short int ) ;
+     size += sizeof ( ossim_int16 ) ;
      break;
    case 3:
      Write_Vpf_Int (&(key.exid), fp, 1 ) ;
-     size += sizeof ( long int ) ;
+     size += sizeof ( ossim_int32 ) ;
      break;
    }
   return size ;
@@ -266,16 +266,16 @@ long int write_key( id_triplet_type key, FILE *fp )
  *    This module should be ANSI C compatible.
  *E
  *************************************************************************/
-long int write_next_row(row_type row, vpf_table_type * table )
+ossim_int32 write_next_row(row_type row, vpf_table_type * table )
 {
-   register long int i,
+   register ossim_int32 i,
 		     j;
    char            * tptr,
 		   * output ;
-   long int          recordsize = 0;
-   long int	     count;
+   ossim_int32          recordsize = 0;
+   ossim_int32	     count;
    id_triplet_type * keys;
-   unsigned long int pos_for_ndx,
+   ossim_uint32 pos_for_ndx,
 		     length;
    int               retn_val = 0;
    coordinate_type   dummycoord = {0.0,0.0};
@@ -297,7 +297,7 @@ long int write_next_row(row_type row, vpf_table_type * table )
 
      if ( table->header[i].count < 0 ) {
        Write_Vpf_Int ( &count, table->fp, 1 ) ;
-       recordsize += sizeof ( long int ) ;
+       recordsize += sizeof ( ossim_int32 ) ;
      }
 
      /* Now write out the data type */
@@ -326,12 +326,12 @@ long int write_next_row(row_type row, vpf_table_type * table )
 
      case 'I':
        Write_Vpf_Int (row[i].ptr, table->fp, count ) ;
-       recordsize += sizeof ( long int ) * count ;
+       recordsize += sizeof ( ossim_int32 ) * count ;
        break;
 
      case 'S':
        Write_Vpf_Short (row[i].ptr, table->fp, count ) ;
-       recordsize += sizeof ( short int ) * count ;
+       recordsize += sizeof ( ossim_int16 ) * count ;
        break;
 
      case 'F':
@@ -449,7 +449,7 @@ long int write_next_row(row_type row, vpf_table_type * table )
  *************************************************************************/
 row_type create_row( vpf_table_type table )
 {
-   long int i;
+   ossim_int32 i;
    row_type row;
 
    row = (row_type)vpfmalloc(table.nfields*sizeof(column_type));
@@ -481,7 +481,7 @@ row_type create_row( vpf_table_type table )
  *
  *   Parameters:
  *A
- *     field <input>  == (long int) column offset.
+ *     field <input>  == (ossim_int32) column offset.
  *     row   <inout> == (row_type) row containing element to be removed.
  *     table <inout> == (vpf_table_type) VPF table owning row.
  *E
@@ -493,7 +493,7 @@ row_type create_row( vpf_table_type table )
  *   JTB  10/91 removed call to exit();
  *E
  *************************************************************************/
-void nullify_table_element( long int            field,
+void nullify_table_element( ossim_int32            field,
 			    row_type       row,
 			    vpf_table_type table )
 {
@@ -527,12 +527,12 @@ void nullify_table_element( long int            field,
  *
  *   Parameters:
  *A
- *     field <input>  == (long int) column offset.
+ *     field <input>  == (ossim_int32) column offset.
  *     row   <in-out> == (row_type) row containing target field.
  *     table <in-out> == (vpf_table_type) VPF table owning row.
  *     value <in>     == (void *) source field element.
- *     count <in>     == (long int) number of items in value.
- *     put_table_element <output> == (long int)
+ *     count <in>     == (ossim_int32) number of items in value.
+ *     put_table_element <output> == (ossim_int32)
  *                                    0 --> element write succeeded
  *                                    1 --> unknown element type or
  *                                          invalid column offset
@@ -548,13 +548,13 @@ void nullify_table_element( long int            field,
  *             -1: unknown element type or invalid column (field) offset
  *E
  *************************************************************************/
-long int put_table_element( long int              field,
+ossim_int32 put_table_element( ossim_int32              field,
 		       row_type         row,
 		       vpf_table_type   table,
 		       void           * value,
-		       long int         count )
+		       ossim_int32         count )
 {
-   long int i, len, stat;
+   ossim_int32 i, len, stat;
    char *str;
 
    stat=0;
@@ -578,7 +578,7 @@ long int put_table_element( long int              field,
 
    switch ( table.header[field].type ) {
       case 'T':
-	len = (long int)max(count,table.header[field].count);
+	len = (ossim_int32)max(count,table.header[field].count);
 	str = (char *) vpfmalloc( len + 1 );
 	row[field].ptr = (char *) vpfmalloc ( len + 1 ) ;
 	strcpy( (char*)str, (char*)value );
@@ -595,13 +595,13 @@ long int put_table_element( long int              field,
 	break;
 
       case 'I' :
-	row[field].ptr = (long int *) vpfmalloc (count*sizeof(long int));
-	memcpy ( row[field].ptr, value, sizeof (long int) * count ) ;
+	row[field].ptr = (ossim_int32 *) vpfmalloc (count*sizeof(ossim_int32));
+	memcpy ( row[field].ptr, value, sizeof (ossim_int32) * count ) ;
 	break;
 
       case 'S' :
-	row[field].ptr = (short int *) vpfmalloc (count*sizeof(short int));
-	memcpy ( row[field].ptr, value, sizeof (short int) * count ) ;
+	row[field].ptr = (ossim_int16 *) vpfmalloc (count*sizeof(ossim_int16));
+	memcpy ( row[field].ptr, value, sizeof (ossim_int16) * count ) ;
 	break;
 
       case 'F':
@@ -695,9 +695,9 @@ long int put_table_element( long int              field,
 
 /* #ifdef UNIX */
 
-long int VpfWrite ( void *from, VpfDataType type, long int count, FILE *to )
+ossim_int32 VpfWrite ( void *from, VpfDataType type, ossim_int32 count, FILE *to )
 {
-  long int retval=0 , i ;
+  ossim_int32 retval=0 , i ;
 
   switch ( type ) {
   case VpfChar:
@@ -706,7 +706,7 @@ long int VpfWrite ( void *from, VpfDataType type, long int count, FILE *to )
   case VpfShort:
     {
       if (MACHINE_BYTE_ORDER != STORAGE_BYTE_ORDER) {
-	short int stemp ,
+	ossim_int16 stemp ,
 		*sptr = (short *) from ;
 	for ( i=0; i < count; i++, sptr++ ) {
 	   swap_two ( (char*)sptr, (char*)&stemp ) ;
@@ -720,14 +720,14 @@ long int VpfWrite ( void *from, VpfDataType type, long int count, FILE *to )
   case VpfInteger:
     {
       if (MACHINE_BYTE_ORDER != STORAGE_BYTE_ORDER) {
-	 long int itemp,
-	   *iptr = (long int *) from ;
+	 ossim_int32 itemp,
+	   *iptr = (ossim_int32 *) from ;
 	 for ( i=0; i < count; i++, iptr++ ) {
 	   swap_four ( (char*)iptr, (char*)&itemp ) ;
-	   retval = (long)fwrite ( &itemp, sizeof (long int), 1, to ) ;
+	   retval = (long)fwrite ( &itemp, sizeof (ossim_int32), 1, to ) ;
 	 }
       } else {
-	 retval = (long)fwrite ( from, sizeof (long int), count, to ) ;
+	 retval = (long)fwrite ( from, sizeof (ossim_int32), count, to ) ;
       }
     }
     break ;
@@ -741,7 +741,7 @@ long int VpfWrite ( void *from, VpfDataType type, long int count, FILE *to )
 	   retval = (long)fwrite ( &ftemp, sizeof (float), 1, to ) ;
 	 }
       } else {
-	 retval = (long)fwrite ( from, sizeof (long int), count, to ) ;
+	 retval = (long)fwrite ( from, sizeof (ossim_int32), count, to ) ;
       }
     }
     break ;
diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt
index eacc6d9..74105f8 100644
--- a/src/test/CMakeLists.txt
+++ b/src/test/CMakeLists.txt
@@ -1,30 +1,50 @@
-# $Id$
+# $Id: CMakeLists.txt 22354 2013-08-02 16:22:15Z gpotts $
 
-OSSIM_SETUP_APPLICATION(ossim-batch-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-batch-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-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-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-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-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-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-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-notify-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-notify-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-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-read-write-consistency-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-read-write-consistency-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-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-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-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-xml-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-xml-test.cpp)
diff --git a/src/test/ossim-batch-test.cpp b/src/test/ossim-batch-test.cpp
deleted file mode 100644
index 0717f38..0000000
--- a/src/test/ossim-batch-test.cpp
+++ /dev/null
@@ -1,574 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File ossim-batch-test.cpp
-// 
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description: Test code application ossim batch test.
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimFilename.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 <fstream>
-#include <string>
-using namespace std;
-
-static void writeTemplate(const ossimFilename& templateFile);
-static void getDateString(std::string& date);
-static void getLogFilename(ossimFilename& logFile);
-
-static bool processTest(const ossimString& prefix, const ossimKeywordlist& kwl,
-                        std::ofstream& logStr);
-
-static bool processCommands(const ossimString& prefix, const ossimKeywordlist& kwl,
-                            std::ofstream& logStr, const ossimString& testName, bool logTime);
-
-static bool processCommands(const ossimString& prefix, const ossimKeywordlist& kwl,
-                            std::ofstream& logStr, const ossimFilename& tempFile,
-                            const ossimString& testName);
-
-int main(int argc, char *argv[])
-{
-   enum
-   {
-      PASS  = 0,
-      FAIL  = 1,
-      ERROR = -1
-   };
-   
-   std::string tempString;
-   ossimArgumentParser::ossimParameter stringParam(tempString);
-   ossimArgumentParser ap(&argc, argv);
-   ossimInit::instance()->addOptions(ap);
-   ossimInit::instance()->initialize(ap);
-
-   ap.getApplicationUsage()->setApplicationName(ap.getApplicationName());
-
-   ap.getApplicationUsage()->setDescription(ap.getApplicationName()+" batch test application.");
-   
-   ap.getApplicationUsage()->setCommandLineUsage(ap.getApplicationName()+" <tests.kwl>");
-   
-   ap.getApplicationUsage()->addCommandLineOption("-h or --help","Display usage.");
-   
-   ap.getApplicationUsage()->addCommandLineOption("-w", "<template_file> Writes a template file.  Can be used to start a tests.kwl file.");
-
-   if ( ap.read("-h") || ap.read("--help") || (ap.argc() < 2) )
-   {
-      ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_NOTICE)); 
-      return 0;
-   }
-   if (ap.read("-w", stringParam))
-   {
-      ossimFilename geometryTemplateFile = tempString.c_str();
-      writeTemplate(geometryTemplateFile);
-      return PASS;
-   }
-
-   ossimFilename configFile = ap.argv()[1];
-
-   ossimKeywordlist kwl;
-   kwl.setExpandEnvVarsFlag(true);
-   if ( kwl.addFile(configFile) )
-   {
-      ossimFilename logDir;
-      const char* lookup = 0;
-      lookup = kwl.find("log_directory");
-      if ( lookup )
-      {
-         logDir = ossimFilename(lookup).expand();
-         if ( logDir.exists() == false )
-         {
-            if ( logDir.createDirectory() == false )
-            {
-               cerr << "Could not create: " << logDir << endl;
-               return ERROR;
-            }
-         }
-      }
-      else
-      {
-         cerr << "missing config keyword: log_directory" << endl;
-      }
-
-      ossimFilename logFile;
-      getLogFilename(logFile);
-      logFile = logDir.dirCat(logFile);
-      ossimSetLogFilename(logFile);
-      std::ofstream logStr;
-      logStr.open(logFile.c_str());
-      if ( logStr.fail() )
-      {
-         cerr << "Could not open: " << logFile << endl;
-         return ERROR;
-      }
-      else
-      {
-         cout << "Logging to file: " << logFile << "\n";
-      }
-      
-      std::string date;
-      getDateString(date);
-      logStr << "// ---\n"
-             << "// ossim-batch-test log:\n"
-             << "// date format = yyyymmddhhmmss\n"
-             << "//---\n"
-             << "start_time: " << date << "\n"
-             << "config_file: " << configFile << "\n";
-      // Start the timer.
-      ossimTimer::instance()->setStartTick();
-      
-      double startTime = ossimTimer::instance()->time_s();
-
-      // Get the number of test:
-      ossimString regExpStr = "test[0-9]+\\.";
-      const ossim_uint32 COUNT = kwl.getNumberOfSubstringKeys(regExpStr);
-      const ossim_uint32 MAX_INDEX = COUNT + 1000;
-      ossimString prefixBase = "test";
-      ossim_uint32 index = 0;
-      ossim_uint32 processedIndexes = 0;
-
-      while ( processedIndexes < COUNT )
-      {
-         ossimString prefix =  prefixBase + ossimString::toString(index) + ".";
-         if ( processTest( prefix, kwl, logStr) )
-         {
-            ++processedIndexes;
-         }
-         ++index;
-         if ( index >= MAX_INDEX ) break; 
-      }
-
-      getDateString(date);
-      logStr << "\nstop_time: " << date << "\n";
-      double stopTime = ossimTimer::instance()->time_s();
-      logStr << "total elapsed time in seconds: "
-             << std::setiosflags(ios::fixed) << std::setprecision(4)
-             << (stopTime-startTime)
-             << endl; // flush
-      logStr.close();
-      
-      cout << "Wrote: " << logFile << endl;
-   }
-   else
-   {
-      cerr << "could not open: " << configFile << endl;
-      return ERROR;
-   }
-
-   return 0;
-}
-
-void writeTemplate(const ossimFilename& templateFile)
-{
-   std::ofstream out(templateFile.c_str());
-   if ( out.good() )
-   {
-      out << "// ossim-batch-test config file.\n"
-          << "log_directory: $(OSSIM_TEST)/logs\n"
-          << "test1.name: test1\n"
-          << "test1.description: Test rgb data coming out grey scale.\n"
-          << "\n"
-          << "// ---\n"
-          << "// Control flags:\n"
-          << "// Use 0 or 1, true 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"
-          << "\n"
-          << "// Turns on/off whole test:\n"
-          << "test1.enabled: 1\n"
-          << "\n"
-          << "test1.run_clean_commands: 0\n"
-          << "test1.run_preprocessing_commands: 1\n"
-          << "test1.run_expected_results_commands: 1\n"
-          << "test1.run_test_commands: 1\n"
-          << "test1.run_postprocessing_commands: 1\n"
-          << "\n"
-          << "// Temp file to catch diff output.\n"
-          << "test1.temp_file: /tmp/tmp.txt\n"
-          << "\n"
-          << "// Clean up commands.\n"
-          << "test1.clean_command0: rm -rf $(OSSIM_TEST)/expected_results/test1\n"
-          << "test1.clean_command1: rm -rf $(OSSIM_TEST)/output/test1\n"
-          << "\n"
-          << "// Pre-process commands:\n"
-          << "test1.preprocess_command0: mkdir -p $(OSSIM_TEST)/expected_results/test1\n"
-          << "test1.preprocess_command1: mkdir -p $(OSSIM_TEST)/output/test1\n"
-          << "\n"
-          << "// Commands to generate expected results:\n"
-          << "test1.expected_results_command0: ossim-orthoigen -w tiff_tiled_band_separate $(OSSIM_TEST)/test_data/test1/test1.ntf $(OSSIM_TEST)/expected_results/test1/t1.tif\n"
-          << "test1.expected_results_command1: ossim-create-histo $(OSSIM_TEST)/expected_results/test1/t1.tif\n"
-          << "\n"
-          << "// The actual commands to test:\n"
-          << "test1.test_command0: ossim-orthoigen -w tiff_tiled_band_separate $(OSSIM_TEST)/test_data/test1/test1.ntf $(OSSIM_TEST)/output/test1/t1.tif\n"
-          << "test1.test_command1: ossim-create-histo $(OSSIM_TEST)/output/test1/t1.tif\n"
-          << "\n"
-          << "// Post process commands for diffs and stuff:\n"
-          << "test1.postprocess_command0: diff -w $(OSSIM_TEST)/expected_results/test1/t1.his $(OSSIM_TEST)/output/test1/t1.his\n"
-          << "\n"
-          << "// test2.name:\n"
-          << "// ..."
-          << std::endl;
-      
-      out.close();
-      
-      ossimNotify(ossimNotifyLevel_NOTICE)
-         << "Wrote file: " << templateFile.c_str() << std::endl;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE)
-         << "Could not open: " << templateFile.c_str() << std::endl;
-   }
-}
-
-void getDateString(std::string& 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(); // ??? (drb)
-   }
-}
-
-void getLogFilename(ossimFilename& logFile)
-{
-   logFile = "ossim-batch-test-log-";
-   std::string date;
-   getDateString(date);
-   logFile += date;
-   logFile += ".txt";
-}
-
-bool processTest(const ossimString& prefix, const ossimKeywordlist& kwl, std::ofstream& logStr)
-{
-   bool result = false;
-   
-   const char* lookup = kwl.find( prefix, "name" );
-   if (lookup)
-   {
-      result = true;
-      ossimString testName = lookup;
-      
-      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 )
-      {
-         logStr << "processing_test: " << testName << "\n";
-
-         lookup = kwl.find( prefix, "description" );
-         if ( lookup )
-         {
-            logStr << "description: " << lookup << "\n";
-         }
-         
-         bool preProcessFlag  = false;
-         bool expectedFlag    = false;
-         bool testFlag        = false;
-         bool postProcessFlag = false;
-         bool cleanFlag       = false;
-
-         const char* lookup;
-         std::string date; 
-
-         lookup = kwl.find(prefix.c_str(), "run_clean_commands");
-         if ( lookup )
-         {
-            cleanFlag = ossimString(lookup).toBool();
-         }
-         else
-         {
-            logStr << "missing_keyword: " << prefix << "run_clean_commands\n"
-                   << "defaulting to false...\n";
-         }
-         
-         lookup = kwl.find(prefix.c_str(), "run_preprocessing_commands");
-         if ( lookup )
-         {
-            preProcessFlag = ossimString(lookup).toBool();
-         }
-         else
-         {
-            logStr << "missing_keyword: " << prefix << "run_preprocessing_commands\n"
-                   << "defaulting to false...\n";
-         }
-
-         lookup = kwl.find(prefix.c_str(), "run_expected_results_commands");
-         if ( lookup )
-         {
-            expectedFlag = ossimString(lookup).toBool();
-         }
-         else
-         {
-            logStr << "missing_keyword: " << prefix << "run_expected_results_commands\n"
-                   << "defaulting to false...\n";
-         }
-
-         lookup = kwl.find(prefix.c_str(), "run_test_commands");
-         if ( lookup )
-         {
-            testFlag = ossimString(lookup).toBool();
-         }
-         else
-         {
-            logStr << "missing_keyword: " << prefix << "run_test_commands\n"
-                   << "defaulting to false...\n";
-         }
-
-         lookup = kwl.find(prefix.c_str(), "run_postprocessing_commands");
-         if ( lookup )
-         {
-            postProcessFlag = ossimString(lookup).toBool();
-         }
-         else
-         {
-            logStr << "missing_keyword: " << prefix << "run_postprocessing_commands\n"
-                   << "defaulting to false...\n";
-         }
-
-
-         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";
-            processCommands( prefixBase, kwl, logStr, testName, false );
-         }
-
-         if ( preProcessFlag )
-         {
-            ossimString prefixBase = prefix + "preprocess_command";
-            processCommands( prefixBase, kwl, logStr, testName, false );
-         }
-         if ( expectedFlag )
-         {
-            ossimString prefixBase = prefix + "expected_results_command";
-            processCommands( prefixBase, kwl, logStr, testName, true );
-         }
-         if ( testFlag )
-         {
-            ossimString prefixBase = prefix + "test_command";
-            processCommands( prefixBase, kwl, logStr, testName, true );
-         }
-         if ( postProcessFlag )
-         {
-            ossimFilename tempFile;
-            lookup = kwl.find(prefix.c_str(), "temp_file");
-            if ( lookup )
-            {
-               tempFile = lookup;
-            }
-            else
-            {
-               logStr << "missing_keyword: " << prefix << "temp_file\n";
-            }
-            ossimString prefixBase = prefix + "postprocess_command";
-            processCommands( prefixBase, kwl, logStr, tempFile, testName );
-         }
-         logStr << "end_test: " << testName << "\n";
-      }
-      else
-      {
-         cout << testName << ": disabled\n";
-         logStr << testName << ": disabled\n";
-      }
-      
-      logStr << "----------------------------------------------------------------------\n"; 
-
-   } // if kwl.find( prefix, "name" );
-      
-   return result; 
-}
-
-bool processCommands(const ossimString& prefixBase, const ossimKeywordlist& kwl,
-                     std::ofstream& logStr, const ossimString& testName, bool logTime)
-{
-   bool result = true;
-
-   //---
-   // 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 COUNT = kwl.getNumberOfSubstringKeys(regExpStr);
-   const ossim_uint32 MAX_INDEX = COUNT + 1000;
-
-   std::string date;
-   double startTime;
-   double stopTime;
-   
-   ossimString command;
-   ossim_uint32 index = 0;
-   ossim_uint32 processedIndexes = 0;
-   const char* lookup = 0;
-   
-   while (  processedIndexes < COUNT )
-   {
-      ossimString prefix =  prefixBase + ossimString::toString(index);
-      lookup = kwl.find( prefix );
-      if ( lookup )
-      {
-         logStr << "executing command: " << lookup << "\n";
-
-         if ( logTime )
-         {
-            getDateString(date);
-            logStr << "begin: " << date << "\n";
-
-            // Start the clock:
-            startTime = ossimTimer::instance()->time_s();
-         }
-            
-         // Launch the command:
-         int status = system(lookup);
-
-         if ( logTime )
-         {
-            // Log the time and status:
-            stopTime = ossimTimer::instance()->time_s();
-            getDateString(date);
-            logStr << "end: " << date << "\n"
-                   << testName << "[" << index << "]: elapsed time in seconds: "
-                   << std::setiosflags(ios::fixed)
-                   << std::setprecision(4)
-                   << (stopTime-startTime) << "\n";
-         }
-         
-         logStr << "return status: " << status << "\n";
-         
-         ++processedIndexes;
-      }
-      ++index;
-      
-      if ( index >= MAX_INDEX ) break; // Config file has bad numbering...
-   }
-   return result;
-}
-
-bool processCommands(const ossimString& prefixBase,
-                     const ossimKeywordlist& kwl,
-                     std::ofstream& logStr,
-                     const ossimFilename& tempFile,
-                     const ossimString& testName)
-{
-   bool result = true;
-
-   //---
-   // 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 COUNT = kwl.getNumberOfSubstringKeys(regExpStr);
-   const ossim_uint32 MAX_INDEX = COUNT + 1000;
-
-   ossimString command;
-   ossim_uint32 index = 0;
-   ossim_uint32 processedIndexes = 0;
-   const char* lookup = 0;
-   
-   while (  processedIndexes < COUNT )
-   {
-      ossimString prefix =  prefixBase + ossimString::toString(index);
-      lookup = kwl.find( prefix );
-      if ( lookup )
-      {
-         ossimString command = lookup;
-         if ( tempFile.size() )
-         {
-            ossimString s = command;
-            s += " > " + tempFile;
-            command = s;
-         }
-         
-         logStr << "executing command: " << command << "\n";
-         
-         // Launch the command:
-         int status = system(command.c_str());
-
-         logStr << "return status: " << status << "\n";
-
-         //---
-         // Output the status.
-         // If failed write the temp file to the log.  This should have the diffs in it.
-         //---
-         if ( status != 0 )
-         {
-            cerr << testName << "[" << index << "]: FAILED" << endl;
-            logStr << testName << "[" << index << "]: FAILED" << endl;
-            logStr << command << "\noutput follows:\n";
-            std::ifstream in;
-            in.open(tempFile.c_str(), ios::in | ios::binary);
-            if ( in.is_open() )
-            {
-               char ch;
-               while ( in.get(ch) ) logStr.put(ch);
-               logStr << "\n";
-               in.close();
-            }
-         }
-         else
-         {
-            cout << testName << "[" << index << "]: PASSED" << endl;
-            logStr << testName << "[" << index << "]: PASSED" << endl;
-         }
-         
-         ++processedIndexes;
-      }
-      ++index;
-      
-      if ( index >= MAX_INDEX ) break; // Config file has bad numbering...
-   }
-   return result;
-}
diff --git a/src/test/ossim-byte-stream-buffer-test.cpp b/src/test/ossim-byte-stream-buffer-test.cpp
new file mode 100644
index 0000000..2ad6091
--- /dev/null
+++ b/src/test/ossim-byte-stream-buffer-test.cpp
@@ -0,0 +1,94 @@
+//----------------------------------------------------------------------------
+//
+// 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 19900 2011-08-04 14:19:57Z dburken $
+//----------------------------------------------------------------------------
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimConstants.h>  // ossim contants...
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimKeywordlist.h>
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimConstants.h>  // ossim contants...
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimNotify.h>
+
+#include <ossim/base/ossimByteStreamBuffer.h>
+
+// Put your includes here:
+
+#include <iostream>
+#include <ostream>
+#include <istream>
+using namespace std;
+
+
+int main(int argc, char *argv[])
+{
+    ossimArgumentParser ap(&argc, argv);
+    ossimInit::instance()->addOptions(ap);
+    ossimInit::instance()->initialize(ap);
+    
+    try
+    {
+        {
+            // testing shared buffer access and writing
+            //
+            char sharedBuf[] = "ABC";
+            ossimByteStreamBuffer buf(sharedBuf, 3, true);
+            
+            buf.setBuf(sharedBuf, 3, true);
+            
+            std::istream in(&buf);
+            std::cout << "Read single byte test? " << (((char)in.get()=='A')?"Passed":"Failed") << std::endl;
+            in.seekg(3);
+            std::cout << "Read passed input? " << ((in.get()==-1)?"Passed":"Failed") << std::endl;
+            
+        }
+        {
+            // dynamic buffer  I/O
+            ossimByteStreamBuffer buf;
+            std::iostream inout(&buf);
+            
+            inout.put(0x00);
+            std::cout << "Read dynamically added byte? " << ((inout.get()==0x00)?"Passed":"Failed") << std::endl;
+            inout << "ABCDEF" << std::endl;
+            inout.seekg(1);
+            std::cout << "Read after << operation? " << (((char)inout.get()=='A')?"Passed":"Failed") << std::endl;
+            inout.seekg(1);
+            std::cout << "Tellg? " << (((ossim_int64)inout.tellg()==1)?"Passed":"Failed") << std::endl;
+        }
+        {
+            // test copy construction
+            ossimByteStreamBuffer buf;
+            std::iostream inout(&buf);
+            inout << "ABCDEFG";
+            
+            ossimByteStreamBuffer buf2(buf);
+            std::iostream inout2(&buf2);
+            std::cout << "Test read after copy constructor? " << ((inout.get() == inout2.get())?"Passed":"Failed") << std::endl;
+        }
+    }
+    catch (const ossimException& e)
+    {
+        ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+        return 1;
+    }
+    
+    return 0;
+}
diff --git a/src/test/ossim-date-test.cpp b/src/test/ossim-date-test.cpp
index 25c52ed..199c465 100644
--- a/src/test/ossim-date-test.cpp
+++ b/src/test/ossim-date-test.cpp
@@ -10,7 +10,7 @@
 //
 // 
 //----------------------------------------------------------------------------
-// $Id$
+// $Id: ossim-date-test.cpp 19751 2011-06-13 15:13:07Z dburken $
 
 #include <iostream>
 using namespace std;
diff --git a/src/test/ossim-datum-shift.cpp b/src/test/ossim-datum-shift.cpp
index f23593c..d4f8f6f 100644
--- a/src/test/ossim-datum-shift.cpp
+++ b/src/test/ossim-datum-shift.cpp
@@ -6,13 +6,14 @@
 //
 // Description: Contains application for simple datum shift test.
 //
-// $Id: dms_test.cpp 12095 2007-11-30 16:06:06Z dburken $
+// $Id: ossim-datum-shift.cpp 19900 2011-08-04 14:19:57Z dburken $
 //----------------------------------------------------------------------------
 
 
 #include <iostream>
 #include <iomanip>
 #include <cstdlib>
+#include <time.h>
 using namespace std;
 
 #include <ossim/init/ossimInit.h>
@@ -26,8 +27,11 @@ using namespace std;
 
 int main()   
 {
+   clock_t time_start = clock();
+
    // To initialize factories.
    ossimInit::instance()->initialize();
+   clock_t time_init = clock();
 
    // WGS 84 datum:
    const ossimDatum* wgeDatum =
@@ -108,5 +112,15 @@ int main()
       
    } while (lat < 65.0);
 
+   clock_t time_end = clock();
+   double init_time = (time_init - time_start)/(double)CLOCKS_PER_SEC;
+   double exec_time = (time_end - time_start)/(double)CLOCKS_PER_SEC;
+   cout <<"\nTiming (in seconds):\n"
+      <<"    Initialization:  "<<init_time<<"\n"
+      <<"    Total Execution: "<<exec_time<<"\n"<<endl;
+   ofstream tfile ("ossim-datum-shift-TIMING.csv", ios_base::app|ios_base::out);
+   tfile<<init_time<<", "<<exec_time<<endl;
+   tfile.close();
+
    return 0;
 }
diff --git a/src/test/ossim-directory-test.cpp b/src/test/ossim-directory-test.cpp
new file mode 100755
index 0000000..582f4c2
--- /dev/null
+++ b/src/test/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/src/test/ossim-duration-test.cpp b/src/test/ossim-duration-test.cpp
index f369ed7..e0f927d 100644
--- a/src/test/ossim-duration-test.cpp
+++ b/src/test/ossim-duration-test.cpp
@@ -6,7 +6,7 @@
 //
 // Description: Test app for ossimString class.
 //
-// $Id$
+// $Id: ossim-duration-test.cpp 19751 2011-06-13 15:13:07Z dburken $
 //----------------------------------------------------------------------------
 #include <iostream>
 #include <ossim/base/ossimDuration.h>
diff --git a/src/test/ossim-elevation-manager-test.cpp b/src/test/ossim-elevation-manager-test.cpp
index d881baa..2e5b5c4 100644
--- a/src/test/ossim-elevation-manager-test.cpp
+++ b/src/test/ossim-elevation-manager-test.cpp
@@ -6,7 +6,7 @@
 //
 // Description: Test code for ossimElevManger.
 //
-// $Id$
+// $Id: ossim-elevation-manager-test.cpp 19751 2011-06-13 15:13:07Z dburken $
 //----------------------------------------------------------------------------
 #include <iostream>
 using namespace std;
diff --git a/src/test/ossim-xml-test.cpp b/src/test/ossim-envi-hdr-test.cpp
old mode 100755
new mode 100644
similarity index 50%
copy from src/test/ossim-xml-test.cpp
copy to src/test/ossim-envi-hdr-test.cpp
index 389afd4..0b0d9af
--- a/src/test/ossim-xml-test.cpp
+++ b/src/test/ossim-envi-hdr-test.cpp
@@ -6,17 +6,17 @@
 //
 // Author:  David Burken
 //
-// XML functions test.
+// Description: Test app for ossimEnviHeader class.
 // 
 //----------------------------------------------------------------------------
-// $Id: ossimFilenameTest.cpp 14235 2009-04-07 01:18:58Z dburken $
+// $Id$
 
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/support_data/ossimEnviHeader.h>
 #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[])
 {
@@ -24,25 +24,25 @@ int main(int argc, char *argv[])
 
    if (argc != 2)
    {
-      cout << "usage: " << argv[0] << " <xml_file>" << endl;
+      cout << argv[0] << " <envi_header_file>"
+           << "\nOpen, parse and print ossimEnviHeader object." << endl;
       return 0;
    }
-   
-   ossimFilename f = argv[1];
 
-   cout << "file: " << f << endl;
+   cout << "ossimEnviHeader test:\n";
 
-   ossimXmlDocument* xdoc = new ossimXmlDocument();
-   if ( xdoc->openFile(f) )
+   ossimEnviHeader hdr;
+   if ( hdr.open( ossimFilename( argv[1] ) ) )
    {
-      cout << "opened..." << endl;
+      ossimString s = "Hello world...";
+      hdr.setDescription( s );
+      
+      cout << hdr << endl;
    }
    else
    {
-      cout << "not opened..." << endl;
+      cout << "Could not open: " << argv[1] << endl;
    }
-   
-   delete xdoc;
 
    return 0;
 }
diff --git a/src/test/ossim-epsg-factory-test.cpp b/src/test/ossim-epsg-factory-test.cpp
new file mode 100644
index 0000000..e9b3260
--- /dev/null
+++ b/src/test/ossim-epsg-factory-test.cpp
@@ -0,0 +1,115 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// File: ossim-epsg-factory-test.cpp
+//
+// Author:  Oscar Kramer
+//
+// Description: Contains test of EPSG projection factory functionality
+//
+// NOTE:  Returns 0 on success, 1 on failure. Outputs test results to stdout.
+//
+// $Id: ossim-epsg-factory-test.cpp 19751 2011-06-13 15:13:07Z 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/projection/ossimEpsgProjectionFactory.h>
+
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+   ossimArgumentParser ap(&argc, argv);
+   ossimInit::instance()->addOptions(ap);
+   ossimInit::instance()->initialize(ap);
+
+   bool passed = true;
+   try
+   {
+      ossimEpsgProjectionFactory* factory = ossimEpsgProjectionFactory::instance();
+      ossimRefPtr<ossimMapProjection> proj = 0;
+      
+
+      ossimString code = "EPSG:2236"; // "NAD83 / Florida East (ftUS)"
+      proj = dynamic_cast<ossimMapProjection*>(factory->createProjection(code));
+      if (proj.valid() && (proj->getProjectionName()=="ossimTransMercatorProjection"))
+         cout << "\nPASSED for code <"<<code<<">"<<endl;
+      else
+      {
+         passed =false;
+         cout<<"\nFAILED for code <"<<code<<">"<<endl;
+      }
+
+      ossimString name = "NAD83 / Virginia North (ftUS)"; // 2283
+      proj = dynamic_cast<ossimMapProjection*>(factory->createProjection(name));
+      if (proj.valid() && (proj->getPcsCode() == 2283))
+         cout << "\nPASSED for name <"<<name<<">"<<endl;
+      else
+      {
+         passed =false;
+         cout<<"\nFAILED for name <"<<name<<">"<<endl;
+      }
+
+      name = "NAD_1983_HARN_StatePlane_Florida_East_FIPS_0901"; // 2777
+      proj = dynamic_cast<ossimMapProjection*>(factory->createProjection(name));
+      if (proj.valid() && (proj->getPcsCode() == 2777))
+         cout << "\nPASSED for name <"<<name<<">"<<endl;
+      else
+      {
+         passed =false;
+         cout<<"\nFAILED for name <"<<name<<">"<<endl;
+      }
+
+      name = "NAD_1983_StatePlane_Virginia_North_FIPS_4501"; // 32146
+      proj = dynamic_cast<ossimMapProjection*>(factory->createProjection(name));
+      if (proj.valid() && (proj->getPcsCode() == 32146))
+         cout << "\nPASSED For name <"<<name<<">"<<endl;
+      else
+      {
+         passed =false;
+         cout<<"\nFAILED for name <"<<name<<">"<<endl;
+      }
+
+      name = "NAD83_SPCS_0101"; // 26929
+      proj = dynamic_cast<ossimMapProjection*>(factory->createProjection(name));
+      if (proj.valid() && (proj->getPcsCode() == 26929))
+         cout << "\nPASSED for name <"<<name<<">"<<endl;
+      else
+      {
+         passed =false;
+         cout<<"\nFAILED for name <"<<name<<">"<<endl;
+      }
+
+      if (proj.valid())
+      {
+         proj->setPcsCode(0);
+         ossim_uint32 lookup = proj->getPcsCode();
+         if ((lookup == 26929) || (lookup == 3465))
+            cout<<"\nPASSED PCS code lookup."<<endl;
+         else
+         {
+            passed =false;
+            cout<<"\nFAILED PCS code lookup."<<endl;
+         }
+      }
+
+      cout<<"\nDone"<<endl;
+      proj = 0;
+   }
+   catch (const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+      passed = false;
+   }
+   
+   if (passed)
+      return 0;
+   return 1;
+}
diff --git a/src/test/ossim-fgdc-txt-doc-test.cpp b/src/test/ossim-fgdc-txt-doc-test.cpp
new file mode 100644
index 0000000..a61e8a1
--- /dev/null
+++ b/src/test/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/src/test/ossim-filename-test.cpp b/src/test/ossim-filename-test.cpp
index e7c9df1..ff81f8d 100644
--- a/src/test/ossim-filename-test.cpp
+++ b/src/test/ossim-filename-test.cpp
@@ -9,18 +9,39 @@
 // ossimFilename class test app.
 // 
 //----------------------------------------------------------------------------
-// $Id: ossimFilenameTest.cpp 14235 2009-04-07 01:18:58Z dburken $
-
-#include <iostream>
-using namespace std;
+// $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";
@@ -157,6 +178,23 @@ int main(int argc, char *argv[])
         << "\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/src/test/ossim-foo.cpp b/src/test/ossim-foo.cpp
index c26a668..2c9de9c 100644
--- a/src/test/ossim-foo.cpp
+++ b/src/test/ossim-foo.cpp
@@ -6,16 +6,14 @@
 //
 // Author:  David Burken
 //
-// Description: Contains application definition "foo" app.
+// Description: Contains application definition "ossim-foo" app.
 //
-// NOTE:  This is supplied for simple quick test.  Makefile links with
-//        libossim so you don't have to muck with that.
-//        DO NOT checkin your test to the svn repository.  Simply
-//        edit foo.cc (Makefile if needed) and run your test.
+// 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.  Enjoy!
+//        keep your working repository up to snuff.
 //
-// $Id$
+// $Id: ossim-foo.cpp 20095 2011-09-14 14:37:26Z dburken $
 //----------------------------------------------------------------------------
 
 #include <ossim/base/ossimArgumentParser.h>
@@ -28,6 +26,7 @@
 // Put your includes here:
 
 #include <iostream>
+#include <sstream>
 using namespace std;
 
 int main(int argc, char *argv[])
diff --git a/src/test/ossim-get-pixel-test.cpp b/src/test/ossim-get-pixel-test.cpp
index a193504..88a6583 100644
--- a/src/test/ossim-get-pixel-test.cpp
+++ b/src/test/ossim-get-pixel-test.cpp
@@ -9,13 +9,18 @@
 // Test code to spit out a pixel value at a given band, line, sample.
 // 
 //----------------------------------------------------------------------------
-// $Id$
+// $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>
@@ -24,56 +29,147 @@
 #include <vector>
 using namespace std;
 
-static void usage()
+static void usage(ossimArgumentParser& ap)
 {
-   cout << "ossim-get-pixel-test <imagefile> <band> <sample> <line>\n"
-        << "Returns pixel value at the given sample and line.\n"
-        << "Notes:\n"
-        << "Band, line and sample are zero based.\n"
-        << "Use an \"a\" for <band> if you want to see all bands.\n"
-        << endl;
+   // 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[])
 {
-   ossimInit::instance()->initialize(argc, argv);
+   // Initialize:
+   ossimArgumentParser ap(&argc, argv);
+   ossimInit::instance()->addOptions(ap);
+   ossimInit::instance()->initialize(ap);
 
-   if (argc != 5)
+   // Argument check:
+   if ( (ap.argc() < 5) || ap.read("-h") || ap.read("--help") )
    {
-      usage();
+      usage(ap);
       return 1;
    }
 
-   ossimFilename imageFile = argv[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();
+      usage(ap);
       return 1;
    }
 
    // Open up an image handler.
    ossimRefPtr<ossimImageHandler> ih
       = (ossimImageHandler*)ossimImageHandlerRegistry::instance()->open( imageFile );
-   if ( !ih )
+   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" )
    {
-      ossim_uint32 bands = ih->getNumberOfOutputBands();
-      for ( ossim_int32 band = 0; band < bands; ++band)
+      for ( ossim_uint32 band = 0; band < BANDS; ++band)
       {
-         bandList.push_back(band);
+         if ( addBand( band, BANDS, bandList ) == false )
+         {
+            return 1;
+         }
       }
    }
    else
    {
-      bandList.push_back( bandString.toUInt32() );
+      ossim_int32 band = bandString.toUInt32();
+      if ( addBand( band, BANDS, bandList ) == false )
+      {
+         return 1;
+      }
    }
       
    ossimIpt pt;
@@ -99,9 +195,24 @@ int main(int argc, char *argv[])
    }
    else
    {
-      cout << "getTile request failed!" << endl;
+      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/src/test/ossim-gpt-test.cpp b/src/test/ossim-gpt-test.cpp
index 5d049a4..d3d803c 100644
--- a/src/test/ossim-gpt-test.cpp
+++ b/src/test/ossim-gpt-test.cpp
@@ -9,7 +9,7 @@
 // Description: Test code for ossimGpt class.
 // 
 //----------------------------------------------------------------------------
-// $Id$
+// $Id: ossim-gpt-test.cpp 19751 2011-06-13 15:13:07Z dburken $
 
 #include <iostream>
 using namespace std;
diff --git a/src/test/ossim-gsd-test.cpp b/src/test/ossim-gsd-test.cpp
index f8877c2..1eba9cb 100644
--- a/src/test/ossim-gsd-test.cpp
+++ b/src/test/ossim-gsd-test.cpp
@@ -13,7 +13,7 @@
 // decimal degrees.
 // 
 //----------------------------------------------------------------------------
-// $Id$
+// $Id: ossim-gsd-test.cpp 19751 2011-06-13 15:13:07Z dburken $
 
 #include <ossim/init/ossimInit.h>
 #include <ossim/base/ossimDpt.h>
diff --git a/src/test/ossim-histo-compare.cpp b/src/test/ossim-histo-compare.cpp
new file mode 100644
index 0000000..508ada4
--- /dev/null
+++ b/src/test/ossim-histo-compare.cpp
@@ -0,0 +1,229 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Oscar Kramer
+//
+// Description:
+//
+// Command line application "ossim-histo-compare" to evaluate differences between histograms.
+//
+//----------------------------------------------------------------------------
+// $Id: ossim-histo-compare.cpp 19751 2011-06-13 15:13:07Z dburken $
+
+#include <ossim/ossimConfig.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+#include <cstdio>
+#include <cstdlib> /* for exit */
+
+//*************************************************************************************************
+// FINALIZE -- Convenient location for placing debug breakpoint for catching program exit.
+//*************************************************************************************************
+void finalize(int code)
+{
+   exit (code);
+}
+
+//*************************************************************************************************
+// MAIN
+//*************************************************************************************************
+int main(int argc, char* argv[])
+{
+   ossimString tempString;
+   double tempDouble, tempDouble2;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+   ossimArgumentParser::ossimParameter doubleParam(tempDouble);
+   ossimArgumentParser::ossimParameter doubleParam2(tempDouble2);
+
+   ossimArgumentParser argumentParser(&argc, argv);
+   ossimInit::instance()->addOptions(argumentParser);
+   ossimInit::instance()->initialize(argumentParser);
+
+   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
+   argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName()+
+      " compares two ossim histogram files and presents statistics about differences. The return "
+      "value is 0 if histograms are within difference tolerances and 1 if not.");
+   argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName()+
+      " [options] <path_to/image1.his> <path_to/image2.his>");
+   argumentParser.getApplicationUsage()->addCommandLineOption("--tolerance | -t <max_diff_percent>", 
+      "Tolerance (0.0 - 100.0) as percent of difference to total bin population. If any bin's "
+      "count difference is found to exceed <max_diff_percent>, the comparison will fail.");
+   argumentParser.getApplicationUsage()->addCommandLineOption("--max-sigma | -s <sigma>",
+      "Tolerance in standard deviation from 0 mean difference. If the mean RSS of all"
+      "differences is greater that <sigma>, the comparison will fail.");
+
+   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help", 
+      "Shows help");
+
+   if(argumentParser.read("-h") || argumentParser.read("--help"))
+   {
+      argumentParser.getApplicationUsage()->write(std::cout);
+      finalize(0);
+   }
+
+   if ( argumentParser.read("--version") || argumentParser.read("-v"))
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)<< argumentParser.getApplicationName().c_str() << " " 
+         << ossimInit::instance()->instance()->version().c_str()<< std::endl;
+      finalize(0);
+   }
+
+   // Fetch command line options:
+   double tolerance = .5; // % default (= 0.005)
+   if (argumentParser.read("--tolerance", doubleParam) || argumentParser.read("-t", doubleParam))
+      tolerance = tempDouble/100.0;
+
+   double max_sigma = 0.05;  
+   if (argumentParser.read("--max-sigma", doubleParam) || argumentParser.read("-s", doubleParam))
+      max_sigma = tempDouble;
+
+   // Handle bad command line:
+   argumentParser.reportRemainingOptionsAsUnrecognized();
+   if (argumentParser.errors())
+   {
+      argumentParser.writeErrorMessages(std::cout);
+      finalize(1);
+   }
+   if(argumentParser.argc() < 3)
+   {
+      argumentParser.getApplicationUsage()->write(std::cout);
+      finalize(1);
+   }
+
+   // Establish the two histogram objects from files:
+   ossimFilename histofile1(argv[1]);
+   ossimRefPtr<ossimMultiResLevelHistogram> mrl_histo1 = new ossimMultiResLevelHistogram;
+   bool success = mrl_histo1->importHistogram(histofile1);
+   if (!success)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)<< argumentParser.getApplicationName().c_str() 
+         << ": Error encountered establishing histogram from <"<<histofile1<<">. Failed."<<endl;
+      finalize(1);
+   }
+
+   ossimFilename histofile2(argv[2]);
+   ossimRefPtr<ossimMultiResLevelHistogram> mrl_histo2 = new ossimMultiResLevelHistogram;
+   success = mrl_histo2->importHistogram(histofile2);
+   if (!success)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)<< argumentParser.getApplicationName().c_str() 
+         << ": Error encountered establishing histogram from <"<<histofile2<<">. FAILED."<<endl;
+      finalize(1);
+   }
+
+   // Check that number of R-levels and bands match:
+   ossim_uint32 nlevels1 = mrl_histo1->getNumberOfResLevels();
+   ossim_uint32 nlevels2 = mrl_histo2->getNumberOfResLevels();
+   if (nlevels1 != nlevels2)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)<< argumentParser.getApplicationName().c_str()
+         << ": Number of resolution levels does not match. FAILED."<<endl;
+      finalize(1);
+   }
+   ossim_uint32 nbands1  = mrl_histo1->getNumberOfBands();
+   ossim_uint32 nbands2  = mrl_histo2->getNumberOfBands();
+   if (nbands1 != nbands2)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)<< argumentParser.getApplicationName().c_str() 
+         << ": Number of bands does not match. FAILED."<<endl;
+      finalize(1);
+   }
+
+   // Loop over each R-level and band:
+   bool failed = false;
+   for (ossim_uint32 rlevel=0; rlevel<nlevels1; ++rlevel)
+   {
+      for (ossim_uint32 band=0; band<nbands1; ++band)
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)<< "\n  Comparing R-level: "<<rlevel<<",  Band: "<<band
+            <<endl;
+
+         // Establish the histogram objects for this R-level and band:
+         const ossimRefPtr<ossimHistogram> histo1 = mrl_histo1->getHistogram(band, rlevel);
+         const ossimRefPtr<ossimHistogram> histo2 = mrl_histo2->getHistogram(band, rlevel);
+
+         float min_val = histo1->GetMinVal();
+         float max_val = histo1->GetMaxVal();
+         float del_val = histo1->GetBucketSize();
+         std::vector<double> norm_diffs;
+         ossim_uint32 diff, count1, count2;
+         double norm_diff;
+
+         // Loop over all bins to collect all differences:
+         for (float val=min_val; val<=max_val; val+=del_val)
+         {
+            count1 = (ossim_uint32) histo1->GetCount(val);
+            count2 = (ossim_uint32) histo2->GetCount(val);
+            diff = abs((int)(count1 - count2));
+ 
+            if (count1 != 0)
+               norm_diff = (double) diff / count1;
+            else if (count2 != 0)
+               norm_diff = (double) diff / count2;
+            else
+               norm_diff = 0.0;
+
+            norm_diffs.push_back(100.0 * norm_diff);
+         }
+
+         // Check trivial case:
+         if (norm_diffs.size() == 0)
+         {
+            ossimNotify(ossimNotifyLevel_FATAL)<< argumentParser.getApplicationName().c_str() 
+               << ": No samples found!. FAILED."<< endl;
+            finalize(1);
+         }
+
+         // Compute statistics on differences:
+         double accum=0;
+         std::vector<double>::iterator i = norm_diffs.begin();
+         while (i != norm_diffs.end())
+         {
+            accum += *i;
+            ++i;
+         }
+         double mean = accum / (double) norm_diffs.size();
+         accum=0;
+         i = norm_diffs.begin();
+         while (i != norm_diffs.end())
+         {
+            accum += (*i - mean) * (*i - mean);
+            ++i;
+         }
+         double sigma = sqrt(accum) / (double) norm_diffs.size();
+
+         // Output mean and sigma for this histo comparison:
+         ossimNotify(ossimNotifyLevel_FATAL)<<"    Mean normalized difference: "<<mean<<" +- "<<sigma<<endl;
+
+         // Do tolerance test:
+         if (mean > tolerance)
+         {
+            ossimNotify(ossimNotifyLevel_FATAL)<<"    Found mean difference of "<<mean
+               <<"%. FAILED tolerance test."<<endl;
+            failed = true;
+         }
+         if (sigma > max_sigma)
+         {
+            ossimNotify(ossimNotifyLevel_FATAL)<<"    Computed sigma of "<<sigma
+               <<". FAILED sigma test."<<endl;
+            failed = true;
+         }
+      }
+   }
+
+   // Return with pass/fail code:
+   if (!failed)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)<< "\n  PASSED"<<endl;
+      finalize(0);
+   }
+   ossimNotify(ossimNotifyLevel_FATAL)<< "\n  FAILED"<<endl;
+   finalize(1);
+}
+
diff --git a/src/test/ossim-image-chain-test.cpp b/src/test/ossim-image-chain-test.cpp
new file mode 100644
index 0000000..8907fb5
--- /dev/null
+++ b/src/test/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/src/test/ossim-image-elevation-test.cpp b/src/test/ossim-image-elevation-test.cpp
new file mode 100644
index 0000000..6e7c0fa
--- /dev/null
+++ b/src/test/ossim-image-elevation-test.cpp
@@ -0,0 +1,98 @@
+//----------------------------------------------------------------------------
+//
+// 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/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/src/test/ossim-image-geometry-test.cpp b/src/test/ossim-image-geometry-test.cpp
index 5b9db12..a44aa07 100644
--- a/src/test/ossim-image-geometry-test.cpp
+++ b/src/test/ossim-image-geometry-test.cpp
@@ -12,7 +12,7 @@
 // used.
 // 
 //----------------------------------------------------------------------------
-// $Id$
+// $Id: ossim-image-geometry-test.cpp 22201 2013-03-20 00:53:33Z dburken $
 
 #include <iostream>
 #include <iomanip>
@@ -106,7 +106,7 @@ int main(int argc, char *argv[])
 
    cout << "image_file:  " << imageFile << "\n";
 
-   cout << "date_yyyymmdd: " << getDate().c_str() << "\n"; 
+   // cout << "date_yyyymmdd: " << getDate().c_str() << "\n"; 
    
    // Get the entry list:
    std::vector<ossim_uint32> entryList;
@@ -288,6 +288,19 @@ int main(int argc, char *argv[])
             << 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.
diff --git a/src/test/ossim-image-handler-test.cpp b/src/test/ossim-image-handler-test.cpp
index 4fbcab2..61f93da 100644
--- a/src/test/ossim-image-handler-test.cpp
+++ b/src/test/ossim-image-handler-test.cpp
@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
    
    if(argc > 1)
    {
-      for(idx = 1; idx < argc; ++idx)
+      for(idx = 1; idx < static_cast<ossim_uint32>(argc); ++idx)
       {
          ossimRefPtr<ossimImageHandler> handler = ossimImageHandlerRegistry::instance()->openBySuffix(ossimFilename(argv[idx]));
          
@@ -71,4 +71,4 @@ int main(int argc, char *argv[])
       }
    }
    return 0;
-}
\ No newline at end of file
+}
diff --git a/src/test/ossim-image-writer-test.cpp b/src/test/ossim-image-writer-test.cpp
index c422631..37a56e8 100644
--- a/src/test/ossim-image-writer-test.cpp
+++ b/src/test/ossim-image-writer-test.cpp
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
    }
    if(argc > 1)
    {
-      for(idx = 1; idx < argc; ++idx)
+      for(idx = 1; static_cast<ossim_int32>(idx) < argc; ++idx)
       {
          ossimRefPtr<ossimImageFileWriter> writer = ossimImageWriterFactoryRegistry::instance()->createWriter(ossimFilename(argv[idx]));
          
diff --git a/src/test/ossim-info-test.cpp b/src/test/ossim-info-test.cpp
new file mode 100644
index 0000000..0c11d05
--- /dev/null
+++ b/src/test/ossim-info-test.cpp
@@ -0,0 +1,71 @@
+//----------------------------------------------------------------------------
+//
+// 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/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/src/test/ossim-jobqueue-test.cpp b/src/test/ossim-jobqueue-test.cpp
new file mode 100644
index 0000000..e3d7fb3
--- /dev/null
+++ b/src/test/ossim-jobqueue-test.cpp
@@ -0,0 +1,77 @@
+#include <ossim/parallel/ossimJob.h>
+#include <ossim/parallel/ossimJobQueue.h>
+#include <ossim/parallel/ossimJobThreadQueue.h>
+#include <ossim/parallel/ossimJobMultiThreadQueue.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/init/ossimInit.h>
+#include <OpenThreads/Thread>
+#include <iostream>
+static const int INITIAL_THREADS = 10;
+static const int INITIAL_JOBS = 20;
+class ossimTestJob : public ossimJob
+{
+public:
+   ossimTestJob(const ossimString& name)
+   :ossimJob()
+   {
+      setName(name);
+   }
+   virtual void start()
+   {
+   }
+};
+
+class ossimTestJobCallback : public ossimJobCallback
+{
+public:
+   ossimTestJobCallback()
+   {
+   }
+   virtual void started(ossimJob* job)
+   {
+      std::cout << "I HAVE STARTED THE Job " << job->name() << "\n";
+   }
+   virtual void finished(ossimJob* job)
+   {
+      std::cout << "I HAVE FINISHED THE Job " << job->name() << "\n";
+   }
+   virtual void canceled(ossimJob* job)
+   {
+      std::cout << "I HAVE CANCELED THE Job " << job->name() << "\n";
+   }
+   
+};
+
+int main(int argc, char *argv[])
+{
+   ossimArgumentParser ap(&argc, argv);
+   ossimInit::instance()->addOptions(ap);
+   ossimInit::instance()->initialize(ap);
+   
+   ossimRefPtr<ossimJobQueue> q = new ossimJobQueue();
+   ossimRefPtr<ossimJobMultiThreadQueue> threadQueue = new ossimJobMultiThreadQueue(q.get(), INITIAL_THREADS);
+   ossimRefPtr<ossimTestJobCallback> callback = new ossimTestJobCallback();
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx < INITIAL_JOBS; ++idx)
+   {
+      ossimRefPtr<ossimTestJob> job = new ossimTestJob(ossimString::toString(idx+1));
+      job->setCallback(callback.get());
+      job->ready();
+      q->add(job.get());
+   }
+   
+   // FOREVER loop until all jobs are completed.
+   while(true)
+   {
+      if ( OpenThreads::Thread::microSleep(250) == 0 )
+      {
+         if ( threadQueue->hasJobsToProcess() == false )
+         {
+            break;
+         }
+      }
+   }
+   
+   return 0;
+}
diff --git a/src/test/ossim-loadtile-test.cpp b/src/test/ossim-loadtile-test.cpp
new file mode 100644
index 0000000..d2bf12b
--- /dev/null
+++ b/src/test/ossim-loadtile-test.cpp
@@ -0,0 +1,115 @@
+//----------------------------------------------------------------------------
+//
+// 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 )
+            {
+               cerr << "bin[" << i << "]: count = " << count
+                    << "\nShould be 256..." << endl;
+               status = FAILED;
+               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/src/test/ossim-lsr-space-test.cpp b/src/test/ossim-lsr-space-test.cpp
index a62dea6..7310f38 100644
--- a/src/test/ossim-lsr-space-test.cpp
+++ b/src/test/ossim-lsr-space-test.cpp
@@ -10,7 +10,7 @@
 // relationship between a local space rectangular (LSR) coordinate system
 // and the earth-centered, earth-fixed (ECEF) system.
 //
-// $Id$
+// $Id: ossim-lsr-space-test.cpp 19751 2011-06-13 15:13:07Z dburken $
 //----------------------------------------------------------------------------
 
 #include <iostream>
diff --git a/src/test/ossim-mask-filter-test.cpp b/src/test/ossim-mask-filter-test.cpp
index d3f8fa3..7dba6a2 100644
--- a/src/test/ossim-mask-filter-test.cpp
+++ b/src/test/ossim-mask-filter-test.cpp
@@ -11,7 +11,7 @@
 // Description: Test application for ossimMaskFilter.
 // 
 //----------------------------------------------------------------------------
-// $Id$
+// $Id: ossim-mask-filter-test.cpp 21631 2012-09-06 18:10:55Z dburken $
 
 #include <iostream>
 using namespace std;
@@ -23,6 +23,7 @@ using namespace std;
 #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>
@@ -130,8 +131,10 @@ int main(int argc, char* argv[])
             
             ossimRefPtr<ossimMaskFilter> maskFlt = new ossimMaskFilter();
             maskFlt->setMaskType(mask_type);
-            maskFlt->connectMyInputTo(0, inputImg.get());
-            maskFlt->connectMyInputTo(1, inputShp.get());
+            maskFlt->connectMyInputTo( 0, inputImg.get() );
+            // maskFlt->connectMyInputTo(1, inputShp.get());
+            maskFlt->setMaskSource( inputShp.get() );
+            maskFlt->initialize();
             
             ossimRefPtr<ossimImageFileWriter> writer =
                ossimImageWriterFactoryRegistry::instance()->
diff --git a/src/test/ossim-notify-test.cpp b/src/test/ossim-notify-test.cpp
index a66330a..3e73138 100755
--- a/src/test/ossim-notify-test.cpp
+++ b/src/test/ossim-notify-test.cpp
@@ -9,7 +9,7 @@
 // ossimNotify functions test.
 // 
 //----------------------------------------------------------------------------
-// $Id: ossimFilenameTest.cpp 14235 2009-04-07 01:18:58Z dburken $
+// $Id: ossim-notify-test.cpp 22148 2013-02-11 17:59:14Z dburken $
 
 #include <iostream>
 using namespace std;
@@ -35,8 +35,17 @@ int main(int argc, char *argv[])
 
    ossimGetLogFilename(logFile);
 
-   cout << "set logFile end of test: " << logFile
-        << endl;
+   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/src/test/ossim-pixel-flipper-test.cpp b/src/test/ossim-pixel-flipper-test.cpp
new file mode 100644
index 0000000..546724b
--- /dev/null
+++ b/src/test/ossim-pixel-flipper-test.cpp
@@ -0,0 +1,144 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description: Contains application definition "foo" app.
+//
+// NOTE:  This is supplied for simple quick test.  Makefile links with
+//        libossim so you don't have to muck with that.
+//        DO NOT checkin your test to the svn repository.  Simply
+//        edit foo.cc (Makefile if needed) 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.  Enjoy!
+//
+// $Id: ossim-pixel-flipper-test.cpp 22197 2013-03-12 02:00:55Z dburken $
+//----------------------------------------------------------------------------
+
+#include <ossim/base/ossimCommon.h>  
+#include <ossim/base/ossimRefPtr.h> 
+#include <ossim/base/ossimException.h> 
+#include <ossim/base/ossimNotify.h> 
+#include <ossim/init/ossimInit.h>
+#include <iostream>
+#include <stdio.h>
+#include <stdlib.h>
+
+
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimPixelFlipper.h>
+
+static int expected_0[] = {0,0,0,0,255,0,0,255,255,5,5,5,5,255,5,128,255,255};
+static int expected_1[] = {11,11,11,11,255,11,11,255,255,11,11,11,11,255,11,128,255,255};
+static int expected_2[] = {0,0,0,11,255,11,11,255,255,5,5,5,11,255,11,128,255,255};
+static int expected_3[] = {0,0,0,11,11,11,11,11,11,5,5,5,11,11,11,128,255,255};
+static int expected_4[] = {11,11,11,0,255,0,0,255,255,11,11,11,5,255,5,128,255,255};
+static int expected_5[] = {8,8,8,8,200,8,8,200,200,8,8,8,8,200,8,128,200,200};
+static int expected_6[] = {11,11,11,11,11,11,11,11,11,8,8,8,8,200,8,128,200,200};
+
+//*************************************************************************************************
+void showPixels(const ossimRefPtr<ossimImageData> tile, const int* expected_values)
+{
+   int j = 0;
+   for (int i=0; i<6; i++)
+   {
+      int r = (int) tile->getPix(i, 0);
+      int g = (int) tile->getPix(i, 1);
+      int b = (int) tile->getPix(i, 2);
+
+      // bool correct = true;
+      if ((r==expected_values[j])&&(g==expected_values[j+1])&&(b==expected_values[j+2]))
+      {
+         cout << "  PASSED ["<<i<<"] = "<<r<<", "<<g<<", "<<b<<endl;
+      }
+      else
+      {
+         cout << "  FAILED ["<<i<<"] = "<<r<<", "<<g<<", "<<b<<" -- expected "
+            <<expected_values[j]<<", "<<expected_values[j+1]<<", "<<expected_values[j+2]
+         <<endl;
+      }
+      j += 3;
+   }
+}
+
+//*************************************************************************************************
+int main(int argc, char *argv[])
+{
+   try
+   {
+      ossimInit::instance()->initialize(argc, argv);
+      ossimFilename fname ("PixelFlipperTestChip.tif");
+      ossimRefPtr<ossimImageHandler> handler = ossimImageHandlerRegistry::instance()->open(fname);
+      vector<ossimIpt> valid_vertices;
+      valid_vertices.push_back(ossimIpt(0,0));
+      valid_vertices.push_back(ossimIpt(127,0));
+      valid_vertices.push_back(ossimIpt(127,127));
+      valid_vertices.push_back(ossimIpt(0,127));
+      handler->writeValidImageVertices(valid_vertices);
+
+      // Fetch raw tile:
+      ossimRefPtr<ossimPixelFlipper> flipper = new ossimPixelFlipper();  
+      ossimIrect tile_rect(0,0,127,127);
+      flipper->connectMyInputTo(handler.get());
+      ossimRefPtr<ossimImageData> tile = handler->getTile(tile_rect);
+      cout<<"\nRaw Tile:"<<endl;
+      showPixels(tile, expected_0);
+
+      // Target Replacement:
+      flipper->setTargetRange(0, 10);  
+      flipper->setReplacementValue(11);
+      flipper->setReplacementMode(ossimPixelFlipper::REPLACE_BAND_IF_TARGET);
+      tile = flipper->getTile(tile_rect);
+      cout<<"\nTarget Replacement REPLACE_BAND_IF_TARGET:"<<endl;
+      showPixels(tile, expected_1);
+
+      // Target Replacement:
+      flipper->setTargetRange(0, 10);  
+      flipper->setReplacementMode(ossimPixelFlipper::REPLACE_BAND_IF_PARTIAL_TARGET);
+      tile = flipper->getTile(tile_rect);
+      cout<<"\nTarget Replacement REPLACE_BAND_IF_PARTIAL_TARGET:"<<endl;
+      showPixels(tile, expected_2);
+
+      // Target Replacement:
+      flipper->setTargetRange(0, 10);  
+      flipper->setReplacementMode(ossimPixelFlipper::REPLACE_ALL_BANDS_IF_PARTIAL_TARGET);
+      tile = flipper->getTile(tile_rect);
+      cout<<"\nTarget Replacement REPLACE_ALL_BANDS_IF_PARTIAL_TARGET:"<<endl;
+      showPixels(tile, expected_3);
+
+      // Target Replacement:
+      flipper->setTargetRange(0, 10);  
+      flipper->setReplacementMode(ossimPixelFlipper::REPLACE_ONLY_FULL_TARGETS);
+      tile = flipper->getTile(tile_rect);
+      cout<<"\nTarget Replacement REPLACE_ONLY_FULL_TARGETS:"<<endl;
+      showPixels(tile, expected_4);
+
+      // Clamping:
+      flipper->setClampValues(8, 200);  
+      tile = flipper->getTile(tile_rect);
+      cout<<"\nClamping:"<<endl;
+      showPixels(tile, expected_5);
+
+      // Valid Vertices:
+      valid_vertices.clear();
+      valid_vertices.push_back(ossimIpt(3,0));
+      valid_vertices.push_back(ossimIpt(127,0));
+      valid_vertices.push_back(ossimIpt(127,127));
+      valid_vertices.push_back(ossimIpt(3,127));
+      handler->writeValidImageVertices(valid_vertices);
+      flipper->initialize();
+      flipper->setClipMode(ossimPixelFlipper::VALID_VERTICES);
+      tile = flipper->getTile(tile_rect);
+      cout<<"\nValid Vertices (with clamping):"<<endl;
+      showPixels(tile, expected_6);
+   }
+   catch (const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << e.what() << std::endl;
+   }
+
+   cout << "FINISHED" << endl;
+   return 0;
+}
diff --git a/src/test/ossim-point-test.cpp b/src/test/ossim-point-test.cpp
index 430a3dc..522d768 100644
--- a/src/test/ossim-point-test.cpp
+++ b/src/test/ossim-point-test.cpp
@@ -5,7 +5,7 @@
 // See LICENSE.txt file in the top level directory for more details.
 //
 //----------------------------------------------------------------------------
-// $Id$
+// $Id: ossim-point-test.cpp 19751 2011-06-13 15:13:07Z dburken $
 
 #include <string>
 #include <iostream>
@@ -116,14 +116,14 @@ int main()
    std::string es1("(1.0,2.0,3.0)");
    ossimEcefPoint ep1;
    ep1.toPoint(es1);
-   std::string es2 = ep1.toString(10);
+   std::string es2 = ep1.toString(10).string();
 
    //---
    // Test ossimEcefPoint toString and toPoint methods.
    //---
    ossimEcefVector ev1;
    ev1.toPoint(es1);
-   std::string es3 = ev1.toString(10);
+   std::string es3 = ev1.toString(10).string();
   
    std::cout
       << "\nis1:       " << is1
diff --git a/src/test/ossim-projection-factory-test.cpp b/src/test/ossim-projection-factory-test.cpp
index 41fe657..ab5eee1 100644
--- a/src/test/ossim-projection-factory-test.cpp
+++ b/src/test/ossim-projection-factory-test.cpp
@@ -7,7 +7,7 @@
 // Description: Test application to spit out projection names from the
 // projection factory registry.
 //
-// $Id$
+// $Id: ossim-projection-factory-test.cpp 19751 2011-06-13 15:13:07Z dburken $
 //----------------------------------------------------------------------------
 
 #include <vector>
diff --git a/src/test/ossim-projection-test.cpp b/src/test/ossim-projection-test.cpp
new file mode 100644
index 0000000..0f9dad1
--- /dev/null
+++ b/src/test/ossim-projection-test.cpp
@@ -0,0 +1,75 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description: Test application to for projection classes.
+//
+//----------------------------------------------------------------------------
+// $Id: ossim-projection-test.cpp 2777 2011-06-27 19:14:17Z david.burken $
+
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+
+#include <vector>
+#include <iostream>
+#include <fstream>
+using namespace std;
+
+
+int main(int argc, char* argv[])   
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+   ossimRefPtr<ossimMapProjection> proj1 = new ossimEquDistCylProjection();
+
+   cout << "\n\nproj1 orgin=(0,0):\n";
+   proj1->print(cout);
+
+   ossim_float64 dpp = 1.0/3600.0; // Degrees per pixel.
+   ossimDpt scale(dpp, dpp);
+   proj1->setDecimalDegreesPerPixel(scale);
+   cout << "\n\nproj1 after setDecimalDegreesPerPixel(0.000277778, 0.000277778):\n";
+   proj1->print(cout);
+
+   ossimGpt origin(38.0, -123.0, 0.0);
+   proj1->setOrigin(origin);
+
+   cout << "\n\nproj1 after setOrgin=(38, -123):\n";
+   proj1->print(cout);
+
+   proj1->setDecimalDegreesPerPixel(scale);
+   cout << "\n\nproj1 after setDecimalDegreesPerPixel(0.000277778, 0.000277778) with origin lat of 38N:\n";
+   proj1->print(cout);
+
+   ossimRefPtr<ossimMapProjection> proj2 =  static_cast<ossimMapProjection*>(proj1->dup());
+   cout << "\n\nproj2 a dup of proj1:\n";
+   proj2->print(cout);
+
+   ossimKeywordlist kwl;
+   proj2->saveState(kwl);
+
+   cout << "\n\nproj2 save state:\n"
+        << kwl << endl;
+
+   ossimRefPtr<ossimProjection> proj3 = ossimProjectionFactoryRegistry::instance()->
+      createProjection(kwl);
+   cout << "\n\nproj3 created from proj2's saveState via ossimProjectionFactoryRegistry::createProjection\n";
+   if ( proj3.valid() )
+   {
+      proj3->print(cout);
+   }
+
+   ossimRefPtr<ossimMapProjection> proj4 = new ossimEquDistCylProjection();
+   proj4->loadState(kwl);
+   
+   cout << "\n\nproj4 from proj2 save state via ossimEquDistCylProjection::loadState:\n";
+   proj4->print(cout);
+   
+   return 0;
+}
diff --git a/src/test/ossim-read-write-consistency-test.cpp b/src/test/ossim-read-write-consistency-test.cpp
new file mode 100644
index 0000000..ced4c4c
--- /dev/null
+++ b/src/test/ossim-read-write-consistency-test.cpp
@@ -0,0 +1,116 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// File: ossim-mda-test.cpp
+//
+// Author:  Oscar Kramer
+//
+// Tests MDA format reading and writing. Given an original MDA file, a chain is created
+// with an MDA reader on the left end and an MDA writer on the right with a simple sequencer 
+// in between. An output file is written to disk then read back in with a new handler instance.
+// The test is successful only if both handlers are equal (minus the filename).
+// 
+// $Id$
+//----------------------------------------------------------------------------
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimConstants.h>  // ossim contants...
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/init/ossimInit.h>
+
+// Put your includes here:
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimImageSourceSequencer.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+#include <iostream>
+#include <sstream>
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+   ossimArgumentParser ap(&argc, argv);
+   ossimInit::instance()->addOptions(ap);
+   ossimInit::instance()->initialize(ap);
+
+   try
+   {
+      if (argc < 2)
+         ossimException ("Need an input original image filename. Cannot continue.");
+
+      ossimFilename orig_fname (argv[1]);
+      if (!orig_fname.isReadable())
+         ossimException ("Filename specified is not readable. Cannot continue.");
+
+      // Open the original input file using factory (includes plugins)
+      ossimRefPtr<ossimImageHandler> handler1 = ossimImageHandlerRegistry::instance()->open(orig_fname);
+      if (!handler1.valid())
+         ossimException ("Could not open input file. Cannot continue.");
+
+      handler1->print(cout); //###
+
+      // Fetch image parameters needed for write:
+      ossimIrect image_rect (handler1->getBoundingRect());
+      // int num_rlevels = handler1->getNumberOfDecimationLevels();
+
+      // Establish a sequencer to loop through all tiles:
+      ossimRefPtr<ossimImageSourceSequencer> sequencer = new ossimImageSourceSequencer;
+      sequencer->connectMyInputTo(handler1.get());
+
+      // Establish an output filename based on the input name:
+      ossimFilename output_fname (orig_fname.noExtension());
+      output_fname += "-RWTestOut";
+      output_fname.setExtension(orig_fname.ext());
+
+      // Establish the associated writer object using factory scheme. This should pick up the 
+      // corresponding writer but no guaranties:
+      ossimRefPtr<ossimImageFileWriter> writer = 
+         ossimImageWriterFactoryRegistry::instance()->createWriterFromExtension(output_fname.ext());
+      if (!writer.valid())
+         ossimException ("Could not create a writer object for this image file extension. Cannot continue.");
+
+      // Connect the writer to the chain and write the file:
+      writer->setOutputName(output_fname);
+      writer->connectMyInputTo(sequencer.get());
+      bool write_successful = writer->execute();
+      if (!write_successful)
+         ossimException ("Error encountered writing output image. Cannot continue.");
+
+      // Use the new output file to initialize a new handler to compare against the original handler
+      ossimRefPtr<ossimImageHandler> handler2 = 
+         ossimImageHandlerRegistry::instance()->open(output_fname);
+      if (!handler2.valid())
+         ossimException ("Could not open test output file for comparison. Test failed.");
+
+      // Save the states to KWL -- this is what will be compared. Need to remove the filename
+      // keyword however since that differs:
+      ossimKeywordlist kwl1;
+      handler1->saveState(kwl1);
+      kwl1.removeKeysThatMatch(ossimKeywordNames::FILENAME_KW);
+      
+      ossimKeywordlist kwl2;
+      handler2->saveState(kwl2);
+      kwl2.removeKeysThatMatch(ossimKeywordNames::FILENAME_KW);
+
+      if (kwl1 == kwl2)
+      {
+         cout << "OSSIM successfully read and wrote image format associated with file <"
+            << orig_fname << ">. Test PASSED." << endl;
+      }
+      else
+      {
+         ossimException ("Differences found between reader and writer. Test FAILED.");
+      }
+   }
+   catch (const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+      return 1;
+   }
+   
+   return 0;
+}
diff --git a/src/test/ossim-ref-ptr-test.cpp b/src/test/ossim-ref-ptr-test.cpp
new file mode 100644
index 0000000..869a237
--- /dev/null
+++ b/src/test/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/src/test/ossim-remap-table-test.cpp b/src/test/ossim-remap-table-test.cpp
index 6741abb..ec80c6e 100644
--- a/src/test/ossim-remap-table-test.cpp
+++ b/src/test/ossim-remap-table-test.cpp
@@ -7,7 +7,7 @@
 // Description: Test normalized remap table.
 // 
 //----------------------------------------------------------------------------
-// $Id$
+// $Id: ossim-remap-table-test.cpp 19751 2011-06-13 15:13:07Z dburken $
 
 #include <iostream>
 #include <iomanip>
diff --git a/src/test/ossim-single-image-chain-test.cpp b/src/test/ossim-single-image-chain-test.cpp
index 86b7847..03d0599 100644
--- a/src/test/ossim-single-image-chain-test.cpp
+++ b/src/test/ossim-single-image-chain-test.cpp
@@ -9,21 +9,22 @@
 // Description: Test application for ossimSingleImageChain class.
 // 
 //----------------------------------------------------------------------------
-// $Id$
-
-#include <iostream>
-using namespace std;
+// $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/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[])
 {
@@ -34,6 +35,8 @@ int main(int argc, char* 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)
@@ -47,40 +50,36 @@ int main(int argc, char* argv[])
    ossimRefPtr<ossimSingleImageChain> sic1 = new ossimSingleImageChain();
    if ( sic1->open( ossimFilename(argv[1]) ) )
    {
-      //---
-      // Since we are doing a sequential write disable the end cache
-      // which is only good for displays where you revisit tiles.
-      //
-      // We won't be using a histogram either.
-      //---
-      // sic1->setAddChainCacheFlag(false);
-      // sic1->setAddHistogramFlag(false);
-      sic1->createRenderedChain();
+      // Set up chain:
       
-      sic1->getImageRenderer()->setEnableFlag(false);
+      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)
       {
-#if 0
-         ossimRefPtr<ossimImageGeometry> geom = sic1->getImageGeometry();
-         if (geom.valid())
-         {
-            ossimRefPtr<ossimProjection> proj = geom->getProjection();
-            if ( proj.valid() )
-            {
-               ossimRefPtr<ossimMapProjection> mapProj =
-                  PTR_CAST( ossimMapProjection, proj.get() );
-               if ( mapProj.valid() )
-               {
-                  
-               }
-            }
-         }
-#endif
-         
+         // 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);
@@ -89,9 +88,13 @@ int main(int argc, char* argv[])
             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";
          }
       }
@@ -116,7 +119,13 @@ int main(int argc, char* argv[])
    }
 
    // Create a normal chain.
-   sic1 = new ossimSingleImageChain();
+   sic1 = new ossimSingleImageChain(true,  // addHistogramFlag
+                                    true,  // addResamplerCacheFlag
+                                    true,  // addChainCacheFlag
+                                    false, // remapToEightBitFlag
+                                    false, // threeBandFlag
+                                    false); // threeBandReverseFlag
+   
    if ( sic1->open( ossimFilename(argv[1]) ) )
    {
       sic1->createRenderedChain();
@@ -129,9 +138,6 @@ int main(int argc, char* argv[])
    sic1 = new ossimSingleImageChain();
    if ( sic1->open( ossimFilename(argv[1]) ) )
    {
-      sic1->setAddHistogramFlag(false);
-      sic1->setAddResamplerCacheFlag(false);
-      sic1->setAddChainCacheFlag(false);
       sic1->createRenderedChain();
       ossimKeywordlist kwl;
       sic1->saveState(kwl, 0);
diff --git a/src/test/ossim-single-image-chain-threaded-test.cpp b/src/test/ossim-single-image-chain-threaded-test.cpp
new file mode 100644
index 0000000..1b2a613
--- /dev/null
+++ b/src/test/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/src/test/ossim-string-test.cpp b/src/test/ossim-string-test.cpp
index 3c0b742..c02849b 100644
--- a/src/test/ossim-string-test.cpp
+++ b/src/test/ossim-string-test.cpp
@@ -6,11 +6,14 @@
 //
 // Description: Test app for ossimString class.
 //
-// $Id: ossimStringTest.cpp 9830 2006-10-31 12:52:15Z dburken $
+// $Id: ossim-string-test.cpp 19871 2011-07-26 11:27:01Z gpotts $
 //----------------------------------------------------------------------------
 
 #include <iostream>
 #include <iomanip>
+#include <map>
+#include <utility>
+#include <iterator>
 using namespace std;
 
 #include <ossim/base/ossimString.h>
@@ -180,6 +183,81 @@ void testString()
    os7 = "240";
    ossim_uint8 pix = os7.toUInt8();
    cout << "toUInt8 test: string = 240, result: " << int(pix) << endl;
+
+   ossimString A ("NAD83_Michigan_South_ft");
+   ossimString B ("NAD83 / Michigan South (ft)");
+   ossimString separators ("_ /()");
+   vector<ossimString> AS = A.split(separators,true);
+   vector<ossimString> BS = B.split(separators,true);
+   if (AS == BS)
+      cout << "split test 1: PASSED"<<endl;
+   else
+      cout<<"split test 1: FAILED"<<endl;
+
+   ossimString splitTestBlank("A B  C");
+   std::vector<ossimString> sliptTestBlankResult = splitTestBlank.split(" ", false);
+   std::vector<ossimString> sliptTestBlankResultCompare;
+   sliptTestBlankResultCompare.push_back("A");
+   sliptTestBlankResultCompare.push_back("B");
+   sliptTestBlankResultCompare.push_back("");
+   sliptTestBlankResultCompare.push_back("C");
+   
+   if(sliptTestBlankResult==sliptTestBlankResultCompare)
+   {
+      cout << "split test blank: PASSED"<<endl;
+   }
+   else 
+   {
+      cout << "split test blank: FAILED"<<endl;
+   }
+   ossimString splitTestEnd("A B C");
+   std::vector<ossimString> sliptTestEndResult = splitTestEnd.split(" C", false);
+   std::vector<ossimString> sliptTestEndCompare;
+   sliptTestEndCompare.push_back("A");
+   sliptTestEndCompare.push_back("B");
+   sliptTestEndCompare.push_back("");
+   
+   if(sliptTestEndResult==sliptTestEndCompare)
+   {
+      cout << "split test end: PASSED"<<endl;
+   }
+   else 
+   {
+      cout << "split test end: FAILED"<<endl;
+   }
+   
+   cout << "test of std::map<ossimString, ossimString, ossimStringLtstr>\n";
+   std::map<ossimString, ossimString, ossimStringLtstr> testMap;
+   testMap.insert( std::make_pair(ossimString("red"), ossimString("1")) );
+   testMap.insert( std::make_pair(ossimString("green"), ossimString("2")) );
+   testMap.insert( std::make_pair(ossimString("blue"), ossimString("3")) );
+   std::map<ossimString, ossimString, ossimStringLtstr>::const_iterator i =
+      testMap.find(ossimString("green"));
+
+   if ( i != testMap.end() )
+   {
+      cout << "Found green in map."
+           << "\n(*i).first: " << (*i).first
+           << "\n(*i).second: " << (*i).second
+           << endl;
+   }
+   else
+   {
+      cout << "test of std::map<ossimString, ossimString, ossimStringLtstr> FAILED\n";
+   }
+   
+   ossimString testCompare = "test";
+   bool compareEquals1 = testCompare == "test";
+   bool compareEquals2 = "test" == testCompare;
+   
+   if(!compareEquals1)
+   {
+      std::cout<<"test of ossimString == const char* FAILED\n";
+   }
+   if(!compareEquals2)
+   {
+      std::cout<<"test of const char* == ossimString FAILED\n";
+   }
 }
 
 void testRegularExpression()
@@ -213,6 +291,12 @@ void testRegularExpression()
    aString5 = "dT5";
    cout << "String \"dT5\": " << (reEx.find(aString5.c_str())?"matches":"doesn't match")
         << endl;
+
+   ossimRegExp reEx2("[d|D][t|T][0-9]$");
+
+   aString5 = "n32.dt2";
+   cout << "String \"n32.dt2\": " << (reEx2.find(aString5.c_str())?"matches":"doesn't match")
+        << endl;
 }
 
 int main()
diff --git a/src/test/ossim-test.cpp b/src/test/ossim-test.cpp
index 9fee91d..ffff2c9 100644
--- a/src/test/ossim-test.cpp
+++ b/src/test/ossim-test.cpp
@@ -6,7 +6,7 @@
 //
 // Description: Test code for generic ossim test.
 //
-// $Id$
+// $Id: ossim-test.cpp 19751 2011-06-13 15:13:07Z dburken $
 //----------------------------------------------------------------------------
 #include <iostream>
 #include <iomanip>
diff --git a/src/test/ossim-threaded-chain-test.cpp b/src/test/ossim-threaded-chain-test.cpp
new file mode 100644
index 0000000..6094b88
--- /dev/null
+++ b/src/test/ossim-threaded-chain-test.cpp
@@ -0,0 +1,221 @@
+//**************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// License:  See top level LICENSE.txt file.
+//
+// Authors:  Oscar Kramer, David Burken
+//
+// Description: Test code for multi-threaded sequencer and associated logic.
+//
+// $Id$
+//**************************************************************************************************
+
+#include <ossim/base/ossimConstants.h>  
+#include <ossim/base/ossimCommon.h>  
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/imaging/ossimSingleImageChain.h>
+#include <ossim/imaging/ossimImageRenderer.h>
+#include <ossim/imaging/ossimFilterResampler.h>
+#include <ossim/parallel/ossimMultiThreadSequencer.h>
+#include <ossim/parallel/ossimMtDebug.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/imaging/ossimImageMosaic.h>
+#include <iostream>
+#include <sstream>
+
+using namespace std;
+
+//**************************************************************************************************
+// USAGE:  ossim-threaded-chain-test <num_threads> <input_file> <output_file>
+//**************************************************************************************************
+int main(int argc, char *argv[])
+{
+   ossimTimer::instance()->setStartTick();
+
+   ossimArgumentParser ap(&argc, argv);
+   ossimInit::instance()->initialize(ap);
+
+   unsigned int tempUint;
+   ossimArgumentParser::ossimParameter uintParam(tempUint);
+   ossimMtDebug* mt_debug = ossimMtDebug::instance();
+   bool chainCacheEnabled=false;
+   if (ap.read("--chain-cache"))
+      chainCacheEnabled = true;
+   if (ap.read("--handler-cache"))
+      mt_debug->handlerCacheEnabled = true;
+   if (ap.read("--faux-input"))
+      mt_debug->handlerUseFauxTile = true;
+   if (ap.read("--shared-handler"))
+      mt_debug->chainSharedHandlers = true;
+   if (ap.read("--seq-debug"))
+      mt_debug->seqDebugEnabled = true;
+   if (ap.read("--timer"))
+      mt_debug->seqMetricsEnabled = true;
+   if (ap.read("--tblocks", uintParam))
+      mt_debug->seqTimedBlocksDt = tempUint;
+   if (ap.read("--cache-size", uintParam))
+      mt_debug->maxTileCacheSize = tempUint;
+
+   // Parse command line "<num_threads> <input_file> <output_file>":
+   if (argc < 2)
+   {
+      cout << "\n   "<< argv[0] << " [options] <image_file> [<output_file.tif>]\n"
+         << "\n Opens up single image chain and writes to output_file using N threads."
+         << "\n If N=0, this indicates a conventional (unthreaded) sequencer will be used."
+         << "\n If no output file is specified, the processed tiles are dumped on the floor."
+         << "\n Only TIFF file output is supported."
+         << "\n"
+         << "\n Options:"
+         << "\n    --threads <int>     Must be nonzero for multi-threading sequencer"
+         << "\n    --shared-handler    Enable shared handlers"
+         << "\n    --handler-cache     Adds cache to handler adaptor (valid only with shared handler)"
+         << "\n    --chain-cache       Inserts cache source in the image chain"
+         << "\n    --faux-input        Use faux input tiles"
+         << "\n    --seq-debug         Enable sequencer debug"
+         << "\n    --timer             Enable sequencer timing metrics"
+         << "\n    --tblocks <msec>    Enable timed blocks at specified interval"
+         << "\n    --cache-size <int>  Specify the max tile cache factor in sequencer"
+         << endl;
+      return 0;
+   }
+   
+   double t1 = (double)ossimTimer::instance()->time_m()/1000.0;
+
+   ossim_uint32  num_threads = 0;
+   if (ap.read("--threads", uintParam))
+      num_threads = tempUint;
+
+   ossimFilename image_file  = argv[1];
+   ossimFilename output_file;
+   if (argc > 2)
+      output_file = argv[2];
+   
+   // Create original chain:
+   ossimRefPtr<ossimSingleImageChain> singleImageChain =
+      new ossimSingleImageChain(false, chainCacheEnabled, false, false, false, false);
+   if (!singleImageChain->open(image_file))
+   {
+      cout<<"\nUnable to open image file at <"<<image_file<<">. Aborting..."<<endl;
+      return 1;
+   }
+   singleImageChain->createRenderedChain();
+   ossimRefPtr<ossimImageRenderer> renderer = singleImageChain->getImageRenderer().get();
+   if (renderer.valid())
+      renderer->getResampler()->setFilterType(ossimFilterResampler::ossimFilterResampler_GAUSSIAN);
+   ossimIrect rect = singleImageChain->getBoundingRect();
+
+   // Create complex chain of chains:
+   ossimRefPtr<ossimImageChain> product_chain = new ossimImageChain;
+   ossimRefPtr<ossimImageMosaic> mosaicObject = new ossimImageMosaic;
+   mosaicObject->connectMyInputTo(singleImageChain.get());
+   singleImageChain->changeOwner(mosaicObject.get());
+   product_chain->addFirst(mosaicObject.get());
+
+   // Make sequencer:
+   ossimRefPtr<ossimMultiThreadSequencer> mts = 0;
+   ossimRefPtr<ossimImageSourceSequencer> seq = 0;
+   ossimRefPtr<ossimImageFileWriter> writer = 0;
+   const char* noyes[2]={"no","yes"};
+   if (num_threads > 0)
+   {
+      // Establish the MT sequencer:
+      mts = new ossimMultiThreadSequencer(product_chain.get(), num_threads);
+      seq = mts.get();
+      cout<<"\nUsing multi-threaded sequencer..."
+         << "\n   Input file:             " << image_file
+         << "\n   Output file:            " << output_file
+         << "\n   Number of threads:      " << num_threads
+         << "\n   Using faux input tiles: " << noyes[(int)mt_debug->handlerUseFauxTile]
+         << "\n   Using shared handler:   " << noyes[(int)mt_debug->chainSharedHandlers]
+         << "\n   Using handler cache:    " << noyes[(int)mt_debug->handlerCacheEnabled]
+         << "\n   Using chain cache:      " << noyes[(int)chainCacheEnabled];
+      if ( mt_debug->seqTimedBlocksDt > 0)
+         cout<< "\n   Using timed blocks:     yes (" << mt_debug->seqTimedBlocksDt<<" ms)";
+      else
+         cout<< "\n   Using timed blocks:     no";
+      cout<<"\n   Sequencer cache size:   " << mts->maxCacheSize() << endl;
+   }
+   else
+   {
+      cout<<"\nUsing conventional (unthreaded) sequencer..."
+         << "\n   Input file:             " << image_file
+         << "\n   Output file:            " << output_file<<endl;
+      seq = new ossimImageSourceSequencer(product_chain.get());
+   }
+
+   if (output_file.empty())
+   {
+      // No writer specified, so simply perform the sequencing here:
+      seq->setToStartOfSequence();
+      ossim_uint32 num_tiles = seq->getNumberOfTiles();
+      ossim_uint32 show_every_n = num_tiles/20;
+      ossim_uint32 percent_complete = 0;
+      ossim_uint32 n = 0;
+      cout << "  0%   \r"<<ends;
+      for (ossim_uint32 tile_idx=0; tile_idx<num_tiles; ++tile_idx)
+      {
+         seq->getNextTile();
+         if (++n >= show_every_n)
+         {
+            percent_complete += 5;
+            cout << "  "<<percent_complete<<"%   \r"<<ends;
+            n = 0;
+         }
+      }
+      cout<<endl;
+   }
+   else
+   {
+      // Make writer object since output file was specified:
+      writer = new ossimTiffWriter();
+      writer->connectMyInputTo(product_chain.get());
+      writer->setOutputName(output_file);
+      writer->changeSequencer( seq.get() );
+      if ( !writer->open( output_file ) )
+      {
+         cout<<"\nUnable to create output file at <"<<output_file<<">. Aborting..."<<endl;
+         return 1;
+      }
+
+      // Add a listener to get percent complete and start:
+      ossimStdOutProgress prog(0, true);
+      writer->addListener(&prog);
+
+      // Write the file:
+      double writeStartTime = ossimTimer::instance()->time_s();
+      writer->execute();
+      double writeStopTime = ossimTimer::instance()->time_s();
+      double writeTime = writeStopTime - writeStartTime;
+      
+      double bps = ((ossim_uint64)output_file.fileSize())/writeTime;
+      double megaBytePerSecond = bps / ((double) 1024*1024);
+      cout << "   Write MB per second:    " << setprecision(3) << megaBytePerSecond << endl;
+   }
+   double t2 = (double)ossimTimer::instance()->time_m()/1000.0;
+
+   if (mts.valid())
+   {
+      cout << "   Max cache used:         "<< mts->d_maxCacheUsed << endl;
+      cout << "   Cache emptied count:    "<< ossimString::toString(mts->d_cacheEmptyCount) << endl;
+   }
+   cout << setprecision(3);
+
+   if (mts.valid())
+   {
+      double jgtt = mts->d_jobGetTileT;
+      double jgttpj = jgtt/num_threads;
+      cout << "   Time waiting on jobs:   "<<mts->d_idleTime2<<" s"<<endl;
+      cout << "   Time waiting on cache:  "<<mts->d_idleTime5<<" s"<<endl;
+      cout << "   Handler getTile T:      "<<mts->handlerGetTileT()<<" s"<<endl;
+      cout << "   Job getTile T:          "<<jgtt<<" s"<<endl;
+      cout << "   Average getTile T/job:  "<<jgttpj<<" s"<<endl;
+   }
+   cout << "   Execution time:         " << t2-t1  << " s" << endl;
+   cout << "   Total time:             " << t2    << " s" << endl;
+
+   writer = 0;
+   return 0;
+}
diff --git a/src/test/ossim-threaded-polyarea2d-test.cpp b/src/test/ossim-threaded-polyarea2d-test.cpp
new file mode 100644
index 0000000..13ca783
--- /dev/null
+++ b/src/test/ossim-threaded-polyarea2d-test.cpp
@@ -0,0 +1,110 @@
+#include <cstdlib> /* for exit */
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimPolyArea2d.h>
+
+#include <OpenThreads/Mutex>
+#include <OpenThreads/Barrier>
+#include <OpenThreads/Thread>
+OpenThreads::Barrier* startBarrier = 0;
+OpenThreads::Barrier* endBarrier = 0;
+class Polyarea2dThread : public OpenThreads::Thread
+{
+public:
+   Polyarea2dThread(const ossimString& threadName)
+   :m_threadName(threadName)
+   {
+      m_numberOfPointsToQuery = 1000000;
+   }
+   void setNumberOfPointsToQuery(ossim_uint32 nPoints)
+   {
+      m_numberOfPointsToQuery = nPoints;
+   }
+   virtual void run()
+   {
+      // let all threads start at the same time
+      startBarrier->block();
+      ossim_uint32 idx = 0;
+      for(idx = 0; idx < m_numberOfPointsToQuery; ++idx)
+      {
+         ossim_float32 t = static_cast<double>(rand())/static_cast<double>(RAND_MAX);
+         ossim_float32 centerx = 10000.0*t; 
+         ossim_float32 centery = 10000.0*t;
+
+         ossimPolyArea2d polyArea1(ossimDrect(centerx-1000,centery-1000,centerx+2000,centery+2000));
+         ossimPolyArea2d polyArea2(ossimDrect(centerx-500,centery-500,centerx+2000,centery+2000));
+
+         ossimPolyArea2d temp1 = polyArea1&polyArea2;
+         ossimPolyArea2d temp2 = polyArea1+polyArea2;
+
+         ossimPolyArea2d temp3(polyArea1);
+         ossimPolyArea2d temp4(polyArea2);
+
+         temp3+=temp1;
+         temp4&=temp3;
+
+ //        ossimGpt gpt(m_minLat + yt*m_latDelta, m_minLon + xt*m_lonDelta);
+      }
+      // let all threads end at the same time
+      endBarrier->block();
+   }
+   
+   ossimString m_threadName;
+   ossim_uint32 m_numberOfPointsToQuery;
+};
+
+int main(int argc, char* argv[])
+{
+   ossimString tempString;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+   ossimArgumentParser argumentParser(&argc, argv);
+   //ossimInit::instance()->addOptions(argumentParser);
+   ossimInit::instance()->initialize(argumentParser);
+   ossim_uint32 threads = 10;
+   ossim_uint32 nvalues = 10;
+   ossim_uint32 randomSeed = 0;
+
+   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
+   argumentParser.getApplicationUsage()->addCommandLineOption("--threads","Specify the number of threads to test simultaneus access to elevation");
+   argumentParser.getApplicationUsage()->addCommandLineOption("--nvalues","Specify the number of random values");
+   if (argumentParser.read("-h") ||
+       argumentParser.read("--help"))
+   {
+      argumentParser.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_WARN));
+      exit(0);
+   }
+   if(argumentParser.read("--threads", stringParam))
+   {
+      threads = tempString.toUInt32();
+   }
+   if(argumentParser.read("--nvalues", stringParam))
+   {
+      nvalues = tempString.toUInt32();
+   }
+
+   std::vector<Polyarea2dThread*> threadList(threads);
+   startBarrier = new OpenThreads::Barrier(threads); // include the main thread for synching
+   endBarrier   = new OpenThreads::Barrier(threads+1); //   include main thread for syncing end 
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx < threads; ++ idx)
+   {
+      threadList[idx] = new Polyarea2dThread("Thread " + ossimString::toString(idx));
+      threadList[idx]->setNumberOfPointsToQuery(nvalues);
+      threadList[idx]->start();
+   }
+   ossimTimer::Timer_t t1 = ossimTimer::instance()->tick();
+   // synch all threads to start at the same time
+   std::cout << "Number of threads:         " << threads      << "\n";
+//   startBarrier->block();
+   endBarrier->block();
+   std::cout << "All threads finished\n";
+   ossimTimer::Timer_t t2 = ossimTimer::instance()->tick();
+   std::cout << "Time elapsed:              " << ossimTimer::instance()->delta_s(t1, t2) << " seconds" << "\n";
+   delete startBarrier;
+   delete endBarrier;
+   return 0;
+}
diff --git a/src/test/ossim-tiff-info-test.cpp b/src/test/ossim-tiff-info-test.cpp
index e32d7d3..1a12c35 100644
--- a/src/test/ossim-tiff-info-test.cpp
+++ b/src/test/ossim-tiff-info-test.cpp
@@ -9,7 +9,7 @@
 // Description: Test app for ossimTiffInfo class.
 // 
 //----------------------------------------------------------------------------
-// $Id$
+// $Id: ossim-tiff-info-test.cpp 19751 2011-06-13 15:13:07Z dburken $
 
 #include <iostream>
 using namespace std;
diff --git a/src/test/ossim-tiled-elevation-test.cpp b/src/test/ossim-tiled-elevation-test.cpp
new file mode 100644
index 0000000..303e69b
--- /dev/null
+++ b/src/test/ossim-tiled-elevation-test.cpp
@@ -0,0 +1,207 @@
+//----------------------------------------------------------------------------
+//
+// 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 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/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("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/src/test/ossim-visitor-test.cpp b/src/test/ossim-visitor-test.cpp
index a67b87f..11d742f 100644
--- a/src/test/ossim-visitor-test.cpp
+++ b/src/test/ossim-visitor-test.cpp
@@ -15,7 +15,7 @@
 //        After completion you can do a "svn revert foo.cpp" if you want to
 //        keep your working repository up to snuff.  Enjoy!
 //
-// $Id$
+// $Id: ossim-visitor-test.cpp 19919 2011-08-09 11:30:59Z gpotts $
 //----------------------------------------------------------------------------
 
 #include <ossim/base/ossimArgumentParser.h>
@@ -78,13 +78,22 @@ int main(int argc, char *argv[])
          connectable3->accept(visitor);
          
          
-         ossimCollectionVisitor::List& collection = visitor.getObjects();
-         ossimCollectionVisitor::List::iterator iter=collection.begin();
-         while(iter != collection.end())
+         ossimCollectionVisitor::ListRef& collection = visitor.getObjects();
+         if(collection.size() == 8)
          {
-            std::cout << (*iter)->getClassName() << std::endl;
-            ++iter;
+            std::cout << "PASSED..." << std::endl;
          }
+         else 
+         {
+            std::cout << "FAILED..." << std::endl;
+         }
+
+         ossimCollectionVisitor::ListRef::iterator iter=collection.begin();
+//         while(iter != collection.end())
+//         {
+//            std::cout << (*iter)->getClassName() << std::endl;
+//            ++iter;
+//         }
       }
    }
    
diff --git a/src/test/ossim-wavelength-test.cpp b/src/test/ossim-wavelength-test.cpp
new file mode 100644
index 0000000..7b3528a
--- /dev/null
+++ b/src/test/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/src/test/ossim-xml-test.cpp b/src/test/ossim-xml-test.cpp
index 389afd4..464880f 100755
--- a/src/test/ossim-xml-test.cpp
+++ b/src/test/ossim-xml-test.cpp
@@ -9,7 +9,7 @@
 // XML functions test.
 // 
 //----------------------------------------------------------------------------
-// $Id: ossimFilenameTest.cpp 14235 2009-04-07 01:18:58Z dburken $
+// $Id: ossim-xml-test.cpp 19751 2011-06-13 15:13:07Z dburken $
 
 #include <iostream>
 using namespace std;
diff --git a/xcode/ossim/ossim.xcodeproj/project.pbxproj b/xcode/ossim/ossim.xcodeproj/project.pbxproj
index d300558..e787a44 100644
--- a/xcode/ossim/ossim.xcodeproj/project.pbxproj
+++ b/xcode/ossim/ossim.xcodeproj/project.pbxproj
@@ -1689,7 +1689,7 @@
 			isa = PBXContainerItemProxy;
 			containerPortal = 43398B711132B6BA0036A644 /* ossim_plugins.xcodeproj */;
 			proxyType = 2;
-			remoteGlobalIDString = 43A9A0AE1151AC37000860DA /* libossimpng_plugin.dylib */;
+			remoteGlobalIDString = 43A9A0AE1151AC37000860DA;
 			remoteInfo = ossim_plugin;
 		};
 		43C6E22D0FEFB4AD004B52F7 /* PBXContainerItemProxy */ = {
@@ -4273,7 +4273,7 @@
 				43398B8E1132B6BA0036A644 /* libossimpng_plugin.dylib */,
 				43398B901132B6BA0036A644 /* libossimkakadu_plugin.dylib */,
 				43398B921132B6BA0036A644 /* libossimcsm_plugin.dylib */,
-				43398B941132B6BA0036A644 /* libossimmrsid_plugin.dylib */,
+				43398B941132B6BA0036A644 /* libossimkakadu_plugin.dylib */,
 				43A9A0B11151AC55000860DA /* libossimpng_plugin.dylib */,
 			);
 			name = Products;
@@ -4334,7 +4334,7 @@
 			isa = PBXGroup;
 			children = (
 				4391D6B210FED19F007AC2C1 /* ossimPlanetQt.framework */,
-				43C8A7921109FF750095AEE2 /* ossimplanet.app */,
+				43C8A7921109FF750095AEE2 /* ossimplanet. */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -6680,6 +6680,7 @@
 			isa = PBXProject;
 			buildConfigurationList = 1FC5981308CB6539002B3E06 /* Build configuration list for PBXProject "ossim" */;
 			compatibilityVersion = "Xcode 2.4";
+			developmentRegion = English;
 			hasScannedForEncodings = 1;
 			knownRegions = (
 				English,
@@ -6878,10 +6879,10 @@
 			remoteRef = 43398B911132B6BA0036A644 /* PBXContainerItemProxy */;
 			sourceTree = BUILT_PRODUCTS_DIR;
 		};
-		43398B941132B6BA0036A644 /* libossimmrsid_plugin.dylib */ = {
+		43398B941132B6BA0036A644 /* libossimkakadu_plugin.dylib */ = {
 			isa = PBXReferenceProxy;
 			fileType = "compiled.mach-o.dylib";
-			path = libossimmrsid_plugin.dylib;
+			path = libossimkakadu_plugin.dylib;
 			remoteRef = 43398B931132B6BA0036A644 /* PBXContainerItemProxy */;
 			sourceTree = BUILT_PRODUCTS_DIR;
 		};
@@ -6934,10 +6935,10 @@
 			remoteRef = 43C6E2AB0FEFB4F0004B52F7 /* PBXContainerItemProxy */;
 			sourceTree = BUILT_PRODUCTS_DIR;
 		};
-		43C8A7921109FF750095AEE2 /* ossimplanet.app */ = {
+		43C8A7921109FF750095AEE2 /* ossimplanet. */ = {
 			isa = PBXReferenceProxy;
 			fileType = wrapper.application;
-			path = ossimplanet.app;
+			path = ossimplanet.;
 			remoteRef = 43C8A7911109FF750095AEE2 /* PBXContainerItemProxy */;
 			sourceTree = BUILT_PRODUCTS_DIR;
 		};

-- 
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