本文整理汇总了C++中VRTDataset::SetMetadataItem方法的典型用法代码示例。如果您正苦于以下问题:C++ VRTDataset::SetMetadataItem方法的具体用法?C++ VRTDataset::SetMetadataItem怎么用?C++ VRTDataset::SetMetadataItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VRTDataset
的用法示例。
在下文中一共展示了VRTDataset::SetMetadataItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProxyMain
//.........这里部分代码省略.........
CPLFree(pasGCPs);
}
else if (GDALGetGCPCount(hDataset) > 0)
{
GDAL_GCP *pasGCPs;
int nGCPs = GDALGetGCPCount(hDataset);
pasGCPs = GDALDuplicateGCPs(nGCPs, GDALGetGCPs(hDataset));
for (i = 0; i < nGCPs; i++)
{
pasGCPs[i].dfGCPPixel -= anSrcWin[0];
pasGCPs[i].dfGCPLine -= anSrcWin[1];
pasGCPs[i].dfGCPPixel *= (nOXSize / (double) anSrcWin[2]);
pasGCPs[i].dfGCPLine *= (nOYSize / (double) anSrcWin[3]);
}
poVDS->SetGCPs(nGCPs, pasGCPs,
GDALGetGCPProjection(hDataset));
GDALDeinitGCPs(nGCPs, pasGCPs);
CPLFree(pasGCPs);
}
/* -------------------------------------------------------------------- */
/* Transfer generally applicable metadata. */
/* -------------------------------------------------------------------- */
poVDS->SetMetadata(((GDALDataset*)hDataset)->GetMetadata());
AttachMetadata((GDALDatasetH) poVDS, papszMetadataOptions);
const char *pszInterleave = GDALGetMetadataItem(hDataset, "INTERLEAVE", "IMAGE_STRUCTURE");
if (pszInterleave)
poVDS->SetMetadataItem("INTERLEAVE", pszInterleave, "IMAGE_STRUCTURE");
/* -------------------------------------------------------------------- */
/* Transfer metadata that remains valid if the spatial */
/* arrangement of the data is unaltered. */
/* -------------------------------------------------------------------- */
if (bSpatialArrangementPreserved)
{
char **papszMD;
papszMD = ((GDALDataset*)hDataset)->GetMetadata("RPC");
if (papszMD != NULL)
poVDS->SetMetadata(papszMD, "RPC");
papszMD = ((GDALDataset*)hDataset)->GetMetadata("GEOLOCATION");
if (papszMD != NULL)
poVDS->SetMetadata(papszMD, "GEOLOCATION");
}
int nSrcBandCount = nBandCount;
if (nRGBExpand != 0)
{
GDALRasterBand *poSrcBand;
poSrcBand = ((GDALDataset*)
hDataset)->GetRasterBand(ABS(panBandList[0]));
if (panBandList[0] < 0)
poSrcBand = poSrcBand->GetMaskBand();
GDALColorTable *poColorTable = poSrcBand->GetColorTable();
if (poColorTable == NULL)
{
fprintf(stderr, "Error : band %d has no color table\n", ABS(panBandList[0]));