本文整理汇总了C++中GetGDALDriverManager函数的典型用法代码示例。如果您正苦于以下问题:C++ GetGDALDriverManager函数的具体用法?C++ GetGDALDriverManager怎么用?C++ GetGDALDriverManager使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetGDALDriverManager函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GDALRegister_ECRGTOC
void GDALRegister_ECRGTOC()
{
GDALDriver *poDriver;
if( GDALGetDriverByName( "ECRGTOC" ) == NULL )
{
poDriver = new GDALDriver();
poDriver->SetDescription( "ECRGTOC" );
poDriver->SetMetadataItem( GDAL_DCAP_RASTER, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME,
"ECRG TOC format" );
poDriver->pfnIdentify = ECRGTOCDataset::Identify;
poDriver->pfnOpen = ECRGTOCDataset::Open;
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC,
"frmt_various.html#ECRGTOC" );
poDriver->SetMetadataItem( GDAL_DMD_EXTENSION, "xml" );
poDriver->SetMetadataItem( GDAL_DCAP_VIRTUALIO, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_SUBDATASETS, "YES" );
GetGDALDriverManager()->RegisterDriver( poDriver );
}
}
开发者ID:miccferr,项目名称:wmshp-electron,代码行数:26,代码来源:ecrgtocdataset.cpp
示例2: GDALRegister_Terragen
void GDALRegister_Terragen()
{
GDALDriver *poDriver;
if( GDALGetDriverByName( "Terragen" ) == NULL )
{
poDriver = new GDALDriver();
poDriver->SetDescription( "Terragen" );
poDriver->SetMetadataItem( GDAL_DCAP_RASTER, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_EXTENSION,
"ter" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME,
"Terragen heightfield" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC,
"frmt_terragen.html" );
poDriver->SetMetadataItem( GDAL_DMD_CREATIONOPTIONLIST,
"<CreationOptionList>"
" <Option name='MINUSERPIXELVALUE' type='float' description='Lowest logical elevation'/>"
" <Option name='MAXUSERPIXELVALUE' type='float' description='Highest logical elevation'/>"
"</CreationOptionList>" );
poDriver->pfnOpen = TerragenDataset::Open;
poDriver->pfnCreate = TerragenDataset::Create;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
}
开发者ID:drownedout,项目名称:datamap,代码行数:30,代码来源:terragendataset.cpp
示例3: GDALRegister_HDF5
CPL_C_END
/************************************************************************/
/* ==================================================================== */
/* HDF5Dataset */
/* ==================================================================== */
/************************************************************************/
/************************************************************************/
/* GDALRegister_HDF5() */
/************************************************************************/
void GDALRegister_HDF5()
{
GDALDriver *poDriver;
if( GDALGetDriverByName("HDF5") == NULL )
{
poDriver = new GDALDriver();
poDriver->SetDescription("HDF5");
poDriver->SetMetadataItem(GDAL_DMD_LONGNAME,
"Hierarchical Data Format Release 5");
poDriver->SetMetadataItem(GDAL_DMD_HELPTOPIC,
"frmt_hdf5.html");
poDriver->SetMetadataItem(GDAL_DMD_EXTENSION, "hdf5");
poDriver->pfnOpen = HDF5Dataset::Open;
poDriver->pfnIdentify = HDF5Dataset::Identify;
GetGDALDriverManager()->RegisterDriver(poDriver);
}
}
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:31,代码来源:hdf5dataset.cpp
示例4: GDALRegister_BT
void GDALRegister_BT()
{
GDALDriver *poDriver;
if( GDALGetDriverByName( "BT" ) == NULL )
{
poDriver = new GDALDriver();
poDriver->SetDescription( "BT" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME,
"VTP .bt (Binary Terrain) 1.3 Format" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC,
"frmt_various.html#BT" );
poDriver->SetMetadataItem( GDAL_DMD_EXTENSION, "bt" );
poDriver->SetMetadataItem( GDAL_DMD_CREATIONDATATYPES,
"Int16 Int32 Float32" );
poDriver->SetMetadataItem( GDAL_DCAP_VIRTUALIO, "YES" );
poDriver->pfnOpen = BTDataset::Open;
poDriver->pfnCreate = BTDataset::Create;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
}
开发者ID:Mofangbao,项目名称:node-gdal,代码行数:25,代码来源:btdataset.cpp
示例5: OGRDeregisterDriver
void OGRDeregisterDriver( OGRSFDriverH hDriver )
{
VALIDATE_POINTER0( hDriver, "OGRDeregisterDriver" );
GetGDALDriverManager()->DeregisterDriver( (GDALDriver*)hDriver );
}
开发者ID:garnertb,项目名称:gdal,代码行数:7,代码来源:ogrsfdriverregistrar.cpp
示例6: GDALRegister_PNM
void GDALRegister_PNM()
{
GDALDriver *poDriver;
if( GDALGetDriverByName( "PNM" ) == NULL )
{
poDriver = new GDALDriver();
poDriver->SetDescription( "PNM" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME,
"Portable Pixmap Format (netpbm)" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC,
"frmt_various.html#PNM" );
poDriver->SetMetadataItem( GDAL_DMD_EXTENSION, "pnm" );
poDriver->SetMetadataItem( GDAL_DMD_MIMETYPE,
"image/x-portable-anymap" );
poDriver->SetMetadataItem( GDAL_DMD_CREATIONDATATYPES,
"Byte UInt16" );
poDriver->SetMetadataItem( GDAL_DMD_CREATIONOPTIONLIST,
"<CreationOptionList>"
" <Option name='MAXVAL' type='unsigned int' description='Maximum color value'/>"
"</CreationOptionList>" );
poDriver->SetMetadataItem( GDAL_DCAP_VIRTUALIO, "YES" );
poDriver->pfnOpen = PNMDataset::Open;
poDriver->pfnCreate = PNMDataset::Create;
poDriver->pfnIdentify = PNMDataset::Identify;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
}
开发者ID:Joe-xXx,项目名称:gdal,代码行数:32,代码来源:pnmdataset.cpp
示例7: GDALRegister_RIK
void GDALRegister_RIK()
{
GDALDriver *poDriver;
if( GDALGetDriverByName( "RIK" ) == NULL )
{
poDriver = new GDALDriver();
poDriver->SetDescription( "RIK" );
poDriver->SetMetadataItem( GDAL_DCAP_RASTER, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME,
"Swedish Grid RIK (.rik)" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC,
"frmt_various.html#RIK" );
poDriver->SetMetadataItem( GDAL_DMD_EXTENSION, "rik" );
poDriver->SetMetadataItem( GDAL_DCAP_VIRTUALIO, "YES" );
poDriver->pfnOpen = RIKDataset::Open;
poDriver->pfnIdentify = RIKDataset::Identify;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
}
开发者ID:rashadkm,项目名称:lib_gdal,代码行数:25,代码来源:rikdataset.cpp
示例8: GDALRegister_GTX
void GDALRegister_GTX()
{
GDALDriver *poDriver;
if( GDALGetDriverByName( "GTX" ) == NULL )
{
poDriver = new GDALDriver();
poDriver->SetDescription( "GTX" );
poDriver->SetMetadataItem( GDAL_DCAP_RASTER, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME,
"NOAA Vertical Datum .GTX" );
poDriver->SetMetadataItem( GDAL_DMD_EXTENSION, "gtx" );
poDriver->SetMetadataItem( GDAL_DCAP_VIRTUALIO, "YES" );
// poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC,
// "frmt_various.html#GTX" );
poDriver->SetMetadataItem( GDAL_DMD_CREATIONDATATYPES,
"Float32" );
poDriver->pfnOpen = GTXDataset::Open;
poDriver->pfnIdentify = GTXDataset::Identify;
poDriver->pfnCreate = GTXDataset::Create;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
}
开发者ID:drownedout,项目名称:datamap,代码行数:28,代码来源:gtxdataset.cpp
示例9: GDALRegister_EPSILON
void GDALRegister_EPSILON()
{
if( !GDAL_CHECK_VERSION( "EPSILON driver" ) )
return;
if( GDALGetDriverByName( "EPSILON" ) != NULL )
return;
GDALDriver *poDriver = new GDALDriver();
poDriver->SetDescription( "EPSILON" );
poDriver->SetMetadataItem( GDAL_DCAP_RASTER, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME, "Epsilon wavelets" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC, "frmt_epsilon.html" );
poDriver->SetMetadataItem( GDAL_DMD_CREATIONDATATYPES, "Byte" );
CPLString osMethods;
char** papszFBID = eps_get_fb_info(EPS_FB_ID);
char** papszFBIDIter = papszFBID;
while(papszFBIDIter && *papszFBIDIter)
{
osMethods += " <Value>";
osMethods += *papszFBIDIter;
osMethods += "</Value>\n";
papszFBIDIter ++;
}
eps_free_fb_info(papszFBID);
CPLString osOptionList;
osOptionList.Printf(
"<CreationOptionList>"
" <Option name='TARGET' type='int' description='target size reduction as a percentage of the original (0-100)' default='75'/>"
" <Option name='FILTER' type='string-select' description='Filter ID' default='daub97lift'>"
"%s"
" </Option>"
" <Option name='BLOCKXSIZE' type='int' description='Tile Width. Between 32 and 1024' default='256'/>"
" <Option name='BLOCKYSIZE' type='int' description='Tile Height. Between 32 and 1024' default='256'/>"
" <Option name='MODE' type='string-select' default='OTLPF'>"
" <Value>NORMAL</Value>"
" <Value>OTLPF</Value>"
" </Option>"
" <Option name='RGB_RESAMPLE' type='boolean' description='if RGB must be resampled to 4:2:0' default='YES'/>"
" <Option name='RASTERLITE_OUTPUT' type='boolean' description='if Rasterlite header and footers must be inserted' default='FALSE'/>"
"</CreationOptionList>", osMethods.c_str() );
poDriver->SetMetadataItem( GDAL_DMD_CREATIONOPTIONLIST,
osOptionList.c_str() );
poDriver->pfnOpen = EpsilonDataset::Open;
poDriver->pfnIdentify = EpsilonDataset::Identify;
poDriver->pfnCreateCopy = EpsilonDatasetCreateCopy;
poDriver->SetMetadataItem( GDAL_DCAP_VIRTUALIO, "YES" );
GetGDALDriverManager()->RegisterDriver( poDriver );
}
开发者ID:ryandavid,项目名称:rotobox,代码行数:58,代码来源:epsilondataset.cpp
示例10: RegisterOGRMySQL
void RegisterOGRMySQL()
{
if (! GDAL_CHECK_VERSION("MySQL driver"))
return;
GDALDriver *poDriver;
if( GDALGetDriverByName( "MySQL" ) == NULL )
{
poDriver = new GDALDriver();
poDriver->SetDescription( "MySQL" );
poDriver->SetMetadataItem( GDAL_DCAP_VECTOR, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME,
"MySQL" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC,
"drv_mysql.html" );
poDriver->SetMetadataItem( GDAL_DMD_CONNECTION_PREFIX, "MYSQL:" );
poDriver->SetMetadataItem( GDAL_DMD_OPENOPTIONLIST,
"<OpenOptionList>"
" <Option name='DBNAME' type='string' description='Database name' required='true'/>"
" <Option name='PORT' type='int' description='Port'/>"
" <Option name='USER' type='string' description='User name'/>"
" <Option name='PASSWORD' type='string' description='Password'/>"
" <Option name='HOST' type='string' description='Server hostname'/>"
" <Option name='TABLES' type='string' description='Restricted set of tables to list (comma separated)'/>"
"</OpenOptionList>");
poDriver->SetMetadataItem( GDAL_DMD_CREATIONOPTIONLIST, "<CreationOptionList/>");
poDriver->SetMetadataItem( GDAL_DS_LAYER_CREATIONOPTIONLIST,
"<LayerCreationOptionList>"
" <Option name='OVERWRITE' type='boolean' description='Whether to overwrite an existing table with the layer name to be created' default='NO'/>"
" <Option name='LAUNDER' type='boolean' description='Whether layer and field names will be laundered' default='YES'/>"
" <Option name='PRECISION' type='boolean' description='Whether fields created should keep the width and precision' default='YES'/>"
" <Option name='GEOMETRY_NAME' type='string' description='Name of geometry column.' default='SHAPE'/>"
" <Option name='SPATIAL_INDEX' type='boolean' description='Whether to create a spatial index' default='YES'/>"
" <Option name='FID' type='string' description='Name of the FID column to create' default='OGR_FID' deprecated_alias='MYSQL_FID'/>"
" <Option name='FID64' type='boolean' description='Whether to create the FID column with BIGINT type to handle 64bit wide ids' default='NO'/>"
" <Option name='ENGINE' type='string' description='Database engine to use.'/>"
"</LayerCreationOptionList>");
poDriver->SetMetadataItem( GDAL_DMD_CREATIONFIELDDATATYPES, "Integer Integer64 Real String Date DateTime Time Binary" );
poDriver->SetMetadataItem( GDAL_DCAP_NOTNULL_FIELDS, "YES" );
poDriver->SetMetadataItem( GDAL_DCAP_DEFAULT_FIELDS, "YES" );
poDriver->pfnOpen = OGRMySQLDriverOpen;
poDriver->pfnIdentify = OGRMySQLDriverIdentify;
poDriver->pfnCreate = OGRMySQLDriverCreate;
poDriver->pfnUnloadDriver = OGRMySQLDriverUnload;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
}
开发者ID:rashadkm,项目名称:lib_gdal,代码行数:57,代码来源:ogrmysqldriver.cpp
示例11: GetGDALDriverManager
Handle<Value> GDALDrivers::count(const Arguments& args)
{
HandleScope scope;
int gdal_count = GetGDALDriverManager()->GetDriverCount();
int ogr_count = OGRSFDriverRegistrar::GetRegistrar()->GetDriverCount();
return scope.Close(Integer::New(gdal_count + ogr_count));
}
开发者ID:Mofangbao,项目名称:node-gdal,代码行数:9,代码来源:gdal_drivers.cpp
示例12: GetGDALDriverManager
Format::Format(const char* name, const char* driver, const char* extension, int w, int h, int b)
{
mName = name;
mDriver = GetGDALDriverManager()->GetDriverByName(driver);
mExtension = extension;
mTileW = w;
mTileH = h;
mTileB = b;
}
开发者ID:xavierholt,项目名称:razormill,代码行数:9,代码来源:Format.cpp
示例13: GDALRegister_WEBP
void GDALRegister_WEBP()
{
if( GDALGetDriverByName( "WEBP" ) != NULL )
return;
GDALDriver *poDriver = new GDALDriver();
poDriver->SetDescription( "WEBP" );
poDriver->SetMetadataItem( GDAL_DCAP_RASTER, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME, "WEBP" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC, "frmt_webp.html" );
poDriver->SetMetadataItem( GDAL_DMD_EXTENSION, "webp" );
poDriver->SetMetadataItem( GDAL_DMD_MIMETYPE, "image/webp" );
poDriver->SetMetadataItem( GDAL_DMD_CREATIONDATATYPES, "Byte" );
poDriver->SetMetadataItem( GDAL_DMD_CREATIONOPTIONLIST,
"<CreationOptionList>\n"
" <Option name='QUALITY' type='float' description='good=100, bad=0' default='75'/>\n"
#if WEBP_ENCODER_ABI_VERSION >= 0x0100
" <Option name='LOSSLESS' type='boolean' description='Whether lossless compression should be used' default='FALSE'/>\n"
#endif
" <Option name='PRESET' type='string-select' description='kind of image' default='DEFAULT'>\n"
" <Value>DEFAULT</Value>\n"
" <Value>PICTURE</Value>\n"
" <Value>PHOTO</Value>\n"
" <Value>DRAWING</Value>\n"
" <Value>ICON</Value>\n"
" <Value>TEXT</Value>\n"
" </Option>\n"
" <Option name='TARGETSIZE' type='int' description='if non-zero, desired target size in bytes. Has precedence over QUALITY'/>\n"
" <Option name='PSNR' type='float' description='if non-zero, minimal distortion to to achieve. Has precedence over TARGETSIZE'/>\n"
" <Option name='METHOD' type='int' description='quality/speed trade-off. fast=0, slower-better=6' default='4'/>\n"
" <Option name='SEGMENTS' type='int' description='maximum number of segments [1-4]' default='4'/>\n"
" <Option name='SNS_STRENGTH' type='int' description='Spatial Noise Shaping. off=0, maximum=100' default='50'/>\n"
" <Option name='FILTER_STRENGTH' type='int' description='Filter strength. off=0, strongest=100' default='20'/>\n"
" <Option name='FILTER_SHARPNESS' type='int' description='Filter sharpness. off=0, least sharp=7' default='0'/>\n"
" <Option name='FILTER_TYPE' type='int' description='Filtering type. simple=0, strong=1' default='0'/>\n"
" <Option name='AUTOFILTER' type='int' description=\"Auto adjust filter's strength. off=0, on=1\" default='0'/>\n"
" <Option name='PASS' type='int' description='Number of entropy analysis passes [1-10]' default='1'/>\n"
" <Option name='PREPROCESSING' type='int' description='Preprocessing filter. none=0, segment-smooth=1' default='0'/>\n"
" <Option name='PARTITIONS' type='int' description='log2(number of token partitions) in [0..3]' default='0'/>\n"
#if WEBP_ENCODER_ABI_VERSION >= 0x0002
" <Option name='PARTITION_LIMIT' type='int' description='quality degradation allowed to fit the 512k limit on prediction modes coding (0=no degradation, 100=full)' default='0'/>\n"
#endif
"</CreationOptionList>\n" );
poDriver->SetMetadataItem( GDAL_DCAP_VIRTUALIO, "YES" );
poDriver->pfnIdentify = WEBPDataset::Identify;
poDriver->pfnOpen = WEBPDataset::Open;
poDriver->pfnCreateCopy = WEBPDataset::CreateCopy;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
开发者ID:bbradbury,项目名称:lib_gdal,代码行数:55,代码来源:webpdataset.cpp
示例14: GDALDriver
// Test that GDALWarp() detects error in flush cache
template<> template<> void object::test<9>()
{
GDALDriver* poDriver = new GDALDriver();
poDriver->SetDescription("DatasetWithErrorInFlushCache");
poDriver->pfnCreate = DatasetWithErrorInFlushCache::Create;
GetGDALDriverManager()->RegisterDriver( poDriver );
const char* args[] = { "-of", "DatasetWithErrorInFlushCache", NULL };
GDALWarpAppOptions* psOptions = GDALWarpAppOptionsNew((char**)args, NULL);
GDALDatasetH hSrcDS = GDALOpen("../gcore/data/byte.tif", GA_ReadOnly);
CPLErrorReset();
CPLPushErrorHandler(CPLQuietErrorHandler);
GDALDatasetH hOutDS = GDALWarp("/", NULL, 1, &hSrcDS, psOptions, NULL);
CPLPopErrorHandler();
GDALClose(hSrcDS);
GDALWarpAppOptionsFree(psOptions);
ensure(hOutDS == NULL);
ensure(CPLGetLastErrorType() != CE_None);
GetGDALDriverManager()->DeregisterDriver( poDriver );
delete poDriver;
}
开发者ID:Mavrx-inc,项目名称:gdal,代码行数:21,代码来源:test_gdal.cpp
示例15: GDALRegister_COSAR
/* register the driver with GDAL */
void GDALRegister_COSAR() {
GDALDriver *pDriver;
if (GDALGetDriverByName("cosar") == NULL) {
pDriver = new GDALDriver();
pDriver->SetDescription("COSAR");
pDriver->SetMetadataItem( GDAL_DMD_LONGNAME,
"COSAR Annotated Binary Matrix (TerraSAR-X)");
pDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC,
"frmt_cosar.html");
pDriver->pfnOpen = COSARDataset::Open;
GetGDALDriverManager()->RegisterDriver(pDriver);
}
}
开发者ID:0004c,项目名称:node-gdal,代码行数:14,代码来源:cosar_dataset.cpp
示例16: GetGDALDriverManager
GDALDriver *OGRSFDriverRegistrar::GetDriverByName( const char * pszName )
{
GDALDriverManager* poDriverManager = GetGDALDriverManager();
GDALDriver* poGDALDriver =
poDriverManager->GetDriverByName(CPLSPrintf("OGR_%s", pszName));
if( poGDALDriver == NULL )
poGDALDriver = poDriverManager->GetDriverByName(pszName);
if( poGDALDriver == NULL ||
poGDALDriver->GetMetadataItem(GDAL_DCAP_VECTOR) == NULL )
return NULL;
return poGDALDriver;
}
开发者ID:Wedjaa,项目名称:node-gdal,代码行数:13,代码来源:ogrsfdriverregistrar.cpp
示例17: write_map
void write_map(fs::path file_path, GDALDataType data_type, boost::shared_ptr<Map_Matrix<DataFormat> > data, std::string WKTprojection, GeoTransform transform, std::string driverName) throw(std::runtime_error)
{
GDALAllRegister(); //This registers all availble raster file formats for use with this utility. How neat is that. We can input any GDAL supported rater file format.
const char *pszFormat = driverName.c_str();
GDALDriver * poDriver = GetGDALDriverManager()->GetDriverByName(pszFormat);
if (poDriver == NULL)
{
throw std::runtime_error("No driver for file tyle found");
}
char ** papszMetadata = poDriver->GetMetadata();
if (!(CSLFetchBoolean(papszMetadata, GDAL_DCAP_CREATE, FALSE)))
{
throw std::runtime_error("Driver does not support raster creation");
}
char **papszOptions = NULL;
papszOptions = CSLSetNameValue(papszOptions, "COMPRESS", "LZW");
GDALDataset *poDstDS = poDriver->Create(file_path.string().c_str(), (int)data->NCols(), (int)data->NRows(), 1, data_type, papszOptions);
double adfGeoTransform[6] = {1, 1, 1, 1, 1, 1};
adfGeoTransform[0] = transform.x_origin;
adfGeoTransform[1] = transform.pixel_width;
adfGeoTransform[2] = transform.x_line_space;
adfGeoTransform[3] = transform.y_origin;
adfGeoTransform[4] = transform.pixel_height;
adfGeoTransform[5] = transform.y_line_space;
const char * psz_WKT = WKTprojection.c_str();
poDstDS->SetGeoTransform(adfGeoTransform);
poDstDS->SetProjection(psz_WKT);
DataFormat * pafScanline = new DataFormat[data->NCols() * data->NRows()];
int pafIterator = 0;
for (int i = 0; i < data->NRows(); i++)
{
for (int j = 0; j < data->NCols(); j++)
{
pafScanline[pafIterator] = data->Get(i, j);
pafIterator++;
}
}
GDALRasterBand * poBand = poDstDS->GetRasterBand(1);
poBand->SetNoDataValue(data->NoDataValue());
poBand->RasterIO(GF_Write, 0, 0, (int) data->NCols(), (int) data->NRows(), pafScanline, (int) data->NCols(), (int) data->NRows(), data_type, 0, 0);
GDALClose( (GDALDatasetH) poDstDS);
}
开发者ID:jeffrey-newman,项目名称:Aggregate-Map,代码行数:51,代码来源:ReadInMap.cpp
示例18: GDALRegister_USGSDEM
void GDALRegister_USGSDEM()
{
GDALDriver *poDriver;
if( GDALGetDriverByName( "USGSDEM" ) == NULL )
{
poDriver = new GDALDriver();
poDriver->SetDescription( "USGSDEM" );
poDriver->SetMetadataItem( GDAL_DCAP_RASTER, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_EXTENSION,
"dem" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME,
"USGS Optional ASCII DEM (and CDED)" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC,
"frmt_usgsdem.html" );
poDriver->SetMetadataItem( GDAL_DMD_CREATIONDATATYPES, "Int16" );
poDriver->SetMetadataItem( GDAL_DMD_CREATIONOPTIONLIST,
"<CreationOptionList>"
" <Option name='PRODUCT' type='string-select' description='Specific Product Type'>"
" <Value>DEFAULT</Value>"
" <Value>CDED50K</Value>"
" </Option>"
" <Option name='TOPLEFT' type='string' description='Top left product corner (ie. 117d15w,52d30n'/>"
" <Option name='RESAMPLE' type='string-select' description='Resampling kernel to use if resampled.'>"
" <Value>Nearest</Value>"
" <Value>Bilinear</Value>"
" <Value>Cubic</Value>"
" <Value>CubicSpline</Value>"
" </Option>"
" <Option name='TEMPLATE' type='string' description='File to default metadata from.'/>"
" <Option name='DEMLevelCode' type='int' description='DEM Level (1, 2 or 3 if set)'/>"
" <Option name='DataSpecVersion' type='int' description='Data and Specification version/revision (eg. 1020)'/>"
" <Option name='PRODUCER' type='string' description='Producer Agency (up to 60 characters)'/>"
" <Option name='OriginCode' type='string' description='Origin code (up to 4 characters, YT for Yukon)'/>"
" <Option name='ProcessCode' type='string' description='Processing Code (8=ANUDEM, 9=FME, A=TopoGrid)'/>"
" <Option name='ZRESOLUTION' type='float' description='Scaling factor for elevation values'/>"
" <Option name='NTS' type='string' description='NTS Mapsheet name, used to derive TOPLEFT.'/>"
" <Option name='INTERNALNAME' type='string' description='Dataset name written into file header.'/>"
"</CreationOptionList>" );
poDriver->SetMetadataItem( GDAL_DCAP_VIRTUALIO, "YES" );
poDriver->pfnOpen = USGSDEMDataset::Open;
poDriver->pfnCreateCopy = USGSDEMCreateCopy;
poDriver->pfnIdentify = USGSDEMDataset::Identify;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
}
开发者ID:garnertb,项目名称:gdal,代码行数:51,代码来源:usgsdemdataset.cpp
示例19: CreateGDALRaster
GDALDataset* CreateGDALRaster(TeRasterParams& params)
{
// Gets the appropriate GDAL driver
std::string path = params.fileName_;
if(path.empty())
return 0;
std::string extension = TeGetExtension(path.c_str());
std::string driverName = TeGDALDecoder::getGDALDriverName(extension);
if(driverName.empty())
return 0;
GDALDriverManager* driverManager = GetGDALDriverManager();
GDALDriver* driver = driverManager->GetDriverByName(driverName.c_str());
if(driver == 0)
return 0;
// Converts the raster data type
GDALDataType gDataType = Convert2GDAL(params.dataType_[0]);
// Creates the raster GDAL
GDALDataset* ds = driver->Create(path.c_str(), params.ncols_, params.nlines_, params.nBands(), gDataType, 0);
if(ds == 0)
return 0;
// Sets the geometric transformations
double gt[6];
Convert2GDAL(gt, params);
ds->SetGeoTransform(gt);
// Sets the raster projection
TeProjection* proj = params.projection();
if(proj)
{
int epsg = proj->epsgCode();
OGRSpatialReference oSRS;
oSRS.importFromEPSG(epsg);
char* projWKT = 0;
if(oSRS.exportToWkt(&projWKT) == OGRERR_NONE)
{
ds->SetProjection(projWKT);
OGRFree(projWKT);
}
}
return ds;
}
开发者ID:Universefei,项目名称:Terralib-analysis,代码行数:50,代码来源:TeGDALUtils.cpp
示例20: GDALRegister_KEA
// method to register this driver
void GDALRegister_KEA()
{
if( !GDAL_CHECK_VERSION( "KEA" ) )
return;
if( GDALGetDriverByName( "KEA" ) != NULL )
return;
GDALDriver *poDriver = new GDALDriver();
poDriver->SetDescription( "KEA" );
poDriver->SetMetadataItem( GDAL_DCAP_RASTER, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME, "KEA Image Format (.kea)" );
poDriver->SetMetadataItem( GDAL_DMD_EXTENSION, "kea" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC, "frmt_kea.html" );
poDriver->SetMetadataItem( GDAL_DMD_CREATIONDATATYPES,
"Byte Int16 UInt16 Int32 UInt32 "
"Float32 Float64" );
poDriver->SetMetadataItem(
GDAL_DMD_CREATIONOPTIONLIST,
CPLSPrintf(
"<CreationOptionList> "
"<Option name='IMAGEBLOCKSIZE' type='int' description='The size of each block for image data' default='%d'/> "
"<Option name='ATTBLOCKSIZE' type='int' description='The size of each block for attribute data' default='%d'/> "
"<Option name='MDC_NELMTS' type='int' description='Number of elements in the meta data cache' default='%d'/> "
"<Option name='RDCC_NELMTS' type='int' description='Number of elements in the raw data chunk cache' default='%d'/> "
"<Option name='RDCC_NBYTES' type='int' description='Total size of the raw data chunk cache, in bytes' default='%d'/> "
"<Option name='RDCC_W0' type='float' min='0' max='1' description='Preemption policy' default='%.2f'/> "
"<Option name='SIEVE_BUF' type='int' description='Sets the maximum size of the data sieve buffer' default='%d'/> "
"<Option name='META_BLOCKSIZE' type='int' description='Sets the minimum size of metadata block allocations' default='%d'/> "
"<Option name='DEFLATE' type='int' description='0 (no compression) to 9 (max compression)' default='%d'/> "
"<Option name='THEMATIC' type='boolean' description='If YES then all bands are set to thematic' default='NO'/> "
"</CreationOptionList>",
static_cast<int>(kealib::KEA_IMAGE_CHUNK_SIZE),
static_cast<int>(kealib::KEA_ATT_CHUNK_SIZE),
static_cast<int>(kealib::KEA_MDC_NELMTS),
static_cast<int>(kealib::KEA_RDCC_NELMTS),
static_cast<int>(kealib::KEA_RDCC_NBYTES),
kealib::KEA_RDCC_W0,
static_cast<int>(kealib::KEA_SIEVE_BUF),
static_cast<int>(kealib::KEA_META_BLOCKSIZE),
kealib::KEA_DEFLATE ) );
poDriver->pfnOpen = KEADataset::Open;
poDriver->pfnIdentify = KEADataset::Identify;
poDriver->pfnCreate = KEADataset::Create;
poDriver->pfnCreateCopy = KEADataset::CreateCopy;
GetGDALDriverManager()->RegisterDriver( poDriver );
}
开发者ID:StephenHolzman,项目名称:UVAmisc,代码行数:51,代码来源:keadriver.cpp
注:本文中的GetGDALDriverManager函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论