本文整理汇总了C++中GDALDriver类的典型用法代码示例。如果您正苦于以下问题:C++ GDALDriver类的具体用法?C++ GDALDriver怎么用?C++ GDALDriver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GDALDriver类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GDALRegister_TSX
void GDALRegister_TSX() {
GDALDriver *poDriver;
if( GDALGetDriverByName( "TSX" ) == NULL )
{
poDriver = new GDALDriver();
poDriver->SetDescription( "TSX" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME,
"TerraSAR-X Product" );
/* poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC, "frmt_tsx.html" ); */
poDriver->pfnOpen = TSXDataset::Open;
poDriver->pfnIdentify = TSXDataset::Identify;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
}
示例2: GDALRegister_TSX
void GDALRegister_TSX()
{
if( GDALGetDriverByName( "TSX" ) != NULL )
return;
GDALDriver *poDriver = new GDALDriver();
poDriver->SetDescription( "TSX" );
poDriver->SetMetadataItem( GDAL_DCAP_RASTER, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME, "TerraSAR-X Product" );
// poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC, "frmt_tsx.html" );
poDriver->SetMetadataItem( GDAL_DCAP_VIRTUALIO, "YES" );
poDriver->pfnOpen = TSXDataset::Open;
poDriver->pfnIdentify = TSXDataset::Identify;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
示例3: GDALRegister_COASP
void GDALRegister_COASP(void)
{
GDALDriver *poDriver;
if ( GDALGetDriverByName( "COASP" ) == NULL ) {
poDriver = new GDALDriver();
poDriver->SetDescription( "COASP" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME,
"DRDC COASP SAR Processor Raster" );
poDriver->SetMetadataItem( GDAL_DMD_EXTENSION,
"hdr" );
/* poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC,
"frmt_coasp.html"); */
poDriver->pfnIdentify = COASPDataset::Identify;
poDriver->pfnOpen = COASPDataset::Open;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
}
示例4: create_tile_dataset
dataset_t create_tile_dataset(GDALDriver& drv, unsigned int tile_xsize, unsigned int tile_ysize)
{
dataset_t ds(make_dataset(drv.Create("", tile_xsize, tile_ysize, 3, ::GDT_Byte, 0)));
if(!ds)
{
throw std::runtime_error("failed to create output dataset");
}
return ds;
}
示例5: CreateOutputDataset
GDALDataset* CreateOutputDataset(char* fileName, int width, int height, int bands)
{
GDALDriverManager *gdm = GetGDALDriverManager();
if(gdm == NULL)
error("GetGDALDriverManager() failed!");
GDALDriver *gd = gdm->GetDriverByName("GTiff");
if(gd == NULL)
error("Get GTiff Driver failed!");
char* options[2];
options[0] = "INTERLEAVE=BAND";
options[1] = NULL;
GDALDataset *dstDS = gd->Create(fileName, width, height, bands, GDT_Byte, options);
return dstDS;
}
示例6: GDALRegister_AirSAR
void GDALRegister_AirSAR()
{
GDALDriver *poDriver;
if( GDALGetDriverByName( "AirSAR" ) == NULL )
{
poDriver = new GDALDriver();
poDriver->SetDescription( "AirSAR" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME,
"AirSAR Polarimetric Image" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC, "frmt_airsar.html" );
poDriver->pfnOpen = AirSARDataset::Open;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
}
示例7: GDALRegister_FujiBAS
void GDALRegister_FujiBAS()
{
if( GDALGetDriverByName( "FujiBAS" ) != NULL )
return;
GDALDriver *poDriver = new GDALDriver();
poDriver->SetDescription( "FujiBAS" );
poDriver->SetMetadataItem( GDAL_DCAP_RASTER, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME, "Fuji BAS Scanner Image" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC,
"frmt_various.html#FujiBAS" );
poDriver->pfnOpen = FujiBASDataset::Open;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
示例8: GDALRegister_MSG
void GDALRegister_MSG()
{
GDALDriver *poDriver;
if( GDALGetDriverByName( "MSG" ) == NULL )
{
poDriver = new GDALDriver();
poDriver->SetDescription( "MSG" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME,
"MSG HRIT Data" );
poDriver->pfnOpen = MSGDataset::Open;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
}
示例9: RegisterOGRGPX
void RegisterOGRGPX()
{
if (! GDAL_CHECK_VERSION("OGR/GPX driver"))
return;
GDALDriver *poDriver;
if( GDALGetDriverByName( "GPX" ) == NULL )
{
poDriver = new GDALDriver();
poDriver->SetDescription( "GPX" );
poDriver->SetMetadataItem( GDAL_DCAP_VECTOR, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME,
"GPX" );
poDriver->SetMetadataItem( GDAL_DMD_EXTENSION, "gpx" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC,
"drv_gpx.html" );
poDriver->SetMetadataItem( GDAL_DMD_CREATIONOPTIONLIST,
"<CreationOptionList>"
#ifdef WIN32
" <Option name='LINEFORMAT' type='string-select' description='end-of-line sequence' default='CRLF'>"
#else
" <Option name='LINEFORMAT' type='string-select' description='end-of-line sequence' default='LF'>"
#endif
" <Value>CRLF</Value>"
" <Value>LF</Value>"
" </Option>"
" <Option name='GPX_USE_EXTENSIONS' type='boolean' description='Whether to write non-GPX attributes in an <extensions> tag' default='NO'/>"
" <Option name='GPX_EXTENSIONS_NS' type='string' description='Namespace value used for extension tags' default='ogr'/>"
" <Option name='GPX_EXTENSIONS_NS_URL' type='string' description='Namespace URI' default='http://osgeo.org/gdal'/>"
"</CreationOptionList>");
poDriver->SetMetadataItem( GDAL_DS_LAYER_CREATIONOPTIONLIST,
"<LayerCreationOptionList>"
" <Option name='FORCE_GPX_TRACK' type='boolean' description='Whether to force layers with geometries of type wkbLineString as tracks' default='NO'/>"
" <Option name='FORCE_GPX_ROUTE' type='boolean' description='Whether to force layers with geometries of type wkbMultiLineString (with single line string in them) as routes' default='NO'/>"
"</LayerCreationOptionList>");
poDriver->SetMetadataItem( GDAL_DCAP_VIRTUALIO, "YES" );
poDriver->pfnOpen = OGRGPXDriverOpen;
poDriver->pfnCreate = OGRGPXDriverCreate;
poDriver->pfnDelete = OGRGPXDriverDelete;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
}
示例10: GDALRegister_GRASS
void GDALRegister_GRASS()
{
if( !GDAL_CHECK_VERSION( "GDAL/GRASS57 driver" ) )
return;
if( GDALGetDriverByName( "GRASS" ) != NULL )
return;
GDALDriver *poDriver = new GDALDriver();
poDriver->SetDescription( "GRASS" );
poDriver->SetMetadataItem( GDAL_DCAP_RASTER, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME, "GRASS Rasters (5.7+)" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC, "frmt_grass.html" );
poDriver->pfnOpen = GRASSDataset::Open;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
示例11: GDALRegister_DIPEx
void GDALRegister_DIPEx()
{
GDALDriver *poDriver;
if( GDALGetDriverByName( "DIPEx" ) == NULL )
{
poDriver = new GDALDriver();
poDriver->SetDescription( "DIPEx" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME,
"DIPEx" );
poDriver->SetMetadataItem( GDAL_DCAP_VIRTUALIO, "YES" );
poDriver->pfnOpen = DIPExDataset::Open;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
}
示例12: GDALRegister_NWT_GRD
void GDALRegister_NWT_GRD()
{
GDALDriver *poDriver;
if( GDALGetDriverByName( "NWT_GRD" ) == NULL )
{
poDriver = new GDALDriver();
poDriver->SetDescription( "NWT_GRD" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME,
"Northwood Numeric Grid Format .grd/.tab" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC, "frmt_various.html#grd");
poDriver->SetMetadataItem( GDAL_DMD_EXTENSION, "grd" );
poDriver->pfnOpen = NWT_GRDDataset::Open;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
}
示例13: RasterCreate
GDALDataset * RasterCreate( const char * pszFormat, const char * pszFilename, char ** papszOptions /*=NULL*/ )
{
int nXSize = atoi(CSLFetchNameValue(papszOptions, "XSize"));
int nYSize = atoi(CSLFetchNameValue(papszOptions, "YSize"));
int nBands = atoi(CSLFetchNameValue(papszOptions, "Bands"));
GDALDataType eBandType = GDALGetDataTypeByName(CSLFetchNameValue(papszOptions, "DataType"));
char ** papszCreate = NULL;
papszCreate = CSLSetNameValue(papszCreate, "BLOCKXSIZE", "256");
papszCreate = CSLSetNameValue( papszCreate, "BLOCKYSIZE", "1" );
GDALDriver * poDriver = GetRasterDriver(pszFormat);
GDALDataset * poDS = poDriver->Create( pszFilename,
nXSize, nYSize, nBands,
eBandType, papszCreate) ;
CSLDestroy(papszCreate);
return poDS;
}
示例14: GetGDALDriverManager
GDALDriver *OGRSFDriverRegistrar::GetDriver( int iDriver )
{
/* We must be careful only to return drivers that are actual OGRSFDriver* */
GDALDriverManager* poDriverManager = GetGDALDriverManager();
int nTotal = poDriverManager->GetDriverCount();
int nOGRDriverCount = 0;
for(int i=0;i<nTotal;i++)
{
GDALDriver* poDriver = poDriverManager->GetDriver(i);
if( poDriver->GetMetadataItem(GDAL_DCAP_VECTOR) != NULL )
{
if( nOGRDriverCount == iDriver )
return poDriver;
nOGRDriverCount ++;
}
}
return NULL;
}
示例15: RegisterOGRTAB
void RegisterOGRTAB()
{
if( GDALGetDriverByName( "MapInfo File" ) != NULL )
return;
GDALDriver *poDriver = new GDALDriver();
poDriver->SetDescription( "MapInfo File" );
poDriver->SetMetadataItem( GDAL_DCAP_VECTOR, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME, "MapInfo File" );
poDriver->SetMetadataItem( GDAL_DMD_EXTENSIONS, "tab mif mid" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC, "drv_mitab.html" );
poDriver->SetMetadataItem( GDAL_DCAP_VIRTUALIO, "YES" );
poDriver->SetMetadataItem( GDAL_DS_LAYER_CREATIONOPTIONLIST,
"<LayerCreationOptionList>"
" <Option name='BOUNDS' type='string' description='Custom bounds. Expect format is xmin,ymin,xmax,ymax'/>"
"</LayerCreationOptionList>");
poDriver->SetMetadataItem( GDAL_DMD_CREATIONOPTIONLIST,
"<CreationOptionList>"
" <Option name='FORMAT' type='string-select' description='type of MapInfo format'>"
" <Value>MIF</Value>"
" <Value>TAB</Value>"
" </Option>"
" <Option name='SPATIAL_INDEX_MODE' type='string-select' description='type of spatial index' default='QUICK'>"
" <Value>QUICK</Value>"
" <Value>OPTIMIZED</Value>"
" </Option>"
" <Option name='BLOCKSIZE' type='int' description='.map block size' min='512' max='32256' default='512'/>"
"</CreationOptionList>");
poDriver->SetMetadataItem( GDAL_DMD_CREATIONFIELDDATATYPES,
"Integer Real String Date DateTime Time" );
poDriver->pfnOpen = OGRTABDriverOpen;
poDriver->pfnIdentify = OGRTABDriverIdentify;
poDriver->pfnCreate = OGRTABDriverCreate;
poDriver->pfnDelete = OGRTABDriverDelete;
poDriver->pfnUnloadDriver = OGRTABDriverUnload;
GetGDALDriverManager()->RegisterDriver( poDriver );
}