Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Project: PCIDSK Database File 4 : * Purpose: Read/write PCIDSK Database File used by the PCI software, using 5 : * the external PCIDSK library. 6 : * Author: Frank Warmerdam, warmerdam@pobox.com 7 : * 8 : ****************************************************************************** 9 : * Copyright (c) 2009, Frank Warmerdam <warmerdam@pobox.com> 10 : * Copyright (c) 2009-2013, Even Rouault <even dot rouault at spatialys.com> 11 : * 12 : * SPDX-License-Identifier: MIT 13 : ****************************************************************************/ 14 : 15 : #include "pcidskdrivercore.h" 16 : 17 : /************************************************************************/ 18 : /* PCIDSKDriverIdentify() */ 19 : /************************************************************************/ 20 : 21 65639 : int PCIDSKDriverIdentify(GDALOpenInfo *poOpenInfo) 22 : 23 : { 24 75118 : return poOpenInfo->nHeaderBytes >= 512 && 25 75118 : memcmp(poOpenInfo->pabyHeader, "PCIDSK ", 8) == 0; 26 : } 27 : 28 : /************************************************************************/ 29 : /* PCIDSKDriverSetCommonMetadata() */ 30 : /************************************************************************/ 31 : 32 1306 : void PCIDSKDriverSetCommonMetadata(GDALDriver *poDriver) 33 : { 34 1306 : poDriver->SetDescription(DRIVER_NAME); 35 1306 : poDriver->SetMetadataItem(GDAL_DCAP_RASTER, "YES"); 36 1306 : poDriver->SetMetadataItem(GDAL_DCAP_VECTOR, "YES"); 37 1306 : poDriver->SetMetadataItem(GDAL_DCAP_CREATE_LAYER, "YES"); 38 1306 : poDriver->SetMetadataItem(GDAL_DCAP_CREATE_FIELD, "YES"); 39 1306 : poDriver->SetMetadataItem(GDAL_DMD_LONGNAME, "PCIDSK Database File"); 40 1306 : poDriver->SetMetadataItem(GDAL_DMD_HELPTOPIC, "drivers/raster/pcidsk.html"); 41 1306 : poDriver->SetMetadataItem(GDAL_DCAP_VIRTUALIO, "YES"); 42 1306 : poDriver->SetMetadataItem(GDAL_DMD_EXTENSION, "pix"); 43 1306 : poDriver->SetMetadataItem(GDAL_DMD_CREATIONDATATYPES, 44 1306 : "Byte UInt16 Int16 Float32 CInt16 CFloat32"); 45 1306 : poDriver->SetMetadataItem( 46 : GDAL_DMD_CREATIONOPTIONLIST, 47 : "<CreationOptionList>" 48 : " <Option name='INTERLEAVING' type='string-select' default='BAND' " 49 : "description='raster data organization'>" 50 : " <Value>PIXEL</Value>" 51 : " <Value>BAND</Value>" 52 : " <Value>FILE</Value>" 53 : " <Value>TILED</Value>" 54 : " </Option>" 55 : " <Option name='COMPRESSION' type='string-select' default='NONE' " 56 : "description='compression - (INTERLEAVING=TILED only)'>" 57 : " <Value>NONE</Value>" 58 : " <Value>RLE</Value>" 59 : " <Value>JPEG</Value>" 60 : " </Option>" 61 : " <Option name='TILESIZE' type='int' default='127' description='Tile " 62 : "Size (INTERLEAVING=TILED only)'/>" 63 : " <Option name='TILEVERSION' type='int' default='2' " 64 : "description='Tile Version (INTERLEAVING=TILED only)'/>" 65 1306 : "</CreationOptionList>"); 66 1306 : poDriver->SetMetadataItem(GDAL_DS_LAYER_CREATIONOPTIONLIST, 67 1306 : "<LayerCreationOptionList/>"); 68 1306 : poDriver->SetMetadataItem(GDAL_DMD_SUPPORTED_SQL_DIALECTS, "OGRSQL SQLITE"); 69 1306 : poDriver->SetMetadataItem(GDAL_DMD_CREATIONFIELDDATATYPES, 70 1306 : "Integer Real String IntegerList"); 71 1306 : poDriver->SetMetadataItem(GDAL_DCAP_Z_GEOMETRIES, "YES"); 72 : 73 1306 : poDriver->pfnIdentify = PCIDSKDriverIdentify; 74 1306 : poDriver->SetMetadataItem(GDAL_DCAP_OPEN, "YES"); 75 1306 : poDriver->SetMetadataItem(GDAL_DCAP_CREATE, "YES"); 76 1306 : } 77 : 78 : /************************************************************************/ 79 : /* DeclareDeferredPCIDSKPlugin() */ 80 : /************************************************************************/ 81 : 82 : #ifdef PLUGIN_FILENAME 83 1595 : void DeclareDeferredPCIDSKPlugin() 84 : { 85 1595 : if (GDALGetDriverByName(DRIVER_NAME) != nullptr) 86 : { 87 302 : return; 88 : } 89 1293 : auto poDriver = new GDALPluginDriverProxy(PLUGIN_FILENAME); 90 : #ifdef PLUGIN_INSTALLATION_MESSAGE 91 : poDriver->SetMetadataItem(GDAL_DMD_PLUGIN_INSTALLATION_MESSAGE, 92 : PLUGIN_INSTALLATION_MESSAGE); 93 : #endif 94 1293 : PCIDSKDriverSetCommonMetadata(poDriver); 95 1293 : GetGDALDriverManager()->DeclareDeferredPluginDriver(poDriver); 96 : } 97 : #endif