1 /***************************************************************************** 2 * $Id: IntergraphDataset.h d23b5a0d22b88657e4fc31f2513701842f0b0585 2019-08-11 03:09:59 +0200 Even Rouault $ 3 * 4 * Project: Intergraph Raster Format support 5 * Purpose: Read selected types of Intergraph Raster Format 6 * Author: Ivan Lucena, [lucena_ivan at hotmail.com] 7 * 8 ****************************************************************************** 9 * Copyright (c) 2007, Ivan Lucena 10 * Copyright (c) 2007-2010, Even Rouault <even dot rouault at spatialys.com> 11 * 12 * Permission is hereby granted, free of charge, to any person obtaining a 13 * copy of this software and associated documentation files ( the "Software" ), 14 * to deal in the Software without restriction, including without limitation 15 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 16 * and/or sell copies of the Software, and to permit persons to whom the 17 * Software is furnished to do so, subject to the following conditions: 18 * 19 * The above copyright notice and this permission notice shall be included 20 * in all copies or substantial portions of the Software. 21 * 22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 25 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 27 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 28 * DEALINGS IN THE SOFTWARE. 29 *****************************************************************************/ 30 31 #include "IngrTypes.h" 32 33 // ---------------------------------------------------------------------------- 34 // Intergraph GDALDataset 35 // ---------------------------------------------------------------------------- 36 37 class IntergraphDataset final: public GDALPamDataset 38 { 39 friend class IntergraphRasterBand; 40 friend class IntergraphRGBBand; 41 friend class IntergraphBitmapBand; 42 friend class IntergraphRLEBand; 43 44 private: 45 VSILFILE *fp; 46 char *pszFilename; 47 double adfGeoTransform[6]; 48 49 INGR_HeaderOne hHeaderOne; 50 INGR_HeaderTwoA hHeaderTwo; 51 INGR_VirtualFile hVirtual; 52 53 public: 54 IntergraphDataset(); 55 virtual ~IntergraphDataset(); 56 57 static GDALDataset *Open( GDALOpenInfo *poOpenInfo ); 58 static GDALDataset *Create( const char *pszFilename, 59 int nXSize, 60 int nYSize, 61 int nBands, 62 GDALDataType eType, 63 char **papszOptions ); 64 static GDALDataset *CreateCopy( const char *pszFilename, 65 GDALDataset *poSrcDS, 66 int bStrict, 67 char **papszOptions, 68 GDALProgressFunc pfnProgress, 69 void * pProgressData ); 70 71 virtual CPLErr GetGeoTransform( double *padfTransform ) override; 72 virtual CPLErr SetGeoTransform( double *padfTransform ) override; 73 virtual CPLErr _SetProjection( const char *pszProjString ) override; SetSpatialRef(const OGRSpatialReference * poSRS)74 CPLErr SetSpatialRef(const OGRSpatialReference* poSRS) override { 75 return OldSetProjectionFromSetSpatialRef(poSRS); 76 } 77 }; 78