Skip to content

Commit

Permalink
Rename VRTTI driver to GTI
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jan 22, 2024
1 parent 82ab1da commit ce9b1a7
Show file tree
Hide file tree
Showing 22 changed files with 538 additions and 540 deletions.
9 changes: 4 additions & 5 deletions apps/gdaladdo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ static bool PartialRefreshFromSourceTimestamp(
return false;
}

std::vector<VRTTISourceDesc> regions;
std::vector<GTISourceDesc> regions;

double dfTotalPixels = 0;

Expand Down Expand Up @@ -357,7 +357,7 @@ static bool PartialRefreshFromSourceTimestamp(
}

dfTotalPixels += static_cast<double>(nXSize) * nYSize;
VRTTISourceDesc region;
GTISourceDesc region;
region.osFilename = poSource->GetSourceDatasetName();
region.nDstXOff = nXOff;
region.nDstYOff = nYOff;
Expand All @@ -369,10 +369,9 @@ static bool PartialRefreshFromSourceTimestamp(
}
}
}
else if (auto poVRTTIDS = GDALDatasetCastToVRTTIDataset(poDS))
else if (auto poGTIDS = GDALDatasetCastToGTIDataset(poDS))
{
regions =
VRTTIGetSourcesMoreRecentThan(poVRTTIDS, sStatVRTOvr.st_mtime);
regions = GTIGetSourcesMoreRecentThan(poGTIDS, sStatVRTOvr.st_mtime);
for (const auto &region : regions)
{
dfTotalPixels +=
Expand Down
2 changes: 1 addition & 1 deletion apps/gdaltindex_bin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static void Usage(bool bIsError, const char *pszErrorMsg)
" [-src_srs_name field_name] [-src_srs_format "
"{AUTO|WKT|EPSG|PROJ}]\n"
" [-lyr_name <name>]\n"
" [-vrtti_filename <name>]\n"
" [-gti_filename <name>]\n"
" [-tr <xres> <yres>] [-te <xmin> <ymin> <xmax> "
"<ymax>]\n"
" [-ot <datatype>] [-bandcount <val>] [-nodata "
Expand Down
24 changes: 12 additions & 12 deletions apps/gdaltindex_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct GDALTileIndexOptions
std::string osDataType{};
bool bMaskBand = false;
std::vector<std::string> aosMetadata{};
std::string osVRTTIFilename{};
std::string osGTIFilename{};
bool bRecursive = false;
double dfMinPixelSize = std::numeric_limits<double>::quiet_NaN();
double dfMaxPixelSize = std::numeric_limits<double>::quiet_NaN();
Expand Down Expand Up @@ -538,16 +538,16 @@ GDALDatasetH GDALTileIndex(const char *pszDest, int nSrcCount,
}
}

if (!psOptions->osVRTTIFilename.empty())
if (!psOptions->osGTIFilename.empty())
{
if (!psOptions->aosMetadata.empty())
{
CPLError(CE_Failure, CPLE_NotSupported,
"-mo is not supported when -vrtti_filename is used");
"-mo is not supported when -gti_filename is used");
return nullptr;
}
CPLXMLNode *psRoot =
CPLCreateXMLNode(nullptr, CXT_Element, "VRTTileIndexDataset");
CPLCreateXMLNode(nullptr, CXT_Element, "GDALTileIndexDataset");
CPLCreateXMLElementAndValue(psRoot, "IndexDataset", pszDest);
CPLCreateXMLElementAndValue(psRoot, "IndexLayer", poLayer->GetName());
CPLCreateXMLElementAndValue(psRoot, "LocationField",
Expand Down Expand Up @@ -648,8 +648,8 @@ GDALDatasetH GDALTileIndex(const char *pszDest, int nSrcCount,
{
CPLCreateXMLElementAndValue(psRoot, "MaskBand", "true");
}
int res = CPLSerializeXMLTreeToFile(psRoot,
psOptions->osVRTTIFilename.c_str());
int res =
CPLSerializeXMLTreeToFile(psRoot, psOptions->osGTIFilename.c_str());
CPLDestroyXMLNode(psRoot);
if (!res)
return nullptr;
Expand Down Expand Up @@ -778,12 +778,12 @@ GDALDatasetH GDALTileIndex(const char *pszDest, int nSrcCount,
CPLFree(pszCurrentPath);
}

const bool bIsVRTTIContext =
const bool bIsGTIContext =
!std::isnan(psOptions->xres) || !std::isnan(psOptions->xmin) ||
!psOptions->osBandCount.empty() || !psOptions->osNodata.empty() ||
!psOptions->osColorInterp.empty() || !psOptions->osDataType.empty() ||
psOptions->bMaskBand || !psOptions->aosMetadata.empty() ||
!psOptions->osVRTTIFilename.empty();
!psOptions->osGTIFilename.empty();

/* -------------------------------------------------------------------- */
/* loop over GDAL files, processing. */
Expand Down Expand Up @@ -931,15 +931,15 @@ GDALDatasetH GDALTileIndex(const char *pszDest, int nSrcCount,
}
}
}
else if (bIsVRTTIContext && !oAlreadyExistingSRS.IsEmpty() &&
else if (bIsGTIContext && !oAlreadyExistingSRS.IsEmpty() &&
(poSrcSRS == nullptr ||
!poSrcSRS->IsSame(&oAlreadyExistingSRS)))
{
CPLError(
CE_Failure, CPLE_AppDefined,
"%s is not using the same projection system "
"as other files in the tileindex. This is not compatible of "
"VRTTI use. Use -t_srs option to reproject tile extents "
"GTI use. Use -t_srs option to reproject tile extents "
"to a common SRS.",
osSrcFilename.c_str());
return nullptr;
Expand Down Expand Up @@ -1288,10 +1288,10 @@ GDALTileIndexOptionsNew(char **papszArgv,
{
psOptions->bMaskBand = true;
}
else if (EQUAL(papszArgv[iArg], "-vrtti_filename"))
else if (EQUAL(papszArgv[iArg], "-gti_filename"))
{
CHECK_HAS_ENOUGH_ADDITIONAL_ARGS(1);
psOptions->osVRTTIFilename = papszArgv[++iArg];
psOptions->osGTIFilename = papszArgv[++iArg];
}
else if (EQUAL(papszArgv[iArg], "-overwrite"))
{
Expand Down
Loading

0 comments on commit ce9b1a7

Please sign in to comment.