diff -Nru gdal-3.6.2+dfsg/alg/delaunay.c gdal-3.6.4+dfsg/alg/delaunay.c --- gdal-3.6.2+dfsg/alg/delaunay.c 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/alg/delaunay.c 2023-04-17 11:50:20.000000000 +0000 @@ -69,9 +69,18 @@ disable : 4324) // 'qhT': structure was padded due to alignment specifier #endif +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation" +#endif + #include "libqhull_r/libqhull_r.h" #include "libqhull_r/qset_r.h" +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + #ifdef _MSC_VER #pragma warning(pop) #endif diff -Nru gdal-3.6.2+dfsg/alg/gdal_alg_priv.h gdal-3.6.4+dfsg/alg/gdal_alg_priv.h --- gdal-3.6.2+dfsg/alg/gdal_alg_priv.h 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/alg/gdal_alg_priv.h 2023-04-17 11:50:19.000000000 +0000 @@ -143,7 +143,7 @@ explicit GDALRasterPolygonEnumeratorT(int nConnectedness = 4); ~GDALRasterPolygonEnumeratorT(); - void ProcessLine(DataType *panLastLineVal, DataType *panThisLineVal, + bool ProcessLine(DataType *panLastLineVal, DataType *panThisLineVal, GInt32 *panLastLineId, GInt32 *panThisLineId, int nXSize); void CompleteMerges(); diff -Nru gdal-3.6.2+dfsg/alg/gdalcutline.cpp gdal-3.6.4+dfsg/alg/gdalcutline.cpp --- gdal-3.6.2+dfsg/alg/gdalcutline.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/alg/gdalcutline.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -250,12 +250,27 @@ /* provided cutline, and optional blend distance. */ /************************************************************************/ -CPLErr GDALWarpCutlineMasker(void *pMaskFuncArg, int /* nBandCount */, - GDALDataType /* eType */, int nXOff, int nYOff, - int nXSize, int nYSize, GByte ** /*ppImageData */, +CPLErr GDALWarpCutlineMasker(void *pMaskFuncArg, int nBandCount, + GDALDataType eType, int nXOff, int nYOff, + int nXSize, int nYSize, GByte **ppImageData, int bMaskIsFloat, void *pValidityMask) { + return GDALWarpCutlineMaskerEx(pMaskFuncArg, nBandCount, eType, nXOff, + nYOff, nXSize, nYSize, ppImageData, + bMaskIsFloat, pValidityMask, nullptr); +} + +CPLErr GDALWarpCutlineMaskerEx(void *pMaskFuncArg, int /* nBandCount */, + GDALDataType /* eType */, int nXOff, int nYOff, + int nXSize, int nYSize, + GByte ** /*ppImageData */, int bMaskIsFloat, + void *pValidityMask, int *pnValidityFlag) + +{ + if (pnValidityFlag) + *pnValidityFlag = GCMVF_PARTIAL_INTERSECTION; + if (nXSize < 1 || nYSize < 1) return CE_None; @@ -307,6 +322,9 @@ sEnvelope.MaxY + psWO->dfCutlineBlendDist < nYOff || sEnvelope.MinY - psWO->dfCutlineBlendDist > nYOff + nYSize) { + if (pnValidityFlag) + *pnValidityFlag = GCMVF_NO_INTERSECTION; + // We are far from the blend line - everything is masked to zero. // It would be nice to realize no work is required for this whole // chunk! @@ -342,6 +360,9 @@ if (sEnvelope.Contains(sChunkEnvelope) && OGRGeometry::FromHandle(hPolygon)->Contains(&oChunkFootprint)) { + if (pnValidityFlag) + *pnValidityFlag = GCMVF_CHUNK_FULLY_WITHIN_CUTLINE; + CPLDebug("WARP", "Source chunk fully contained within cutline."); return CE_None; } diff -Nru gdal-3.6.2+dfsg/alg/gdalgeoloc.cpp gdal-3.6.4+dfsg/alg/gdalgeoloc.cpp --- gdal-3.6.2+dfsg/alg/gdalgeoloc.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/alg/gdalgeoloc.cpp 2023-04-17 11:50:19.000000000 +0000 @@ -974,9 +974,11 @@ const double C = (x1 - x) * (y1 - y3) - (y1 - y) * (x1 - x3); const double denom = A - 2 * B + C; double s; - if (fabs(denom) <= 1e-12) + const double magnitudeOfValues = fabs(A) + fabs(B) + fabs(C); + if (fabs(denom) <= 1e-12 * magnitudeOfValues) { // Happens typically when the x_i,y_i points form a rectangle + // Can also happen when they form a triangle. s = A / (A - C); } else @@ -991,14 +993,14 @@ } const double t_denom_x = (1 - s) * (x0 - x2) + s * (x1 - x3); - if (fabs(t_denom_x) > 1e-12) + if (fabs(t_denom_x) > 1e-12 * magnitudeOfValues) { i += ((1 - s) * (x0 - x) + s * (x1 - x)) / t_denom_x; } else { const double t_denom_y = (1 - s) * (y0 - y2) + s * (y1 - y3); - if (fabs(t_denom_y) > 1e-12) + if (fabs(t_denom_y) > 1e-12 * magnitudeOfValues) { i += ((1 - s) * (y0 - y) + s * (y1 - y)) / t_denom_y; } diff -Nru gdal-3.6.2+dfsg/alg/gdalrasterpolygonenumerator.cpp gdal-3.6.4+dfsg/alg/gdalrasterpolygonenumerator.cpp --- gdal-3.6.2+dfsg/alg/gdalrasterpolygonenumerator.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/alg/gdalrasterpolygonenumerator.cpp 2023-04-17 11:50:19.000000000 +0000 @@ -31,6 +31,7 @@ #include "gdal_alg_priv.h" #include +#include #include "cpl_conv.h" #include "cpl_error.h" @@ -129,21 +130,53 @@ DataType nValue) { - const int nPolyId = nNextPolygonId; - + if (nNextPolygonId == std::numeric_limits::max()) + { + CPLError(CE_Failure, CPLE_AppDefined, + "GDALRasterPolygonEnumeratorT::NewPolygon(): maximum number " + "of polygons reached"); + return -1; + } if (nNextPolygonId >= nPolyAlloc) { - nPolyAlloc = nPolyAlloc * 2 + 20; - panPolyIdMap = static_cast( - CPLRealloc(panPolyIdMap, nPolyAlloc * sizeof(GInt32))); - panPolyValue = static_cast( - CPLRealloc(panPolyValue, nPolyAlloc * sizeof(DataType))); + int nPolyAllocNew; + if (nPolyAlloc < (std::numeric_limits::max() - 20) / 2) + nPolyAllocNew = nPolyAlloc * 2 + 20; + else + nPolyAllocNew = std::numeric_limits::max(); +#if SIZEOF_VOIDP == 4 + if (nPolyAllocNew > + static_cast(std::numeric_limits::max() / + sizeof(GInt32)) || + nPolyAllocNew > + static_cast(std::numeric_limits::max() / + sizeof(DataType))) + { + CPLError(CE_Failure, CPLE_OutOfMemory, + "GDALRasterPolygonEnumeratorT::NewPolygon(): too many " + "polygons"); + return -1; + } +#endif + auto panPolyIdMapNew = static_cast( + VSI_REALLOC_VERBOSE(panPolyIdMap, nPolyAllocNew * sizeof(GInt32))); + auto panPolyValueNew = static_cast(VSI_REALLOC_VERBOSE( + panPolyValue, nPolyAllocNew * sizeof(DataType))); + if (panPolyIdMapNew == nullptr || panPolyValueNew == nullptr) + { + VSIFree(panPolyIdMapNew); + VSIFree(panPolyValueNew); + return -1; + } + panPolyIdMap = panPolyIdMapNew; + panPolyValue = panPolyValueNew; + nPolyAlloc = nPolyAllocNew; } - nNextPolygonId++; - + const int nPolyId = nNextPolygonId; panPolyIdMap[nPolyId] = nPolyId; panPolyValue[nPolyId] = nValue; + nNextPolygonId++; return nPolyId; } @@ -197,7 +230,7 @@ /************************************************************************/ template -void GDALRasterPolygonEnumeratorT::ProcessLine( +bool GDALRasterPolygonEnumeratorT::ProcessLine( DataType *panLastLineVal, DataType *panThisLineVal, GInt32 *panLastLineId, GInt32 *panThisLineId, int nXSize) @@ -219,6 +252,8 @@ !(eq.operator()(panThisLineVal[i], panThisLineVal[i - 1]))) { panThisLineId[i] = NewPolygon(panThisLineVal[i]); + if (panThisLineId[i] < 0) + return false; } else { @@ -226,7 +261,7 @@ } } - return; + return true; } /* -------------------------------------------------------------------- */ @@ -292,8 +327,11 @@ else { panThisLineId[i] = NewPolygon(panThisLineVal[i]); + if (panThisLineId[i] < 0) + return false; } } + return true; } template class GDALRasterPolygonEnumeratorT; diff -Nru gdal-3.6.2+dfsg/alg/gdalsievefilter.cpp gdal-3.6.4+dfsg/alg/gdalsievefilter.cpp --- gdal-3.6.2+dfsg/alg/gdalsievefilter.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/alg/gdalsievefilter.cpp 2023-04-17 11:50:19.000000000 +0000 @@ -256,13 +256,21 @@ if (eErr == CE_None && hMaskBand != nullptr) eErr = GPMaskImageData(hMaskBand, pabyMaskLine, iY, nXSize, panThisLineVal); + if (eErr != CE_None) + break; if (iY == 0) - oFirstEnum.ProcessLine(nullptr, panThisLineVal, nullptr, - panThisLineId, nXSize); + eErr = oFirstEnum.ProcessLine(nullptr, panThisLineVal, nullptr, + panThisLineId, nXSize) + ? CE_None + : CE_Failure; else - oFirstEnum.ProcessLine(panLastLineVal, panThisLineVal, - panLastLineId, panThisLineId, nXSize); + eErr = oFirstEnum.ProcessLine(panLastLineVal, panThisLineVal, + panLastLineId, panThisLineId, nXSize) + ? CE_None + : CE_Failure; + if (eErr != CE_None) + break; /* -------------------------------------------------------------------- */ @@ -293,8 +301,7 @@ /* Report progress, and support interrupts. */ /* -------------------------------------------------------------------- */ - if (eErr == CE_None && - !pfnProgress(0.25 * ((iY + 1) / static_cast(nYSize)), "", + if (!pfnProgress(0.25 * ((iY + 1) / static_cast(nYSize)), "", pProgressArg)) { CPLError(CE_Failure, CPLE_UserInterrupt, "User terminated"); @@ -307,7 +314,8 @@ /* points to the final id it should use, not an intermediate */ /* value. */ /* -------------------------------------------------------------------- */ - oFirstEnum.CompleteMerges(); + if (eErr == CE_None) + oFirstEnum.CompleteMerges(); /* -------------------------------------------------------------------- */ /* Push the sizes of merged polygon fragments into the */ @@ -372,11 +380,18 @@ /* -------------------------------------------------------------------- */ if (iY == 0) - oSecondEnum.ProcessLine(nullptr, panThisLineVal, nullptr, - panThisLineId, nXSize); + eErr = oSecondEnum.ProcessLine(nullptr, panThisLineVal, nullptr, + panThisLineId, nXSize) + ? CE_None + : CE_Failure; else - oSecondEnum.ProcessLine(panLastLineVal, panThisLineVal, - panLastLineId, panThisLineId, nXSize); + eErr = oSecondEnum.ProcessLine(panLastLineVal, panThisLineVal, + panLastLineId, panThisLineId, nXSize) + ? CE_None + : CE_Failure; + + if (eErr != CE_None) + continue; /* -------------------------------------------------------------------- */ diff -Nru gdal-3.6.2+dfsg/alg/gdalwarper.cpp gdal-3.6.4+dfsg/alg/gdalwarper.cpp --- gdal-3.6.2+dfsg/alg/gdalwarper.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/alg/gdalwarper.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -47,6 +47,7 @@ #include "gdal_priv.h" #include "ogr_api.h" #include "ogr_core.h" +#include "vrtdataset.h" // for VRTSerializeNoData #if (defined(__x86_64) || defined(_M_X64)) #include @@ -1758,12 +1759,11 @@ if (psWO->padfSrcNoDataReal != nullptr) { - if (CPLIsNan(psWO->padfSrcNoDataReal[i])) - CPLCreateXMLElementAndValue(psBand, "SrcNoDataReal", "nan"); - else - CPLCreateXMLElementAndValue( - psBand, "SrcNoDataReal", - CPLString().Printf("%.16g", psWO->padfSrcNoDataReal[i])); + CPLCreateXMLElementAndValue( + psBand, "SrcNoDataReal", + VRTSerializeNoData(psWO->padfSrcNoDataReal[i], + psWO->eWorkingDataType, 16) + .c_str()); } if (psWO->padfSrcNoDataImag != nullptr) @@ -1784,12 +1784,11 @@ if (psWO->padfDstNoDataReal != nullptr) { - if (CPLIsNan(psWO->padfDstNoDataReal[i])) - CPLCreateXMLElementAndValue(psBand, "DstNoDataReal", "nan"); - else - CPLCreateXMLElementAndValue( - psBand, "DstNoDataReal", - CPLString().Printf("%.16g", psWO->padfDstNoDataReal[i])); + CPLCreateXMLElementAndValue( + psBand, "DstNoDataReal", + VRTSerializeNoData(psWO->padfDstNoDataReal[i], + psWO->eWorkingDataType, 16) + .c_str()); } if (psWO->padfDstNoDataImag != nullptr) @@ -2024,6 +2023,28 @@ if (pszValue != nullptr) psWO->panDstBands[iBand] = atoi(pszValue); + const auto NormalizeValue = [](const char *pszValueIn, + GDALDataType eDataType) -> double + { + if (eDataType == GDT_Float32 && + CPLString().Printf( + "%.16g", -std::numeric_limits::max()) == pszValueIn) + { + return -std::numeric_limits::max(); + } + else if (eDataType == GDT_Float32 && + CPLString().Printf("%.16g", + std::numeric_limits::max()) == + pszValueIn) + { + return std::numeric_limits::max(); + } + else + { + return CPLAtof(pszValueIn); + } + }; + /* -------------------------------------------------------------------- */ /* Source nodata. */ @@ -2033,7 +2054,8 @@ if (pszValue != nullptr) { GDALWarpInitSrcNoDataReal(psWO, -1.1e20); - psWO->padfSrcNoDataReal[iBand] = CPLAtof(pszValue); + psWO->padfSrcNoDataReal[iBand] = + NormalizeValue(pszValue, psWO->eWorkingDataType); } pszValue = CPLGetXMLValue(psBand, "SrcNoDataImag", nullptr); @@ -2052,7 +2074,8 @@ if (pszValue != nullptr) { GDALWarpInitDstNoDataReal(psWO, -1.1e20); - psWO->padfDstNoDataReal[iBand] = CPLAtof(pszValue); + psWO->padfDstNoDataReal[iBand] = + NormalizeValue(pszValue, psWO->eWorkingDataType); } pszValue = CPLGetXMLValue(psBand, "DstNoDataImag", nullptr); diff -Nru gdal-3.6.2+dfsg/alg/gdalwarper.h gdal-3.6.4+dfsg/alg/gdalwarper.h --- gdal-3.6.2+dfsg/alg/gdalwarper.h 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/alg/gdalwarper.h 2023-04-17 11:50:19.000000000 +0000 @@ -132,6 +132,17 @@ int nXSize, int nYSize, GByte ** /* ppImageData */, int bMaskIsFloat, void *pValidityMask); + +/* GCMVF stands for GDALWARP_CUTLINE_MASKER_VALIDITY_FLAG */ +#define GCMVF_PARTIAL_INTERSECTION 0 +#define GCMVF_NO_INTERSECTION 1 +#define GCMVF_CHUNK_FULLY_WITHIN_CUTLINE 2 +CPLErr CPL_DLL GDALWarpCutlineMaskerEx(void *pMaskFuncArg, int nBandCount, + GDALDataType eType, int nXOff, int nYOff, + int nXSize, int nYSize, + GByte ** /* ppImageData */, + int bMaskIsFloat, void *pValidityMask, + int *pnValidityFlag); /*! @endcond */ /************************************************************************/ diff -Nru gdal-3.6.2+dfsg/alg/gdalwarpkernel.cpp gdal-3.6.4+dfsg/alg/gdalwarpkernel.cpp --- gdal-3.6.2+dfsg/alg/gdalwarpkernel.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/alg/gdalwarpkernel.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -1213,12 +1213,47 @@ !bApplyVerticalShift && CPLFetchBool(papszWarpOptions, "USE_OPENCL", true)) { - const CPLErr eResult = GWKOpenCLCase(this); + if (pafUnifiedSrcDensity != nullptr) + { + // If pafUnifiedSrcDensity is only set to 1.0, then we can + // discard it. + bool bFoundNotOne = false; + for (GPtrDiff_t j = 0; + j < static_cast(nSrcXSize) * nSrcYSize; j++) + { + if (pafUnifiedSrcDensity[j] != 1.0) + { + bFoundNotOne = true; + break; + } + } + if (!bFoundNotOne) + { + CPLFree(pafUnifiedSrcDensity); + pafUnifiedSrcDensity = nullptr; + } + } - // CE_Warning tells us a suitable OpenCL environment was not available - // so we fall through to other CPU based methods. - if (eResult != CE_Warning) - return eResult; + if (pafUnifiedSrcDensity != nullptr) + { + // Typically if there's a cutline or an alpha band + static bool bHasWarned = false; + if (!bHasWarned) + { + bHasWarned = true; + CPLDebug("WARP", "pafUnifiedSrcDensity is not null, " + "hence OpenCL warper cannot be used"); + } + } + else + { + const CPLErr eResult = GWKOpenCLCase(this); + + // CE_Warning tells us a suitable OpenCL environment was not available + // so we fall through to other CPU based methods. + if (eResult != CE_Warning) + return eResult; + } } #endif // defined HAVE_OPENCL @@ -4984,6 +5019,12 @@ GDALWarpKernel *poWK = psJob->poWK; const int iYMin = psJob->iYMin; const int iYMax = psJob->iYMax; + const double dfMultFactorVerticalShiftPipeline = + poWK->bApplyVerticalShift + ? CPLAtof(CSLFetchNameValueDef( + poWK->papszWarpOptions, "MULT_FACTOR_VERTICAL_SHIFT_PIPELINE", + "1.0")) + : 0.0; int nDstXSize = poWK->nDstXSize; int nSrcXSize = poWK->nSrcXSize; @@ -5153,7 +5194,7 @@ // from target to source dfValueReal = dfValueReal * poWK->dfMultFactorVerticalShift - - padfZ[iDstX]; + padfZ[iDstX] * dfMultFactorVerticalShiftPipeline; } bHasFoundDensity = true; @@ -5227,6 +5268,12 @@ const int nDstXSize = poWK->nDstXSize; const int nSrcXSize = poWK->nSrcXSize; const int nSrcYSize = poWK->nSrcYSize; + const double dfMultFactorVerticalShiftPipeline = + poWK->bApplyVerticalShift + ? CPLAtof(CSLFetchNameValueDef( + poWK->papszWarpOptions, "MULT_FACTOR_VERTICAL_SHIFT_PIPELINE", + "1.0")) + : 0.0; /* -------------------------------------------------------------------- */ /* Allocate x,y,z coordinate arrays for transformation ... one */ @@ -5426,7 +5473,7 @@ // from target to source dfValueReal = dfValueReal * poWK->dfMultFactorVerticalShift - - padfZ[iDstX]; + padfZ[iDstX] * dfMultFactorVerticalShiftPipeline; } bHasFoundDensity = true; @@ -5495,6 +5542,12 @@ GDALWarpKernel *poWK = psJob->poWK; const int iYMin = psJob->iYMin; const int iYMax = psJob->iYMax; + const double dfMultFactorVerticalShiftPipeline = + poWK->bApplyVerticalShift + ? CPLAtof(CSLFetchNameValueDef( + poWK->papszWarpOptions, "MULT_FACTOR_VERTICAL_SHIFT_PIPELINE", + "1.0")) + : 0.0; const int nDstXSize = poWK->nDstXSize; const int nSrcXSize = poWK->nSrcXSize; @@ -5612,7 +5665,8 @@ // Subtract padfZ[] since the coordinate transformation is // from target to source value = GWKClampValueT( - value * poWK->dfMultFactorVerticalShift - padfZ[iDstX]); + value * poWK->dfMultFactorVerticalShift - + padfZ[iDstX] * dfMultFactorVerticalShiftPipeline); } if (poWK->pafDstDensity) @@ -5727,6 +5781,12 @@ GDALWarpKernel *poWK = psJob->poWK; const int iYMin = psJob->iYMin; const int iYMax = psJob->iYMax; + const double dfMultFactorVerticalShiftPipeline = + poWK->bApplyVerticalShift + ? CPLAtof(CSLFetchNameValueDef( + poWK->papszWarpOptions, "MULT_FACTOR_VERTICAL_SHIFT_PIPELINE", + "1.0")) + : 0.0; const int nDstXSize = poWK->nDstXSize; const int nSrcXSize = poWK->nSrcXSize; @@ -5855,7 +5915,7 @@ // is from target to source value = GWKClampValueT( value * poWK->dfMultFactorVerticalShift - - padfZ[iDstX]); + padfZ[iDstX] * dfMultFactorVerticalShiftPipeline); } if (dfBandDensity < 1.0) @@ -6021,6 +6081,12 @@ GDALWarpKernel *poWK = psJob->poWK; const int iYMin = psJob->iYMin; const int iYMax = psJob->iYMax; + const double dfMultFactorVerticalShiftPipeline = + poWK->bApplyVerticalShift + ? CPLAtof(CSLFetchNameValueDef( + poWK->papszWarpOptions, "MULT_FACTOR_VERTICAL_SHIFT_PIPELINE", + "1.0")) + : 0.0; const int nDstXSize = poWK->nDstXSize; const int nSrcXSize = poWK->nSrcXSize; @@ -6401,7 +6467,8 @@ // transformation is from target to source dfValueReal = dfValueReal * poWK->dfMultFactorVerticalShift - - padfZ[iDstX]; + padfZ[iDstX] * + dfMultFactorVerticalShiftPipeline; } if (bIsComplex) @@ -6469,7 +6536,8 @@ // transformation is from target to source dfValueReal = dfValueReal * poWK->dfMultFactorVerticalShift - - padfZ[iDstX]; + padfZ[iDstX] * + dfMultFactorVerticalShiftPipeline; } if (bIsComplex) @@ -6536,7 +6604,8 @@ // transformation is from target to source dfValueReal = dfValueReal * poWK->dfMultFactorVerticalShift - - padfZ[iDstX]; + padfZ[iDstX] * + dfMultFactorVerticalShiftPipeline; } if (bIsComplex) @@ -6628,7 +6697,8 @@ dfValueReal = dfValueReal * poWK->dfMultFactorVerticalShift - - padfZ[iDstX]; + padfZ[iDstX] * + dfMultFactorVerticalShiftPipeline; } dfBandDensity = 1; @@ -6692,7 +6762,8 @@ dfValueReal = dfValueReal * poWK->dfMultFactorVerticalShift - - padfZ[iDstX]; + padfZ[iDstX] * + dfMultFactorVerticalShiftPipeline; } dfBandDensity = 1; @@ -6752,7 +6823,8 @@ // transformation is from target to source dfValueReal = dfValueReal * poWK->dfMultFactorVerticalShift - - padfZ[iDstX]; + padfZ[iDstX] * + dfMultFactorVerticalShiftPipeline; } dfBandDensity = 1; @@ -6811,7 +6883,8 @@ // transformation is from target to source dfValueReal = dfValueReal * poWK->dfMultFactorVerticalShift - - padfZ[iDstX]; + padfZ[iDstX] * + dfMultFactorVerticalShiftPipeline; } dfBandDensity = 1; @@ -6872,7 +6945,8 @@ // transformation is from target to source dfValueReal = dfValueReal * poWK->dfMultFactorVerticalShift - - padfZ[iDstX]; + padfZ[iDstX] * + dfMultFactorVerticalShiftPipeline; } dfBandDensity = 1; diff -Nru gdal-3.6.2+dfsg/alg/gdalwarpoperation.cpp gdal-3.6.4+dfsg/alg/gdalwarpoperation.cpp --- gdal-3.6.2+dfsg/alg/gdalwarpoperation.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/alg/gdalwarpoperation.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -1949,7 +1949,9 @@ if (eErr == CE_None && psOptions->hCutline != nullptr && nSrcXSize > 0 && nSrcYSize > 0) { - if (oWK.pafUnifiedSrcDensity == nullptr) + const bool bUnifiedSrcDensityJustCreated = + (oWK.pafUnifiedSrcDensity == nullptr); + if (bUnifiedSrcDensityJustCreated) { eErr = CreateKernelMask(&oWK, 0 /* not used */, "UnifiedSrcDensity"); @@ -1963,11 +1965,19 @@ } } + int nValidityFlag = 0; if (eErr == CE_None) - eErr = GDALWarpCutlineMasker( + eErr = GDALWarpCutlineMaskerEx( psOptions, psOptions->nBandCount, psOptions->eWorkingDataType, oWK.nSrcXOff, oWK.nSrcYOff, oWK.nSrcXSize, oWK.nSrcYSize, - oWK.papabySrcImage, TRUE, oWK.pafUnifiedSrcDensity); + oWK.papabySrcImage, TRUE, oWK.pafUnifiedSrcDensity, + &nValidityFlag); + if (nValidityFlag == GCMVF_CHUNK_FULLY_WITHIN_CUTLINE && + bUnifiedSrcDensityJustCreated) + { + VSIFree(oWK.pafUnifiedSrcDensity); + oWK.pafUnifiedSrcDensity = nullptr; + } } /* -------------------------------------------------------------------- */ diff -Nru gdal-3.6.2+dfsg/alg/llrasterize.cpp gdal-3.6.4+dfsg/alg/llrasterize.cpp --- gdal-3.6.2+dfsg/alg/llrasterize.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/alg/llrasterize.cpp 2023-04-17 11:50:19.000000000 +0000 @@ -376,6 +376,12 @@ bool bIntersectOnly) { + // This is an epsilon to detect geometries that are aligned with pixel + // coordinates. Hard to find the right value. We put it to that value + // to satisfy the scenarios of https://github.com/OSGeo/gdal/issues/7523 + // and https://github.com/OSGeo/gdal/issues/6414 + constexpr double EPSILON_INTERSECT_ONLY = 1e-4; + if (!nPartCount) return; @@ -425,8 +431,10 @@ { if (bIntersectOnly) { - if (std::abs(dfX - std::round(dfX)) < 0.01 && - std::abs(dfXEnd - std::round(dfXEnd)) < 0.01) + if (std::abs(dfX - std::round(dfX)) < + EPSILON_INTERSECT_ONLY && + std::abs(dfXEnd - std::round(dfXEnd)) < + EPSILON_INTERSECT_ONLY) continue; } @@ -502,8 +510,10 @@ { if (bIntersectOnly) { - if (std::abs(dfY - std::round(dfY)) < 0.01 && - std::abs(dfYEnd - std::round(dfYEnd)) < 0.01) + if (std::abs(dfY - std::round(dfY)) < + EPSILON_INTERSECT_ONLY && + std::abs(dfYEnd - std::round(dfYEnd)) < + EPSILON_INTERSECT_ONLY) continue; } diff -Nru gdal-3.6.2+dfsg/alg/polygonize.cpp gdal-3.6.4+dfsg/alg/polygonize.cpp --- gdal-3.6.2+dfsg/alg/polygonize.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/alg/polygonize.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -582,6 +583,11 @@ /* -------------------------------------------------------------------- */ const int nXSize = GDALGetRasterBandXSize(hSrcBand); const int nYSize = GDALGetRasterBandYSize(hSrcBand); + if (nXSize > std::numeric_limits::max() - 2) + { + CPLError(CE_Failure, CPLE_AppDefined, "Too wide raster"); + return CE_Failure; + } DataType *panLastLineVal = static_cast( VSI_MALLOC2_VERBOSE(sizeof(DataType), nXSize + 2)); @@ -661,13 +667,21 @@ if (eErr == CE_None && hMaskBand != nullptr) eErr = GPMaskImageData(hMaskBand, pabyMaskLine, iY, nXSize, panThisLineVal); + if (eErr != CE_None) + break; if (iY == 0) - oFirstEnum.ProcessLine(nullptr, panThisLineVal, nullptr, - panThisLineId, nXSize); + eErr = oFirstEnum.ProcessLine(nullptr, panThisLineVal, nullptr, + panThisLineId, nXSize) + ? CE_None + : CE_Failure; else - oFirstEnum.ProcessLine(panLastLineVal, panThisLineVal, - panLastLineId, panThisLineId, nXSize); + eErr = oFirstEnum.ProcessLine(panLastLineVal, panThisLineVal, + panLastLineId, panThisLineId, nXSize) + ? CE_None + : CE_Failure; + if (eErr != CE_None) + break; // Swap lines. std::swap(panLastLineVal, panThisLineVal); @@ -678,8 +692,7 @@ /* Report progress, and support interrupts. */ /* -------------------------------------------------------------------- */ - if (eErr == CE_None && - !pfnProgress(0.10 * ((iY + 1) / static_cast(nYSize)), "", + if (!pfnProgress(0.10 * ((iY + 1) / static_cast(nYSize)), "", pProgressArg)) { CPLError(CE_Failure, CPLE_UserInterrupt, "User terminated"); @@ -692,7 +705,8 @@ /* points to the final id it should use, not an intermediate */ /* value. */ /* -------------------------------------------------------------------- */ - oFirstEnum.CompleteMerges(); + if (eErr == CE_None) + oFirstEnum.CompleteMerges(); /* -------------------------------------------------------------------- */ /* Initialize ids to -1 to serve as a nodata value for the */ @@ -712,7 +726,9 @@ GDALRasterPolygonEnumeratorT oSecondEnum( nConnectedness); RPolygon **papoPoly = static_cast( - CPLCalloc(sizeof(RPolygon *), oFirstEnum.nNextPolygonId)); + VSI_CALLOC_VERBOSE(sizeof(RPolygon *), oFirstEnum.nNextPolygonId)); + if (oFirstEnum.nNextPolygonId && papoPoly == nullptr) + eErr = CE_Failure; /* ==================================================================== */ /* Second pass during which we will actually collect polygon */ @@ -751,16 +767,23 @@ } else if (iY == 0) { - oSecondEnum.ProcessLine(nullptr, panThisLineVal, nullptr, - panThisLineId + 1, nXSize); + eErr = oSecondEnum.ProcessLine(nullptr, panThisLineVal, nullptr, + panThisLineId + 1, nXSize) + ? CE_None + : CE_Failure; } else { - oSecondEnum.ProcessLine(panLastLineVal, panThisLineVal, - panLastLineId + 1, panThisLineId + 1, - nXSize); + eErr = oSecondEnum.ProcessLine(panLastLineVal, panThisLineVal, + panLastLineId + 1, panThisLineId + 1, + nXSize) + ? CE_None + : CE_Failure; } + if (eErr != CE_None) + continue; + /* -------------------------------------------------------------------- */ /* Add polygon edges to our polygon list for the pixel */ diff -Nru gdal-3.6.2+dfsg/apps/gdal_grid_lib.cpp gdal-3.6.4+dfsg/apps/gdal_grid_lib.cpp --- gdal-3.6.2+dfsg/apps/gdal_grid_lib.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/apps/gdal_grid_lib.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -282,6 +282,9 @@ if (poClipSrc && !p->Within(poClipSrc)) return; + if (iBurnField < 0 && std::isnan(p->getZ())) + return; + adfX.push_back(p->getX()); adfY.push_back(p->getY()); if (iBurnField < 0) @@ -345,11 +348,14 @@ const OGRGeometry *poGeom = poFeat->GetGeometryRef(); if (poGeom) { - double dfBurnValue = 0.0; - if (iBurnField >= 0) - dfBurnValue = poFeat->GetFieldAsDouble(iBurnField); - oVisitor.dfBurnValue = dfBurnValue; + { + if (!poFeat->IsFieldSetAndNotNull(iBurnField)) + { + continue; + } + oVisitor.dfBurnValue = poFeat->GetFieldAsDouble(iBurnField); + } poGeom->accept(&oVisitor); } diff -Nru gdal-3.6.2+dfsg/apps/gdallocationinfo.cpp gdal-3.6.4+dfsg/apps/gdallocationinfo.cpp --- gdal-3.6.2+dfsg/apps/gdallocationinfo.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/apps/gdallocationinfo.cpp 2023-04-17 11:50:19.000000000 +0000 @@ -434,14 +434,18 @@ /* Report the pixel value of this band. */ /* -------------------------------------------------------------------- */ - double adfPixel[2]; + double adfPixel[2] = {0, 0}; + const bool bIsComplex = CPL_TO_BOOL( + GDALDataTypeIsComplex(GDALGetRasterDataType(hBand))); if (GDALRasterIO(hBand, GF_Read, iPixelToQuery, iLineToQuery, 1, 1, - adfPixel, 1, 1, GDT_CFloat64, 0, 0) == CE_None) + adfPixel, 1, 1, + bIsComplex ? GDT_CFloat64 : GDT_Float64, 0, + 0) == CE_None) { CPLString osValue; - if (GDALDataTypeIsComplex(GDALGetRasterDataType(hBand))) + if (bIsComplex) osValue.Printf("%.15g+%.15gi", adfPixel[0], adfPixel[1]); else osValue.Printf("%.15g", adfPixel[0]); @@ -482,11 +486,13 @@ if (dfOffset != 0.0 || dfScale != 1.0) { adfPixel[0] = adfPixel[0] * dfScale + dfOffset; - adfPixel[1] = adfPixel[1] * dfScale + dfOffset; - if (GDALDataTypeIsComplex(GDALGetRasterDataType(hBand))) + if (bIsComplex) + { + adfPixel[1] = adfPixel[1] * dfScale + dfOffset; osValue.Printf("%.15g+%.15gi", adfPixel[0], adfPixel[1]); + } else osValue.Printf("%.15g", adfPixel[0]); diff -Nru gdal-3.6.2+dfsg/apps/gdalmdimtranslate_lib.cpp gdal-3.6.4+dfsg/apps/gdalmdimtranslate_lib.cpp --- gdal-3.6.2+dfsg/apps/gdalmdimtranslate_lib.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/apps/gdalmdimtranslate_lib.cpp 2023-04-17 11:50:19.000000000 +0000 @@ -1022,7 +1022,7 @@ indexingVarSpec = srcIndexVar->GetFullName(); } } - if (srcIndexVar && + if (srcIndexVar && !indexingVarSpec.empty() && srcIndexVar->GetFullName() != srcArray->GetFullName()) { if (poSrcRootGroup) @@ -1683,20 +1683,7 @@ (!psOptions->aosArraySpec.empty() || !psOptions->aosGroup.empty() || !psOptions->aosSubset.empty() || !psOptions->aosScaleFactor.empty())) { - auto poVRTDriver = GDALDriver::FromHandle(GDALGetDriverByName("VRT")); - if (!poVRTDriver) - { -#ifdef this_is_dead_code_for_now - if (bCloseOutDSOnError) -#endif - { - GDALClose(hDstDS); - hDstDS = nullptr; - } - return nullptr; - } - poTmpDS.reset( - poVRTDriver->CreateMultiDimensional("", nullptr, nullptr)); + poTmpDS.reset(VRTDataset::CreateMultiDimensional("", nullptr, nullptr)); CPLAssert(poTmpDS); poTmpSrcDS = poTmpDS.get(); diff -Nru gdal-3.6.2+dfsg/apps/gdalsrsinfo.cpp gdal-3.6.4+dfsg/apps/gdalsrsinfo.cpp --- gdal-3.6.2+dfsg/apps/gdalsrsinfo.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/apps/gdalsrsinfo.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -466,7 +466,7 @@ if (bPrintSep) printf("PROJ.4 : "); oSRS.exportToProj4(&pszOutput); - printf("%s\n", pszOutput); + printf("%s\n", pszOutput ? pszOutput : "(error)"); } else if (EQUAL("PROJJSON", pszOutputType)) @@ -476,7 +476,7 @@ const char *const apszOptions[] = { bPretty ? "MULTILINE=YES" : "MULTILINE=NO", nullptr}; oSRS.exportToPROJJSON(&pszOutput, apszOptions); - printf("%s\n", pszOutput); + printf("%s\n", pszOutput ? pszOutput : "(error)"); } else if (EQUAL("wkt1", pszOutputType)) @@ -486,7 +486,7 @@ const char *const apszOptions[] = { "FORMAT=WKT1_GDAL", bPretty ? "MULTILINE=YES" : nullptr, nullptr}; oSRS.exportToWkt(&pszOutput, apszOptions); - printf("%s\n", pszOutput); + printf("%s\n", pszOutput ? pszOutput : "(error)"); } else if (EQUAL("wkt_simple", pszOutputType)) @@ -496,7 +496,7 @@ const char *const apszOptions[] = { "FORMAT=WKT1_SIMPLE", bPretty ? "MULTILINE=YES" : nullptr, nullptr}; oSRS.exportToWkt(&pszOutput, apszOptions); - printf("%s\n", pszOutput); + printf("%s\n", pszOutput ? pszOutput : "(error)"); } else if (EQUAL("wkt_noct", pszOutputType)) @@ -506,7 +506,7 @@ const char *const apszOptions[] = { "FORMAT=SFSQL", bPretty ? "MULTILINE=YES" : nullptr, nullptr}; oSRS.exportToWkt(&pszOutput, apszOptions); - printf("%s\n", pszOutput); + printf("%s\n", pszOutput ? pszOutput : "(error)"); } else if (EQUAL("wkt_esri", pszOutputType)) @@ -516,7 +516,7 @@ const char *const apszOptions[] = { "FORMAT=WKT1_ESRI", bPretty ? "MULTILINE=YES" : nullptr, nullptr}; oSRS.exportToWkt(&pszOutput, apszOptions); - printf("%s\n", pszOutput); + printf("%s\n", pszOutput ? pszOutput : "(error)"); } else if (EQUAL("wkt2_2015", pszOutputType)) @@ -526,7 +526,7 @@ const char *const apszOptions[] = { "FORMAT=WKT2_2015", bPretty ? "MULTILINE=YES" : nullptr, nullptr}; oSRS.exportToWkt(&pszOutput, apszOptions); - printf("%s\n", pszOutput); + printf("%s\n", pszOutput ? pszOutput : "(error)"); } else if (EQUAL("wkt", pszOutputType) || EQUAL("wkt2", pszOutputType) || @@ -538,7 +538,7 @@ const char *const apszOptions[] = { "FORMAT=WKT2_2018", bPretty ? "MULTILINE=YES" : nullptr, nullptr}; oSRS.exportToWkt(&pszOutput, apszOptions); - printf("%s\n", pszOutput); + printf("%s\n", pszOutput ? pszOutput : "(error)"); } else if (EQUAL("mapinfo", pszOutputType)) @@ -546,7 +546,7 @@ if (bPrintSep) printf("MAPINFO : "); oSRS.exportToMICoordSys(&pszOutput); - printf("\'%s\'\n", pszOutput); + printf("\'%s\'\n", pszOutput ? pszOutput : "(error)"); } else if (EQUAL("xml", pszOutputType)) @@ -554,7 +554,7 @@ if (bPrintSep) printf("XML :\n"); oSRS.exportToXML(&pszOutput, nullptr); - printf("%s\n", pszOutput); + printf("%s\n", pszOutput ? pszOutput : "(error)"); } else diff -Nru gdal-3.6.2+dfsg/apps/gdal_translate_lib.cpp gdal-3.6.4+dfsg/apps/gdal_translate_lib.cpp --- gdal-3.6.2+dfsg/apps/gdal_translate_lib.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/apps/gdal_translate_lib.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -1483,16 +1483,27 @@ { if (!psOptions->bQuiet) { - CPLError(CE_Warning, CPLE_AppDefined, - "Cannot get overview level %d. Defaulting to level %d", - psOptions->nOvLevel, nOvCount - 1); + if (nOvCount > 0) + { + CPLError(CE_Warning, CPLE_AppDefined, + "Cannot get overview level %d. " + "Defaulting to level %d.", + psOptions->nOvLevel, nOvCount - 1); + } + else + { + CPLError(CE_Warning, CPLE_AppDefined, + "Cannot get overview level %d. " + "Defaulting to full resolution.", + psOptions->nOvLevel); + } } if (nOvCount > 0) poSrcOvrDS = GDALCreateOverviewDataset(poSrcDS, nOvCount - 1, /* bThisLevelOnly = */ true); } - if (psOptions->dfXRes == 0.0 && !bOutsizeExplicitlySet) + if (poSrcOvrDS && psOptions->dfXRes == 0.0 && !bOutsizeExplicitlySet) { const double dfRatioX = static_cast(poSrcDSOri->GetRasterXSize()) / @@ -2095,12 +2106,26 @@ poVDS->AddBand(eBandType, aosAddBandOptions.List()); VRTSourcedRasterBand *poVRTBand = static_cast(poVDS->GetRasterBand(i + 1)); + if (nSrcBand < 0) { poVRTBand->AddMaskBandSource( poSrcBand, psOptions->adfSrcWin[0], psOptions->adfSrcWin[1], psOptions->adfSrcWin[2], psOptions->adfSrcWin[3], adfDstWin[0], adfDstWin[1], adfDstWin[2], adfDstWin[3]); + + // Color interpretation override + if (psOptions->panColorInterp) + { + if (i < psOptions->nColorInterpSize && + psOptions->panColorInterp[i] >= 0) + { + poVRTBand->SetColorInterpretation( + static_cast( + psOptions->panColorInterp[i])); + } + } + continue; } diff -Nru gdal-3.6.2+dfsg/apps/gdalwarp_lib.cpp gdal-3.6.4+dfsg/apps/gdalwarp_lib.cpp --- gdal-3.6.2+dfsg/apps/gdalwarp_lib.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/apps/gdalwarp_lib.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -535,34 +535,41 @@ double adfGT[6]; if (GDALGetGeoTransform(pahSrcDS[0], adfGT) == CE_None) { + // We allow for a relative error in coordinates up to 0.1% of the + // pixel size for rounding purposes. + constexpr double REL_EPS_PIXEL = 1e-3; if (CPLFetchBool(papszWarpOptions, "CUTLINE_ALL_TOUCHED", false)) { // All touched ? Then make the extent a bit larger than the // cutline envelope - dfMinX = - adfGT[0] + - floor((dfMinX - adfGT[0]) / adfGT[1] + 1e-8) * adfGT[1]; + dfMinX = adfGT[0] + + floor((dfMinX - adfGT[0]) / adfGT[1] + REL_EPS_PIXEL) * + adfGT[1]; dfMinY = adfGT[3] + - ceil((dfMinY - adfGT[3]) / adfGT[5] - 1e-8) * adfGT[5]; + ceil((dfMinY - adfGT[3]) / adfGT[5] - REL_EPS_PIXEL) * + adfGT[5]; dfMaxX = adfGT[0] + - ceil((dfMaxX - adfGT[0]) / adfGT[1] - 1e-8) * adfGT[1]; - dfMaxY = - adfGT[3] + - floor((dfMaxY - adfGT[3]) / adfGT[5] + 1e-8) * adfGT[5]; + ceil((dfMaxX - adfGT[0]) / adfGT[1] - REL_EPS_PIXEL) * + adfGT[1]; + dfMaxY = adfGT[3] + + floor((dfMaxY - adfGT[3]) / adfGT[5] + REL_EPS_PIXEL) * + adfGT[5]; } else { // Otherwise, make it a bit smaller dfMinX = adfGT[0] + - ceil((dfMinX - adfGT[0]) / adfGT[1] - 1e-8) * adfGT[1]; - dfMinY = - adfGT[3] + - floor((dfMinY - adfGT[3]) / adfGT[5] + 1e-8) * adfGT[5]; - dfMaxX = - adfGT[0] + - floor((dfMaxX - adfGT[0]) / adfGT[1] + 1e-8) * adfGT[1]; + ceil((dfMinX - adfGT[0]) / adfGT[1] - REL_EPS_PIXEL) * + adfGT[1]; + dfMinY = adfGT[3] + + floor((dfMinY - adfGT[3]) / adfGT[5] + REL_EPS_PIXEL) * + adfGT[5]; + dfMaxX = adfGT[0] + + floor((dfMaxX - adfGT[0]) / adfGT[1] + REL_EPS_PIXEL) * + adfGT[1]; dfMaxY = adfGT[3] + - ceil((dfMaxY - adfGT[3]) / adfGT[5] - 1e-8) * adfGT[5]; + ceil((dfMaxY - adfGT[3]) / adfGT[5] - REL_EPS_PIXEL) * + adfGT[5]; } } } @@ -693,6 +700,12 @@ const char *pszUnit = GDALGetRasterUnitType(GDALGetRasterBand(hWrkSrcDS, 1)); + double dfToMeterSrcAxis = 1.0; + if (bSrcHasVertAxis) + { + oSRSSrc.GetAxis(nullptr, 2, nullptr, &dfToMeterSrcAxis); + } + if (pszUnit && (EQUAL(pszUnit, "m") || EQUAL(pszUnit, "meter") || EQUAL(pszUnit, "metre"))) { @@ -710,10 +723,7 @@ { if (bSrcHasVertAxis) { - oSRSSrc.GetAxis(nullptr, 2, nullptr, &dfToMeterSrc); - CPLError(CE_Warning, CPLE_AppDefined, - "Unknown units=%s. Using source vertical units.", - pszUnit); + dfToMeterSrc = dfToMeterSrcAxis; } else { @@ -740,6 +750,16 @@ psWO->papszWarpOptions = CSLSetNameValue( psWO->papszWarpOptions, "MULT_FACTOR_VERTICAL_SHIFT", CPLSPrintf("%.18g", dfMultFactorVerticalShift)); + + const double dfMultFactorVerticalShiftPipeline = + dfToMeterSrcAxis / dfToMeterDst; + CPLDebug("WARP", + "Applying MULT_FACTOR_VERTICAL_SHIFT_PIPELINE=%.18g", + dfMultFactorVerticalShiftPipeline); + psWO->papszWarpOptions = CSLSetNameValue( + psWO->papszWarpOptions, + "MULT_FACTOR_VERTICAL_SHIFT_PIPELINE", + CPLSPrintf("%.18g", dfMultFactorVerticalShiftPipeline)); } } } @@ -2611,6 +2631,9 @@ if (psOptions->nOvLevel <= OVR_LEVEL_AUTO && nOvCount > 0) { double dfTargetRatio = 0; + double dfTargetRatioX = 0; + double dfTargetRatioY = 0; + if (bFigureoutCorrespondingWindow) { // If the user has explicitly set the target bounds and @@ -2641,19 +2664,30 @@ { double dfMinSrcX = std::numeric_limits::infinity(); double dfMaxSrcX = -std::numeric_limits::infinity(); + double dfMinSrcY = std::numeric_limits::infinity(); + double dfMaxSrcY = -std::numeric_limits::infinity(); for (int i = 0; i < nPoints; i++) { if (abSuccess[i]) { dfMinSrcX = std::min(dfMinSrcX, adfX[i]); dfMaxSrcX = std::max(dfMaxSrcX, adfX[i]); + dfMinSrcY = std::min(dfMinSrcY, adfY[i]); + dfMaxSrcY = std::max(dfMaxSrcY, adfY[i]); } } if (dfMaxSrcX > dfMinSrcX) { - dfTargetRatio = (dfMaxSrcX - dfMinSrcX) / - GDALGetRasterXSize(hDstDS); + dfTargetRatioX = (dfMaxSrcX - dfMinSrcX) / + GDALGetRasterXSize(hDstDS); + } + if (dfMaxSrcY > dfMinSrcY) + { + dfTargetRatioY = (dfMaxSrcY - dfMinSrcY) / + GDALGetRasterYSize(hDstDS); } + // take the minimum of these ratios #7019 + dfTargetRatio = std::min(dfTargetRatioX, dfTargetRatioY); } } else diff -Nru gdal-3.6.2+dfsg/apps/ogr2ogr_lib.cpp gdal-3.6.4+dfsg/apps/ogr2ogr_lib.cpp --- gdal-3.6.2+dfsg/apps/ogr2ogr_lib.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/apps/ogr2ogr_lib.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -463,26 +463,32 @@ class LayerTranslator { public: - GDALDataset *m_poSrcDS; - GDALDataset *m_poODS; - bool m_bTransform; - bool m_bWrapDateline; - CPLString m_osDateLineOffset; - OGRSpatialReference *m_poOutputSRS; - bool m_bNullifyOutputSRS; - OGRSpatialReference *m_poUserSourceSRS; - OGRCoordinateTransformation *m_poGCPCoordTrans; - int m_eGType; - GeomTypeConversion m_eGeomTypeConversion; - bool m_bMakeValid; - int m_nCoordDim; - GeomOperation m_eGeomOp; - double m_dfGeomOpParam; - OGRGeometry *m_poClipSrc; - OGRGeometry *m_poClipDst; - bool m_bExplodeCollections; - bool m_bNativeData; - GIntBig m_nLimit; + GDALDataset *m_poSrcDS = nullptr; + GDALDataset *m_poODS = nullptr; + bool m_bTransform = false; + bool m_bWrapDateline = false; + CPLString m_osDateLineOffset{}; + OGRSpatialReference *m_poOutputSRS = nullptr; + bool m_bNullifyOutputSRS = false; + OGRSpatialReference *m_poUserSourceSRS = nullptr; + OGRCoordinateTransformation *m_poGCPCoordTrans = nullptr; + int m_eGType = -1; + GeomTypeConversion m_eGeomTypeConversion = GTC_DEFAULT; + bool m_bMakeValid = false; + int m_nCoordDim = 0; + GeomOperation m_eGeomOp = GEOMOP_NONE; + double m_dfGeomOpParam = 0; + OGRGeometry *m_poClipSrcOri = nullptr; + bool m_bWarnedClipSrcSRS = false; + std::unique_ptr m_poClipSrcReprojectedToSrcSRS; + const OGRSpatialReference *m_poClipSrcReprojectedToSrcSRS_SRS = nullptr; + OGRGeometry *m_poClipDstOri = nullptr; + bool m_bWarnedClipDstSRS = false; + std::unique_ptr m_poClipDstReprojectedToDstSRS; + const OGRSpatialReference *m_poClipDstReprojectedToDstSRS_SRS = nullptr; + bool m_bExplodeCollections = false; + bool m_bNativeData = false; + GIntBig m_nLimit = -1; OGRGeometryFactory::TransformWithOptionsCache m_transformWithOptionsCache; int Translate(OGRFeature *poFeatureIn, TargetLayerInfo *psInfo, @@ -505,8 +511,8 @@ static OGRGeometry *LoadGeometry(const char *pszDS, const char *pszSQL, const char *pszLyr, const char *pszWhere) { - GDALDataset *poDS = - reinterpret_cast(OGROpen(pszDS, FALSE, nullptr)); + auto poDS = + std::unique_ptr(GDALDataset::Open(pszDS, GDAL_OF_VECTOR)); if (poDS == nullptr) return nullptr; @@ -522,14 +528,13 @@ { CPLError(CE_Failure, CPLE_AppDefined, "Failed to identify source layer from datasource."); - GDALClose(poDS); return nullptr; } if (pszWhere) poLyr->SetAttributeFilter(pszWhere); - OGRMultiPolygon *poMP = nullptr; + std::unique_ptr poMP; for (auto &poFeat : poLyr) { OGRGeometry *poSrcGeom = poFeat->GetGeometryRef(); @@ -539,7 +544,16 @@ wkbFlatten(poSrcGeom->getGeometryType()); if (poMP == nullptr) - poMP = new OGRMultiPolygon(); + { + poMP = cpl::make_unique(); + const auto poSRSSrc = poSrcGeom->getSpatialReference(); + if (poSRSSrc) + { + auto poSRSClone = poSRSSrc->Clone(); + poMP->assignSpatialReference(poSRSClone); + poSRSClone->Release(); + } + } if (eType == wkbPolygon) poMP->addGeometry(poSrcGeom); @@ -557,10 +571,8 @@ { CPLError(CE_Failure, CPLE_AppDefined, "Geometry not of polygon type."); - OGRGeometryFactory::destroyGeometry(poMP); if (pszSQL != nullptr) poDS->ReleaseResultSet(poLyr); - GDALClose(poDS); return nullptr; } } @@ -568,9 +580,8 @@ if (pszSQL != nullptr) poDS->ReleaseResultSet(poLyr); - GDALClose(poDS); - return poMP; + return poMP.release(); } /************************************************************************/ @@ -2020,8 +2031,8 @@ psOptions->pszGeomField); if (iGeomField >= 0) poSrcLayer->SetSpatialFilter( - iGeomField, reinterpret_cast( - psOptions->hSpatialFilter)); + iGeomField, + OGRGeometry::FromHandle(psOptions->hSpatialFilter)); else CPLError(CE_Warning, CPLE_AppDefined, "Cannot find geometry field %s in layer %s. " @@ -2032,8 +2043,7 @@ else { poSrcLayer->SetSpatialFilter( - reinterpret_cast( - psOptions->hSpatialFilter)); + OGRGeometry::FromHandle(psOptions->hSpatialFilter)); } } } @@ -2248,9 +2258,47 @@ return nullptr; } + /* -------------------------------------------------------------------- */ + /* Parse spatial filter SRS if needed. */ + /* -------------------------------------------------------------------- */ + struct l_OGRSpatialReferenceReleaser + { + void operator()(OGRSpatialReference *poSRS) const + { + if (poSRS) + poSRS->Release(); + } + }; + std::unique_ptr + poSpatSRS; + if (psOptions->hSpatialFilter != nullptr && + psOptions->pszSpatSRSDef != nullptr) + { + if (psOptions->pszSQLStatement) + { + CPLError(CE_Failure, CPLE_IllegalArg, + "-spat_srs not compatible with -sql."); + GDALVectorTranslateOptionsFree(psOptions); + return nullptr; + } + OGREnvelope sEnvelope; + OGR_G_GetEnvelope(psOptions->hSpatialFilter, &sEnvelope); + poSpatSRS.reset(new OGRSpatialReference()); + poSpatSRS->SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); + if (poSpatSRS->SetFromUserInput(psOptions->pszSpatSRSDef) != + OGRERR_NONE) + { + CPLError(CE_Failure, CPLE_AppDefined, + "Failed to process SRS definition: %s", + psOptions->pszSpatSRSDef); + GDALVectorTranslateOptionsFree(psOptions); + return nullptr; + } + } + if (psOptions->bClipSrc && psOptions->pszClipSrcDS != nullptr) { - psOptions->hClipSrc = reinterpret_cast(LoadGeometry( + psOptions->hClipSrc = OGRGeometry::ToHandle(LoadGeometry( psOptions->pszClipSrcDS, psOptions->pszClipSrcSQL, psOptions->pszClipSrcLayer, psOptions->pszClipSrcWhere)); if (psOptions->hClipSrc == nullptr) @@ -2264,7 +2312,14 @@ else if (psOptions->bClipSrc && psOptions->hClipSrc == nullptr) { if (psOptions->hSpatialFilter) + { psOptions->hClipSrc = OGR_G_Clone(psOptions->hSpatialFilter); + if (poSpatSRS) + { + OGRGeometry::FromHandle(psOptions->hClipSrc) + ->assignSpatialReference(poSpatSRS.get()); + } + } if (psOptions->hClipSrc == nullptr) { CPLError( @@ -2280,7 +2335,7 @@ if (psOptions->pszClipDstDS != nullptr) { - psOptions->hClipDst = reinterpret_cast(LoadGeometry( + psOptions->hClipDst = OGRGeometry::ToHandle(LoadGeometry( psOptions->pszClipDstDS, psOptions->pszClipDstSQL, psOptions->pszClipDstLayer, psOptions->pszClipDstWhere)); if (psOptions->hClipDst == nullptr) @@ -2292,14 +2347,14 @@ } } - GDALDataset *poDS = static_cast(hSrcDS); + GDALDataset *poDS = GDALDataset::FromHandle(hSrcDS); GDALDataset *poODS = nullptr; GDALDriver *poDriver = nullptr; CPLString osDestFilename; if (hDstDS) { - poODS = static_cast(hDstDS); + poODS = GDALDataset::FromHandle(hDstDS); osDestFilename = poODS->GetDescription(); } else @@ -2362,17 +2417,17 @@ if (bUpdate && poODS == nullptr) { - poODS = static_cast( - GDALOpenEx(osDestFilename, GDAL_OF_UPDATE | GDAL_OF_VECTOR, nullptr, - psOptions->papszDestOpenOptions, nullptr)); + poODS = GDALDataset::Open(osDestFilename, + GDAL_OF_UPDATE | GDAL_OF_VECTOR, nullptr, + psOptions->papszDestOpenOptions, nullptr); if (poODS == nullptr) { if (bOverwrite || bAppend) { - poODS = static_cast( - GDALOpenEx(osDestFilename, GDAL_OF_VECTOR, nullptr, - psOptions->papszDestOpenOptions, nullptr)); + poODS = + GDALDataset::Open(osDestFilename, GDAL_OF_VECTOR, nullptr, + psOptions->papszDestOpenOptions, nullptr); if (poODS == nullptr) { /* OK the datasource doesn't exist at all */ @@ -2687,39 +2742,6 @@ } /* -------------------------------------------------------------------- */ - /* Parse spatial filter SRS if needed. */ - /* -------------------------------------------------------------------- */ - OGRSpatialReference oSpatSRS; - OGRSpatialReference *poSpatSRS = nullptr; - if (psOptions->hSpatialFilter != nullptr && - psOptions->pszSpatSRSDef != nullptr) - { - if (psOptions->pszSQLStatement) - { - CPLError(CE_Failure, CPLE_IllegalArg, - "-spat_srs not compatible with -sql."); - GDALVectorTranslateOptionsFree(psOptions); - if (hDstDS == nullptr) - GDALClose(poODS); - return nullptr; - } - OGREnvelope sEnvelope; - OGR_G_GetEnvelope(psOptions->hSpatialFilter, &sEnvelope); - oSpatSRS.SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); - if (oSpatSRS.SetFromUserInput(psOptions->pszSpatSRSDef) != OGRERR_NONE) - { - CPLError(CE_Failure, CPLE_AppDefined, - "Failed to process SRS definition: %s", - psOptions->pszSpatSRSDef); - GDALVectorTranslateOptionsFree(psOptions); - if (hDstDS == nullptr) - GDALClose(poODS); - return nullptr; - } - poSpatSRS = &oSpatSRS; - } - - /* -------------------------------------------------------------------- */ /* Create a transformation object from the source to */ /* destination coordinate system. */ /* -------------------------------------------------------------------- */ @@ -2788,10 +2810,14 @@ oTranslator.m_nCoordDim = psOptions->nCoordDim; oTranslator.m_eGeomOp = psOptions->eGeomOp; oTranslator.m_dfGeomOpParam = psOptions->dfGeomOpParam; - oTranslator.m_poClipSrc = - reinterpret_cast(psOptions->hClipSrc); - oTranslator.m_poClipDst = - reinterpret_cast(psOptions->hClipDst); + // Do not emit warning if the user specified directly the clip source geom + if (psOptions->pszClipSrcDS == nullptr) + oTranslator.m_bWarnedClipSrcSRS = true; + oTranslator.m_poClipSrcOri = OGRGeometry::FromHandle(psOptions->hClipSrc); + // Do not emit warning if the user specified directly the clip dest geom + if (psOptions->pszClipDstDS == nullptr) + oTranslator.m_bWarnedClipDstSRS = true; + oTranslator.m_poClipDstOri = OGRGeometry::FromHandle(psOptions->hClipDst); oTranslator.m_bExplodeCollections = psOptions->bExplodeCollections; oTranslator.m_bNativeData = psOptions->bNativeData; oTranslator.m_nLimit = psOptions->nLimit; @@ -2829,7 +2855,7 @@ OGRLayer *poResultSet = poDS->ExecuteSQL( psOptions->pszSQLStatement, (psOptions->pszGeomField == nullptr) - ? reinterpret_cast(psOptions->hSpatialFilter) + ? OGRGeometry::FromHandle(psOptions->hSpatialFilter) : nullptr, psOptions->pszDialect); @@ -2842,8 +2868,8 @@ psOptions->pszGeomField); if (iGeomField >= 0) poResultSet->SetSpatialFilter( - iGeomField, reinterpret_cast( - psOptions->hSpatialFilter)); + iGeomField, + OGRGeometry::FromHandle(psOptions->hSpatialFilter)); else CPLError(CE_Warning, CPLE_AppDefined, "Cannot find geometry field %s.", @@ -3096,9 +3122,8 @@ } ApplySpatialFilter( - poLayer, - reinterpret_cast(psOptions->hSpatialFilter), - poSpatSRS, psOptions->pszGeomField, poSourceSRS); + poLayer, OGRGeometry::FromHandle(psOptions->hSpatialFilter), + poSpatSRS.get(), psOptions->pszGeomField, poSourceSRS); oMapLayerToIdx[poLayer] = iLayer; } @@ -3336,9 +3361,8 @@ } ApplySpatialFilter( - poLayer, - reinterpret_cast(psOptions->hSpatialFilter), - poSpatSRS, psOptions->pszGeomField, poSourceSRS); + poLayer, OGRGeometry::FromHandle(psOptions->hSpatialFilter), + poSpatSRS.get(), psOptions->pszGeomField, poSourceSRS); if (psOptions->bDisplayProgress) { @@ -3484,7 +3508,7 @@ GDALVectorTranslateOptionsFree(psOptions); if (nRetCode == 0) - return static_cast(poODS); + return GDALDataset::ToHandle(poODS); if (hDstDS == nullptr) GDALClose(poODS); @@ -3730,14 +3754,42 @@ if (bUnsetDefault) oFieldDefn.SetDefault(nullptr); - if (poDstDS->GetDriver() != nullptr && - poDstDS->GetDriver()->GetMetadataItem( - GDAL_DMD_CREATIONFIELDDATATYPES) != nullptr && - strstr(poDstDS->GetDriver()->GetMetadataItem( - GDAL_DMD_CREATIONFIELDDATATYPES), + const auto poDstDriver = poDstDS->GetDriver(); + const char *pszCreationFieldDataTypes = + poDstDriver + ? poDstDriver->GetMetadataItem(GDAL_DMD_CREATIONFIELDDATATYPES) + : nullptr; + const char *pszCreationFieldDataSubtypes = + poDstDriver + ? poDstDriver->GetMetadataItem(GDAL_DMD_CREATIONFIELDDATASUBTYPES) + : nullptr; + if (pszCreationFieldDataTypes && + strstr(pszCreationFieldDataTypes, OGRFieldDefn::GetFieldTypeName(oFieldDefn.GetType())) == nullptr) { - if (oFieldDefn.GetType() == OFTInteger64) + if (pszCreationFieldDataSubtypes && + (oFieldDefn.GetType() == OFTIntegerList || + oFieldDefn.GetType() == OFTInteger64List || + oFieldDefn.GetType() == OFTRealList || + oFieldDefn.GetType() == OFTStringList) && + strstr(pszCreationFieldDataSubtypes, "JSON")) + { + if (!bQuiet) + { + CPLError( + CE_Warning, CPLE_AppDefined, + "The output driver does not seem to natively support %s " + "type for field %s. Converting it to String(JSON) instead. " + "-mapFieldType can be used to control field type " + "conversion.", + OGRFieldDefn::GetFieldTypeName(oFieldDefn.GetType()), + oFieldDefn.GetNameRef()); + } + oFieldDefn.SetSubType(OFSTNone); + oFieldDefn.SetType(OFTString); + oFieldDefn.SetSubType(OFSTJSON); + } + else if (oFieldDefn.GetType() == OFTInteger64) { if (!bQuiet) { @@ -3763,9 +3815,7 @@ oFieldDefn.GetNameRef()); } } - else if (poDstDS->GetDriver() != nullptr && - poDstDS->GetDriver()->GetMetadataItem( - GDAL_DMD_CREATIONFIELDDATATYPES) == nullptr) + else if (!pszCreationFieldDataTypes) { // All drivers supporting OFTInteger64 should advertise it theoretically if (oFieldDefn.GetType() == OFTInteger64) @@ -5208,7 +5258,7 @@ OGRGeometry *poStolenGeometry = nullptr; if (!bExplodeCollections && nSrcGeomFieldCount == 1 && (nDstGeomFieldCount == 1 || - (nDstGeomFieldCount == 0 && m_poClipSrc))) + (nDstGeomFieldCount == 0 && m_poClipSrcOri))) { poStolenGeometry = poFeature->StealGeometry(); } @@ -5218,10 +5268,46 @@ poFeature->StealGeometry(iRequestedSrcGeomField); } - if (nDstGeomFieldCount == 0 && poStolenGeometry && m_poClipSrc) + if (nDstGeomFieldCount == 0 && poStolenGeometry && + m_poClipSrcOri) { - OGRGeometry *poClipped = - poStolenGeometry->Intersection(m_poClipSrc); + auto poGeomSRS = poStolenGeometry->getSpatialReference(); + if (m_poClipSrcReprojectedToSrcSRS_SRS != poGeomSRS) + { + auto poClipSrcSRS = + m_poClipSrcOri->getSpatialReference(); + if (poClipSrcSRS && poGeomSRS && + !poClipSrcSRS->IsSame(poGeomSRS)) + { + // Transform clip geom to geometry SRS + m_poClipSrcReprojectedToSrcSRS.reset( + m_poClipSrcOri->clone()); + if (m_poClipSrcReprojectedToSrcSRS->transformTo( + poGeomSRS) != OGRERR_NONE) + { + delete poStolenGeometry; + goto end_loop; + } + m_poClipSrcReprojectedToSrcSRS_SRS = poGeomSRS; + } + else if (!poClipSrcSRS && poGeomSRS) + { + if (!m_bWarnedClipSrcSRS) + { + m_bWarnedClipSrcSRS = true; + CPLError( + CE_Warning, CPLE_AppDefined, + "Clip source geometry has no attached SRS, " + "but the feature's geometry has one. " + "Assuming clip source geometry SRS is the " + "same as the feature's geometry"); + } + } + } + OGRGeometry *poClipped = poStolenGeometry->Intersection( + m_poClipSrcReprojectedToSrcSRS + ? m_poClipSrcReprojectedToSrcSRS.get() + : m_poClipSrcOri); delete poStolenGeometry; poStolenGeometry = nullptr; if (poClipped == nullptr || poClipped->IsEmpty()) @@ -5386,10 +5472,45 @@ } } - if (m_poClipSrc) + if (m_poClipSrcOri) { - OGRGeometry *poClipped = - poDstGeometry->Intersection(m_poClipSrc); + auto poGeomSRS = poDstGeometry->getSpatialReference(); + if (m_poClipSrcReprojectedToSrcSRS_SRS != poGeomSRS) + { + auto poClipSrcSRS = + m_poClipSrcOri->getSpatialReference(); + if (poClipSrcSRS && poGeomSRS && + !poClipSrcSRS->IsSame(poGeomSRS)) + { + // Transform clip geom to geometry SRS + m_poClipSrcReprojectedToSrcSRS.reset( + m_poClipSrcOri->clone()); + if (m_poClipSrcReprojectedToSrcSRS->transformTo( + poGeomSRS) != OGRERR_NONE) + { + delete poDstGeometry; + goto end_loop; + } + m_poClipSrcReprojectedToSrcSRS_SRS = poGeomSRS; + } + else if (!poClipSrcSRS && poGeomSRS) + { + if (!m_bWarnedClipSrcSRS) + { + m_bWarnedClipSrcSRS = true; + CPLError( + CE_Warning, CPLE_AppDefined, + "Clip source geometry has no attached SRS, " + "but the feature's geometry has one. " + "Assuming clip source geometry SRS is the " + "same as the feature's geometry"); + } + } + } + OGRGeometry *poClipped = poDstGeometry->Intersection( + m_poClipSrcReprojectedToSrcSRS + ? m_poClipSrcReprojectedToSrcSRS.get() + : m_poClipSrcOri); if (poClipped == nullptr || poClipped->IsEmpty()) { delete poDstGeometry; @@ -5469,10 +5590,45 @@ if (poDstGeometry != nullptr) { - if (m_poClipDst) + if (m_poClipDstOri) { - OGRGeometry *poClipped = - poDstGeometry->Intersection(m_poClipDst); + auto poGeomSRS = poDstGeometry->getSpatialReference(); + if (m_poClipDstReprojectedToDstSRS_SRS != poGeomSRS) + { + auto poClipDstSRS = + m_poClipDstOri->getSpatialReference(); + if (poClipDstSRS && poGeomSRS && + !poClipDstSRS->IsSame(poGeomSRS)) + { + // Transform clip geom to geometry SRS + m_poClipDstReprojectedToDstSRS.reset( + m_poClipDstOri->clone()); + if (m_poClipDstReprojectedToDstSRS->transformTo( + poGeomSRS) != OGRERR_NONE) + { + delete poDstGeometry; + goto end_loop; + } + m_poClipDstReprojectedToDstSRS_SRS = poGeomSRS; + } + else if (!poClipDstSRS && poGeomSRS) + { + if (!m_bWarnedClipDstSRS) + { + m_bWarnedClipDstSRS = true; + CPLError(CE_Warning, CPLE_AppDefined, + "Clip destination geometry has no " + "attached SRS, but the feature's " + "geometry has one. Assuming clip " + "destination geometry SRS is the " + "same as the feature's geometry"); + } + } + } + OGRGeometry *poClipped = poDstGeometry->Intersection( + m_poClipDstReprojectedToDstSRS + ? m_poClipDstReprojectedToDstSRS.get() + : m_poClipDstOri); if (poClipped == nullptr || poClipped->IsEmpty()) { delete poDstGeometry; @@ -6070,8 +6226,7 @@ OGRPolygon *poSpatialFilter = new OGRPolygon(); poSpatialFilter->addRing(&oRing); OGR_G_DestroyGeometry(psOptions->hSpatialFilter); - psOptions->hSpatialFilter = - reinterpret_cast(poSpatialFilter); + psOptions->hSpatialFilter = OGRGeometry::ToHandle(poSpatialFilter); i += 4; } else if (i + 1 < nArgc && EQUAL(papszArgv[i], "-spat_srs")) @@ -6245,7 +6400,7 @@ CPLAtof(papszArgv[i + 2])); OGRPolygon *poPoly = new OGRPolygon(); - psOptions->hClipSrc = reinterpret_cast(poPoly); + psOptions->hClipSrc = OGRGeometry::ToHandle(poPoly); poPoly->addRing(&oRing); i += 4; } @@ -6253,9 +6408,10 @@ STARTS_WITH_CI(papszArgv[i + 1], "MULTIPOLYGON")) && VSIStatL(papszArgv[i + 1], &sStat) != 0) { - OGRGeometryFactory::createFromWkt( - papszArgv[i + 1], nullptr, - reinterpret_cast(&psOptions->hClipSrc)); + OGRGeometry *poGeom = nullptr; + OGRGeometryFactory::createFromWkt(papszArgv[i + 1], nullptr, + &poGeom); + psOptions->hClipSrc = OGRGeometry::ToHandle(poGeom); if (psOptions->hClipSrc == nullptr) { CPLError(CE_Failure, CPLE_IllegalArg, @@ -6327,7 +6483,7 @@ CPLAtof(papszArgv[i + 2])); OGRPolygon *poPoly = new OGRPolygon(); - psOptions->hClipDst = reinterpret_cast(poPoly); + psOptions->hClipDst = OGRGeometry::ToHandle(poPoly); poPoly->addRing(&oRing); i += 4; } @@ -6335,9 +6491,10 @@ STARTS_WITH_CI(papszArgv[i + 1], "MULTIPOLYGON")) && VSIStatL(papszArgv[i + 1], &sStat) != 0) { - OGRGeometryFactory::createFromWkt( - papszArgv[i + 1], nullptr, - reinterpret_cast(&psOptions->hClipDst)); + OGRGeometry *poGeom = nullptr; + OGRGeometryFactory::createFromWkt(papszArgv[i + 1], nullptr, + &poGeom); + psOptions->hClipDst = OGRGeometry::ToHandle(poGeom); if (psOptions->hClipDst == nullptr) { CPLError(CE_Failure, CPLE_IllegalArg, diff -Nru gdal-3.6.2+dfsg/apps/test_ogrsf.cpp gdal-3.6.4+dfsg/apps/test_ogrsf.cpp --- gdal-3.6.2+dfsg/apps/test_ogrsf.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/apps/test_ogrsf.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -1623,7 +1623,7 @@ } /* mapogr.cpp doesn't like errors after GetNextFeature() */ - if (CPLGetLastErrorType() != CE_None) + if (CPLGetLastErrorType() == CE_Failure) { bRet = FALSE; printf("ERROR: An error was reported : %s\n", CPLGetLastErrorMsg()); diff -Nru gdal-3.6.2+dfsg/CITATION.cff gdal-3.6.4+dfsg/CITATION.cff --- gdal-3.6.2+dfsg/CITATION.cff 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/CITATION.cff 2023-04-17 11:50:20.000000000 +0000 @@ -2,8 +2,8 @@ message: Please cite this software using these metadata or in the CITATION file. type: software title: GDAL -version: 3.6.2 -date-released: 2023-01-02 +version: 3.6.4 +date-released: 2023-04-17 doi: 10.5281/zenodo.5884351 abstract: GDAL is a translator library for raster and vector geospatial data formats that is released under an MIT style Open Source License by the Open diff -Nru gdal-3.6.2+dfsg/cmake/helpers/CheckDependentLibraries.cmake gdal-3.6.4+dfsg/cmake/helpers/CheckDependentLibraries.cmake --- gdal-3.6.2+dfsg/cmake/helpers/CheckDependentLibraries.cmake 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/helpers/CheckDependentLibraries.cmake 2023-04-17 11:50:20.000000000 +0000 @@ -53,7 +53,7 @@ # geotiff-config.cmake of GeoTIFF 1.7.0 doesn't define a INTERFACE_INCLUDE_DIRECTORIES # property, but a GeoTIFF_INCLUDE_DIRS variable. set_target_properties(${target} PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${GeoTIFF_INCLUDE_DIRS}) + INTERFACE_INCLUDE_DIRECTORIES "${GeoTIFF_INCLUDE_DIRS}") else() message(WARNING "Target ${target} has no INTERFACE_INCLUDE_DIRECTORIES property. Ignoring that target.") set(${res_var} FALSE PARENT_SCOPE) @@ -109,8 +109,9 @@ string(TOUPPER ${name} key) set(_find_dependency "") set(_find_dependency_args "") - find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) - if (NOT DEFINED ${key}_FOUND) + if(FIND_PACKAGE2_${name}_ENABLED) + find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) + else() set(_find_package_args) if (_GCP_VERSION) list(APPEND _find_package_args ${_GCP_VERSION}) diff -Nru gdal-3.6.2+dfsg/cmake/helpers/configure.cmake gdal-3.6.4+dfsg/cmake/helpers/configure.cmake --- gdal-3.6.2+dfsg/cmake/helpers/configure.cmake 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/helpers/configure.cmake 2023-04-17 11:50:20.000000000 +0000 @@ -40,6 +40,7 @@ check_type_size("int" SIZEOF_INT) check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG) +check_type_size("long int" SIZEOF_LONG_INT) check_type_size("void*" SIZEOF_VOIDP) check_type_size("size_t" SIZEOF_SIZE_T) @@ -109,15 +110,15 @@ " #define _GNU_SOURCE #include - int main() { pthread_spinlock_t spin; return 1; } + int main() { pthread_spinlock_t spin; return pthread_spin_lock(&spin); } " - HAVE_PTHREAD_SPINLOCK) + HAVE_PTHREAD_SPIN_LOCK) check_c_source_compiles( " #define _GNU_SOURCE #include - int main() { return (mremap(0,0,0,0,0)); } + int main() { return (mremap(0,0,0,0,0) != 0); } " HAVE_5ARGS_MREMAP) diff -Nru gdal-3.6.2+dfsg/cmake/helpers/GdalDriverHelper.cmake gdal-3.6.4+dfsg/cmake/helpers/GdalDriverHelper.cmake --- gdal-3.6.2+dfsg/cmake/helpers/GdalDriverHelper.cmake 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/helpers/GdalDriverHelper.cmake 2023-04-17 11:50:20.000000000 +0000 @@ -314,7 +314,7 @@ include(CMakeDependentOption) -macro(check_depend_condition depends) +macro(check_depend_condition variable depends) foreach(_dep IN ITEMS ${depends}) if( "${_dep}" MATCHES "GDAL_ENABLE_DRIVER_" OR "${_dep}" MATCHES "OGR_ENABLE_DRIVER_") if(NOT DEFINED "${_dep}") @@ -322,6 +322,19 @@ endif() endif() endforeach() + + if(${variable}) + cmake_dependent_option(TO_BE_REMOVED "" ON "${depends}" OFF) + if(NOT ${TO_BE_REMOVED}) + unset(TO_BE_REMOVED CACHE) + if (NOT GDAL_IGNORE_FAILED_CONDITIONS) + message(FATAL_ERROR "${variable} cannot be enabled because condition ${depends} is not met. To ignore this error (but the driver will not be built), set the GDAL_IGNORE_FAILED_CONDITIONS variable") + else() + message(WARNING "${variable} cannot be enabled because condition ${depends} is not met.") + endif() + endif() + unset(TO_BE_REMOVED CACHE) + endif() endmacro() # gdal_dependent_format(format desc depend) do followings: @@ -339,7 +352,7 @@ else() string(TOUPPER ${format} key) endif() - check_depend_condition(${depends}) + check_depend_condition(GDAL_ENABLE_DRIVER_${key} "${depends}") cmake_dependent_option(GDAL_ENABLE_DRIVER_${key} "Set ON to build ${desc} format" ${GDAL_BUILD_OPTIONAL_DRIVERS} "${depends}" OFF) add_feature_info(gdal_${key} GDAL_ENABLE_DRIVER_${key} "${desc}") @@ -379,7 +392,7 @@ macro(ogr_dependent_driver name desc depend) string(TOUPPER ${name} key) - check_depend_condition(${depend}) + check_depend_condition(OGR_ENABLE_DRIVER_${key} "${depend}") if( NOT("${key}" STREQUAL "GPKG" OR "${key}" STREQUAL "SQLITE" OR "${key}" STREQUAL "AVC") ) cmake_dependent_option(OGR_ENABLE_DRIVER_${key} "Set ON to build OGR ${desc} driver" ${OGR_BUILD_OPTIONAL_DRIVERS} "${depend}" OFF) diff -Nru gdal-3.6.2+dfsg/cmake/modules/3.20/FindLibLZMA.cmake gdal-3.6.4+dfsg/cmake/modules/3.20/FindLibLZMA.cmake --- gdal-3.6.2+dfsg/cmake/modules/3.20/FindLibLZMA.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/3.20/FindLibLZMA.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -96,12 +96,12 @@ mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY ) if (LIBLZMA_FOUND) - set(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY}) - set(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR}) + set(LIBLZMA_LIBRARIES "${LIBLZMA_LIBRARY}") + set(LIBLZMA_INCLUDE_DIRS "${LIBLZMA_INCLUDE_DIR}") if(NOT TARGET LibLZMA::LibLZMA) add_library(LibLZMA::LibLZMA UNKNOWN IMPORTED) set_target_properties(LibLZMA::LibLZMA PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${LIBLZMA_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${LIBLZMA_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES C) if(LIBLZMA_LIBRARY_RELEASE) diff -Nru gdal-3.6.2+dfsg/cmake/modules/DefineFindPackage2.cmake gdal-3.6.4+dfsg/cmake/modules/DefineFindPackage2.cmake --- gdal-3.6.2+dfsg/cmake/modules/DefineFindPackage2.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/DefineFindPackage2.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -68,6 +68,8 @@ else() set_property(GLOBAL APPEND PROPERTY define_find_package_find_path_suffix "_unset_") endif() + set(FIND_PACKAGE2_${pkgname}_ENABLED TRUE CACHE BOOL "Use find_package2 for dependency ${pkgname}") + mark_as_advanced(FIND_PACKAGE2_${pkgname}_ENABLED) endfunction() function(find_package2 pkgname) diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindBRUNSLI.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindBRUNSLI.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindBRUNSLI.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindBRUNSLI.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -7,13 +7,13 @@ Find the BRUNSLI libraries -Brunsli encode and decode libraries are built with CMake. +Brunsli encode and decode libraries are built with CMake. Unfortunately Brunsli does not export cmake config files yet, thus this find module IMPORTED targets ^^^^^^^^^^^^^^^^ -This module defines the following +This module defines the following :prop_tgt:`IMPORTED` target: ``BRUNSLI::ENCODE`` :prop_tgt:`IMPORTED` target: ``BRUNSLI::DECODE`` @@ -36,13 +36,13 @@ PATH_SUFFIXES ${BRUNSLI_NAME}/include include ) -find_library(BRUNSLI_ENC_LIB +find_library(BRUNSLI_ENC_LIB NAMES brunslienc-c HINTS ${BRUNSLI_ROOT} PATH_SUFFIXES ${BRUNSLI_NAME}/lib lib ) -find_library(BRUNSLI_DEC_LIB +find_library(BRUNSLI_DEC_LIB NAMES brunslidec-c HINTS ${BRUNSLI_ROOT} PATH_SUFFIXES ${BRUNSLI_NAME}/lib lib @@ -58,17 +58,17 @@ if(NOT TARGET BRUNSLI::ENCODE) add_library(BRUNSLI::ENCODE UNKNOWN IMPORTED) set_target_properties(BRUNSLI::ENCODE PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${BRUNSLI_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${BRUNSLI_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES C - IMPORTED_LOCATION ${BRUNSLI_ENC_LIB} + IMPORTED_LOCATION "${BRUNSLI_ENC_LIB}" ) endif() if(NOT TARGET BRUNSLI::DECODE) add_library(BRUNSLI::DECODE UNKNOWN IMPORTED) set_target_properties(BRUNSLI::DECODE PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${BRUNSLI_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${BRUNSLI_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES C - IMPORTED_LOCATION ${BRUNSLI_DEC_LIB} + IMPORTED_LOCATION "${BRUNSLI_DEC_LIB}" ) endif() endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindCryptoPP.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindCryptoPP.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindCryptoPP.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindCryptoPP.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -72,13 +72,26 @@ mark_as_advanced(CRYPTOPP_LIBRARY CRYPTOPP_INCLUDE_DIR) if(CRYPTOPP_FOUND) - set(CRYPTOPP_LIBRARIES ${CRYPTOPP_LIBRARY}) - set(CRYPTOPP_INCLUDE_DIRS ${CRYPTOPP_INCLUDE_DIR}) + set(CRYPTOPP_LIBRARIES "${CRYPTOPP_LIBRARY}") + set(CRYPTOPP_INCLUDE_DIRS "${CRYPTOPP_INCLUDE_DIR}") if(NOT TARGET CRYPTOPP::CRYPTOPP) add_library(CRYPTOPP::CRYPTOPP UNKNOWN IMPORTED) set_target_properties(CRYPTOPP::CRYPTOPP PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${CRYPTOPP_INCLUDE_DIR} - IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" - IMPORTED_LOCATION ${CRYPTOPP_LIBRARY}) + INTERFACE_INCLUDE_DIRECTORIES "${CRYPTOPP_INCLUDE_DIR}" + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX") + + if(CRYPTOPP_LIBRARY_RELEASE) + set_property(TARGET CRYPTOPP::CRYPTOPP APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(CRYPTOPP::CRYPTOPP PROPERTIES + IMPORTED_LOCATION_RELEASE "${CRYPTOPP_LIBRARY_RELEASE}") + endif() + + if(CRYPTOPP_LIBRARY_DEBUG) + set_property(TARGET CRYPTOPP::CRYPTOPP APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(CRYPTOPP::CRYPTOPP PROPERTIES + IMPORTED_LOCATION_DEBUG "${CRYPTOPP_LIBRARY_DEBUG}") + endif() endif() endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindDeflate.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindDeflate.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindDeflate.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindDeflate.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -107,10 +107,5 @@ set_target_properties(Deflate::Deflate PROPERTIES IMPORTED_LOCATION_DEBUG "${Deflate_LIBRARY_DEBUG}") endif() - - if(NOT Deflate_LIBRARY_RELEASE AND NOT Deflate_LIBRARY_DEBUG) - set_target_properties(Deflate::Deflate PROPERTIES - IMPORTED_LOCATION_RELEASE "${Deflate_LIBRARY}") - endif() endif() endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindFYBA.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindFYBA.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindFYBA.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindFYBA.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -18,21 +18,21 @@ find_package_handle_standard_args(FYBA REQUIRED_VARS FYBA_FYBA_LIBRARY FYBA_FYGM_LIBRARY FYBA_FYUT_LIBRARY FYBA_INCLUDE_DIR) if(FYBA_FOUND) - set(FYBA_LIBRARIES ${FYBA_FYBA_LIBRARY} ${FYBA_FYGM_LIBRARY} ${FYBA_FYUT_LIBRARY}) - set(FYBA_INCLUDE_DIRS ${FYBA_INCLUDE_DIR}) + set(FYBA_LIBRARIES "${FYBA_FYBA_LIBRARY}" "${FYBA_FYGM_LIBRARY}" "${FYBA_FYUT_LIBRARY}") + set(FYBA_INCLUDE_DIRS "${FYBA_INCLUDE_DIR}") if(NOT TARGET FYBA::FYBA) add_library(FYBA::FYBA UNKNOWN IMPORTED) set_target_properties(FYBA::FYBA PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${FYBA_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${FYBA_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES C - IMPORTED_LOCATION ${FYBA_FYBA_LIBRARY}) + IMPORTED_LOCATION "${FYBA_FYBA_LIBRARY}") add_library(FYBA::FYGM UNKNOWN IMPORTED) set_target_properties(FYBA::FYGM PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES C - IMPORTED_LOCATION ${FYBA_FYGM_LIBRARY}) + IMPORTED_LOCATION "${FYBA_FYGM_LIBRARY}") add_library(FYBA::FYUT UNKNOWN IMPORTED) set_target_properties(FYBA::FYUT PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES C - IMPORTED_LOCATION ${FYBA_FYUT_LIBRARY}) + IMPORTED_LOCATION "${FYBA_FYUT_LIBRARY}") endif() endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindGeoTIFF.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindGeoTIFF.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindGeoTIFF.cmake 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindGeoTIFF.cmake 2023-04-17 11:50:20.000000000 +0000 @@ -72,13 +72,13 @@ VERSION_VAR GEOTIFF_VERSION_STRING) if(GEOTIFF_FOUND) - set(GEOTIFF_LIBRARIES ${GEOTIFF_LIBRARY}) - set(GEOTIFF_INCLUDE_DIRS ${GEOTIFF_INCLUDE_DIR}) + set(GEOTIFF_LIBRARIES "${GEOTIFF_LIBRARY}") + set(GEOTIFF_INCLUDE_DIRS "${GEOTIFF_INCLUDE_DIR}") set(GeoTIFF_TARGET GEOTIFF::GEOTIFF) if(NOT TARGET ${GeoTIFF_TARGET}) add_library(${GeoTIFF_TARGET} UNKNOWN IMPORTED) set_target_properties(${GeoTIFF_TARGET} PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${GEOTIFF_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${GEOTIFF_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES C) if(EXISTS "${GEOTIFF_LIBRARY}") set_target_properties(${GeoTIFF_TARGET} PROPERTIES diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindGIF.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindGIF.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindGIF.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindGIF.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -89,8 +89,8 @@ if(NOT TARGET GIF::GIF) add_library(GIF::GIF UNKNOWN IMPORTED) set_target_properties(GIF::GIF PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${GIF_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${GIF_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES C - IMPORTED_LOCATION ${GIF_LIBRARY}) + IMPORTED_LOCATION "${GIF_LIBRARY}") endif() -endif() \ No newline at end of file +endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindHDF4.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindHDF4.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindHDF4.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindHDF4.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -125,7 +125,7 @@ add_library(HDF4::HDF4 INTERFACE IMPORTED) set_target_properties(HDF4::HDF4 PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${HDF4_INCLUDE_DIRS} + INTERFACE_INCLUDE_DIRECTORIES "${HDF4_INCLUDE_DIRS}" INTERFACE_LINK_LIBRARIES "${HDF4_TARGETS}") endif() endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindLibKML.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindLibKML.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindLibKML.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindLibKML.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -97,14 +97,14 @@ VERSION_VAR LIBKML_VERSION_STRING) if(LIBKML_FOUND) - set(LIBKML_INCLUDE_DIRS ${LIBKML_INCLUDE_DIR}) - set(LIBKML_LIBRARIES ${LIBKML_BASE_LIBRARY}) + set(LIBKML_INCLUDE_DIRS "${LIBKML_INCLUDE_DIR}") + set(LIBKML_LIBRARIES "${LIBKML_BASE_LIBRARY}") if(NOT TARGET LIBKML::LibKML) add_library(LIBKML::LibKML UNKNOWN IMPORTED) set_target_properties(LIBKML::LibKML PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${LIBKML_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${LIBKML_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES "C++" - IMPORTED_LOCATION ${LIBKML_BASE_LIBRARY}) + IMPORTED_LOCATION "${LIBKML_BASE_LIBRARY}") endif() foreach(_comp IN LISTS libkml_known_components) if(${_comp} IN_LIST LibKML_FIND_COMPONENTS) diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindLURATECH.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindLURATECH.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindLURATECH.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindLURATECH.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -27,13 +27,13 @@ ) if(LURATECH_FOUND) - set(LURATECH_LIBRARIES ${LURATECH_LIBRARY}) - set(LURATECH_INCLUDE_DIRS ${LURATECH_INCLUDE_DIR}) + set(LURATECH_LIBRARIES "${LURATECH_LIBRARY}") + set(LURATECH_INCLUDE_DIRS "${LURATECH_INCLUDE_DIR}") if(NOT TARGET LURATECH::LURATECH) add_library(LURATECH::LURATECH UNKNOWN IMPORTED) set_target_properties(LURATECH::LURATECH PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${LURATECH_INCLUDE_DIRS} + INTERFACE_INCLUDE_DIRECTORIES "${LURATECH_INCLUDE_DIRS}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION ${LURATECH_LIBRARIES}) + IMPORTED_LOCATION "${LURATECH_LIBRARIES}") endif() endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindMONGOCXX.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindMONGOCXX.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindMONGOCXX.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindMONGOCXX.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -37,20 +37,20 @@ VERSION_VAR MONGOCXX_VERSION_STRING) if(MONGOCXX_FOUND) - set(MONGOCXX_LIBRARIES ${MONGOCXX_LIBRARY} ${BSONCXX_LIBRARY}) - set(MONGOCXX_INCLUDE_DIRS ${MONGOCXX_INCLUDE_DIR} ${BSONCXX_INCLUDE_DIR}) + set(MONGOCXX_LIBRARIES "${MONGOCXX_LIBRARY}" "${BSONCXX_LIBRARY}") + set(MONGOCXX_INCLUDE_DIRS "${MONGOCXX_INCLUDE_DIR}" "${BSONCXX_INCLUDE_DIR}") if(NOT TARGET MONGOCXX::MONGOCXX) add_library(MONGOCXX::MONGOCXX UNKNOWN IMPORTED) set_target_properties(MONGOCXX::MONGOCXX PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${MONGOCXX_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${MONGOCXX_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION ${MONGOCXX_LIBRARY}) + IMPORTED_LOCATION "${MONGOCXX_LIBRARY}") endif() if(NOT TARGET MONGOCXX::BSONCXX) add_library(MONGOCXX::BSONCXX UNKNOWN IMPORTED) set_target_properties(MONGOCXX::BSONCXX PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${BSONCXX_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${BSONCXX_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION ${BSONCXX_LIBRARY}) + IMPORTED_LOCATION "${BSONCXX_LIBRARY}") endif() endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindOpenJPEG.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindOpenJPEG.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindOpenJPEG.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindOpenJPEG.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -111,13 +111,13 @@ REQUIRED_VARS OPENJPEG_LIBRARY OPENJPEG_INCLUDE_DIR VERSION_VAR OPENJPEG_VERSION_STRING) if(OPENJPEG_FOUND) - set(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY}) - set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIR}) + set(OPENJPEG_LIBRARIES "${OPENJPEG_LIBRARY}") + set(OPENJPEG_INCLUDE_DIRS "${OPENJPEG_INCLUDE_DIR}") if(NOT TARGET OPENJPEG::OpenJPEG) add_library(OPENJPEG::OpenJPEG UNKNOWN IMPORTED) set_target_properties(OPENJPEG::OpenJPEG PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${OPENJPEG_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${OPENJPEG_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LOCATION "${OPENJPEG_LIBRARY}") endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindOracle.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindOracle.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindOracle.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindOracle.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -196,30 +196,30 @@ mark_as_advanced(Oracle_INCLUDE_DIR Oracle_LIBRARY) IF(Oracle_FOUND) - set(Oracle_INCLUDE_DIRS ${Oracle_INCLUDE_DIR}) - set(Oracle_LIBRARIES ${Oracle_LIBRARY}) + set(Oracle_INCLUDE_DIRS "${Oracle_INCLUDE_DIR}") + set(Oracle_LIBRARIES "${Oracle_LIBRARY}") if(Oracle_XML_INCLUDE_DIR AND Oracle_XML_LIBRARY) - list(APPEND Oracle_INCLUDE_DIRS ${Oracle_XML_INCLUDE_DIR}) + list(APPEND Oracle_INCLUDE_DIRS "${Oracle_XML_INCLUDE_DIR}") endif() if(NOT TARGET Oracle::OCI) add_library(Oracle::OCI UNKNOWN IMPORTED) set_target_properties(Oracle::OCI PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${Oracle_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${Oracle_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION ${Oracle_LIBRARY} + IMPORTED_LOCATION "${Oracle_LIBRARY}" ) foreach(tgt IN LISTS Oracle_known_components) if(Oracle_${tgt}_FOUND) add_library(Oracle::${tgt} UNKNOWN IMPORTED) set_target_properties(Oracle::${tgt} PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION ${Oracle_${tgt}_LIBRARY}) + IMPORTED_LOCATION "${Oracle_${tgt}_LIBRARY}") endif() endforeach() if(Oracle_XML_INCLUDE_DIR) if(TARGET Oracle::XML) set_property(Oracle::XML APPEND PROPERTY - INTERFACE_INCLUDE_DIRECTORIES ${Oracle_XML_INCLUDE_DIR}) + INTERFACE_INCLUDE_DIRECTORIES "${Oracle_XML_INCLUDE_DIR}") endif() endif() endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindPCRE2.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindPCRE2.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindPCRE2.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindPCRE2.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -15,13 +15,13 @@ REQUIRED_VARS PCRE2-8_LIBRARY PCRE2_INCLUDE_DIR) mark_as_advanced(PCRE2_INCLUDE_DIR PCRE2-8_LIBRARY) if(PCRE2_FOUND) - list(APPEND PCRE2_LIBRARIES ${PCRE2-8_LIBRARY}) - set(PCRE2_INCLUDE_DIRS ${PCRE2_INCLUDE_DIR}) + list(APPEND PCRE2_LIBRARIES "${PCRE2-8_LIBRARY}") + set(PCRE2_INCLUDE_DIRS "${PCRE2_INCLUDE_DIR}") if(NOT TARGET PCRE2::PCRE2-8) add_library(PCRE2::PCRE2-8 UNKNOWN IMPORTED) set_target_properties(PCRE2::PCRE2-8 PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${PCRE2_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${PCRE2_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION ${PCRE2-8_LIBRARY}) + IMPORTED_LOCATION "${PCRE2-8_LIBRARY}") endif() endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindPCRE.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindPCRE.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindPCRE.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindPCRE.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -16,13 +16,13 @@ REQUIRED_VARS PCRE_LIBRARY PCRE_INCLUDE_DIR) mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARY) if(PCRE_FOUND) - set(PCRE_LIBRARIES ${PCRE_LIBRARY}) - set(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR}) + set(PCRE_LIBRARIES "${PCRE_LIBRARY}") + set(PCRE_INCLUDE_DIRS "${PCRE_INCLUDE_DIR}") if(NOT TARGET PCRE::PCRE) add_library(PCRE::PCRE UNKNOWN IMPORTED) set_target_properties(PCRE::PCRE PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${PCRE_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${PCRE_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION ${PCRE_LIBRARY}) + IMPORTED_LOCATION "${PCRE_LIBRARY}") endif() endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindPodofo.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindPodofo.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindPodofo.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindPodofo.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -70,14 +70,14 @@ VERSION_VAR PODOFO_VERSION_STRING) if(PODOFO_FOUND) - set(PODOFO_INCLUDE_DIRS ${PODOFO_INCLUDE_DIR}) - set(PODOFO_LIBRARIES ${PDOFO_LIBRARY}) + set(PODOFO_INCLUDE_DIRS "${PODOFO_INCLUDE_DIR}") + set(PODOFO_LIBRARIES "${PDOFO_LIBRARY}") if(NOT TARGET PODOFO::Podofo) add_library(PODOFO::Podofo UNKNOWN IMPORTED) set_target_properties(PODOFO::Podofo PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${PODOFO_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${PODOFO_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION ${PODOFO_LIBRARY}) + IMPORTED_LOCATION "${PODOFO_LIBRARY}") endif() endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindPoppler.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindPoppler.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindPoppler.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindPoppler.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -135,14 +135,22 @@ mark_as_advanced(Poppler_INCLUDE_DIR Poppler_LIBRARY) if(Poppler_FOUND) - set(Poppler_INCLUDE_DIRS ${Poppler_INCLUDE_DIR}) + if (NOT EXISTS "${Poppler_INCLUDE_DIR}/Object.h") + message(WARNING "Poppler private headers not found. Make sure you build Poppler with -DENABLE_UNSTABLE_API_ABI_HEADERS") + unset(Poppler_FOUND) + unset(POPPLER_FOUND) + endif() +endif() + +if(Poppler_FOUND) + set(Poppler_INCLUDE_DIRS "${Poppler_INCLUDE_DIR}") if(Poppler_INCLUDE_DIR MATCHES ".*/poppler" OR Poppler_INCLUDE_DIR MATCHES ".*\\poppler") # poppler/splash/SplashBitmap.h unfortunately has a #include "poppler/GfxState.h" # which obliges us to add the parent directory of Poppler_INCLUDE_DIR get_filename_component(_poppler_upper_include_dir "${Poppler_INCLUDE_DIR}" DIRECTORY) list(APPEND Poppler_INCLUDE_DIRS "${_poppler_upper_include_dir}") endif() - set(Poppler_LIBRARIES ${Poppler_LIBRARY}) + set(Poppler_LIBRARIES "${Poppler_LIBRARY}") if(NOT TARGET Poppler::Poppler) add_library(Poppler::Poppler UNKNOWN IMPORTED) set(POPPLER_EXTRA_TARGETS) @@ -162,9 +170,9 @@ foreach(tgt IN LISTS Poppler_known_components) add_library(Poppler::${tgt} UNKNOWN IMPORTED) set_target_properties(Poppler::${tgt} PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${Poppler_${tgt}_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${Poppler_${tgt}_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION ${POPPLER_${tgt}_LIBRARY}) + IMPORTED_LOCATION "${POPPLER_${tgt}_LIBRARY}") endforeach() endif() endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindPROJ.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindPROJ.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindPROJ.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindPROJ.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -60,12 +60,12 @@ mark_as_advanced(PROJ_INCLUDE_DIR PROJ_LIBRARY) if(PROJ_FOUND) - set(PROJ_LIBRARIES ${PROJ_LIBRARY}) - set(PROJ_INCLUDE_DIRS ${PROJ_INCLUDE_DIR}) + set(PROJ_LIBRARIES "${PROJ_LIBRARY}") + set(PROJ_INCLUDE_DIRS "${PROJ_INCLUDE_DIR}") if(NOT TARGET PROJ::proj) add_library(PROJ::proj UNKNOWN IMPORTED) set_target_properties(PROJ::proj PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${PROJ_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${PROJ_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES "C") if(EXISTS "${PROJ_LIBRARY}") set_target_properties(PROJ::proj PROPERTIES diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindRASTERLITE2.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindRASTERLITE2.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindRASTERLITE2.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindRASTERLITE2.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -78,13 +78,13 @@ REQUIRED_VARS RASTERLITE2_LIBRARY RASTERLITE2_INCLUDE_DIR VERSION_VAR RASTERLITE2_VERSION_STRING) if(RASTERLITE2_FOUND) - set(RASTERLITE2_LIBRARIES ${RASTERLITE2_LIBRARY}) - set(RASTERLITE2_INCLUDE_DIRS ${RASTERLITE2_INCLUDE_DIR}) + set(RASTERLITE2_LIBRARIES "${RASTERLITE2_LIBRARY}") + set(RASTERLITE2_INCLUDE_DIRS "${RASTERLITE2_INCLUDE_DIR}") if(NOT TARGET RASTERLITE2::RASTERLITE2) add_library(RASTERLITE2::RASTERLITE2 UNKNOWN IMPORTED) set_target_properties(RASTERLITE2::RASTERLITE2 PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${RASTERLITE2_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${RASTERLITE2_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION ${RASTERLITE2_LIBRARY}) + IMPORTED_LOCATION "${RASTERLITE2_LIBRARY}") endif() endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindShapelib.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindShapelib.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindShapelib.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindShapelib.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -57,13 +57,13 @@ mark_as_advanced(Shapelib_INCLUDE_DIR Shapelib_LIBRARY) if(Shapelib_FOUND) - set(Shapelib_INCLUDE_DIRS ${Shapelib_INCLUDE_DIR}) - set(Shapelib_LIBRARIES ${Shapelib_LIBRARY}) + set(Shapelib_INCLUDE_DIRS "${Shapelib_INCLUDE_DIR}") + set(Shapelib_LIBRARIES "${Shapelib_LIBRARY}") if(NOT TARGET SHAPELIB::shp) add_library(SHAPELIB::shp UNKNOWN IMPORTED) set_target_properties(SHAPELIB::shp PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${Shapelib_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${Shapelib_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES C - IMPORTED_LOCATION ${Shapelib_LIBRARY}) + IMPORTED_LOCATION "${Shapelib_LIBRARY}") endif() endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindSPATIALITE.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindSPATIALITE.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindSPATIALITE.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindSPATIALITE.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -66,13 +66,13 @@ REQUIRED_VARS SPATIALITE_LIBRARY SPATIALITE_INCLUDE_DIR VERSION_VAR SPATIALITE_VERSION_STRING) if(SPATIALITE_FOUND) - set(SPATIALITE_LIBRARIES ${SPATIALITE_LIBRARY}) - set(SPATIALITE_INCLUDE_DIRS ${SPATIALITE_INCLUDE_DIR}) + set(SPATIALITE_LIBRARIES "${SPATIALITE_LIBRARY}") + set(SPATIALITE_INCLUDE_DIRS "${SPATIALITE_INCLUDE_DIR}") if(NOT TARGET SPATIALITE::SPATIALITE) add_library(SPATIALITE::SPATIALITE UNKNOWN IMPORTED) set_target_properties(SPATIALITE::SPATIALITE PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${SPATIALITE_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${SPATIALITE_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION ${SPATIALITE_LIBRARY}) + IMPORTED_LOCATION "${SPATIALITE_LIBRARY}") endif() endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindSQLite3.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindSQLite3.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindSQLite3.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindSQLite3.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -26,7 +26,7 @@ Copyright (c) 2018,2021 Hiroshi Miura Copyright (c) 2019 Chuck Atkins #]=======================================================================] - +include (CMakePushCheckState) # Accept upper case variant for SQLite3_INCLUDE_DIR if(SQLITE3_INCLUDE_DIR) if(SQLite3_INCLUDE_DIR AND NOT "${SQLite3_INCLUDE_DIR}" STREQUAL "${SQLITE3_INCLUDE_DIR}") diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindWebP.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindWebP.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindWebP.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindWebP.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -26,13 +26,13 @@ ) if(WEBP_FOUND) - set(WEBP_LIBRARIES ${WEBP_LIBRARY}) - set(WEBP_INCLUDE_DIRS ${WEBP_INCLUDE_DIR}) + set(WEBP_LIBRARIES "${WEBP_LIBRARY}") + set(WEBP_INCLUDE_DIRS "${WEBP_INCLUDE_DIR}") if(NOT TARGET WEBP::WebP) add_library(WEBP::WebP UNKNOWN IMPORTED) set_target_properties(WEBP::WebP PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${WEBP_INCLUDE_DIRS} + INTERFACE_INCLUDE_DIRECTORIES "${WEBP_INCLUDE_DIRS}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION ${WEBP_LIBRARIES}) + IMPORTED_LOCATION "${WEBP_LIBRARIES}") endif() endif() diff -Nru gdal-3.6.2+dfsg/cmake/modules/packages/FindZSTD.cmake gdal-3.6.4+dfsg/cmake/modules/packages/FindZSTD.cmake --- gdal-3.6.2+dfsg/cmake/modules/packages/FindZSTD.cmake 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/modules/packages/FindZSTD.cmake 2023-04-17 11:50:19.000000000 +0000 @@ -80,13 +80,13 @@ URL "https://github.com/facebook/zstd") if(ZSTD_FOUND) - set(ZSTD_INCLUDE_DIRS ${ZSTD_INCLUDE_DIR}) - set(ZSTD_LIBRARIES ${ZSTD_LIBRARY}) + set(ZSTD_INCLUDE_DIRS "${ZSTD_INCLUDE_DIR}") + set(ZSTD_LIBRARIES "${ZSTD_LIBRARY}") set(ZSTD_DEFINITIONS ${PC_ZSTD_CFLAGS_OTHER}) set(ZSTD_TARGET ZSTD::zstd) if(NOT TARGET ${ZSTD_TARGET}) add_library(${ZSTD_TARGET} UNKNOWN IMPORTED) - set_target_properties(${ZSTD_TARGET} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) + set_target_properties(${ZSTD_TARGET} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ZSTD_INCLUDE_DIR}") if(EXISTS "${ZSTD_LIBRARY}") set_target_properties(${ZSTD_TARGET} PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" IMPORTED_LOCATION "${ZSTD_LIBRARY}") diff -Nru gdal-3.6.2+dfsg/cmake/template/cpl_config.h.in gdal-3.6.4+dfsg/cmake/template/cpl_config.h.in --- gdal-3.6.2+dfsg/cmake/template/cpl_config.h.in 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/cmake/template/cpl_config.h.in 2023-04-17 11:50:19.000000000 +0000 @@ -49,6 +49,9 @@ #ifdef GDAL_COMPILATION +/* The size of `long int', as computed by sizeof. */ +#cmakedefine SIZEOF_LONG_INT @SIZEOF_LONG_INT@ + /* Define if you want to use pthreads based multiprocessing support */ #cmakedefine CPL_MULTIPROC_PTHREAD 1 @@ -58,8 +61,8 @@ /* Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant. */ #cmakedefine HAVE_PTHREAD_MUTEX_ADAPTIVE_NP 1 -/* Define to 1 if you have the `pthread_spinlock_t' type. */ -#cmakedefine HAVE_PTHREAD_SPINLOCK 1 +/* Define to 1 if you have the `pthread_spin_lock' function. */ +#cmakedefine HAVE_PTHREAD_SPIN_LOCK 1 /* Define to 1 if you have the `pthread_atfork' function. */ #cmakedefine HAVE_PTHREAD_ATFORK 1 diff -Nru gdal-3.6.2+dfsg/data/s57objectclasses.csv gdal-3.6.4+dfsg/data/s57objectclasses.csv --- gdal-3.6.2+dfsg/data/s57objectclasses.csv 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/data/s57objectclasses.csv 2023-04-17 11:50:19.000000000 +0000 @@ -56,7 +56,7 @@ 55,Fishing facility,FSHFAC,CATFIF;NOBJNM;OBJNAM;PEREND;PERSTA;STATUS;VERACC;VERLEN;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point;Line;Area; 56,Fishing ground,FSHGRD,NOBJNM;OBJNAM;PEREND;PERSTA;STATUS;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Area; 57,Floating dock,FLODOC,COLOUR;COLPAT;CONDTN;CONRAD;CONVIS;DATEND;DATSTA;DRVAL1;HORACC;HORCLR;HORLEN;HORWID;LIFCAP;NOBJNM;OBJNAM;STATUS;VERACC;VERLEN;VERDAT;,INFORM;NINFOM;NTXTDS;PICREP;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Line;Area; -58,Fog signal,FOGSIG,CATFOG;DATEND;DATSTA;NOBJNM;OBJNAM;SIGFRQ;SIGGEN;SIGGRP;SIGPER;SIGSEQ;STATUS;VALMXR;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point; +58,Fog signal,FOGSIG,CATFOG;DATEND;DATSTA;NOBJNM;OBJNAM;PEREND;PERSTA;SIGFRQ;SIGGEN;SIGGRP;SIGPER;SIGSEQ;STATUS;VALMXR;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point; 59,Fortified structure,FORSTC,CATFOR;CONDTN;CONRAD;CONVIS;HEIGHT;NATCON;NOBJNM;OBJNAM;VERACC;VERDAT;VERLEN;,INFORM;NINFOM;NTXTDS;PICREP;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point;Line;Area; 60,Free port area,FRPARE,NOBJNM;OBJNAM;STATUS;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Area; 61,Gate,GATCON,CATGAT;CONDTN;DRVAL1;HORACC;HORCLR;NATCON;NOBJNM;OBJNAM;QUASOU;SOUACC;STATUS;VERACC;VERCLR;VERDAT;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point;Line;Area; @@ -100,8 +100,8 @@ 99,Radar line,RADLNE,NOBJNM;OBJNAM;ORIENT;STATUS;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Line; 100,Radar range,RADRNG,COMCHA;DATEND;DATSTA;NOBJNM;OBJNAM;STATUS;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Area; 101,Radar reflector,RADRFL,HEIGHT;STATUS;VERACC;VERDAT;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point; -102,Radar station,RADSTA,CATRAS;DATEND;DATSTA;HEIGHT;NOBJNM;OBJNAM;STATUS;VERACC;VALMXR;VERDAT;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point; -103,Radar transponder beacon,RTPBCN,CATRTB;DATEND;DATSTA;NOBJNM;OBJNAM;RADWAL;SECTR1;SECTR2;SIGGRP;SIGSEQ;STATUS;VALMXR;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point; +102,Radar station,RADSTA,CATRAS;DATEND;DATSTA;HEIGHT;NOBJNM;OBJNAM;PEREND;PERSTA;STATUS;VERACC;VALMXR;VERDAT;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point; +103,Radar transponder beacon,RTPBCN,CATRTB;DATEND;DATSTA;NOBJNM;OBJNAM;PEREND;PERSTA;RADWAL;SECTR1;SECTR2;SIGGRP;SIGSEQ;STATUS;VALMXR;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point; 104,Radio calling-in point,RDOCAL,COMCHA;DATEND;DATSTA;NOBJNM;OBJNAM;ORIENT;PEREND;PERSTA;STATUS;TRAFIC;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point;Line; 105,Radio station,RDOSTA,CALSGN;CATROS;COMCHA;DATEND;DATSTA;ESTRNG;NOBJNM;OBJNAM;ORIENT;PEREND;PERSTA;SIGFRQ;STATUS;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point; 106,Railway,RAILWY,CONDTN;HEIGHT;NOBJNM;OBJNAM;STATUS;VERACC;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Line; @@ -111,7 +111,7 @@ 110,Recommended Traffic Lane Part,RCTLPT,DATEND;DATSTA;ORIENT;STATUS;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point;Area; 111,Rescue station,RSCSTA,CATRSC;DATEND;DATSTA;NOBJNM;OBJNAM;PEREND;PERSTA;STATUS;,INFORM;NINFOM;SCAMAX;SCAMIN;,RECDAT;RECIND;SORDAT;SORIND;,G,Point; 112,Restricted area,RESARE,CATREA;DATEND;DATSTA;NOBJNM;OBJNAM;PEREND;PERSTA;RESTRN;STATUS;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Area; -113,Retro-reflector,RETRFL,COLOUR;COLPAT;HEIGHT;MARSYS;STATUS;VERACC;VERDAT;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point; +113,Retro-reflector,RETRFL,COLOUR;COLPAT;DATEND;DATSTA;HEIGHT;MARSYS;PEREND;PERSTA;STATUS;VERACC;VERDAT;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point; 114,River,RIVERS,NOBJNM;OBJNAM;STATUS;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Line;Area; 115,River bank,RIVBNK,NOBJNM;OBJNAM;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Line;Area; 116,Road,ROADWY,CATROD;CONDTN;NATCON;NOBJNM;OBJNAM;STATUS;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point;Line;Area; @@ -142,7 +142,7 @@ 141,Tide - non-harmonic prediction,T_NHMN,NOBJNM;OBJNAM;T_ACWL;T_MTOD;T_THDF;STATUS;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point;Area; 142,Tidal stream - time series,T_TIMS,NOBJNM;OBJNAM;T_HWLW;T_TINT;T_TSVL;TIMEND;TIMSTA;STATUS;T_ACWL;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point;Area; 143,Tideway,TIDEWY,NOBJNM;OBJNAM;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Line;Area; -144,Top mark,TOPMAR,COLOUR;COLPAT;HEIGHT;MARSYS;STATUS;TOPSHP;VERACC;VERDAT;VERLEN;,INFORM;NINFOM;NTXTDS;PICREP;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point; +144,Top mark,TOPMAR,COLOUR;COLPAT;DATEND;DATSTA;HEIGHT;MARSYS;PEREND;PERSTA;STATUS;TOPSHP;VERACC;VERDAT;VERLEN;,INFORM;NINFOM;NTXTDS;PICREP;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Point; 145,Traffic Separation Line,TSELNE,CATTSS;DATEND;DATSTA;STATUS;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Line; 146,Traffic Separation Scheme Boundary,TSSBND,CATTSS;DATEND;DATSTA;STATUS;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Line; 147,Traffic Separation Scheme Crossing,TSSCRS,CATTSS;DATEND;DATSTA;RESTRN;STATUS;,INFORM;NINFOM;NTXTDS;SCAMAX;SCAMIN;TXTDSC;,RECDAT;RECIND;SORDAT;SORIND;,G,Area; diff -Nru gdal-3.6.2+dfsg/debian/changelog gdal-3.6.4+dfsg/debian/changelog --- gdal-3.6.2+dfsg/debian/changelog 2023-01-07 11:43:46.000000000 +0000 +++ gdal-3.6.4+dfsg/debian/changelog 2023-04-23 07:36:05.000000000 +0000 @@ -1,8 +1,42 @@ -gdal (3.6.2+dfsg-1~jammy0) jammy; urgency=medium +gdal (3.6.4+dfsg-1~jammy0) jammy; urgency=medium * No change rebuild for Jammy. - -- Angelos Tzotsos Sat, 08 Jan 2023 14:00:00 +0200 + -- Angelos Tzotsos Sun, 23 Apr 2023 11:00:00 +0300 + +gdal (3.6.4+dfsg-1~exp1) experimental; urgency=medium + + * New upstream release. + * Update symbols for other architectures. + + -- Bas Couwenberg Fri, 21 Apr 2023 15:19:16 +0200 + +gdal (3.6.4~rc1+dfsg-1~exp1) experimental; urgency=medium + + * New upstream release candidate. + * Drop spelling-errors2.patch, applied upstream. + * Update symbols for amd64. + + -- Bas Couwenberg Mon, 17 Apr 2023 14:23:20 +0200 + +gdal (3.6.3+dfsg-1~exp1) experimental; urgency=medium + + * New upstream release. + * Update symbols for other architectures. + * Strip pre-releases from symbols version. + + -- Bas Couwenberg Tue, 14 Mar 2023 05:22:49 +0100 + +gdal (3.6.3~rc1+dfsg-1~exp1) experimental; urgency=medium + + * New upstream release candidate. + * Bump Standards-Version to 4.6.2, no changes. + * Drop files removed upstream from Files-Excluded. + * Update symbols for amd64. + * Update lintian overrides. + * Add patch to fix spelling errors. + + -- Bas Couwenberg Tue, 07 Mar 2023 20:44:11 +0100 gdal (3.6.2+dfsg-1) unstable; urgency=medium diff -Nru gdal-3.6.2+dfsg/debian/control gdal-3.6.4+dfsg/debian/control --- gdal-3.6.2+dfsg/debian/control 2023-01-05 07:58:52.000000000 +0000 +++ gdal-3.6.4+dfsg/debian/control 2023-03-07 20:22:54.000000000 +0000 @@ -59,9 +59,9 @@ swig, unixodbc-dev (>= 2.2.11), zlib1g-dev -Standards-Version: 4.6.1 +Standards-Version: 4.6.2 Vcs-Browser: https://salsa.debian.org/debian-gis-team/gdal -Vcs-Git: https://salsa.debian.org/debian-gis-team/gdal.git +Vcs-Git: https://salsa.debian.org/debian-gis-team/gdal.git -b experimental Homepage: http://www.gdal.org/ Rules-Requires-Root: no diff -Nru gdal-3.6.2+dfsg/debian/copyright gdal-3.6.4+dfsg/debian/copyright --- gdal-3.6.2+dfsg/debian/copyright 2022-11-20 05:25:53.000000000 +0000 +++ gdal-3.6.4+dfsg/debian/copyright 2023-03-07 20:22:54.000000000 +0000 @@ -15,9 +15,7 @@ . Files-Excluded: data/cubewerx_extra.wkt data/ecw_cs.wkt - doc/* .gitattributes - .github/* Files: * Copyright: 2007-2022, Even Rouault diff -Nru gdal-3.6.2+dfsg/debian/gbp.conf gdal-3.6.4+dfsg/debian/gbp.conf --- gdal-3.6.2+dfsg/debian/gbp.conf 2023-01-05 07:58:52.000000000 +0000 +++ gdal-3.6.4+dfsg/debian/gbp.conf 2023-03-07 20:22:54.000000000 +0000 @@ -6,7 +6,7 @@ # The default name for the Debian branch is "master". # Change it if the name is different (for instance, "debian/unstable"). -debian-branch = master +debian-branch = experimental # git-import-orig uses the following names for the upstream tags. # Change the value if you are not using git-import-orig diff -Nru gdal-3.6.2+dfsg/debian/libgdal32.lintian-overrides gdal-3.6.4+dfsg/debian/libgdal32.lintian-overrides --- gdal-3.6.2+dfsg/debian/libgdal32.lintian-overrides 2022-11-20 05:25:53.000000000 +0000 +++ gdal-3.6.4+dfsg/debian/libgdal32.lintian-overrides 2023-03-07 20:23:18.000000000 +0000 @@ -5,9 +5,6 @@ # False positive, Lat/Lon spelling-error-in-binary lon long * -# False positive, Invalid txe or tye parameters detected. Please check your -txe or -tye argument. -spelling-error-in-binary tye type * - # GDAL uses external libjpeg embedded-library * libjpeg diff -Nru gdal-3.6.2+dfsg/debian/libgdal32.symbols gdal-3.6.4+dfsg/debian/libgdal32.symbols --- gdal-3.6.2+dfsg/debian/libgdal32.symbols 2023-01-05 08:19:58.000000000 +0000 +++ gdal-3.6.4+dfsg/debian/libgdal32.symbols 2023-04-18 09:27:08.000000000 +0000 @@ -1,4 +1,4 @@ -# SymbolsHelper-Confirmed: 3.6.2~rc1 arm64 armel armhf sparc64 +# SymbolsHelper-Confirmed: 3.6.4~rc1 amd64 armel armhf hppa hurd-i386 i386 m68k mipsel powerpc ppc64 s390x libgdal.so.32 #PACKAGE# #MINVER# * Build-Depends-Package: libgdal-dev BSBClose@Base 1.8.0 @@ -1109,6 +1109,7 @@ GDALWarpAppOptionsSetQuiet@Base 2.3.0 GDALWarpAppOptionsSetWarpOption@Base 2.1.0 GDALWarpCutlineMasker@Base 1.8.0 + GDALWarpCutlineMaskerEx@Base 3.6.3 GDALWarpDstAlphaMasker@Base 1.8.0 GDALWarpInitDefaultBandMapping@Base 2.3.0 GDALWarpInitDstNoDataImag@Base 2.3.0 @@ -3130,7 +3131,9 @@ _ZN13RawRasterBand10IReadBlockEiiPv@Base 1.8.0 _ZN13RawRasterBand10InitializeEv@Base 1.8.0 (arch=armel armhf hppa hurd-i386 i386 m68k mipsel powerpc x32)_ZN13RawRasterBand11AccessBlockEyjPv@Base 3.5.1 + (arch=!amd64 !ppc64 !s390x)_ZN13RawRasterBand11AccessBlockEyjPvj@Base 3.6.4~rc1 (arch=alpha amd64 arm64 ia64 mips64el ppc64 ppc64el riscv64 s390x sparc64)_ZN13RawRasterBand11AccessBlockEymPv@Base 3.6.0 + _ZN13RawRasterBand11AccessBlockEymPvm@Base 3.6.4~rc1 _ZN13RawRasterBand11IWriteBlockEiiPv@Base 1.8.0 _ZN13RawRasterBand13BIPWriteBlockEiiPKv@Base 3.3.0 _ZN13RawRasterBand13GetColorTableEv@Base 1.8.0 @@ -7381,7 +7384,7 @@ (optional=templinst|arch=!alpha !armel !armhf !hurd-i386 !i386 !mipsel !powerpc !ppc64 !s390x)_ZNSt8_Rb_treeIiSt4pairIKiPKcESt10_Select1stIS4_ESt4lessIiESaIS4_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIS4_ERS1_@Base 3.4.2 (optional=templinst)_ZNSt8_Rb_treeIiSt4pairIKiPvESt10_Select1stIS3_ESt4lessIiESaIS3_EE17_M_emplace_uniqueIJS0_IiS2_EEEES0_ISt17_Rb_tree_iteratorIS3_EbEDpOT_@Base 3.1.0 (optional=templinst)_ZNSt8_Rb_treeIiSt4pairIKiS0_INSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiEESt10_Select1stIS9_ESt4lessIiESaIS9_EE24_M_get_insert_unique_posERS1_@Base 3.6.0 - (optional=templinst|arch=amd64 arm64 hppa ia64 mips64el ppc64el riscv64 sparc64 x32)_ZNSt8_Rb_treeIiSt4pairIKiS0_INSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiEESt10_Select1stIS9_ESt4lessIiESaIS9_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIS9_ERS1_@Base 3.6.0 + (optional=templinst|arch=amd64 hppa m68k)_ZNSt8_Rb_treeIiSt4pairIKiS0_INSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiEESt10_Select1stIS9_ESt4lessIiESaIS9_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIS9_ERS1_@Base 3.6.0 (optional=templinst)_ZNSt8_Rb_treeIiSt4pairIKiSt10unique_ptrI8OGRLayerSt14default_deleteIS3_EEESt10_Select1stIS7_ESt4lessIiESaIS7_EE22_M_emplace_hint_uniqueIJRKSt21piecewise_construct_tSt5tupleIJRS1_EESI_IJEEEEESt17_Rb_tree_iteratorIS7_ESt23_Rb_tree_const_iteratorIS7_EDpOT_@Base 3.5.2 (optional=templinst)_ZNSt8_Rb_treeIiSt4pairIKiSt10unique_ptrI8OGRLayerSt14default_deleteIS3_EEESt10_Select1stIS7_ESt4lessIiESaIS7_EE24_M_get_insert_unique_posERS1_@Base 3.1.0 (optional=templinst|arch=!alpha !armel !armhf !hurd-i386 !i386 !mipsel !powerpc !ppc64 !s390x)_ZNSt8_Rb_treeIiSt4pairIKiSt10unique_ptrI8OGRLayerSt14default_deleteIS3_EEESt10_Select1stIS7_ESt4lessIiESaIS7_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIS7_ERS1_@Base 3.4.2 @@ -7425,7 +7428,7 @@ (optional=templinst|arch=armel armhf hppa hurd-i386 i386 m68k mipsel powerpc x32)_ZNSt8_Rb_treeIjSt4pairIKjjESt10_Select1stIS2_ESt4lessIjESaIS2_EE24_M_get_insert_unique_posERS1_@Base 3.5.0 (optional=templinst|arch=hppa x32)_ZNSt8_Rb_treeIjjSt9_IdentityIjESt4lessIjESaIjEE16_M_insert_uniqueIRKjEESt4pairISt17_Rb_tree_iteratorIjEbEOT_@Base 3.5.0 (optional=templinst)_ZNSt8_Rb_treeIjjSt9_IdentityIjESt4lessIjESaIjEE24_M_get_insert_unique_posERKj@Base 3.6.0 - (optional=templinst|arch=amd64 arm64 hppa ia64 mips64el ppc64el riscv64 sparc64 x32)_ZNSt8_Rb_treeIjjSt9_IdentityIjESt4lessIjESaIjEE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIjERKj@Base 3.6.0 + (optional=templinst|arch=amd64 hppa m68k)_ZNSt8_Rb_treeIjjSt9_IdentityIjESt4lessIjESaIjEE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIjERKj@Base 3.6.0 (optional=templinst|arch=amd64 arm64 hppa x32)_ZNSt8_Rb_treeIlSt4pairIKllESt10_Select1stIS2_ESt4lessIlESaIS2_EE17_M_emplace_uniqueIJRS0_IllEEEES0_ISt17_Rb_tree_iteratorIS2_EbEDpOT_@Base 3.5.2 (optional=templinst|arch=!amd64 !arm64 !ia64 !mips64el !ppc64el !riscv64 !sparc64 !x32)_ZNSt8_Rb_treeIlSt4pairIKllESt10_Select1stIS2_ESt4lessIlESaIS2_EE22_M_emplace_hint_uniqueIJRKSt21piecewise_construct_tSt5tupleIJRS1_EESD_IJEEEEESt17_Rb_tree_iteratorIS2_ESt23_Rb_tree_const_iteratorIS2_EDpOT_@Base 3.5.3 (optional=templinst)_ZNSt8_Rb_treeIlSt4pairIKllESt10_Select1stIS2_ESt4lessIlESaIS2_EE24_M_get_insert_unique_posERS1_@Base 2.2.0 @@ -7454,7 +7457,7 @@ (optional=templinst|arch=alpha ppc64 s390x)_ZNSt8_Rb_treeIxSt4pairIKxPvESt10_Select1stIS3_ESt4lessIxESaIS3_EE22_M_emplace_hint_uniqueIJRKSt21piecewise_construct_tSt5tupleIJRS1_EESE_IJEEEEESt17_Rb_tree_iteratorIS3_ESt23_Rb_tree_const_iteratorIS3_EDpOT_@Base 3.5.2 (optional=templinst)_ZNSt8_Rb_treeIxSt4pairIKxPvESt10_Select1stIS3_ESt4lessIxESaIS3_EE24_M_get_insert_unique_posERS1_@Base 3.0.3 (optional=templinst|arch=!alpha !armel !armhf !hurd-i386 !i386 !mipsel !powerpc !ppc64 !s390x)_ZNSt8_Rb_treeIxSt4pairIKxPvESt10_Select1stIS3_ESt4lessIxESaIS3_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIS3_ERS1_@Base 3.4.2 - (optional=templinst|arch=armel armhf)_ZNSt8_Rb_treeIxSt4pairIKxPvESt10_Select1stIS3_ESt4lessIxESaIS3_EE4findERS1_@Base 3.6.2 + (optional=templinst|arch=armel armhf m68k)_ZNSt8_Rb_treeIxSt4pairIKxPvESt10_Select1stIS3_ESt4lessIxESaIS3_EE4findERS1_@Base 3.6.2 (optional=templinst)_ZNSt8_Rb_treeIxSt4pairIKxS0_IiPvEESt10_Select1stIS4_ESt4lessIxESaIS4_EE24_M_get_insert_unique_posERS1_@Base 1.10.1 (optional=templinst|arch=!alpha !armel !armhf !hurd-i386 !i386 !mipsel !powerpc !ppc64 !s390x)_ZNSt8_Rb_treeIxSt4pairIKxS0_IiPvEESt10_Select1stIS4_ESt4lessIxESaIS4_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIS4_ERS1_@Base 3.4.2 (optional=templinst|arch=armel armhf m68k)_ZNSt8_Rb_treeIxSt4pairIKxS0_IiPvEESt10_Select1stIS4_ESt4lessIxESaIS4_EE4findERS1_@Base 3.4.2 diff -Nru gdal-3.6.2+dfsg/docker/alpine-normal/build.sh gdal-3.6.4+dfsg/docker/alpine-normal/build.sh --- gdal-3.6.2+dfsg/docker/alpine-normal/build.sh 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/docker/alpine-normal/build.sh 2023-04-17 11:50:19.000000000 +0000 @@ -42,10 +42,12 @@ "${SCRIPT_DIR}/../util.sh" --platform linux/arm64 "$@" --test-python if test "$HAS_PUSH" = "1"; then - docker manifest rm ${TARGET_IMAGE}-latest || /bin/true - docker manifest create ${TARGET_IMAGE}-latest \ - --amend ${TARGET_IMAGE}-latest-amd64 \ - --amend ${TARGET_IMAGE}-latest-arm64 - docker manifest push ${TARGET_IMAGE}-latest + DOCKER_REPO=$(cat /tmp/gdal_docker_repo.txt) + + docker manifest rm ${DOCKER_REPO}/${TARGET_IMAGE}-latest || /bin/true + docker manifest create ${DOCKER_REPO}/${TARGET_IMAGE}-latest \ + --amend ${DOCKER_REPO}/${TARGET_IMAGE}-latest-amd64 \ + --amend ${DOCKER_REPO}/${TARGET_IMAGE}-latest-arm64 + docker manifest push ${DOCKER_REPO}/${TARGET_IMAGE}-latest fi fi diff -Nru gdal-3.6.2+dfsg/docker/alpine-small/build.sh gdal-3.6.4+dfsg/docker/alpine-small/build.sh --- gdal-3.6.2+dfsg/docker/alpine-small/build.sh 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/docker/alpine-small/build.sh 2023-04-17 11:50:19.000000000 +0000 @@ -42,10 +42,12 @@ "${SCRIPT_DIR}/../util.sh" --platform linux/arm64 "$@" if test "$HAS_PUSH" = "1"; then - docker manifest rm ${TARGET_IMAGE}-latest || /bin/true - docker manifest create ${TARGET_IMAGE}-latest \ - --amend ${TARGET_IMAGE}-latest-amd64 \ - --amend ${TARGET_IMAGE}-latest-arm64 - docker manifest push ${TARGET_IMAGE}-latest + DOCKER_REPO=$(cat /tmp/gdal_docker_repo.txt) + + docker manifest rm ${DOCKER_REPO}/${TARGET_IMAGE}-latest || /bin/true + docker manifest create ${DOCKER_REPO}/${TARGET_IMAGE}-latest \ + --amend ${DOCKER_REPO}/${TARGET_IMAGE}-latest-amd64 \ + --amend ${DOCKER_REPO}/${TARGET_IMAGE}-latest-arm64 + docker manifest push ${DOCKER_REPO}/${TARGET_IMAGE}-latest fi fi diff -Nru gdal-3.6.2+dfsg/docker/README.md gdal-3.6.4+dfsg/docker/README.md --- gdal-3.6.2+dfsg/docker/README.md 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/docker/README.md 2023-04-17 11:50:20.000000000 +0000 @@ -13,7 +13,7 @@ * 3.16 for GDAL 3.6 * 3.15 for GDAL 3.5 -## Small: `osgeo/gdal:alpine-small-latest` +## Small: `ghcr.io/osgeo/gdal:alpine-small-latest` * Image size: ~ 59 MB * Raster drivers: ultrasmall + built-in + SQLite-based ones + network-based ones @@ -26,7 +26,7 @@ See [alpine-small/Dockerfile](alpine-small/Dockerfile) -## Normal: `osgeo/gdal:alpine-normal-latest` +## Normal: `ghcr.io/osgeo/gdal:alpine-normal-latest` * Image size: ~ 282 MB * Raster drivers: small + netCDF, HDF5, BAG @@ -46,7 +46,7 @@ * 22.04 for GDAL 3.6 * 20.04 for GDAL 3.4 and 3.5 -## Small: `osgeo/gdal:ubuntu-small-latest` +## Small: `ghcr.io/osgeo/gdal:ubuntu-small-latest` * Image size: ~ 385 MB * Raster drivers: all built-in + JPEG + PNG + JP2OpenJPEG + WEBP +SQLite-based ones + network-based ones @@ -60,7 +60,7 @@ See [ubuntu-small/Dockerfile](ubuntu-small/Dockerfile) -## Full: `osgeo/gdal:ubuntu-full-latest` (aliased to `osgeo/gdal`) +## Full: `ghcr.io/osgeo/gdal:ubuntu-full-latest` (aliased to `osgeo/gdal`) * Image size: ~ 1.48 GB * Raster drivers: all based on almost all possible free and open-source dependencies @@ -85,8 +85,8 @@ ## Example: ```shell -docker pull osgeo/gdal:alpine-small-latest -docker run --rm -v /home:/home osgeo/gdal:alpine-small-latest gdalinfo $PWD/my.tif +docker pull ghcr.io/osgeo/gdal:alpine-small-latest +docker run --rm -v /home:/home ghcr.io/osgeo/gdal:alpine-small-latest gdalinfo $PWD/my.tif ``` ## Troubleshooting @@ -95,11 +95,11 @@ # Images of releases -Tagged images of recent past releases are available. The last ones (at time of writing) are for GDAL 3.5.3 and PROJ 9.1.0, for linux/amd64 and linux/arm64: -* osgeo/gdal:alpine-small-3.5.3 -* osgeo/gdal:alpine-normal-3.5.3 -* osgeo/gdal:ubuntu-small-3.5.3 -* osgeo/gdal:ubuntu-full-3.5.3 +Tagged images of recent past releases are available. The last ones (at time of writing) are for GDAL 3.6.3 and PROJ 9.2.0, for linux/amd64 and linux/arm64: +* ghcr.io/osgeo/gdal:alpine-small-3.6.3 +* ghcr.io/osgeo/gdal:alpine-normal-3.6.3 +* ghcr.io/osgeo/gdal:ubuntu-small-3.6.3 +* ghcr.io/osgeo/gdal:ubuntu-full-3.6.3 ## Multi-arch Images diff -Nru gdal-3.6.2+dfsg/docker/ubuntu-full/build.sh gdal-3.6.4+dfsg/docker/ubuntu-full/build.sh --- gdal-3.6.2+dfsg/docker/ubuntu-full/build.sh 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/docker/ubuntu-full/build.sh 2023-04-17 11:50:19.000000000 +0000 @@ -42,16 +42,18 @@ "${SCRIPT_DIR}/../util.sh" --platform linux/arm64 "$@" --test-python if test "$HAS_PUSH" = "1"; then - docker manifest rm ${TARGET_IMAGE}-latest || /bin/true - docker manifest create ${TARGET_IMAGE}-latest \ - --amend ${TARGET_IMAGE}-latest-amd64 \ - --amend ${TARGET_IMAGE}-latest-arm64 - docker manifest push ${TARGET_IMAGE}-latest + DOCKER_REPO=$(cat /tmp/gdal_docker_repo.txt) - docker manifest rm osgeo/gdal || /bin/true - docker manifest create osgeo/gdal \ - --amend osgeo/gdal:ubuntu-full-latest-amd64 \ - --amend osgeo/gdal:ubuntu-full-latest-arm64 - docker manifest push osgeo/gdal + docker manifest rm ${DOCKER_REPO}/${TARGET_IMAGE}-latest || /bin/true + docker manifest create ${DOCKER_REPO}/${TARGET_IMAGE}-latest \ + --amend ${DOCKER_REPO}/${TARGET_IMAGE}-latest-amd64 \ + --amend ${DOCKER_REPO}/${TARGET_IMAGE}-latest-arm64 + docker manifest push ${DOCKER_REPO}/${TARGET_IMAGE}-latest + + docker manifest rm ${DOCKER_REPO}/osgeo/gdal || /bin/true + docker manifest create ${DOCKER_REPO}/osgeo/gdal \ + --amend ${DOCKER_REPO}/osgeo/gdal:ubuntu-full-latest-amd64 \ + --amend ${DOCKER_REPO}/osgeo/gdal:ubuntu-full-latest-arm64 + docker manifest push ${DOCKER_REPO}/osgeo/gdal fi fi diff -Nru gdal-3.6.2+dfsg/docker/ubuntu-small/build.sh gdal-3.6.4+dfsg/docker/ubuntu-small/build.sh --- gdal-3.6.2+dfsg/docker/ubuntu-small/build.sh 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/docker/ubuntu-small/build.sh 2023-04-17 11:50:19.000000000 +0000 @@ -42,10 +42,12 @@ "${SCRIPT_DIR}/../util.sh" --platform linux/arm64 "$@" --test-python if test "$HAS_PUSH" = "1"; then - docker manifest rm ${TARGET_IMAGE}-latest || /bin/true - docker manifest create ${TARGET_IMAGE}-latest \ - --amend ${TARGET_IMAGE}-latest-amd64 \ - --amend ${TARGET_IMAGE}-latest-arm64 - docker manifest push ${TARGET_IMAGE}-latest + DOCKER_REPO=$(cat /tmp/gdal_docker_repo.txt) + + docker manifest rm ${DOCKER_REPO}/${TARGET_IMAGE}-latest || /bin/true + docker manifest create ${DOCKER_REPO}/${TARGET_IMAGE}-latest \ + --amend ${DOCKER_REPO}/${TARGET_IMAGE}-latest-amd64 \ + --amend ${DOCKER_REPO}/${TARGET_IMAGE}-latest-arm64 + docker manifest push ${DOCKER_REPO}/${TARGET_IMAGE}-latest fi fi diff -Nru gdal-3.6.2+dfsg/docker/util.sh gdal-3.6.4+dfsg/docker/util.sh --- gdal-3.6.2+dfsg/docker/util.sh 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/docker/util.sh 2023-04-17 11:50:20.000000000 +0000 @@ -17,10 +17,10 @@ usage() { - echo "Usage: build.sh [--push] [--tag name] [--gdal tag|sha1|master] [--gdal-repository repo] [--proj tag|sha1|master] [--release]" + echo "Usage: build.sh [--push] [--docker-repository repo] [--tag name] [--gdal tag|sha1|master] [--gdal-repository repo] [--proj tag|sha1|master] [--release]" # Non-documented: --test-python echo "" - echo "--push: push image to Docker hub" + echo "--push: push image to docker repository (defaults to ghcr.io)" echo "--tag name: suffix to append to image name. Defaults to 'latest' for non release builds or the GDAL tag name for release builds" echo "--gdal tag|sha1|master: GDAL version to use. Defaults to master" echo "--proj tag|sha1|master: PROJ version to use. Defaults to master" @@ -32,6 +32,7 @@ RELEASE=no ARCH_PLATFORMS="linux/amd64" +DOCKER_REPO=ghcr.io GDAL_REPOSITORY=OSGeo/gdal @@ -47,6 +48,12 @@ shift ;; + docker-repository) + shift + DOCKER_REPO="$1" + shift + ;; + --gdal) shift GDAL_VERSION="$1" @@ -112,6 +119,8 @@ esac done +echo "${DOCKER_REPO}" > /tmp/gdal_docker_repo.txt + if test "${DOCKER_BUILDKIT}" = "1" && test "${DOCKER_CLI_EXPERIMENTAL}" = "enabled"; then DOCKER_BUILDX="buildx" DOCKER_BUILDX_ARGS=("--platform" "${ARCH_PLATFORMS}") @@ -253,7 +262,8 @@ echo "Using GDAL_REPOSITORY=${GDAL_REPOSITORY}" IMAGE_NAME="${TARGET_IMAGE}-${TAG_NAME}" -BUILDER_IMAGE_NAME="${IMAGE_NAME}_builder" +REPO_IMAGE_NAME="${DOCKER_REPO}/${IMAGE_NAME}" +BUILDER_IMAGE_NAME="${DOCKER_REPO}/${IMAGE_NAME}_builder" if test "${RELEASE}" = "yes"; then BUILD_ARGS=( @@ -283,30 +293,30 @@ ) docker $(build_cmd) "${BUILD_ARGS[@]}" "${LABEL_ARGS[@]}" --target builder -t "${BUILDER_IMAGE_NAME}" "${SCRIPT_DIR}" - docker $(build_cmd) "${BUILD_ARGS[@]}" "${LABEL_ARGS[@]}" -t "${IMAGE_NAME}" "${SCRIPT_DIR}" + docker $(build_cmd) "${BUILD_ARGS[@]}" "${LABEL_ARGS[@]}" -t "${REPO_IMAGE_NAME}" "${SCRIPT_DIR}" if test "${DOCKER_BUILDX}" != "buildx"; then - check_image "${IMAGE_NAME}" + check_image "${REPO_IMAGE_NAME}" fi if test "${PUSH_GDAL_DOCKER_IMAGE}" = "yes"; then if test "${DOCKER_BUILDX}" = "buildx"; then - docker $(build_cmd) "${BUILD_ARGS[@]}" "${LABEL_ARGS[@]}" -t "${IMAGE_NAME}" --push "${SCRIPT_DIR}" + docker $(build_cmd) "${BUILD_ARGS[@]}" "${LABEL_ARGS[@]}" -t "${REPO_IMAGE_NAME}" --push "${SCRIPT_DIR}" else - docker push "${IMAGE_NAME}" + docker push "${REPO_IMAGE_NAME}" fi fi else - IMAGE_NAME_WITH_ARCH="${IMAGE_NAME}" + IMAGE_NAME_WITH_ARCH="${REPO_IMAGE_NAME}" if test "${IMAGE_NAME}" = "osgeo/gdal:ubuntu-full-latest" \ -o "${IMAGE_NAME}" = "osgeo/gdal:ubuntu-small-latest" \ -o "${IMAGE_NAME}" = "osgeo/gdal:alpine-small-latest" \ -o "${IMAGE_NAME}" = "osgeo/gdal:alpine-normal-latest"; then if test "${DOCKER_BUILDX}" != "buildx"; then ARCH_PLATFORM_ARCH=$(echo ${ARCH_PLATFORMS} | sed "s/linux\///") - IMAGE_NAME_WITH_ARCH="${IMAGE_NAME}-${ARCH_PLATFORM_ARCH}" + IMAGE_NAME_WITH_ARCH="${REPO_IMAGE_NAME}-${ARCH_PLATFORM_ARCH}" BUILDER_IMAGE_NAME="${BUILDER_IMAGE_NAME}_${ARCH_PLATFORM_ARCH}" fi fi @@ -390,10 +400,18 @@ BASE_IMAGE=$(grep "ARG BASE_IMAGE=" ${SCRIPT_DIR}/Dockerfile | sed "s/ARG BASE_IMAGE=//") echo "Fetching digest for ${BASE_IMAGE} ${ARCH_PLATFORMS}..." ARCH_PLATFORM_ARCH=$(echo ${ARCH_PLATFORMS} | sed "s/linux\///") - TARGET_BASE_IMAGE_DIGEST=$(docker manifest inspect ${BASE_IMAGE} | jq --raw-output '.manifests[] | (if .platform.architecture == "'${ARCH_PLATFORM_ARCH}'" then .digest else empty end)') + + # Below no longer works with recent Ubuntu images with Docker client < 23.0.0 + # Cf https://github.com/moby/moby/issues/44898 + #TARGET_BASE_IMAGE_DIGEST=$(docker manifest inspect ${BASE_IMAGE} | jq --raw-output '.manifests[] | (if .platform.architecture == "'${ARCH_PLATFORM_ARCH}'" then .digest else empty end)') + # So workaround the issue by pulling explicitly the image + docker pull arm64v8/${BASE_IMAGE} + TARGET_BASE_IMAGE_DIGEST=$(docker inspect arm64v8/${BASE_IMAGE} | jq --raw-output '.[0].Id') + echo "${TARGET_BASE_IMAGE_DIGEST}" BUILD_ARGS+=("--build-arg" "TARGET_ARCH=${ARCH_PLATFORM_ARCH}") - BUILD_ARGS+=("--build-arg" "TARGET_BASE_IMAGE=${BASE_IMAGE}@${TARGET_BASE_IMAGE_DIGEST}") + #BUILD_ARGS+=("--build-arg" "TARGET_BASE_IMAGE=${BASE_IMAGE}@${TARGET_BASE_IMAGE_DIGEST}") + BUILD_ARGS+=("--build-arg" "TARGET_BASE_IMAGE=${TARGET_BASE_IMAGE_DIGEST}") # echo "${BUILD_ARGS[@]}" fi elif test "${DOCKER_BUILDX}" != "buildx" -a \( "${IMAGE_NAME}" = "osgeo/gdal:alpine-small-latest" -o "${IMAGE_NAME}" = "osgeo/gdal:alpine-normal-latest" \); then @@ -421,18 +439,18 @@ if test "${PUSH_GDAL_DOCKER_IMAGE}" = "yes"; then if test "${DOCKER_BUILDX}" = "buildx"; then - docker $(build_cmd) "${BUILD_ARGS[@]}" -t "${IMAGE_NAME}" --push "${SCRIPT_DIR}" + docker $(build_cmd) "${BUILD_ARGS[@]}" -t "${REPO_IMAGE_NAME}" --push "${SCRIPT_DIR}" else docker push "${IMAGE_NAME_WITH_ARCH}" fi if test "${IMAGE_NAME}" = "osgeo/gdal:ubuntu-full-latest"; then if test "${DOCKER_BUILDX}" = "buildx"; then - docker $(build_cmd) "${BUILD_ARGS[@]}" -t "osgeo/gdal:latest" --push "${SCRIPT_DIR}" + docker $(build_cmd) "${BUILD_ARGS[@]}" -t "${DOCKER_REPO}/osgeo/gdal:latest" --push "${SCRIPT_DIR}" else if test "${ARCH_PLATFORMS}" = "linux/amd64"; then - docker image tag "${IMAGE_NAME_WITH_ARCH}" "osgeo/gdal:latest" - docker push osgeo/gdal:latest + docker image tag "${IMAGE_NAME_WITH_ARCH}" "${DOCKER_REPO}/osgeo/gdal:latest" + docker push "${DOCKER_REPO}/osgeo/gdal:latest" fi fi fi @@ -453,7 +471,7 @@ -o "${IMAGE_NAME}" = "osgeo/gdal:alpine-small-latest" \ -o "${IMAGE_NAME}" = "osgeo/gdal:alpine-normal-latest"; then if test "${DOCKER_BUILDX}" != "buildx" -a "${ARCH_PLATFORMS}" = "linux/amd64"; then - docker image tag "${IMAGE_NAME_WITH_ARCH}" "${IMAGE_NAME}" + docker image tag "${IMAGE_NAME_WITH_ARCH}" "${REPO_IMAGE_NAME}" fi fi fi diff -Nru gdal-3.6.2+dfsg/frmts/bmp/bmpdataset.cpp gdal-3.6.4+dfsg/frmts/bmp/bmpdataset.cpp --- gdal-3.6.2+dfsg/frmts/bmp/bmpdataset.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/bmp/bmpdataset.cpp 2023-04-17 11:50:19.000000000 +0000 @@ -236,6 +236,8 @@ GDALColorTable *poColorTable; double adfGeoTransform[6]; int bGeoTransformValid; + bool m_bNewFile = false; + vsi_l_offset m_nLargeFileSize = 0; char *pszFilename; VSILFILE *fp; @@ -966,6 +968,17 @@ { FlushCache(true); + if (m_bNewFile && fp) + { + // Extend the file with zeroes if needed + VSIFSeekL(fp, 0, SEEK_END); + + if (VSIFTellL(fp) < m_nLargeFileSize) + { + VSIFTruncateL(fp, m_nLargeFileSize); + } + } + CPLFree(pabyColorTable); if (poColorTable) delete poColorTable; @@ -1436,6 +1449,7 @@ /* Create the dataset. */ /* -------------------------------------------------------------------- */ BMPDataset *poDS = new BMPDataset(); + poDS->m_bNewFile = true; poDS->fp = VSIFOpenL(pszFilename, "wb+"); if (poDS->fp == nullptr) @@ -1482,7 +1496,6 @@ } nScanSize = (nScanSize & ~31U) / 8; - poDS->sInfoHeader.iSizeImage = nScanSize * poDS->sInfoHeader.iHeight; poDS->sInfoHeader.iXPelsPerMeter = 0; poDS->sInfoHeader.iYPelsPerMeter = 0; poDS->nColorElems = 4; @@ -1513,15 +1526,53 @@ /* -------------------------------------------------------------------- */ /* Fill the BMPFileHeader */ /* -------------------------------------------------------------------- */ + + poDS->sFileHeader.iOffBits = BFH_SIZE + poDS->sInfoHeader.iSize + + poDS->sInfoHeader.iClrUsed * poDS->nColorElems; + + // From https://medium.com/@chiaracoetzee/maximum-resolution-of-bmp-image-file-8c729b3f833a + if (nXSize > 30000 || nYSize > 30000) + { + CPLDebug("BMP", "Dimensions of BMP file exceed maximum supported by " + "Adobe Photoshop CC 2014.2.2"); + } + if (nXSize > 2147483647 / (nYSize + 1)) + { + CPLDebug("BMP", "Dimensions of BMP file exceed maximum supported by " + "Windows Photo Viewer"); + } + + const vsi_l_offset nLargeImageSize = + static_cast(nScanSize) * poDS->sInfoHeader.iHeight; + poDS->m_nLargeFileSize = poDS->sFileHeader.iOffBits + nLargeImageSize; + if (nLargeImageSize > std::numeric_limits::max()) + { + CPLError(CE_Warning, CPLE_AppDefined, + "Image too big for its size to fit in a 32 bit integer! " + "Writing 0xFFFFFFFF in it, but that could cause compatibility " + "problems with other readers."); + poDS->sFileHeader.iSize = std::numeric_limits::max(); + poDS->sInfoHeader.iSizeImage = std::numeric_limits::max(); + } + else if (poDS->m_nLargeFileSize > std::numeric_limits::max()) + { + CPLError(CE_Warning, CPLE_AppDefined, + "File too big for its size to fit in a 32 bit integer! " + "Writing 0xFFFFFFFF in it, but that could cause compatibility " + "problems with other readers."); + poDS->sFileHeader.iSize = std::numeric_limits::max(); + poDS->sInfoHeader.iSizeImage = static_cast(nLargeImageSize); + } + else + { + poDS->sFileHeader.iSize = static_cast(poDS->m_nLargeFileSize); + poDS->sInfoHeader.iSizeImage = static_cast(nLargeImageSize); + } + poDS->sFileHeader.bType[0] = 'B'; poDS->sFileHeader.bType[1] = 'M'; - poDS->sFileHeader.iSize = BFH_SIZE + poDS->sInfoHeader.iSize + - poDS->sInfoHeader.iClrUsed * poDS->nColorElems + - poDS->sInfoHeader.iSizeImage; poDS->sFileHeader.iReserved1 = 0; poDS->sFileHeader.iReserved2 = 0; - poDS->sFileHeader.iOffBits = BFH_SIZE + poDS->sInfoHeader.iSize + - poDS->sInfoHeader.iClrUsed * poDS->nColorElems; /* -------------------------------------------------------------------- */ /* Write all structures to the file */ diff -Nru gdal-3.6.2+dfsg/frmts/dimap/dimapdataset.cpp gdal-3.6.4+dfsg/frmts/dimap/dimapdataset.cpp --- gdal-3.6.2+dfsg/frmts/dimap/dimapdataset.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/dimap/dimapdataset.cpp 2023-04-17 11:50:19.000000000 +0000 @@ -93,6 +93,10 @@ char **GetMetadata(const char *pszDomain) override; char **GetFileList() override; + CPLErr IRasterIO(GDALRWFlag, int, int, int, int, void *, int, int, + GDALDataType, int, int *, GSpacing, GSpacing, GSpacing, + GDALRasterIOExtraArg *psExtraArg) override; + static int Identify(GDALOpenInfo *); static GDALDataset *Open(GDALOpenInfo *); @@ -338,6 +342,34 @@ } /************************************************************************/ +/* IRasterIO() */ +/************************************************************************/ + +CPLErr DIMAPDataset::IRasterIO(GDALRWFlag eRWFlag, int nXOff, int nYOff, + int nXSize, int nYSize, void *pData, + int nBufXSize, int nBufYSize, + GDALDataType eBufType, int nBandCount, + int *panBandMap, GSpacing nPixelSpace, + GSpacing nLineSpace, GSpacing nBandSpace, + GDALRasterIOExtraArg *psExtraArg) + +{ + if (cpl::down_cast(papoBands[0]) + ->GDALPamRasterBand::GetOverviewCount() > 0) + { + return GDALPamDataset::IRasterIO(eRWFlag, nXOff, nYOff, nXSize, nYSize, + pData, nBufXSize, nBufYSize, eBufType, + nBandCount, panBandMap, nPixelSpace, + nLineSpace, nBandSpace, psExtraArg); + } + + return poVRTDS->IRasterIO(eRWFlag, nXOff, nYOff, nXSize, nYSize, pData, + nBufXSize, nBufYSize, eBufType, nBandCount, + panBandMap, nPixelSpace, nLineSpace, nBandSpace, + psExtraArg); +} + +/************************************************************************/ /* GetOverviewCount() */ /************************************************************************/ diff -Nru gdal-3.6.2+dfsg/frmts/grib/degrib/degrib/degrib1.cpp gdal-3.6.4+dfsg/frmts/grib/degrib/degrib/degrib1.cpp --- gdal-3.6.2+dfsg/frmts/grib/degrib/degrib/degrib1.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/grib/degrib/degrib/degrib1.cpp 2023-04-17 11:50:19.000000000 +0000 @@ -1148,6 +1148,7 @@ if (gdsMeta->center & GRIB2BIT_1) { /* South polar stereographic. */ gdsMeta->scaleLat1 = gdsMeta->scaleLat2 = -90; + gdsMeta->meshLat = -gdsMeta->meshLat; } else { /* North polar stereographic. */ gdsMeta->scaleLat1 = gdsMeta->scaleLat2 = 90; diff -Nru gdal-3.6.2+dfsg/frmts/grib/degrib/degrib/myerror.cpp gdal-3.6.4+dfsg/frmts/grib/degrib/degrib/myerror.cpp --- gdal-3.6.2+dfsg/frmts/grib/degrib/degrib/myerror.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/grib/degrib/degrib/myerror.cpp 2023-04-17 11:50:19.000000000 +0000 @@ -40,7 +40,6 @@ #endif - /***************************************************************************** * AllocSprintf() -- Arthur Taylor / MDL (Review 12/2002) * @@ -178,7 +177,7 @@ switch (flag) { case 'l': case 'L': - sprintf (bufpart, format, va_arg (ap, sInt4)); + snprintf (bufpart, sizeof(bufpart), format, va_arg (ap, sInt4)); break; /* * gcc warning for 'h': "..." promotes short int to @@ -188,11 +187,11 @@ */ /* case 'h': - sprintf (bufpart, format, va_arg(ap, short int)); + snprintf (bufpart, sizeof(bufpart), format, va_arg(ap, short int)); break; */ default: - sprintf (bufpart, format, va_arg (ap, int)); + snprintf (bufpart, sizeof(bufpart), format, va_arg (ap, int)); } slen = strlen (bufpart); lenBuff += slen; @@ -201,7 +200,7 @@ ipos = lenBuff - 1; break; case 'f': - sprintf (bufpart, format, va_arg (ap, double)); + snprintf (bufpart, sizeof(bufpart), format, va_arg (ap, double)); slen = strlen (bufpart); lenBuff += slen; buffer = (char *) realloc ((void *) buffer, lenBuff); @@ -209,7 +208,7 @@ ipos = lenBuff - 1; break; case 'e': - sprintf (bufpart, format, va_arg (ap, double)); + snprintf (bufpart, sizeof(bufpart), format, va_arg (ap, double)); slen = strlen (bufpart); lenBuff += slen; buffer = (char *) realloc ((void *) buffer, lenBuff); @@ -217,7 +216,7 @@ ipos = lenBuff - 1; break; case 'g': - sprintf (bufpart, format, va_arg (ap, double)); + snprintf (bufpart, sizeof(bufpart), format, va_arg (ap, double)); slen = strlen (bufpart); lenBuff += slen; buffer = (char *) realloc ((void *) buffer, lenBuff); diff -Nru gdal-3.6.2+dfsg/frmts/gtiff/cogdriver.cpp gdal-3.6.4+dfsg/frmts/gtiff/cogdriver.cpp --- gdal-3.6.2+dfsg/frmts/gtiff/cogdriver.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/gtiff/cogdriver.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -1083,8 +1083,7 @@ { if (pszQuality && atoi(pszQuality) == 100) aosOptions.SetNameValue("WEBP_LOSSLESS", "YES"); - else - aosOptions.SetNameValue("WEBP_LEVEL", pszQuality); + aosOptions.SetNameValue("WEBP_LEVEL", pszQuality); } else if (EQUAL(osCompress, "DEFLATE") || EQUAL(osCompress, "LERC_DEFLATE")) { diff -Nru gdal-3.6.2+dfsg/frmts/gtiff/geotiff.cpp gdal-3.6.4+dfsg/frmts/gtiff/geotiff.cpp --- gdal-3.6.2+dfsg/frmts/gtiff/geotiff.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/gtiff/geotiff.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -1064,45 +1064,29 @@ } CPL_IGNORE_RET_VAL(VSIFCloseL(fp)); - if (m_poGDS->m_poJPEGDS == nullptr) - { - const char *const apszDrivers[] = {"JPEG", nullptr}; - - CPLConfigOptionSetter oJPEGtoRGBSetter( - "GDAL_JPEG_TO_RGB", - m_poGDS->m_poParentDS->m_nPlanarConfig == PLANARCONFIG_CONTIG && - m_poGDS->nBands == 4 - ? "NO" - : "YES", - false); + const char *const apszDrivers[] = {"JPEG", nullptr}; - m_poGDS->m_poJPEGDS.reset(GDALDataset::Open( - osFileToOpen, GDAL_OF_RASTER | GDAL_OF_INTERNAL, apszDrivers, - nullptr, nullptr)); - - if (m_poGDS->m_poJPEGDS != nullptr) - { - // Force all implicit overviews to be available, even for - // small tiles. - CPLConfigOptionSetter oInternalOverviewsSetter( - "JPEG_FORCE_INTERNAL_OVERVIEWS", "YES", false); - GDALGetOverviewCount( - GDALGetRasterBand(m_poGDS->m_poJPEGDS.get(), 1)); + CPLConfigOptionSetter oJPEGtoRGBSetter( + "GDAL_JPEG_TO_RGB", + m_poGDS->m_poParentDS->m_nPlanarConfig == PLANARCONFIG_CONTIG && + m_poGDS->nBands == 4 + ? "NO" + : "YES", + false); + + m_poGDS->m_poJPEGDS.reset( + GDALDataset::Open(osFileToOpen, GDAL_OF_RASTER | GDAL_OF_INTERNAL, + apszDrivers, nullptr, nullptr)); + + if (m_poGDS->m_poJPEGDS != nullptr) + { + // Force all implicit overviews to be available, even for + // small tiles. + CPLConfigOptionSetter oInternalOverviewsSetter( + "JPEG_FORCE_INTERNAL_OVERVIEWS", "YES", false); + GDALGetOverviewCount( + GDALGetRasterBand(m_poGDS->m_poJPEGDS.get(), 1)); - m_poGDS->m_nBlockId = nBlockId; - } - } - else - { - // Trick: we invalidate the JPEG dataset to force a reload - // of the new content. - CPLErrorReset(); - m_poGDS->m_poJPEGDS->FlushCache(false); - if (CPLGetLastErrorNo() != 0) - { - m_poGDS->m_poJPEGDS.reset(); - return CE_Failure; - } m_poGDS->m_nBlockId = nBlockId; } } @@ -2346,12 +2330,14 @@ if (nBufXSize < nXSize && nBufYSize < nYSize) { int bTried = FALSE; - ++m_nJPEGOverviewVisibilityCounter; + if (psExtraArg->eResampleAlg == GRIORA_NearestNeighbour) + ++m_nJPEGOverviewVisibilityCounter; const CPLErr eErr = TryOverviewRasterIO( eRWFlag, nXOff, nYOff, nXSize, nYSize, pData, nBufXSize, nBufYSize, eBufType, nBandCount, panBandMap, nPixelSpace, nLineSpace, nBandSpace, psExtraArg, &bTried); - --m_nJPEGOverviewVisibilityCounter; + if (psExtraArg->eResampleAlg == GRIORA_NearestNeighbour) + --m_nJPEGOverviewVisibilityCounter; if (bTried) return eErr; } @@ -2421,12 +2407,14 @@ } #endif - ++m_nJPEGOverviewVisibilityCounter; + if (psExtraArg->eResampleAlg == GRIORA_NearestNeighbour) + ++m_nJPEGOverviewVisibilityCounter; const CPLErr eErr = GDALPamDataset::IRasterIO( eRWFlag, nXOff, nYOff, nXSize, nYSize, pData, nBufXSize, nBufYSize, eBufType, nBandCount, panBandMap, nPixelSpace, nLineSpace, nBandSpace, psExtraArg); - m_nJPEGOverviewVisibilityCounter--; + if (psExtraArg->eResampleAlg == GRIORA_NearestNeighbour) + m_nJPEGOverviewVisibilityCounter--; if (pBufferedData) { @@ -5590,11 +5578,13 @@ if (nBufXSize < nXSize && nBufYSize < nYSize) { int bTried = FALSE; - ++m_poGDS->m_nJPEGOverviewVisibilityCounter; + if (psExtraArg->eResampleAlg == GRIORA_NearestNeighbour) + ++m_poGDS->m_nJPEGOverviewVisibilityCounter; const CPLErr eErr = TryOverviewRasterIO( eRWFlag, nXOff, nYOff, nXSize, nYSize, pData, nBufXSize, nBufYSize, eBufType, nPixelSpace, nLineSpace, psExtraArg, &bTried); - --m_poGDS->m_nJPEGOverviewVisibilityCounter; + if (psExtraArg->eResampleAlg == GRIORA_NearestNeighbour) + --m_poGDS->m_nJPEGOverviewVisibilityCounter; if (bTried) return eErr; } @@ -5711,11 +5701,13 @@ } } - ++m_poGDS->m_nJPEGOverviewVisibilityCounter; + if (psExtraArg->eResampleAlg == GRIORA_NearestNeighbour) + ++m_poGDS->m_nJPEGOverviewVisibilityCounter; const CPLErr eErr = GDALPamRasterBand::IRasterIO( eRWFlag, nXOff, nYOff, nXSize, nYSize, pData, nBufXSize, nBufYSize, eBufType, nPixelSpace, nLineSpace, psExtraArg); - --m_poGDS->m_nJPEGOverviewVisibilityCounter; + if (psExtraArg->eResampleAlg == GRIORA_NearestNeighbour) + --m_poGDS->m_nJPEGOverviewVisibilityCounter; m_poGDS->m_bLoadingOtherBands = false; @@ -15467,12 +15459,9 @@ psGeodataXform = CPLGetXMLNode(psValueAsXML, "=GeodataXform"); } - const char *pszTIFFTagResUnit = - GetMetadataItem("TIFFTAG_RESOLUTIONUNIT"); const char *pszTIFFTagXRes = GetMetadataItem("TIFFTAG_XRESOLUTION"); const char *pszTIFFTagYRes = GetMetadataItem("TIFFTAG_YRESOLUTION"); - if (psGeodataXform && pszTIFFTagResUnit && pszTIFFTagXRes && - pszTIFFTagYRes && atoi(pszTIFFTagResUnit) == 2) + if (psGeodataXform && pszTIFFTagXRes && pszTIFFTagYRes) { CPLXMLNode *psSourceGCPs = CPLGetXMLNode(psGeodataXform, "SourceGCPs"); @@ -15520,7 +15509,8 @@ m_pasGCPList[i].pszId = CPLStrdup(""); m_pasGCPList[i].pszInfo = CPLStrdup(""); // The origin used is the bottom left corner, - // and raw values are in inches! + // and raw values to be multiplied by the + // TIFFTAG_XRESOLUTION/TIFFTAG_YRESOLUTION m_pasGCPList[i].dfGCPPixel = adfSourceGCPs[2 * i] * CPLAtof(pszTIFFTagXRes); m_pasGCPList[i].dfGCPLine = diff -Nru gdal-3.6.2+dfsg/frmts/hdf5/bagdataset.cpp gdal-3.6.4+dfsg/frmts/hdf5/bagdataset.cpp --- gdal-3.6.2+dfsg/frmts/hdf5/bagdataset.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/hdf5/bagdataset.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -423,6 +423,8 @@ BAGRasterBand::~BAGRasterBand() { + HDF5_GLOBAL_LOCK(); + if (eAccess == GA_Update) { CreateDatasetIfNeeded(); @@ -740,6 +742,8 @@ /************************************************************************/ CPLErr BAGRasterBand::IReadBlock(int nBlockXOff, int nBlockYOff, void *pImage) { + HDF5_GLOBAL_LOCK(); + if (!CreateDatasetIfNeeded()) return CE_Failure; @@ -824,6 +828,8 @@ CPLErr BAGRasterBand::IWriteBlock(int nBlockXOff, int nBlockYOff, void *pImage) { + HDF5_GLOBAL_LOCK(); + if (!CreateDatasetIfNeeded()) return CE_Failure; @@ -939,6 +945,8 @@ CPLErr BAGSuperGridBand::IReadBlock(int, int nBlockYOff, void *pImage) { + HDF5_GLOBAL_LOCK(); + BAGDataset *poGDS = cpl::down_cast(poDS); H5OFFSET_TYPE offset[2] = { static_cast(0), @@ -1103,6 +1111,8 @@ CPLErr BAGResampledBand::IReadBlock(int nBlockXOff, int nBlockYOff, void *pImage) { + HDF5_GLOBAL_LOCK(); + BAGDataset *poGDS = cpl::down_cast(poDS); #ifdef DEBUG_VERBOSE CPLDebug( @@ -1642,6 +1652,8 @@ CPLErr BAGGeorefMDBand::IReadBlock(int nBlockXOff, int nBlockYOff, void *pImage) { + HDF5_GLOBAL_LOCK(); + if (m_poKeys) { const GUInt64 arrayStartIdx[2] = { @@ -1959,6 +1971,8 @@ if (!Identify(poOpenInfo)) return nullptr; + HDF5_GLOBAL_LOCK(); + if (poOpenInfo->nOpenFlags & GDAL_OF_MULTIDIM_RASTER) { return HDF5Dataset::OpenMultiDim(poOpenInfo); diff -Nru gdal-3.6.2+dfsg/frmts/hdf5/CMakeLists.txt gdal-3.6.4+dfsg/frmts/hdf5/CMakeLists.txt --- gdal-3.6.2+dfsg/frmts/hdf5/CMakeLists.txt 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/hdf5/CMakeLists.txt 2023-04-17 11:50:20.000000000 +0000 @@ -12,6 +12,52 @@ add_gdal_driver(TARGET gdal_HDF5 SOURCES ${SOURCE} PLUGIN_CAPABLE) +# Try to detect if libhdf5 has thread-safety enabled +if(NOT DEFINED GDAL_ENABLE_HDF5_GLOBAL_LOCK AND UNIX AND + (HDF5_C_LIBRARIES MATCHES ".so" OR HDF5_C_LIBRARIES MATCHES ".dylib")) + + set(HDF5_LINKS_TO_PTHREAD NO) + if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + find_program(LDD_PROGRAM ldd) + if(LDD_PROGRAM) + foreach (lib IN LISTS HDF5_C_LIBRARIES) + if(lib MATCHES "libhdf5*.so") + execute_process(COMMAND "${LDD_PROGRAM}" "${lib}" OUTPUT_VARIABLE res) + if("${res}" MATCHES "libpthread") + set(HDF5_LINKS_TO_PTHREAD YES) + message(STATUS "${lib} links against pthread.") + break() + endif() + endif() + endforeach() + endif() + elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") + find_program(OTOOL_PROGRAM otool) + if(OTOOL_PROGRAM) + foreach (lib IN LISTS HDF5_C_LIBRARIES) + if(lib MATCHES "libhdf5*dylib") + execute_process(COMMAND "${OTOOL_PROGRAM}" -L "${lib}" OUTPUT_VARIABLE res) + if("${res}" MATCHES "libpthread") + set(HDF5_LINKS_TO_PTHREAD YES) + message(STATUS "${lib} links against pthread.") + break() + endif() + endif() + endforeach() + endif() + endif() + + if (NOT HDF5_LINKS_TO_PTHREAD) + message(WARNING "HDF5 library does not seem to have thread-safety enabled. Adding a global lock on GDAL side") + target_compile_definitions(gdal_HDF5 PRIVATE -DENABLE_HDF5_GLOBAL_LOCK) + endif() +elseif(GDAL_ENABLE_HDF5_GLOBAL_LOCK) + target_compile_definitions(gdal_HDF5 PRIVATE -DENABLE_HDF5_GLOBAL_LOCK) +elseif(NOT DEFINED GDAL_ENABLE_HDF5_GLOBAL_LOCK) + message(WARNING "HDF5 library status regarding thread-safety is unknown (set GDAL_ENABLE_HDF5_GLOBAL_LOCK=NO if it is known to be thread-safe). Adding a global lock on GDAL side") + target_compile_definitions(gdal_HDF5 PRIVATE -DENABLE_HDF5_GLOBAL_LOCK) +endif() + # When build as plugin, initialize all drivers from Register_HDF5 if (GDAL_ENABLE_DRIVER_HDF5_PLUGIN) target_compile_definitions(gdal_HDF5 PRIVATE -DHDF5_PLUGIN) diff -Nru gdal-3.6.2+dfsg/frmts/hdf5/hdf5dataset.cpp gdal-3.6.4+dfsg/frmts/hdf5/hdf5dataset.cpp --- gdal-3.6.2+dfsg/frmts/hdf5/hdf5dataset.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/hdf5/hdf5dataset.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -49,6 +49,20 @@ constexpr size_t MAX_METADATA_LEN = 32768; +#ifdef ENABLE_HDF5_GLOBAL_LOCK + +/************************************************************************/ +/* GetHDF5GlobalMutex() */ +/************************************************************************/ + +std::recursive_mutex &GetHDF5GlobalMutex() +{ + static std::recursive_mutex oMutex; + return oMutex; +} + +#endif + /************************************************************************/ /* HDF5GetFileDriver() */ /************************************************************************/ @@ -130,6 +144,8 @@ /************************************************************************/ HDF5Dataset::~HDF5Dataset() { + HDF5_GLOBAL_LOCK(); + CSLDestroy(papszMetadata); if (hGroupID > 0) H5Gclose(hGroupID); @@ -518,6 +534,8 @@ if (!Identify(poOpenInfo)) return nullptr; + HDF5_GLOBAL_LOCK(); + if (poOpenInfo->nOpenFlags & GDAL_OF_MULTIDIM_RASTER) { return OpenMultiDim(poOpenInfo); diff -Nru gdal-3.6.2+dfsg/frmts/hdf5/hdf5dataset.h gdal-3.6.4+dfsg/frmts/hdf5/hdf5dataset.h --- gdal-3.6.2+dfsg/frmts/hdf5/hdf5dataset.h 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/hdf5/hdf5dataset.h 2023-04-17 11:50:20.000000000 +0000 @@ -36,6 +36,18 @@ #include "cpl_list.h" #include "gdal_pam.h" +#ifdef ENABLE_HDF5_GLOBAL_LOCK +#include +std::recursive_mutex &GetHDF5GlobalMutex(); +#define HDF5_GLOBAL_LOCK() \ + std::lock_guard oLock(GetHDF5GlobalMutex()) +#else +#define HDF5_GLOBAL_LOCK() \ + do \ + { \ + } while (0) +#endif + typedef struct HDF5GroupObjects { char *pszName; diff -Nru gdal-3.6.2+dfsg/frmts/hdf5/hdf5imagedataset.cpp gdal-3.6.4+dfsg/frmts/hdf5/hdf5imagedataset.cpp --- gdal-3.6.2+dfsg/frmts/hdf5/hdf5imagedataset.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/hdf5/hdf5imagedataset.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -181,6 +181,8 @@ /************************************************************************/ HDF5ImageDataset::~HDF5ImageDataset() { + HDF5_GLOBAL_LOCK(); + FlushCache(true); if (dataset_id > 0) @@ -316,6 +318,8 @@ CPLErr HDF5ImageRasterBand::IReadBlock(int nBlockXOff, int nBlockYOff, void *pImage) { + HDF5_GLOBAL_LOCK(); + HDF5ImageDataset *poGDS = static_cast(poDS); memset(pImage, 0, @@ -422,6 +426,8 @@ if (!STARTS_WITH_CI(poOpenInfo->pszFilename, "HDF5:")) return nullptr; + HDF5_GLOBAL_LOCK(); + // Confirm the requested access is supported. if (poOpenInfo->eAccess == GA_Update) { diff -Nru gdal-3.6.2+dfsg/frmts/hdf5/hdf5multidim.cpp gdal-3.6.4+dfsg/frmts/hdf5/hdf5multidim.cpp --- gdal-3.6.2+dfsg/frmts/hdf5/hdf5multidim.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/hdf5/hdf5multidim.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -296,6 +296,8 @@ const std::shared_ptr &poShared, hid_t hArray, const HDF5Group *poGroup, bool bSkipFullDimensionInstantiation) { + HDF5_GLOBAL_LOCK(); + auto ar(std::shared_ptr( new HDF5Array(osParentName, osName, poShared, hArray, poGroup, bSkipFullDimensionInstantiation))); @@ -433,6 +435,8 @@ const std::shared_ptr &poShared, hid_t hAttribute) { + HDF5_GLOBAL_LOCK(); + auto ar(std::shared_ptr(new HDF5Attribute( osGroupFullName, osParentName, osName, poShared, hAttribute))); if (ar->m_dt.GetClass() == GEDTC_NUMERIC && @@ -471,6 +475,8 @@ HDF5SharedResources::~HDF5SharedResources() { + HDF5_GLOBAL_LOCK(); + if (m_hHDF5 > 0) H5Fclose(m_hHDF5); } @@ -482,6 +488,8 @@ std::vector> HDF5Group::GetDimensions(CSLConstList) const { + HDF5_GLOBAL_LOCK(); + if (m_bGotDims) return m_cachedDims; @@ -607,6 +615,8 @@ std::vector HDF5Group::GetGroupNames(CSLConstList) const { + HDF5_GLOBAL_LOCK(); + m_osListSubGroups.clear(); H5Giterate(m_poShared->GetHDF5(), GetFullName().c_str(), nullptr, GetGroupNamesCallback, @@ -621,6 +631,8 @@ std::shared_ptr HDF5Group::OpenGroup(const std::string &osName, CSLConstList) const { + HDF5_GLOBAL_LOCK(); + if (m_osListSubGroups.empty()) GetGroupNames(nullptr); if (std::find(m_osListSubGroups.begin(), m_osListSubGroups.end(), osName) == @@ -690,6 +702,8 @@ std::vector HDF5Group::GetMDArrayNames(CSLConstList) const { + HDF5_GLOBAL_LOCK(); + m_osListArrays.clear(); H5Giterate(m_poShared->GetHDF5(), GetFullName().c_str(), nullptr, GetArrayNamesCallback, @@ -704,6 +718,8 @@ std::shared_ptr HDF5Group::OpenMDArray(const std::string &osName, CSLConstList) const { + HDF5_GLOBAL_LOCK(); + if (m_osListArrays.empty()) GetMDArrayNames(nullptr); if (std::find(m_osListArrays.begin(), m_osListArrays.end(), osName) == @@ -753,6 +769,8 @@ std::vector> HDF5Group::GetAttributes(CSLConstList papszOptions) const { + HDF5_GLOBAL_LOCK(); + m_oListAttributes.clear(); m_bShowAllAttributes = CPLTestBool(CSLFetchNameValueDef(papszOptions, "SHOW_ALL", "NO")); @@ -767,6 +785,8 @@ HDF5Array::~HDF5Array() { + HDF5_GLOBAL_LOCK(); + if (m_hArray > 0) H5Dclose(m_hArray); if (m_hNativeDT > 0) @@ -1099,6 +1119,8 @@ std::vector> HDF5Array::GetAttributes(CSLConstList papszOptions) const { + HDF5_GLOBAL_LOCK(); + m_oListAttributes.clear(); m_bShowAllAttributes = CPLTestBool(CSLFetchNameValueDef(papszOptions, "SHOW_ALL", "NO")); @@ -1663,6 +1685,8 @@ const GDALExtendedDataType &bufferDataType, void *pDstBuffer) const { + HDF5_GLOBAL_LOCK(); + const size_t nDims(m_dims.size()); std::vector anOffset(nDims); std::vector anCount(nDims); @@ -1849,6 +1873,8 @@ HDF5Attribute::~HDF5Attribute() { + HDF5_GLOBAL_LOCK(); + if (m_hAttribute > 0) H5Aclose(m_hAttribute); if (m_hNativeDT > 0) @@ -1929,6 +1955,8 @@ const GDALExtendedDataType &bufferDataType, void *pDstBuffer) const { + HDF5_GLOBAL_LOCK(); + const size_t nDims(m_dims.size()); if (m_dt.GetClass() == GEDTC_STRING) { @@ -2047,6 +2075,8 @@ std::shared_ptr HDF5Dimension::GetIndexingVariable() const { + HDF5_GLOBAL_LOCK(); + auto hGroup = H5Gopen(m_poShared->GetHDF5(), m_osGroupFullname.c_str()); if (hGroup >= 0) { @@ -2082,6 +2112,8 @@ GDALDataset *HDF5Dataset::OpenMultiDim(GDALOpenInfo *poOpenInfo) { + HDF5_GLOBAL_LOCK(); + const char *pszFilename = STARTS_WITH(poOpenInfo->pszFilename, "HDF5:") ? poOpenInfo->pszFilename + strlen("HDF5:") : poOpenInfo->pszFilename; @@ -2121,6 +2153,8 @@ std::shared_ptr HDF5Dataset::OpenGroup( std::shared_ptr poSharedResources) { + HDF5_GLOBAL_LOCK(); + H5G_stat_t oStatbuf; if (H5Gget_objinfo(poSharedResources->m_hHDF5, "/", FALSE, &oStatbuf) < 0) { diff -Nru gdal-3.6.2+dfsg/frmts/hfa/hfadataset.cpp gdal-3.6.4+dfsg/frmts/hfa/hfadataset.cpp --- gdal-3.6.2+dfsg/frmts/hfa/hfadataset.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/hfa/hfadataset.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -3294,6 +3294,28 @@ sPro.proParams[6] = oSRS.GetProjParm(SRS_PP_FALSE_EASTING); sPro.proParams[7] = oSRS.GetProjParm(SRS_PP_FALSE_NORTHING); } + else if (EQUAL(pszProjName, SRS_PT_LAMBERT_CONFORMAL_CONIC_1SP)) + { + // Not sure if Imagine has a mapping of LCC_1SP. In the mean time + // convert it to LCC_2SP + auto poTmpSRS = std::unique_ptr( + oSRS.convertToOtherProjection(SRS_PT_LAMBERT_CONFORMAL_CONIC_2SP)); + if (poTmpSRS) + { + sPro.proNumber = EPRJ_LAMBERT_CONFORMAL_CONIC; + sPro.proName = const_cast("Lambert Conformal Conic"); + sPro.proParams[2] = + poTmpSRS->GetProjParm(SRS_PP_STANDARD_PARALLEL_1) * D2R; + sPro.proParams[3] = + poTmpSRS->GetProjParm(SRS_PP_STANDARD_PARALLEL_2) * D2R; + sPro.proParams[4] = + poTmpSRS->GetProjParm(SRS_PP_CENTRAL_MERIDIAN) * D2R; + sPro.proParams[5] = + poTmpSRS->GetProjParm(SRS_PP_LATITUDE_OF_ORIGIN) * D2R; + sPro.proParams[6] = poTmpSRS->GetProjParm(SRS_PP_FALSE_EASTING); + sPro.proParams[7] = poTmpSRS->GetProjParm(SRS_PP_FALSE_NORTHING); + } + } else if (EQUAL(pszProjName, SRS_PT_LAMBERT_CONFORMAL_CONIC_2SP)) { sPro.proNumber = EPRJ_LAMBERT_CONFORMAL_CONIC; @@ -3325,6 +3347,25 @@ sPro.proParams[6] = oSRS.GetProjParm(SRS_PP_FALSE_EASTING); sPro.proParams[7] = oSRS.GetProjParm(SRS_PP_FALSE_NORTHING); } + else if (EQUAL(pszProjName, SRS_PT_MERCATOR_2SP)) + { + // Not sure if Imagine has a mapping of Mercator_2SP. In the mean time + // convert it to Mercator_1SP + auto poTmpSRS = std::unique_ptr( + oSRS.convertToOtherProjection(SRS_PT_MERCATOR_1SP)); + if (poTmpSRS) + { + sPro.proNumber = EPRJ_MERCATOR_VARIANT_A; + sPro.proName = const_cast("Mercator (Variant A)"); + sPro.proParams[4] = + poTmpSRS->GetProjParm(SRS_PP_CENTRAL_MERIDIAN) * D2R; + sPro.proParams[5] = + poTmpSRS->GetProjParm(SRS_PP_LATITUDE_OF_ORIGIN) * D2R; + sPro.proParams[2] = poTmpSRS->GetProjParm(SRS_PP_SCALE_FACTOR); + sPro.proParams[6] = poTmpSRS->GetProjParm(SRS_PP_FALSE_EASTING); + sPro.proParams[7] = poTmpSRS->GetProjParm(SRS_PP_FALSE_NORTHING); + } + } else if (EQUAL(pszProjName, SRS_PT_KROVAK)) { sPro.proNumber = EPRJ_KROVAK; @@ -3441,7 +3482,7 @@ sPro.proNumber = EPRJ_EQUIRECTANGULAR; sPro.proName = const_cast("Equirectangular"); sPro.proParams[4] = oSRS.GetProjParm(SRS_PP_CENTRAL_MERIDIAN) * D2R; - sPro.proParams[5] = oSRS.GetProjParm(SRS_PP_LATITUDE_OF_ORIGIN) * D2R; + sPro.proParams[5] = oSRS.GetProjParm(SRS_PP_STANDARD_PARALLEL_1) * D2R; sPro.proParams[6] = oSRS.GetProjParm(SRS_PP_FALSE_EASTING); sPro.proParams[7] = oSRS.GetProjParm(SRS_PP_FALSE_NORTHING); } @@ -3618,7 +3659,7 @@ sPro.proNumber = EPRJ_LOXIMUTHAL; sPro.proName = const_cast("Loximuthal"); sPro.proParams[4] = oSRS.GetProjParm(SRS_PP_CENTRAL_MERIDIAN) * D2R; - sPro.proParams[5] = oSRS.GetProjParm("central_parallel") * D2R; + sPro.proParams[5] = oSRS.GetProjParm("latitude_of_origin") * D2R; sPro.proParams[6] = oSRS.GetProjParm(SRS_PP_FALSE_EASTING); sPro.proParams[7] = oSRS.GetProjParm(SRS_PP_FALSE_NORTHING); } @@ -3650,6 +3691,7 @@ } else if (EQUAL(pszProjName, "Behrmann")) { + // Mapped to Lambert Cylindrical Equal Area in recent PROJ versions sPro.proNumber = EPRJ_BEHRMANN; sPro.proName = const_cast("Behrmann"); sPro.proParams[4] = oSRS.GetProjParm(SRS_PP_CENTRAL_MERIDIAN) * D2R; @@ -3658,6 +3700,7 @@ } else if (EQUAL(pszProjName, "Equidistant_Cylindrical")) { + // Dead code path. Mapped to Equirectangular sPro.proNumber = EPRJ_EQUIDISTANT_CYLINDRICAL; sPro.proName = const_cast("Equidistant_Cylindrical"); sPro.proParams[2] = oSRS.GetProjParm(SRS_PP_STANDARD_PARALLEL_1) * D2R; @@ -3748,7 +3791,9 @@ sPro.proParams[6] = oSRS.GetProjParm(SRS_PP_FALSE_EASTING); sPro.proParams[7] = oSRS.GetProjParm(SRS_PP_FALSE_NORTHING); } - else if (EQUAL(pszProjName, "Vertical_Near_Side_Perspective")) + else if ( + EQUAL(pszProjName, + "Vertical_Near_Side_Perspective")) // ESRI WKT, before PROJ 6.3.0 { sPro.proNumber = EPRJ_VERTICAL_NEAR_SIDE_PERSPECTIVE; sPro.proName = const_cast("Vertical_Near_Side_Perspective"); @@ -3760,6 +3805,19 @@ sPro.proParams[6] = oSRS.GetProjParm(SRS_PP_FALSE_EASTING); sPro.proParams[7] = oSRS.GetProjParm(SRS_PP_FALSE_NORTHING); } + else if (EQUAL(pszProjName, + "Vertical Perspective")) // WKT2, starting with PROJ 6.3.0 + { + sPro.proNumber = EPRJ_VERTICAL_NEAR_SIDE_PERSPECTIVE; + sPro.proName = const_cast("Vertical_Near_Side_Perspective"); + sPro.proParams[2] = oSRS.GetProjParm("Viewpoint height"); + sPro.proParams[4] = + oSRS.GetProjParm("Longitude of topocentric origin", 75.0) * D2R; + sPro.proParams[5] = + oSRS.GetProjParm("Latitude of topocentric origin", 40.0) * D2R; + sPro.proParams[6] = oSRS.GetProjParm(SRS_PP_FALSE_EASTING); + sPro.proParams[7] = oSRS.GetProjParm(SRS_PP_FALSE_NORTHING); + } else if (EQUAL(pszProjName, "Hotine_Oblique_Mercator_Two_Point_Center")) { sPro.proNumber = EPRJ_HOTINE_OBLIQUE_MERCATOR_TWO_POINT_CENTER; @@ -4125,17 +4183,53 @@ m_oSRS.Clear(); - if ((psMapInfo == nullptr && poMapInformation == nullptr) || - ((!psDatum || strlen(psDatum->datumname) == 0 || - EQUAL(psDatum->datumname, "Unknown")) && - (!psPro || strlen(psPro->proName) == 0 || - EQUAL(psPro->proName, "Unknown")) && - (psMapInfo && (strlen(psMapInfo->proName) == 0 || - EQUAL(psMapInfo->proName, "Unknown"))) && - (!psPro || psPro->proZone == 0))) + if (psMapInfo == nullptr && poMapInformation == nullptr) { return CE_None; } + else if (((!psDatum || strlen(psDatum->datumname) == 0 || + EQUAL(psDatum->datumname, "Unknown")) && + (!psPro || strlen(psPro->proName) == 0 || + EQUAL(psPro->proName, "Unknown")) && + (psMapInfo && (strlen(psMapInfo->proName) == 0 || + EQUAL(psMapInfo->proName, "Unknown"))) && + (!psPro || psPro->proZone == 0))) + { + // It is not clear if Erdas Imagine would recognize a ESRI_PE string + // alone, but versions of GDAL between 3.0 and 3.6.3 have written CRS + // using for example the Vertical Projection with a ESRI_PE string only. + char *pszPE_COORDSYS = HFAGetPEString(hHFA); + OGRSpatialReference oSRSFromPE; + oSRSFromPE.SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); + if (pszPE_COORDSYS != nullptr && strlen(pszPE_COORDSYS) > 0 && + // Config option for testing purposes only/mostly + CPLTestBool(CPLGetConfigOption("HFA_USE_ESRI_PE_STRING", "YES")) && + oSRSFromPE.importFromWkt(pszPE_COORDSYS) == OGRERR_NONE) + { + const char *pszProjName = + oSRSFromPE.GetAttrValue("PROJCS|PROJECTION"); + if (pszProjName && + (EQUAL(pszProjName, "Vertical Perspective") || + EQUAL(pszProjName, "Vertical_Near_Side_Perspective")) && + CPLTestBool(CPLGetConfigOption( + "HFA_SHOW_ESRI_PE_STRING_ONLY_WARNING", "YES"))) + { + CPLError(CE_Warning, CPLE_AppDefined, + "A ESRI_PE string encoding a CRS has been found for " + "projection method %s, but no corresponding " + "Eprj_ProParameters are present. This file has likely " + "been generated by GDAL >= 3.0 and <= 3.6.2. It is " + "recommended to recreate it, e.g with gdal_translate, " + "with GDAL >= 3.6.3. This warning can be suppressed " + "by setting the HFA_SHOW_ESRI_PE_STRING_ONLY_WARNING " + "configuration option to NO.", + pszProjName); + } + m_oSRS = oSRSFromPE; + } + CPLFree(pszPE_COORDSYS); + return m_oSRS.IsEmpty() ? CE_Failure : CE_None; + } auto poSRS = HFAPCSStructToOSR(psDatum, psPro, psMapInfo, poMapInformation); if (poSRS) @@ -4154,6 +4248,8 @@ OGRSpatialReference oSRSFromPE; oSRSFromPE.SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); if (pszPE_COORDSYS != nullptr && strlen(pszPE_COORDSYS) > 0 && + // Config option for testing purposes only/mostly + CPLTestBool(CPLGetConfigOption("HFA_USE_ESRI_PE_STRING", "YES")) && oSRSFromPE.importFromWkt(pszPE_COORDSYS) == OGRERR_NONE) { m_oSRS = oSRSFromPE; diff -Nru gdal-3.6.2+dfsg/frmts/hfa/hfaopen.cpp gdal-3.6.4+dfsg/frmts/hfa/hfaopen.cpp --- gdal-3.6.2+dfsg/frmts/hfa/hfaopen.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/hfa/hfaopen.cpp 2023-04-17 11:50:19.000000000 +0000 @@ -3989,6 +3989,8 @@ "0.9144", "yd", "0.9144", + "clarke_yard", + "0.9143917962", "miles", "1304.544", "mile", @@ -4349,10 +4351,12 @@ break; case EPRJ_HOTINE_OBLIQUE_MERCATOR_AZIMUTH_CENTER: - poSRS->SetHOMAC(psPro->proParams[5] * R2D, - psPro->proParams[4] * R2D, - psPro->proParams[3] * R2D, 0.0, psPro->proParams[2], - psPro->proParams[6], psPro->proParams[7]); + poSRS->SetHOMAC( + psPro->proParams[5] * R2D, psPro->proParams[4] * R2D, + psPro->proParams[3] * R2D, + psPro->proParams[3] * + R2D, // We reuse azimuth as rectified_grid_angle + psPro->proParams[2], psPro->proParams[6], psPro->proParams[7]); break; case EPRJ_ROBINSON: @@ -4569,14 +4573,13 @@ case EPRJ_VERTICAL_NEAR_SIDE_PERSPECTIVE: { - poSRS->SetProjection("Vertical_Near_Side_Perspective"); - poSRS->SetNormProjParm(SRS_PP_LATITUDE_OF_CENTER, - psPro->proParams[5] * R2D); - poSRS->SetNormProjParm(SRS_PP_LONGITUDE_OF_CENTER, - psPro->proParams[4] * R2D); - poSRS->SetNormProjParm("height", psPro->proParams[2]); - poSRS->SetNormProjParm(SRS_PP_FALSE_EASTING, psPro->proParams[6]); - poSRS->SetNormProjParm(SRS_PP_FALSE_NORTHING, psPro->proParams[7]); + poSRS->SetVerticalPerspective( + psPro->proParams[5] * R2D, // dfTopoOriginLat + psPro->proParams[4] * R2D, // dfTopoOriginLon + 0, // dfTopoOriginHeight + psPro->proParams[2], // dfViewPointHeight + psPro->proParams[6], // dfFalseEasting + psPro->proParams[7]); // dfFalseNorthing } break; diff -Nru gdal-3.6.2+dfsg/frmts/jpegxl/jpegxl.cpp gdal-3.6.4+dfsg/frmts/jpegxl/jpegxl.cpp --- gdal-3.6.2+dfsg/frmts/jpegxl/jpegxl.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/jpegxl/jpegxl.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -1941,16 +1941,18 @@ JxlEncoderUseBoxes(encoder.get()); - const GByte *pabyBoxData = poJUMBFBox->GetWritableBoxData(); + GByte *pabyBoxData = poJUMBFBox->GetWritableBoxData(); if (JxlEncoderAddBox( encoder.get(), "jumb", pabyBoxData, static_cast(poJUMBFBox->GetBoxLength()), bCompressBox) != JXL_ENC_SUCCESS) { + VSIFree(pabyBoxData); CPLError(CE_Failure, CPLE_AppDefined, "JxlEncoderAddBox() failed"); return nullptr; } + VSIFree(pabyBoxData); } } #endif diff -Nru gdal-3.6.2+dfsg/frmts/mbtiles/mbtilesdataset.cpp gdal-3.6.4+dfsg/frmts/mbtiles/mbtilesdataset.cpp --- gdal-3.6.2+dfsg/frmts/mbtiles/mbtilesdataset.cpp 2023-01-02 14:38:16.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/mbtiles/mbtilesdataset.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -705,7 +705,8 @@ /* ==================================================================== */ /* LocationInfo handling. */ /* ==================================================================== */ - if (pszDomain != nullptr && EQUAL(pszDomain, "LocationInfo") && + if (poGDS->hDS != nullptr && pszDomain != nullptr && + EQUAL(pszDomain, "LocationInfo") && (STARTS_WITH_CI(pszName, "Pixel_") || STARTS_WITH_CI(pszName, "GeoPixel_"))) { @@ -1364,7 +1365,7 @@ char **MBTilesDataset::GetMetadata(const char *pszDomain) { - if (pszDomain != nullptr && !EQUAL(pszDomain, "")) + if (hDS == nullptr || (pszDomain != nullptr && !EQUAL(pszDomain, ""))) return GDALPamDataset::GetMetadata(pszDomain); if (bFetchedMetadata) diff -Nru gdal-3.6.2+dfsg/frmts/mrf/marfa.h gdal-3.6.4+dfsg/frmts/mrf/marfa.h --- gdal-3.6.2+dfsg/frmts/mrf/marfa.h 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/mrf/marfa.h 2023-04-17 11:50:20.000000000 +0000 @@ -387,6 +387,14 @@ return m_oSRS.IsEmpty() ? nullptr : &m_oSRS; } + CPLErr SetSpatialRef(const OGRSpatialReference *poSRS) override + { + m_oSRS.Clear(); + if (poSRS) + m_oSRS = *poSRS; + return CE_None; + } + virtual CPLString const &GetPhotometricInterpretation() { return photometric; diff -Nru gdal-3.6.2+dfsg/frmts/netcdf/netcdfdataset.cpp gdal-3.6.4+dfsg/frmts/netcdf/netcdfdataset.cpp --- gdal-3.6.2+dfsg/frmts/netcdf/netcdfdataset.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/netcdf/netcdfdataset.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -4768,6 +4768,53 @@ bGotCfGT = false; } } + else if (!bGotCfGT && !bReadSRSOnly && (nVarDimXID != -1) && + (nVarDimYID != -1) && xdim > 0 && ydim > 0 && + ((!bSwitchedXY && + NCDFIsVarLongitude(nGroupId, nVarDimXID, nullptr) && + NCDFIsVarLatitude(nGroupId, nVarDimYID, nullptr)) || + (bSwitchedXY && + NCDFIsVarLongitude(nGroupId, nVarDimYID, nullptr) && + NCDFIsVarLatitude(nGroupId, nVarDimXID, nullptr)))) + { + // Case of autotest/gdrivers/data/netcdf/GLMELT_4X5.OCN.nc + // which is indexed by lat, lon variables, but lat has irregular + // spacing. + const char *pszGeolocXFullName = poDS->papszDimName[poDS->nXDimID]; + const char *pszGeolocYFullName = poDS->papszDimName[poDS->nYDimID]; + if (bSwitchedXY) + { + std::swap(pszGeolocXFullName, pszGeolocYFullName); + GDALPamDataset::SetMetadataItem("SWAP_XY", "YES", "GEOLOCATION"); + } + + CPLDebug("GDAL_netCDF", "using variables %s and %s for GEOLOCATION", + pszGeolocXFullName, pszGeolocYFullName); + + GDALPamDataset::SetMetadataItem("SRS", SRS_WKT_WGS84_LAT_LONG, + "GEOLOCATION"); + + CPLString osTMP; + osTMP.Printf("NETCDF:\"%s\":%s", osFilename.c_str(), + pszGeolocXFullName); + + GDALPamDataset::SetMetadataItem("X_DATASET", osTMP, "GEOLOCATION"); + GDALPamDataset::SetMetadataItem("X_BAND", "1", "GEOLOCATION"); + osTMP.Printf("NETCDF:\"%s\":%s", osFilename.c_str(), + pszGeolocYFullName); + + GDALPamDataset::SetMetadataItem("Y_DATASET", osTMP, "GEOLOCATION"); + GDALPamDataset::SetMetadataItem("Y_BAND", "1", "GEOLOCATION"); + + GDALPamDataset::SetMetadataItem("PIXEL_OFFSET", "0", "GEOLOCATION"); + GDALPamDataset::SetMetadataItem("PIXEL_STEP", "1", "GEOLOCATION"); + + GDALPamDataset::SetMetadataItem("LINE_OFFSET", "0", "GEOLOCATION"); + GDALPamDataset::SetMetadataItem("LINE_STEP", "1", "GEOLOCATION"); + + GDALPamDataset::SetMetadataItem("GEOREFERENCING_CONVENTION", + "PIXEL_CENTER", "GEOLOCATION"); + } // Set GeoTransform if we got a complete one - after projection has been set if (bGotCfGT || bGotGdalGT) @@ -6851,10 +6898,21 @@ snprintf(szTemp, sizeof(szTemp), "SUBDATASET_%d_NAME", nSubDatasets); - poDS->papszSubDatasets = - CSLSetNameValue(poDS->papszSubDatasets, szTemp, - CPLSPrintf("NETCDF:\"%s\":%s", - poDS->osFilename.c_str(), pszName)); + if (strchr(pszName, ' ') || strchr(pszName, ':')) + { + poDS->papszSubDatasets = CSLSetNameValue( + poDS->papszSubDatasets, szTemp, + CPLSPrintf("NETCDF:\"%s\":\"%s\"", poDS->osFilename.c_str(), + pszName)); + } + else + { + poDS->papszSubDatasets = CSLSetNameValue( + poDS->papszSubDatasets, szTemp, + CPLSPrintf("NETCDF:\"%s\":%s", poDS->osFilename.c_str(), + pszName)); + } + CPLFree(pszName); snprintf(szTemp, sizeof(szTemp), "SUBDATASET_%d_DESC", @@ -8811,10 +8869,11 @@ // Figure out whether or not the listed dataset has support for simple // geometries (CF-1.8) poDS->nCFVersion = nccfdriver::getCFVersion(cdfid); + bool bHasSimpleGeometries = false; // but not necessarily valid if (poDS->nCFVersion >= 1.8) { poDS->bSGSupport = true; - poDS->DetectAndFillSGLayers(cdfid); + bHasSimpleGeometries = poDS->DetectAndFillSGLayers(cdfid); poDS->vcdf.enableFullVirtualMode(); } else @@ -8890,7 +8949,8 @@ #endif { poDS->FilterVars(cdfid, (poOpenInfo->nOpenFlags & GDAL_OF_RASTER) != 0, - (poOpenInfo->nOpenFlags & GDAL_OF_VECTOR) != 0, + (poOpenInfo->nOpenFlags & GDAL_OF_VECTOR) != 0 && + !bHasSimpleGeometries, papszIgnoreVars, &nRasterVars, &nGroupID, &nVarID, &nIgnoredVars, oMap2DDimsToGroupAndVar); } @@ -12853,7 +12913,7 @@ aoQueueGroupIdsToVisit.push(nParentGroupId); else if (status2 != NC_ENOGRP) NCDF_ERR(status2); - if (pszVar) + else if (pszVar) // When resolving a variable, if there is no more // parent group then we switch to width-wise search mode // starting from the latest found parent group. @@ -12979,6 +13039,8 @@ int nVarXId = -1; int nVarYId = -1; int nVarZId = -1; + int nVarTimeId = -1; + int nVarTimeDimId = -1; bool bIsVectorOnly = true; int nProfileDimId = -1; int nParentIndexVarID = -1; @@ -13027,9 +13089,17 @@ CPLFree(pszVarFullName); if (bIgnoreVar) { - (*pnIgnoredVars)++; - CPLDebug("GDAL_netCDF", "variable #%d [%s] was ignored", v, - szTemp); + if (nVarDims == 1 && NCDFIsVarTimeCoord(nCdfId, -1, szTemp)) + { + nVarTimeId = v; + nc_inq_vardimid(nCdfId, v, &nVarTimeDimId); + } + else if (nVarDims > 1) + { + (*pnIgnoredVars)++; + CPLDebug("GDAL_netCDF", "variable #%d [%s] was ignored", v, + szTemp); + } } // Only accept 2+D vars. else if (nVarDims >= 2) @@ -13150,8 +13220,7 @@ *pnRasterVars += nRasterVars; } - if (!anPotentialVectorVarID.empty() && bKeepVectors && - nccfdriver::getCFVersion(nCdfId) <= 1.6) + if (!anPotentialVectorVarID.empty() && bKeepVectors) { // Take the dimension that is referenced the most times. if (!(oMapDimIdToCount.size() == 1 || @@ -13165,6 +13234,11 @@ } else { + if (nVarTimeId >= 0 && + oMapDimIdToCount.find(nVarTimeDimId) != oMapDimIdToCount.end()) + { + anPotentialVectorVarID.push_back(nVarTimeId); + } CreateGrpVectorLayers(nCdfId, osFeatureType, anPotentialVectorVarID, oMapDimIdToCount, nVarXId, nVarYId, nVarZId, nProfileDimId, nParentIndexVarID, diff -Nru gdal-3.6.2+dfsg/frmts/netcdf/netcdfdataset.h gdal-3.6.4+dfsg/frmts/netcdf/netcdfdataset.h --- gdal-3.6.2+dfsg/frmts/netcdf/netcdfdataset.h 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/netcdf/netcdfdataset.h 2023-04-17 11:50:20.000000000 +0000 @@ -918,7 +918,7 @@ int nProfileDimId, int nParentIndexVarID, bool bKeepRasters); - CPLErr DetectAndFillSGLayers(int ncid); + bool DetectAndFillSGLayers(int ncid); CPLErr LoadSGVarIntoLayer(int ncid, int nc_basevarId); #ifdef NETCDF_HAS_NC4 diff -Nru gdal-3.6.2+dfsg/frmts/netcdf/netcdflayersg.cpp gdal-3.6.4+dfsg/frmts/netcdf/netcdflayersg.cpp --- gdal-3.6.2+dfsg/frmts/netcdf/netcdflayersg.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/netcdf/netcdflayersg.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -132,7 +132,7 @@ } // namespace nccfdriver -CPLErr netCDFDataset::DetectAndFillSGLayers(int ncid) +bool netCDFDataset::DetectAndFillSGLayers(int ncid) { // Discover simple geometry variables int var_count; @@ -160,7 +160,7 @@ } } - return CE_None; + return !vidList.empty(); } CPLErr netCDFDataset::LoadSGVarIntoLayer(int ncid, int nc_basevarId) diff -Nru gdal-3.6.2+dfsg/frmts/netcdf/netcdfmultidim.cpp gdal-3.6.4+dfsg/frmts/netcdf/netcdfmultidim.cpp --- gdal-3.6.2+dfsg/frmts/netcdf/netcdfmultidim.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/netcdf/netcdfmultidim.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -1587,7 +1587,6 @@ netCDFGroup oGroup(m_poShared, m_gid); const auto arrayNames = oGroup.GetMDArrayNames(nullptr); std::shared_ptr candidateIndexingVariable; - int nCountCandidateIndexingVariable = 0; for (const auto &arrayName : arrayNames) { const auto poArray = oGroup.OpenMDArray(arrayName, nullptr); @@ -1608,15 +1607,14 @@ // If the array doesn't have a coordinates variable, but is a 1D // array indexed by our dimension, then use it as the indexing // variable, provided it is the only such variable. - if (nCountCandidateIndexingVariable == 0) + if (!candidateIndexingVariable) { candidateIndexingVariable = poArray; } else { - candidateIndexingVariable.reset(); + return nullptr; } - nCountCandidateIndexingVariable++; continue; } } diff -Nru gdal-3.6.2+dfsg/frmts/nitf/nitfdataset.cpp gdal-3.6.4+dfsg/frmts/nitf/nitfdataset.cpp --- gdal-3.6.2+dfsg/frmts/nitf/nitfdataset.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/nitf/nitfdataset.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -5577,7 +5577,7 @@ } /* -------------------------------------------------------------------- */ - /* Update COMRAT, the compression rate variable. */ + /* Update COMRAT, the compression rate variable, and CLEVEL */ /* -------------------------------------------------------------------- */ /* Set to IC position */ @@ -5640,6 +5640,48 @@ } bOK &= VSIFWriteL(szCOMRAT, 4, 1, fpVSIL) == 1; + + /* ---------------------------------------------------------------- */ + /* Update CLEVEL. */ + /* ---------------------------------------------------------------- */ + // Get existing CLEVEL + constexpr int OFFSET_CLEVEL = 9; + constexpr int SIZE_CLEVEL = 2; + bOK &= VSIFSeekL(fpVSIL, OFFSET_CLEVEL, SEEK_SET) == 0; + char szCLEVEL[SIZE_CLEVEL + 1] = {0}; + bOK &= VSIFReadL(szCLEVEL, 1, SIZE_CLEVEL, fpVSIL) != 0; + unsigned int nCLevel = static_cast(atoi(szCLEVEL)); + if (nCLevel >= 3 && nCLevel <= 7) + { + const unsigned int nCLevelOri = nCLevel; + if (nFileLen > 2147483647) + { + nCLevel = MAX(nCLevel, 7U); + } + else if (nFileLen > 1073741833) + { + nCLevel = MAX(nCLevel, 6U); + } + else if (nFileLen > 52428799) + { + nCLevel = MAX(nCLevel, 5U); + } + if (nCLevel != nCLevelOri) + { + CPLDebug("NITF", "Updating CLEVEL from %02u to %02u", + nCLevelOri, nCLevel); + // %100 to please -Wformat-truncation + snprintf(szCLEVEL, sizeof(szCLEVEL), "%02u", nCLevel % 100); + bOK &= VSIFSeekL(fpVSIL, OFFSET_CLEVEL, SEEK_SET) == 0; + bOK &= VSIFWriteL(szCLEVEL, 1, SIZE_CLEVEL, fpVSIL) != 0; + } + } + else + { + CPLError(CE_Warning, CPLE_AppDefined, + "Invalid CLEVEL=%s value found when updating NITF header.", + szCLEVEL); + } } if (VSIFCloseL(fpVSIL) != 0) diff -Nru gdal-3.6.2+dfsg/frmts/nitf/nitffile.c gdal-3.6.4+dfsg/frmts/nitf/nitffile.c --- gdal-3.6.2+dfsg/frmts/nitf/nitffile.c 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/nitf/nitffile.c 2023-04-17 11:50:20.000000000 +0000 @@ -548,7 +548,7 @@ VSILFILE *fp; GUIntBig nCur = 0; int nOffset = 0, iBand, nIHSize, nNPPBH, nNPPBV; - GUIntBig nImageSize; + GUIntBig nImageSize = 0; int nNBPR, nNBPC; const char *pszIREP; const char *pszIC = CSLFetchNameValue(papszOptions, "IC"); @@ -691,8 +691,11 @@ nNPPBH = 0; nNPPBV = 0; - nImageSize = - ((nBitsPerSample) / 8) * ((GUIntBig)nPixels * nLines) * nBands; + if (EQUAL(pszIC, "NC")) + { + nImageSize = + ((nBitsPerSample) / 8) * ((GUIntBig)nPixels * nLines) * nBands; + } } else if ((EQUAL(pszIC, "NC") || EQUAL(pszIC, "C8")) && nPixels > 8192 && nNPPBH == nPixels) @@ -711,8 +714,11 @@ return FALSE; } - nImageSize = ((nBitsPerSample) / 8) * - ((GUIntBig)nPixels * (nNBPC * nNPPBV)) * nBands; + if (EQUAL(pszIC, "NC")) + { + nImageSize = ((nBitsPerSample) / 8) * + ((GUIntBig)nPixels * (nNBPC * nNPPBV)) * nBands; + } } else if ((EQUAL(pszIC, "NC") || EQUAL(pszIC, "C8")) && nLines > 8192 && nNPPBV == nLines) @@ -731,8 +737,11 @@ return FALSE; } - nImageSize = ((nBitsPerSample) / 8) * - ((GUIntBig)nLines * (nNBPR * nNPPBH)) * nBands; + if (EQUAL(pszIC, "NC")) + { + nImageSize = ((nBitsPerSample) / 8) * + ((GUIntBig)nLines * (nNBPR * nNPPBH)) * nBands; + } } else { @@ -750,8 +759,11 @@ return FALSE; } - nImageSize = ((nBitsPerSample) / 8) * ((GUIntBig)nNBPR * nNBPC) * - nNPPBH * nNPPBV * nBands; + if (EQUAL(pszIC, "NC")) + { + nImageSize = ((nBitsPerSample) / 8) * ((GUIntBig)nNBPR * nNBPC) * + nNPPBH * nNPPBV * nBands; + } } if (EQUAL(pszIC, "NC")) @@ -1454,7 +1466,6 @@ int bIgnoreBLOCKA = CSLFetchNameValue(papszOptions, "BLOCKA_BLOCK_COUNT") != NULL; int iOption; - int nTREPrefixLen = (int)strlen(pszTREPrefix); const bool bReserveSpaceForTREOverflow = CSLFetchNameValue(papszOptions, "RESERVE_SPACE_FOR_TRE_OVERFLOW") != NULL; @@ -1470,6 +1481,7 @@ int nContentLength; const char *pszSpace; int bIsHex = FALSE; + int nTREPrefixLen = (int)strlen(pszTREPrefix); if (!EQUALN(papszOptions[iOption], pszTREPrefix, nTREPrefixLen)) continue; diff -Nru gdal-3.6.2+dfsg/frmts/ozi/CMakeLists.txt gdal-3.6.4+dfsg/frmts/ozi/CMakeLists.txt --- gdal-3.6.2+dfsg/frmts/ozi/CMakeLists.txt 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/ozi/CMakeLists.txt 2023-04-17 11:50:19.000000000 +0000 @@ -6,7 +6,7 @@ else () target_compile_definitions(gdal_OZI PRIVATE -DHAVE_ZLIB_H -DHAVE_ZLIB) gdal_target_link_libraries(gdal_OZI PRIVATE ZLIB::ZLIB) - if (MSVC) + if (MSVC AND NOT ZLIB_IS_STATIC) target_compile_definitions(gdal_OZI PRIVATE -DZLIB_DLL) endif () endif () diff -Nru gdal-3.6.2+dfsg/frmts/pdf/pdfcreatecopy.cpp gdal-3.6.4+dfsg/frmts/pdf/pdfcreatecopy.cpp --- gdal-3.6.2+dfsg/frmts/pdf/pdfcreatecopy.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/pdf/pdfcreatecopy.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -4297,6 +4297,7 @@ char szTmp[64]; char **papszOptions = nullptr; + bool bEcwEncodeKeyRequiredButNotFound = false; if (eCompressMethod == COMPRESS_JPEG) { poJPEGDriver = (GDALDriver *)GDALGetDriverByName("JPEG"); @@ -4322,6 +4323,19 @@ { poJPEGDriver = nullptr; } + else if (poJPEGDriver) + { + if (strstr(poJPEGDriver->GetMetadataItem( + GDAL_DMD_CREATIONOPTIONLIST), + "ECW_ENCODE_KEY")) + { + if (!CPLGetConfigOption("ECW_ENCODE_KEY", nullptr)) + { + bEcwEncodeKeyRequiredButNotFound = true; + poJPEGDriver = nullptr; + } + } + } } if (poJPEGDriver) { @@ -4348,8 +4362,18 @@ if (poJPEGDriver == nullptr) { - CPLError(CE_Failure, CPLE_NotSupported, "No %s driver found", - (eCompressMethod == COMPRESS_JPEG) ? "JPEG" : "JPEG2000"); + if (bEcwEncodeKeyRequiredButNotFound) + { + CPLError(CE_Failure, CPLE_NotSupported, + "No JPEG2000 driver usable (JP2ECW detected but " + "ECW_ENCODE_KEY configuration option not set"); + } + else + { + CPLError(CE_Failure, CPLE_NotSupported, "No %s driver found", + (eCompressMethod == COMPRESS_JPEG) ? "JPEG" + : "JPEG2000"); + } eErr = CE_Failure; goto end; } diff -Nru gdal-3.6.2+dfsg/frmts/raw/gtxdataset.cpp gdal-3.6.4+dfsg/frmts/raw/gtxdataset.cpp --- gdal-3.6.2+dfsg/frmts/raw/gtxdataset.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/raw/gtxdataset.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -248,8 +248,8 @@ CPL_MSBPTR64(poDS->adfGeoTransform + 3); CPL_MSBPTR64(poDS->adfGeoTransform + 5); - poDS->adfGeoTransform[3] += - poDS->adfGeoTransform[5] * (poDS->nRasterYSize - 1); + poDS->adfGeoTransform[3] += poDS->adfGeoTransform[5] * + (static_cast(poDS->nRasterYSize) - 1); poDS->adfGeoTransform[0] -= poDS->adfGeoTransform[1] * 0.5; poDS->adfGeoTransform[3] += poDS->adfGeoTransform[5] * 0.5; diff -Nru gdal-3.6.2+dfsg/frmts/raw/lcpdataset.cpp gdal-3.6.4+dfsg/frmts/raw/lcpdataset.cpp --- gdal-3.6.2+dfsg/frmts/raw/lcpdataset.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/raw/lcpdataset.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -34,6 +34,9 @@ #include "ogr_spatialref.h" #include "rawdataset.h" +#include +#include + constexpr size_t LCP_HEADER_SIZE = 7316; constexpr int LCP_MAX_BANDS = 10; constexpr int LCP_MAX_PATH = 256; @@ -54,7 +57,7 @@ CPLString osPrjFilename{}; OGRSpatialReference m_oSRS{}; - static CPLErr ClassifyBandData(GDALRasterBand *poBand, GInt32 *pnNumClasses, + static CPLErr ClassifyBandData(GDALRasterBand *poBand, GInt32 &nNumClasses, GInt32 *panClasses); CPL_DISALLOW_COPY_ASSIGN(LCPDataset) @@ -799,43 +802,24 @@ /* calculate them by default. */ /************************************************************************/ -CPLErr LCPDataset::ClassifyBandData(GDALRasterBand *poBand, - GInt32 *pnNumClasses, GInt32 *panClasses) +CPLErr LCPDataset::ClassifyBandData(GDALRasterBand *poBand, GInt32 &nNumClasses, + GInt32 *panClasses) { - if (pnNumClasses == nullptr) - { - CPLError(CE_Failure, CPLE_AppDefined, "Invalid pointer for panClasses"); - return CE_Failure; - } - - if (panClasses == nullptr) - { - CPLError(CE_Failure, CPLE_AppDefined, "Invalid pointer for panClasses"); - *pnNumClasses = -1; - return CE_Failure; - } - - if (poBand == nullptr) - { - CPLError(CE_Failure, CPLE_AppDefined, - "Invalid band passed to ClassifyBandData()"); - *pnNumClasses = -1; - memset(panClasses, 0, 400); - return CE_Failure; - } + CPLAssert(poBand); + CPLAssert(panClasses); const int nXSize = poBand->GetXSize(); const int nYSize = poBand->GetYSize(); - double dfMax = 0.0; - double dfDummy = 0.0; - poBand->GetStatistics(FALSE, TRUE, &dfDummy, &dfMax, &dfDummy, &dfDummy); - const int nSpan = static_cast(dfMax); GInt16 *panValues = static_cast(CPLMalloc(sizeof(GInt16) * nXSize)); - GByte *pabyFlags = - static_cast(CPLMalloc(sizeof(GByte) * nSpan + 1)); - memset(pabyFlags, 0, nSpan + 1); + constexpr int MIN_VAL = std::numeric_limits::min(); + constexpr int MAX_VAL = std::numeric_limits::max(); + constexpr int RANGE_VAL = MAX_VAL - MIN_VAL + 1; + GByte *pabyFlags = static_cast(CPLCalloc(1, RANGE_VAL)); + + /* so that values in [-32768,32767] are mapped to [0,65535] in pabyFlags */ + constexpr int OFFSET = -MIN_VAL; int nFound = 0; bool bTooMany = false; @@ -844,48 +828,49 @@ { eErr = poBand->RasterIO(GF_Read, 0, iLine, nXSize, 1, panValues, nXSize, 1, GDT_Int16, 0, 0, nullptr); + if (eErr != CE_None) + break; for (int iPixel = 0; iPixel < nXSize; iPixel++) { if (panValues[iPixel] == -9999) { continue; } - if (nFound > 99) + if (nFound == LCP_MAX_CLASSES) { CPLDebug("LCP", - "Found more that 100 unique values in " + "Found more that %d unique values in " "band %d. Not 'classifying' the data.", - poBand->GetBand()); + LCP_MAX_CLASSES - 1, poBand->GetBand()); nFound = -1; bTooMany = true; break; } - if (bTooMany) - { - break; - } - if (pabyFlags[panValues[iPixel]] == 0) + if (pabyFlags[panValues[iPixel] + OFFSET] == 0) { - pabyFlags[panValues[iPixel]] = 1; + pabyFlags[panValues[iPixel] + OFFSET] = 1; nFound++; } } + if (bTooMany) + break; } - CPLAssert(nFound <= 100); - - // The classes are always padded with a leading 0. This was for aligning - // offsets, or making it a 1-based array instead of 0-based. - panClasses[0] = 0; - for (int j = 0, nIndex = 1; j < nSpan + 1; j++) + if (!bTooMany) { - if (pabyFlags[j] == 1) + // The classes are always padded with a leading 0. This was for aligning + // offsets, or making it a 1-based array instead of 0-based. + panClasses[0] = 0; + for (int j = 0, nIndex = 1; j < RANGE_VAL; j++) { - panClasses[nIndex++] = j; + if (pabyFlags[j] == 1) + { + panClasses[nIndex++] = j; + } } } - *pnNumClasses = nFound; - CPLFree(reinterpret_cast(pabyFlags)); - CPLFree(reinterpret_cast(panValues)); + nNumClasses = nFound; + CPLFree(pabyFlags); + CPLFree(panValues); return eErr; } @@ -1375,7 +1360,7 @@ // See comment above. if (bClassifyData) { - eErr = ClassifyBandData(poBand, panFound + i, + eErr = ClassifyBandData(poBand, panFound[i], panClasses + (i * LCP_MAX_CLASSES)); if (eErr != CE_None) { @@ -1457,14 +1442,16 @@ // These two arrays were swapped in their entirety above. CPL_IGNORE_RET_VAL(VSIFWriteL(panFound + i, 4, 1, fp)); CPL_IGNORE_RET_VAL( - VSIFWriteL(panClasses + (i * LCP_MAX_CLASSES), 4, 100, fp)); + VSIFWriteL(panClasses + (i * LCP_MAX_CLASSES), 4, + LCP_MAX_CLASSES, fp)); } else { nTemp = -1; CPL_LSBPTR32(&nTemp); CPL_IGNORE_RET_VAL(VSIFWriteL(&nTemp, 4, 1, fp)); - CPL_IGNORE_RET_VAL(VSIFSeekL(fp, 400, SEEK_CUR)); + CPL_IGNORE_RET_VAL( + VSIFSeekL(fp, 4 * LCP_MAX_CLASSES, SEEK_CUR)); } } } diff -Nru gdal-3.6.2+dfsg/frmts/tiledb/tiledbdataset.cpp gdal-3.6.4+dfsg/frmts/tiledb/tiledbdataset.cpp --- gdal-3.6.2+dfsg/frmts/tiledb/tiledbdataset.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/tiledb/tiledbdataset.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -37,7 +37,6 @@ #ifdef _MSC_VER #pragma warning(push) -// 'tiledb::Query::set_buffer': was declared deprecated // 'tiledb::Array::Array': was declared deprecated #pragma warning(disable : 4996) /* XXXX was deprecated */ #endif @@ -65,7 +64,6 @@ int nBlocksX = 0; int nBlocksY = 0; int nBandStart = 1; - bool bGlobalOrder = false; bool bHasSubDatasets = false; int nSubDataCount = 0; char **papszSubDatasets = nullptr; @@ -85,16 +83,15 @@ std::list> lpoAttributeDS = {}; bool bStats = FALSE; + CPLErr IRasterIO(GDALRWFlag, int, int, int, int, void *, int, int, + GDALDataType, int, int *, GSpacing, GSpacing, GSpacing, + GDALRasterIOExtraArg *psExtraArg) override; CPLErr AddFilter(const char *pszFilterName, const int level); CPLErr CreateAttribute(GDALDataType eType, const CPLString &osAttrName, const int nSubRasterCount = 1); CPLErr AddDimensions(tiledb::Domain &domain, tiledb::Dimension &y, tiledb::Dimension &x, tiledb::Dimension *poBands = nullptr); - CPLErr IRasterIO(GDALRWFlag, int, int, int, int, void *, int, int, - GDALDataType, int, int *, GSpacing nPixelSpace, - GSpacing nLineSpace, GSpacing nBandSpace, - GDALRasterIOExtraArg *psExtraArg) override; public: virtual ~TileDBDataset(); @@ -141,16 +138,14 @@ TileDBDataset *poGDS; bool bStats; CPLString osAttrName; - int nCurrBlockX = 0; - int nCurrBlockY = 0; - std::unique_ptr m_query; - std::unique_ptr m_roQuery; - void Finalize(); public: TileDBRasterBand(TileDBDataset *, int, CPLString = TILEDB_VALUES); virtual CPLErr IReadBlock(int, int, void *) override; virtual CPLErr IWriteBlock(int, int, void *) override; + virtual CPLErr IRasterIO(GDALRWFlag, int, int, int, int, void *, int, int, + GDALDataType, GSpacing, GSpacing, + GDALRasterIOExtraArg *psExtraArg) override; virtual GDALColorInterp GetColorInterpretation() override; }; @@ -227,6 +222,63 @@ /* SetBuffer() */ /************************************************************************/ +#if ((TILEDB_VERSION_MAJOR > 2) || \ + (TILEDB_VERSION_MAJOR == 2 && TILEDB_VERSION_MINOR >= 4)) +static CPLErr SetBuffer(tiledb::Query *poQuery, GDALDataType eType, + const CPLString &osAttrName, void *pImage, int nSize) +{ + switch (eType) + { + case GDT_Byte: + poQuery->set_data_buffer( + osAttrName, reinterpret_cast(pImage), nSize); + break; + case GDT_UInt16: + poQuery->set_data_buffer( + osAttrName, reinterpret_cast(pImage), nSize); + break; + case GDT_UInt32: + poQuery->set_data_buffer( + osAttrName, reinterpret_cast(pImage), nSize); + break; + case GDT_Int16: + poQuery->set_data_buffer(osAttrName, + reinterpret_cast(pImage), nSize); + break; + case GDT_Int32: + poQuery->set_data_buffer(osAttrName, + reinterpret_cast(pImage), nSize); + break; + case GDT_Float32: + poQuery->set_data_buffer(osAttrName, + reinterpret_cast(pImage), nSize); + break; + case GDT_Float64: + poQuery->set_data_buffer(osAttrName, + reinterpret_cast(pImage), nSize); + break; + case GDT_CInt16: + poQuery->set_data_buffer( + osAttrName, reinterpret_cast(pImage), nSize * 2); + break; + case GDT_CInt32: + poQuery->set_data_buffer( + osAttrName, reinterpret_cast(pImage), nSize * 2); + break; + case GDT_CFloat32: + poQuery->set_data_buffer( + osAttrName, reinterpret_cast(pImage), nSize * 2); + break; + case GDT_CFloat64: + poQuery->set_data_buffer( + osAttrName, reinterpret_cast(pImage), nSize * 2); + break; + default: + return CE_Failure; + } + return CE_None; +} +#else static CPLErr SetBuffer(tiledb::Query *poQuery, GDALDataType eType, const CPLString &osAttrName, void *pImage, int nSize) { @@ -281,6 +333,7 @@ } return CE_None; } +#endif /************************************************************************/ /* TileDBRasterBand() */ @@ -298,256 +351,114 @@ nRasterYSize = poGDS->nRasterYSize; nBlockXSize = poGDS->nBlockXSize; nBlockYSize = poGDS->nBlockYSize; - - m_query.reset(new tiledb::Query(*poGDS->m_ctx, *poGDS->m_array)); - - if ((eAccess == GA_Update) && (poGDS->m_roArray)) - { - m_roQuery.reset(new tiledb::Query(*poGDS->m_roCtx, *poGDS->m_roArray)); - m_roQuery->set_layout(TILEDB_ROW_MAJOR); - } - - if (poGDS->bGlobalOrder) - { - m_query->set_layout(TILEDB_GLOBAL_ORDER); - int nBandIdx = poGDS->nBandStart + nBand - 1; - // initialize to complete image block layout - std::vector oaSubarray = { - uint64_t(nBandIdx), - uint64_t(nBandIdx), - 0, - uint64_t(poDSIn->nBlocksY) * nBlockYSize - 1, - 0, - uint64_t(poDSIn->nBlocksX) * nBlockXSize - 1, - }; - - if (poGDS->m_array->schema().domain().ndim() == 3) - { - if (poGDS->eIndexMode == PIXEL) - std::rotate(oaSubarray.begin(), oaSubarray.begin() + 2, - oaSubarray.end()); - m_query->set_subarray(oaSubarray); - } - else - { - m_query->set_subarray(std::vector(oaSubarray.cbegin() + 2, - oaSubarray.cend())); - } - } - else - m_query->set_layout(TILEDB_ROW_MAJOR); } /************************************************************************/ -/* Finalize() */ -/************************************************************************/ - -void TileDBRasterBand::Finalize() - -{ - if (poGDS->bGlobalOrder) - { - m_query->finalize(); - } -} - -/************************************************************************/ -/* IReadBlock() */ -/************************************************************************/ - -CPLErr TileDBRasterBand::IReadBlock(int nBlockXOff, int nBlockYOff, - void *pImage) -{ - int nStartX = nBlockXSize * nBlockXOff; - int nStartY = nBlockYSize * nBlockYOff; - uint64_t nEndX = nStartX + nBlockXSize; - uint64_t nEndY = nStartY + nBlockYSize; - int nBandIdx = poGDS->nBandStart + nBand - 1; - - std::vector oaSubarray = { - uint64_t(nBandIdx), uint64_t(nBandIdx), (uint64_t)nStartY, - (uint64_t)nEndY - 1, (uint64_t)nStartX, (uint64_t)nEndX - 1}; - - if (poGDS->eIndexMode == PIXEL) - std::rotate(oaSubarray.begin(), oaSubarray.begin() + 2, - oaSubarray.end()); - - tiledb::Query *q; - if ((eAccess == GA_Update) && (poGDS->m_roArray)) - q = m_roQuery.get(); - else - q = m_query.get(); - - if (poGDS->m_array->schema().domain().ndim() == 3) - { - q->set_subarray(oaSubarray); - } - else - { - q->set_subarray( - std::vector(oaSubarray.cbegin() + 2, oaSubarray.cend())); - } - - SetBuffer(q, eDataType, osAttrName, pImage, nBlockXSize * nBlockYSize); - - if (bStats) - tiledb::Stats::enable(); - - auto status = q->submit(); - - if (bStats) - { - tiledb::Stats::dump(stdout); - tiledb::Stats::disable(); - } - - if (status == tiledb::Query::Status::FAILED) - return CE_Failure; - else - return CE_None; -} - -/************************************************************************/ -/* IWriteBlock() */ +/* IRasterIO() */ /************************************************************************/ -CPLErr TileDBRasterBand::IWriteBlock(int nBlockXOff, int nBlockYOff, - void *pImage) +CPLErr TileDBRasterBand::IRasterIO(GDALRWFlag eRWFlag, int nXOff, int nYOff, + int nXSize, int nYSize, void *pData, + int nBufXSize, int nBufYSize, + GDALDataType eBufType, GSpacing nPixelSpace, + GSpacing nLineSpace, + GDALRasterIOExtraArg *psExtraArg) { - if (eAccess == GA_ReadOnly) + if (poGDS->eIndexMode == ATTRIBUTES && eRWFlag == GF_Write) { CPLError(CE_Failure, CPLE_NoWriteAccess, - "Unable to write block, dataset is opened read only.\n"); + "Unable to write using band ordered IRasterIO when using " + "interleave 'ATTRIBUTES'.\n"); return CE_Failure; } - CPLAssert(poGDS != nullptr && nBlockXOff >= 0 && nBlockYOff >= 0 && - pImage != nullptr); + const int nBufferDTSize(GDALGetDataTypeSizeBytes(eBufType)); - int nBandIdx = poGDS->nBandStart + nBand - 1; - if (!poGDS->bGlobalOrder) + if (eBufType == eDataType && nXSize == nBufXSize && nYSize == nBufYSize && + nBufferDTSize > 0 && (nPixelSpace % nBufferDTSize) == 0 && + (nLineSpace % nBufferDTSize) == 0) { - int nStartX = nBlockXSize * nBlockXOff; - int nStartY = nBlockYSize * nBlockYOff; - uint64_t nEndX = nStartX + nBlockXSize; - uint64_t nEndY = nStartY + nBlockYSize; - + std::unique_ptr poQuery; + int nBandIdx = poGDS->nBandStart + nBand - 1; std::vector oaSubarray = { - uint64_t(nBandIdx), uint64_t(nBandIdx), (uint64_t)nStartY, - (uint64_t)nEndY - 1, (uint64_t)nStartX, (uint64_t)nEndX - 1}; - + uint64_t(nBandIdx), uint64_t(nBandIdx), + (uint64_t)nYOff, (uint64_t)nYOff + nYSize - 1, + (uint64_t)nXOff, (uint64_t)nXOff + nXSize - 1}; if (poGDS->eIndexMode == PIXEL) std::rotate(oaSubarray.begin(), oaSubarray.begin() + 2, oaSubarray.end()); - if (poGDS->eIndexMode == ATTRIBUTES) + if ((eRWFlag == GF_Read) && + ((eAccess == GA_Update) && (poGDS->m_roArray))) { - m_query->set_subarray(std::vector(oaSubarray.cbegin() + 2, - oaSubarray.cend())); + poQuery.reset( + new tiledb::Query(*poGDS->m_roCtx, *poGDS->m_roArray)); } else { - m_query->set_subarray(oaSubarray); + poQuery.reset(new tiledb::Query(*poGDS->m_ctx, *poGDS->m_array)); } - } - else - { - // global order requires ordered blocks (see FlushCache(bool - // bAtClosing)) - if ((nCurrBlockX != nBlockXOff) || (nCurrBlockY != nBlockYOff)) + + if (poGDS->m_array->schema().domain().ndim() == 3) { - CPLError(CE_Failure, CPLE_AppDefined, - "Non-sequential global write to TileDB.\n"); - return CE_Failure; + poQuery->set_subarray(oaSubarray); } else { - if (++nCurrBlockX == poGDS->nBlocksX) - { - nCurrBlockX = 0; - nCurrBlockY++; - } + poQuery->set_subarray(std::vector(oaSubarray.cbegin() + 2, + oaSubarray.cend())); } - } - std::vector> aBlocks; + SetBuffer(poQuery.get(), eDataType, osAttrName, pData, nXSize * nYSize); - if (poGDS->lpoAttributeDS.size() > 0) - { - for (auto const &poAttrDS : poGDS->lpoAttributeDS) - { - GDALRasterBand *poAttrBand = poAttrDS->GetRasterBand(nBandIdx); - GDALDataType eAttrType = poAttrBand->GetRasterDataType(); - int nBytes = GDALGetDataTypeSizeBytes(eAttrType); - int nValues = nBlockXSize * nBlockYSize; - void *pAttrBlock = VSIMalloc(nBytes * nValues); - aBlocks.emplace_back(pAttrBlock, &VSIFree); + // write additional co-registered values + std::vector> aBlocks; - if (pAttrBlock == nullptr) + if (poGDS->lpoAttributeDS.size() > 0) + { + for (auto const &poAttrDS : poGDS->lpoAttributeDS) { - CPLError(CE_Failure, CPLE_OutOfMemory, - "Cannot allocate attribute buffer"); - return CE_Failure; - } + GDALRasterBand *poAttrBand = poAttrDS->GetRasterBand(nBandIdx); + GDALDataType eAttrType = poAttrBand->GetRasterDataType(); + int nBytes = GDALGetDataTypeSizeBytes(eAttrType); + size_t nValues = static_cast(nBufXSize) * nBufYSize; + void *pAttrBlock = VSIMalloc(nBytes * nValues); + aBlocks.emplace_back(pAttrBlock, &VSIFree); - int nXSize = nBlockXSize; - int nYSize = nBlockYSize; - if (nBlockXOff + nXSize > nRasterXSize) - nXSize = nRasterXSize - nBlockXOff; - if (nBlockYOff + nYSize > nRasterYSize) - nYSize = nRasterYSize - nBlockYOff; - - poAttrBand->AdviseRead(nBlockXOff, nBlockYOff, nXSize, nYSize, - nBlockXSize, nBlockYSize, eAttrType, - nullptr); - - CPLErr eErr = poAttrBand->RasterIO( - GF_Read, nBlockXOff, nBlockYOff, nXSize, nYSize, pAttrBlock, - nBlockXSize, nBlockYSize, eAttrType, 0, 0, nullptr); + if (pAttrBlock == nullptr) + { + CPLError(CE_Failure, CPLE_OutOfMemory, + "Cannot allocate attribute buffer"); + return CE_Failure; + } - if (eErr == CE_None) - { - CPLString osName = CPLString().Printf( - "%s", CPLGetBasename(poAttrDS->GetDescription())); + poAttrBand->AdviseRead(nXOff, nYOff, nXSize, nYSize, nBufXSize, + nBufYSize, eAttrType, nullptr); - SetBuffer(m_query.get(), eAttrType, osName, pAttrBlock, - nBlockXSize * nBlockYSize); - } - else - { - return eErr; - } - } - } + CPLErr eErr = poAttrBand->RasterIO( + GF_Read, nXOff, nYOff, nXSize, nYSize, pAttrBlock, + nBufXSize, nBufYSize, eAttrType, nPixelSpace, nLineSpace, + psExtraArg); - if (poGDS->eIndexMode == ATTRIBUTES) - { - if (nBand != poGDS->GetRasterCount()) - { - tiledb::Query *q = - ((TileDBRasterBand *)poGDS->GetRasterBand(poGDS->nBands)) - ->m_query.get(); - SetBuffer(q, eDataType, osAttrName, pImage, - nBlockXSize * nBlockYSize); - } - else - { - SetBuffer(m_query.get(), eDataType, osAttrName, pImage, - nBlockXSize * nBlockYSize); + if (eErr == CE_None) + { + CPLString osName = CPLString().Printf( + "%s", CPLGetBasename(poAttrDS->GetDescription())); + + SetBuffer(poQuery.get(), eAttrType, osName, pAttrBlock, + nBufXSize * nBufYSize); + } + else + { + return eErr; + } + } } - } - else - { - SetBuffer(m_query.get(), eDataType, osAttrName, pImage, - nBlockXSize * nBlockYSize); - } - if ((poGDS->eIndexMode != ATTRIBUTES) || (nBand == poGDS->GetRasterCount())) - { if (bStats) tiledb::Stats::enable(); - auto status = m_query->submit(); + auto status = poQuery->submit(); if (bStats) { @@ -557,9 +468,51 @@ if (status == tiledb::Query::Status::FAILED) return CE_Failure; + else + return CE_None; } - return CE_None; + return GDALPamRasterBand::IRasterIO(eRWFlag, nXOff, nYOff, nXSize, nYSize, + pData, nBufXSize, nBufYSize, eBufType, + nPixelSpace, nLineSpace, psExtraArg); +} + +CPLErr TileDBRasterBand::IReadBlock(int nBlockXOff, int nBlockYOff, + void *pImage) +{ + const int nXOff = nBlockXOff * nBlockXSize; + const int nYOff = nBlockYOff * nBlockYSize; + const int nDTSize = GDALGetDataTypeSizeBytes(eDataType); + return IRasterIO(GF_Read, nXOff, nYOff, nBlockXSize, nBlockYSize, pImage, + nBlockXSize, nBlockYSize, eDataType, nDTSize, + nDTSize * nBlockXSize, nullptr); +} + +/************************************************************************/ +/* IWriteBlock() */ +/************************************************************************/ + +CPLErr TileDBRasterBand::IWriteBlock(int nBlockXOff, int nBlockYOff, + void *pImage) + +{ + if (eAccess == GA_ReadOnly) + { + CPLError(CE_Failure, CPLE_NoWriteAccess, + "Unable to write block, dataset is opened read only.\n"); + return CE_Failure; + } + + CPLAssert(poGDS != nullptr && nBlockXOff >= 0 && nBlockYOff >= 0 && + pImage != nullptr); + + int nStartX = nBlockXSize * nBlockXOff; + int nStartY = nBlockYSize * nBlockYOff; + + const int nDTSize = GDALGetDataTypeSizeBytes(eDataType); + return IRasterIO(GF_Write, nStartX, nStartY, nBlockXSize, nBlockYSize, + pImage, nBlockXSize, nBlockYSize, eDataType, nDTSize, + nDTSize * nBlockXSize, nullptr); } /************************************************************************/ @@ -599,15 +552,6 @@ { TileDBDataset::FlushCache(true); - // important to finalize arrays before closing array when updating - if (bGlobalOrder) - { - for (auto &&poBand : GetBands()) - { - static_cast(poBand)->Finalize(); - } - } - try { if (m_array) @@ -625,6 +569,79 @@ } /************************************************************************/ +/* IRasterio() */ +/************************************************************************/ + +CPLErr TileDBDataset::IRasterIO(GDALRWFlag eRWFlag, int nXOff, int nYOff, + int nXSize, int nYSize, void *pData, + int nBufXSize, int nBufYSize, + GDALDataType eBufType, int nBandCount, + int *panBandMap, GSpacing nPixelSpace, + GSpacing nLineSpace, GSpacing nBandSpace, + CPL_UNUSED GDALRasterIOExtraArg *psExtraArg) + +{ + // support special case of writing attributes for bands, all attributes have to be set at once + const int nBufferDTSize(GDALGetDataTypeSizeBytes(eBufType)); + + if (eIndexMode == ATTRIBUTES && nBandCount == nBands && + eBufType == eDataType && nXSize == nBufXSize && nYSize == nBufYSize && + nBufferDTSize > 0 && (nPixelSpace % nBufferDTSize) == 0 && + (nLineSpace % nBufferDTSize) == 0) + { + std::unique_ptr poQuery; + std::vector oaSubarray = { + (uint64_t)nYOff, (uint64_t)nYOff + nYSize - 1, (uint64_t)nXOff, + (uint64_t)nXOff + nXSize - 1}; + + if ((eRWFlag == GF_Read) && (eAccess == GA_Update && m_roArray)) + { + poQuery.reset(new tiledb::Query(*m_roCtx, *m_roArray)); + } + else + { + poQuery.reset(new tiledb::Query(*m_ctx, *m_array)); + } + + if (poQuery != nullptr) + { + poQuery->set_subarray(oaSubarray); + + for (int b = 0; b < nBandCount; b++) + { + TileDBRasterBand *poBand = + (TileDBRasterBand *)GetRasterBand(panBandMap[b]); + int nRegionSize = nBufXSize * nBufYSize * nBufferDTSize; + SetBuffer(poQuery.get(), eDataType, poBand->osAttrName, + ((GByte *)pData) + b * nRegionSize, nRegionSize); + } + + if (bStats) + tiledb::Stats::enable(); + + auto status = poQuery->submit(); + + if (bStats) + { + tiledb::Stats::dump(stdout); + tiledb::Stats::disable(); + } + + if (status == tiledb::Query::Status::FAILED) + return CE_Failure; + else + return CE_None; + } + return CE_Failure; + } + + return GDALPamDataset::IRasterIO(eRWFlag, nXOff, nYOff, nXSize, nYSize, + pData, nBufXSize, nBufYSize, eBufType, + nBandCount, panBandMap, nPixelSpace, + nLineSpace, nBandSpace, psExtraArg); +} + +/************************************************************************/ /* AddDimensions() */ /************************************************************************/ @@ -1233,6 +1250,9 @@ const char *pszTimestamp = CSLFetchNameValue(poOpenInfo->papszOpenOptions, "TILEDB_TIMESTAMP"); + poDS->bStats = + CSLFetchBoolean(poOpenInfo->papszOpenOptions, "STATS", FALSE); + if (pszConfig != nullptr) { tiledb::Config cfg(pszConfig); @@ -1242,9 +1262,8 @@ { poDS->m_ctx.reset(new tiledb::Context()); } - if (pszTimestamp) - poDS->nTimestamp = atoi(pszTimestamp); + poDS->nTimestamp = std::strtoull(pszTimestamp, nullptr, 10); CPLString osArrayPath; CPLString osAux; @@ -1294,18 +1313,23 @@ { eMode = TILEDB_WRITE; poDS->m_roCtx.reset(new tiledb::Context(poDS->m_ctx->config())); - if (poDS->nTimestamp) - poDS->m_roArray.reset( - new tiledb::Array(*poDS->m_roCtx, osArrayPath, TILEDB_READ, - poDS->nTimestamp)); - else - poDS->m_roArray.reset(new tiledb::Array( - *poDS->m_roCtx, osArrayPath, TILEDB_READ)); + poDS->m_roArray.reset( + new tiledb::Array(*poDS->m_roCtx, osArrayPath, TILEDB_READ)); } if (poDS->nTimestamp) - poDS->m_array.reset(new tiledb::Array(*poDS->m_ctx, osArrayPath, - eMode, poDS->nTimestamp)); + { + if (eMode == TILEDB_READ) + { + poDS->m_array.reset(new tiledb::Array( + *poDS->m_ctx, osArrayPath, TILEDB_READ, poDS->nTimestamp)); + } + else + { + poDS->m_array.reset(new tiledb::Array( + *poDS->m_ctx, osArrayPath, TILEDB_WRITE, poDS->nTimestamp)); + } + } else poDS->m_array.reset( new tiledb::Array(*poDS->m_ctx, osArrayPath, eMode)); @@ -1814,7 +1838,6 @@ poDS->eDataType = eType; poDS->nBands = nBandsIn; poDS->eAccess = GA_Update; - poDS->bGlobalOrder = true; if (poDS->nBands == 0) // subdatasets { @@ -1857,7 +1880,7 @@ const char *pszTimestamp = CSLFetchNameValue(papszOptions, "TILEDB_TIMESTAMP"); if (pszTimestamp != nullptr) - poDS->nTimestamp = atoi(pszTimestamp); + poDS->nTimestamp = std::strtoull(pszTimestamp, nullptr, 10); // set dimensions and attribute type for schema poDS->m_schema.reset( @@ -2099,9 +2122,11 @@ tiledb::Array::create(poDstDS->GetDescription(), *poDstDS->m_schema); if (poDstDS->nTimestamp) + { poDstDS->m_array.reset( new tiledb::Array(*poDstDS->m_ctx, poDstDS->GetDescription(), TILEDB_WRITE, poDstDS->nTimestamp)); + } else poDstDS->m_array.reset(new tiledb::Array( *poDstDS->m_ctx, poDstDS->GetDescription(), TILEDB_WRITE)); @@ -2223,12 +2248,10 @@ for (int i = 0; i < poDS->nBands; i++) { if (poDS->eIndexMode == ATTRIBUTES) - { poDS->SetBand(i + 1, new TileDBRasterBand( poDS.get(), i + 1, TILEDB_VALUES + CPLString().Printf("_%i", i + 1))); - } else poDS->SetBand(i + 1, new TileDBRasterBand(poDS.get(), i + 1)); } @@ -2415,16 +2438,26 @@ } } + CSLDestroy(papszCopyOptions); + // TODO Supporting mask bands is a possible future task if (poDstDS != nullptr) { int nCloneFlags = GCIF_PAM_DEFAULT & ~GCIF_MASK; poDstDS->CloneInfo(poSrcDS, nCloneFlags); - } - CSLDestroy(papszCopyOptions); + if (poDstDS->eIndexMode == ATTRIBUTES) + { + poDstDS->FlushCache(false); + } + + poDstDS->m_array->close(); + poDstDS->eAccess = GA_ReadOnly; + poDstDS->m_array->open(TILEDB_READ); - return poDstDS.release(); + return poDstDS.release(); + } + return nullptr; } catch (const tiledb::TileDBError &e) { @@ -2435,39 +2468,6 @@ } /************************************************************************/ -/* IRasterIO() */ -/* */ -/* Multi-band raster io handler. We will use block based */ -/* loading for attribute only arrays and for */ -/* arrays that are indexed band last as they */ -/* are effectively pixel interleaved, so processing all bands */ -/* for a given block together avoid extra seeks. */ -/************************************************************************/ - -CPLErr TileDBDataset::IRasterIO(GDALRWFlag eRWFlag, int nXOff, int nYOff, - int nXSize, int nYSize, void *pData, - int nBufXSize, int nBufYSize, - GDALDataType eBufType, int nBandCount, - int *panBandMap, GSpacing nPixelSpace, - GSpacing nLineSpace, GSpacing nBandSpace, - GDALRasterIOExtraArg *psExtraArg) - -{ - if ((eIndexMode == PIXEL) || (eIndexMode == ATTRIBUTES)) - { - return GDALDataset::BlockBasedRasterIO( - eRWFlag, nXOff, nYOff, nXSize, nYSize, pData, nBufXSize, nBufYSize, - eBufType, nBandCount, panBandMap, nPixelSpace, nLineSpace, - nBandSpace, psExtraArg); - } - else - return GDALDataset::IRasterIO(eRWFlag, nXOff, nYOff, nXSize, nYSize, - pData, nBufXSize, nBufYSize, eBufType, - nBandCount, panBandMap, nPixelSpace, - nLineSpace, nBandSpace, psExtraArg); -} - -/************************************************************************/ /* GDALRegister_TILEDB() */ /************************************************************************/ diff -Nru gdal-3.6.2+dfsg/frmts/zmap/zmapdataset.cpp gdal-3.6.4+dfsg/frmts/zmap/zmapdataset.cpp --- gdal-3.6.2+dfsg/frmts/zmap/zmapdataset.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/frmts/zmap/zmapdataset.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -504,6 +504,7 @@ if (static_cast(strlen(pszValue)) > nWidth) { + CPLAssert(nDecimals >= 0); snprintf(szFormat, sizeof(szFormat), "%%.%dg", nDecimals); pszValue = const_cast(CPLSPrintf(szFormat, dfValue)); pszE = strchr(pszValue, 'e'); @@ -597,7 +598,7 @@ WriteRightJustified(fp, nFieldSize, 10); VSIFPrintfL(fp, ","); - WriteRightJustified(fp, dfNoDataValue, 10); + WriteRightJustified(fp, dfNoDataValue, nFieldSize, nDecimalCount); VSIFPrintfL(fp, ","); WriteRightJustified(fp, "", 10); VSIFPrintfL(fp, ","); diff -Nru gdal-3.6.2+dfsg/gcore/gdaldefaultoverviews.cpp gdal-3.6.4+dfsg/gcore/gdaldefaultoverviews.cpp --- gdal-3.6.2+dfsg/gcore/gdaldefaultoverviews.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/gcore/gdaldefaultoverviews.cpp 2023-04-17 11:50:19.000000000 +0000 @@ -496,7 +496,7 @@ // Select the larger dimension to have increased accuracy, but // with a slight preference to x even if (a bit) smaller than y // in an attempt to behave closer as previous behavior. - if (nRasterXSize >= nRasterYSize / 2) + if (nRasterXSize != 1 && nRasterXSize >= nRasterYSize / 2) { return static_cast(0.5 + nRasterXSize / static_cast(nOvrXSize)); diff -Nru gdal-3.6.2+dfsg/gcore/gdalpamdataset.cpp gdal-3.6.4+dfsg/gcore/gdalpamdataset.cpp --- gdal-3.6.2+dfsg/gcore/gdalpamdataset.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/gcore/gdalpamdataset.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -488,8 +488,13 @@ /* -------------------------------------------------------------------- */ /* Try loading ESRI xml encoded GeodataXform. */ /* -------------------------------------------------------------------- */ - if (psPam->poSRS == nullptr) { + // previously we only tried to load GeodataXform if we didn't already + // encounter a valid SRS at this stage. But in some cases a PAMDataset + // may have both a SRS child element AND a GeodataXform with a SpatialReference + // child element. In this case we should prioritize the GeodataXform + // over the root PAMDataset SRS node. + // ArcGIS 9.3: GeodataXform as a root element CPLXMLNode *psGeodataXform = CPLGetXMLNode(psTree, "=GeodataXform"); CPLXMLNode *psValueAsXML = nullptr; @@ -520,6 +525,7 @@ CPLGetXMLValue(psGeodataXform, "SpatialReference.WKT", nullptr); if (pszESRI_WKT) { + delete psPam->poSRS; psPam->poSRS = new OGRSpatialReference(nullptr); psPam->poSRS->SetAxisMappingStrategy( OAMS_TRADITIONAL_GIS_ORDER); diff -Nru gdal-3.6.2+dfsg/gcore/gdalproxypool.cpp gdal-3.6.4+dfsg/gcore/gdalproxypool.cpp --- gdal-3.6.2+dfsg/gcore/gdalproxypool.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/gcore/gdalproxypool.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -1264,7 +1264,24 @@ CPLErr GDALProxyPoolRasterBand::FlushCache(bool bAtClosing) { - GDALRasterBand *poUnderlyingRasterBand = RefUnderlyingRasterBand(false); + GDALRasterBand *poUnderlyingRasterBand; + if (auto l_poProxyMaskBand = dynamic_cast(this)) + { + poUnderlyingRasterBand = + static_cast(l_poProxyMaskBand) + ->RefUnderlyingRasterBand(); + } + else if (auto poProxyOvrBand = + dynamic_cast(this)) + { + poUnderlyingRasterBand = + static_cast(poProxyOvrBand) + ->RefUnderlyingRasterBand(); + } + else + { + poUnderlyingRasterBand = RefUnderlyingRasterBand(false); + } if (poUnderlyingRasterBand) { CPLErr eErr = poUnderlyingRasterBand->FlushCache(bAtClosing); diff -Nru gdal-3.6.2+dfsg/gcore/gdal_version.h.in gdal-3.6.4+dfsg/gcore/gdal_version.h.in --- gdal-3.6.2+dfsg/gcore/gdal_version.h.in 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/gcore/gdal_version.h.in 2023-04-17 11:50:20.000000000 +0000 @@ -7,7 +7,7 @@ #ifndef GDAL_VERSION_MAJOR # define GDAL_VERSION_MAJOR 3 # define GDAL_VERSION_MINOR 6 -# define GDAL_VERSION_REV 2 +# define GDAL_VERSION_REV 4 # define GDAL_VERSION_BUILD 0 #endif @@ -24,9 +24,9 @@ #if !defined(DO_NOT_DEFINE_GDAL_DATE_NAME) #ifndef GDAL_RELEASE_DATE -# define GDAL_RELEASE_DATE 20230102 +# define GDAL_RELEASE_DATE 20230417 #endif #ifndef GDAL_RELEASE_NAME -# define GDAL_RELEASE_NAME "3.6.2" +# define GDAL_RELEASE_NAME "3.6.4" #endif #endif diff -Nru gdal-3.6.2+dfsg/gcore/rasterio.cpp gdal-3.6.4+dfsg/gcore/rasterio.cpp --- gdal-3.6.2+dfsg/gcore/rasterio.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/gcore/rasterio.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -4608,6 +4608,9 @@ bInterleave = true; else if (pszInterleave != nullptr && EQUAL(pszInterleave, "BAND")) bInterleave = false; + // attributes is specific to the TileDB driver + else if (pszInterleave != nullptr && EQUAL(pszInterleave, "ATTRIBUTES")) + bInterleave = true; else if (pszInterleave != nullptr) { CPLError(CE_Warning, CPLE_NotSupported, diff -Nru gdal-3.6.2+dfsg/gcore/rawdataset.cpp gdal-3.6.4+dfsg/gcore/rawdataset.cpp --- gdal-3.6.2+dfsg/gcore/rawdataset.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/gcore/rawdataset.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -380,6 +380,7 @@ if (!masterBand->FlushCurrentLine(false)) { masterBand->bNeedFileFlush = false; + bNeedFileFlush = false; return CE_Failure; } @@ -389,10 +390,13 @@ int nRet = VSIFFlushL(fpRawL); masterBand->bNeedFileFlush = false; + bNeedFileFlush = false; if (nRet < 0) return CE_Failure; } + bNeedFileFlush = false; + return CE_None; } @@ -882,6 +886,13 @@ CPLErr RawRasterBand::AccessBlock(vsi_l_offset nBlockOff, size_t nBlockSize, void *pData) { + return AccessBlock(nBlockOff, nBlockSize, pData, + nBlockSize / std::abs(nPixelOffset)); +} + +CPLErr RawRasterBand::AccessBlock(vsi_l_offset nBlockOff, size_t nBlockSize, + void *pData, size_t nValues) +{ // Seek to the correct block. if (Seek(nBlockOff, SEEK_SET) == -1) { @@ -901,8 +912,7 @@ // Byte swap the interesting data, if required. if (NeedsByteOrderChange()) { - DoByteSwap(pData, nBlockSize / nPixelOffset, std::abs(nPixelOffset), - true); + DoByteSwap(pData, nValues, std::abs(nPixelOffset), true); } return CE_None; @@ -1021,6 +1031,9 @@ if (bNeedFileFlush) RawRasterBand::FlushCache(false); + // Needed for ICC fast math approximations + constexpr double EPS = 1e-10; + // Read data. if (eRWFlag == GF_Read) { @@ -1039,7 +1052,8 @@ if (nXSize == GetXSize() && nXSize == nBufXSize && nYSize == nBufYSize && eBufType == eDataType && nPixelOffset == nBandDataSize && nPixelSpace == nBufDataSize && - nLineSpace == nPixelSpace * nXSize) + nLineSpace == nPixelSpace * nXSize && + nLineOffset == nPixelOffset * nXSize) { vsi_l_offset nOffset = nImgOffset; if (nLineOffset >= 0) @@ -1047,9 +1061,9 @@ else nOffset -= nYOff * static_cast(-nLineOffset); - const size_t nBytesToRead = - static_cast(nXSize) * nYSize * nBandDataSize; - if (AccessBlock(nOffset, nBytesToRead, pData) != CE_None) + const size_t nValues = static_cast(nXSize) * nYSize; + const size_t nBytesToRead = nValues * nBandDataSize; + if (AccessBlock(nOffset, nBytesToRead, pData, nValues) != CE_None) { CPLError(CE_Failure, CPLE_FileIO, "Failed to read " CPL_FRMT_GUIB @@ -1065,7 +1079,8 @@ const double dfSrcYInc = static_cast(nYSize) / nBufYSize; const size_t nBytesToRW = - static_cast(nPixelOffset) * nXSize; + static_cast(nPixelOffset) * (nXSize - 1) + + GDALGetDataTypeSizeBytes(eDataType); GByte *pabyData = static_cast(VSI_MALLOC_VERBOSE(nBytesToRW)); if (pabyData == nullptr) @@ -1075,7 +1090,7 @@ { const vsi_l_offset nLine = static_cast(nYOff) + - static_cast(iLine * dfSrcYInc); + static_cast(iLine * dfSrcYInc + EPS); vsi_l_offset nOffset = nImgOffset; if (nLineOffset >= 0) nOffset += nLine * nLineOffset; @@ -1085,7 +1100,8 @@ nOffset += nXOff * static_cast(nPixelOffset); else nOffset -= nXOff * static_cast(-nPixelOffset); - if (AccessBlock(nOffset, nBytesToRW, pabyData) != CE_None) + if (AccessBlock(nOffset, nBytesToRW, pabyData, nXSize) != + CE_None) { CPLError(CE_Failure, CPLE_FileIO, "Failed to read " CPL_FRMT_GUIB @@ -1109,9 +1125,9 @@ for (int iPixel = 0; iPixel < nBufXSize; iPixel++) { GDALCopyWords( - pabyData + - static_cast(iPixel * dfSrcXInc) * - nPixelOffset, + pabyData + static_cast( + iPixel * dfSrcXInc + EPS) * + nPixelOffset, eDataType, nPixelOffset, static_cast(pData) + static_cast(iLine) * nLineSpace + @@ -1140,12 +1156,15 @@ if (nXSize == GetXSize() && nXSize == nBufXSize && nYSize == nBufYSize && eBufType == eDataType && nPixelOffset == nBandDataSize && nPixelSpace == nBufDataSize && - nLineSpace == nPixelSpace * nXSize) + nLineSpace == nPixelSpace * nXSize && + nLineOffset == nPixelOffset * nXSize) { + const size_t nValues = static_cast(nXSize) * nYSize; + // Byte swap the data buffer, if required. if (NeedsByteOrderChange()) { - DoByteSwap(pData, nXSize, std::abs(nPixelOffset), false); + DoByteSwap(pData, nValues, std::abs(nPixelOffset), false); } // Seek to the correct block. @@ -1165,8 +1184,7 @@ } // Write the block. - const size_t nBytesToRW = - static_cast(nXSize) * nYSize * nBandDataSize; + const size_t nBytesToRW = nValues * nBandDataSize; const size_t nBytesActuallyWritten = Write(pData, 1, nBytesToRW); if (nBytesActuallyWritten < nBytesToRW) @@ -1184,7 +1202,7 @@ // buffer is still usable for reading purposes. if (NeedsByteOrderChange()) { - DoByteSwap(pData, nXSize, std::abs(nPixelOffset), true); + DoByteSwap(pData, nValues, std::abs(nPixelOffset), true); } } // 2. Case when we need deinterleave and/or subsample data. @@ -1194,7 +1212,8 @@ const double dfSrcYInc = static_cast(nYSize) / nBufYSize; const size_t nBytesToRW = - static_cast(nPixelOffset) * nXSize; + static_cast(nPixelOffset) * (nXSize - 1) + + GDALGetDataTypeSizeBytes(eDataType); GByte *pabyData = static_cast(VSI_MALLOC_VERBOSE(nBytesToRW)); if (pabyData == nullptr) @@ -1204,7 +1223,7 @@ { const vsi_l_offset nLine = static_cast(nYOff) + - static_cast(iLine * dfSrcYInc); + static_cast(iLine * dfSrcYInc + EPS); vsi_l_offset nOffset = nImgOffset; if (nLineOffset >= 0) nOffset += nLine * static_cast(nLineOffset); @@ -1218,7 +1237,7 @@ // If the data for this band is completely contiguous we don't // have to worry about pre-reading from disk. if (nPixelOffset > nBandDataSize) - AccessBlock(nOffset, nBytesToRW, pabyData); + AccessBlock(nOffset, nBytesToRW, pabyData, nXSize); // Copy data from user block buffer to disk buffer and // subsample, if needed. @@ -1239,9 +1258,9 @@ static_cast(iLine) * nLineSpace + static_cast(iPixel) * nPixelSpace, eBufType, static_cast(nPixelSpace), - pabyData + - static_cast(iPixel * dfSrcXInc) * - nPixelOffset, + pabyData + static_cast( + iPixel * dfSrcXInc + EPS) * + nPixelOffset, eDataType, nPixelOffset, 1); } } diff -Nru gdal-3.6.2+dfsg/gcore/rawdataset.h gdal-3.6.4+dfsg/gcore/rawdataset.h --- gdal-3.6.2+dfsg/gcore/rawdataset.h 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/gcore/rawdataset.h 2023-04-17 11:50:20.000000000 +0000 @@ -119,6 +119,8 @@ size_t Write(void *, size_t, size_t); CPLErr AccessBlock(vsi_l_offset nBlockOff, size_t nBlockSize, void *pData); + CPLErr AccessBlock(vsi_l_offset nBlockOff, size_t nBlockSize, void *pData, + size_t nValues); int IsSignificantNumberOfLinesLoaded(int nLineOff, int nLines); void Initialize(); diff -Nru gdal-3.6.2+dfsg/gdal.cmake gdal-3.6.4+dfsg/gdal.cmake --- gdal-3.6.2+dfsg/gdal.cmake 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/gdal.cmake 2023-04-17 11:50:20.000000000 +0000 @@ -459,8 +459,8 @@ ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR} ) - if( NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "" ) - message(WARNING "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} will be ignored and replaced with ${base};${base}/${relDir} due to GDAL_SET_INSTALL_RELATIVE_RPATH being set") + if( NOT "${CMAKE_INSTALL_RPATH}" STREQUAL "" ) + message(WARNING "CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH} will be ignored and replaced with ${base};${base}/${relDir} due to GDAL_SET_INSTALL_RELATIVE_RPATH being set") endif() set(CMAKE_INSTALL_RPATH ${base} ${base}/${relDir}) endif() diff -Nru gdal-3.6.2+dfsg/man/man1/gdal2tiles.1 gdal-3.6.4+dfsg/man/man1/gdal2tiles.1 --- gdal-3.6.2+dfsg/man/man1/gdal2tiles.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal2tiles.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL2TILES" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal2tiles \- Generates directory with TMS tiles, KMLs and simple web viewers. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL2TILES" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal2tiles \- Generates directory with TMS tiles, KMLs and simple web viewers. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -315,7 +315,7 @@ .sp .nf .ft C -gdal2tiles.py \-\-zoom=16\-18 \-w mapml \-p APSTILE \-\-url "https://example.com" input.tif output_folder +gdal2tiles.py \-\-zoom=16\-18 \-w mapml \-p APSTILE \-\-url \(dqhttps://example.com\(dq input.tif output_folder .ft P .fi .UNINDENT diff -Nru gdal-3.6.2+dfsg/man/man1/gdaladdo.1 gdal-3.6.4+dfsg/man/man1/gdaladdo.1 --- gdal-3.6.2+dfsg/man/man1/gdaladdo.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdaladdo.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDALADDO" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdaladdo \- Builds or rebuilds overview images. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDALADDO" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdaladdo \- Builds or rebuilds overview images. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -301,7 +301,7 @@ .UNINDENT .UNINDENT .sp -Create overviews for a specific subdataset, like for example one of potentially many raster layers in a GeoPackage (the "filename" parameter must be driver prefix, filename and subdataset name, like e.g. shown by gdalinfo): +Create overviews for a specific subdataset, like for example one of potentially many raster layers in a GeoPackage (the \(dqfilename\(dq parameter must be driver prefix, filename and subdataset name, like e.g. shown by gdalinfo): .INDENT 0.0 .INDENT 3.5 .sp diff -Nru gdal-3.6.2+dfsg/man/man1/gdalbuildvrt.1 gdal-3.6.4+dfsg/man/man1/gdalbuildvrt.1 --- gdal-3.6.2+dfsg/man/man1/gdalbuildvrt.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdalbuildvrt.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDALBUILDVRT" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdalbuildvrt \- Builds a VRT from a list of datasets. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDALBUILDVRT" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdalbuildvrt \- Builds a VRT from a list of datasets. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -42,7 +42,7 @@ [\-separate] [\-b band]* [\-sd subdataset] [\-allow_projection_difference] [\-q] [\-addalpha] [\-hidenodata] - [\-srcnodata "value [value...]"] [\-vrtnodata "value [value...]"] + [\-srcnodata \(dqvalue [value...]\(dq] [\-vrtnodata \(dqvalue [value...]\(dq] [\-ignore_srcmaskband] [\-a_srs srs_def] [\-r {nearest,bilinear,cubic,cubicspline,lanczos,average,mode}] @@ -306,7 +306,7 @@ .sp .nf .ft C -gdalbuildvrt \-hidenodata \-vrtnodata "0 0 255" doq_index.vrt doq/*.tif +gdalbuildvrt \-hidenodata \-vrtnodata \(dq0 0 255\(dq doq_index.vrt doq/*.tif .ft P .fi .UNINDENT diff -Nru gdal-3.6.2+dfsg/man/man1/gdal_calc.1 gdal-3.6.4+dfsg/man/man1/gdal_calc.1 --- gdal-3.6.2+dfsg/man/man1/gdal_calc.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal_calc.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL_CALC" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal_calc \- Command line raster calculator with numpy syntax. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL_CALC" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal_calc \- Command line raster calculator with numpy syntax. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -245,7 +245,7 @@ .sp .nf .ft C -gdal_calc.py \-A input1.tif \-B input2.tif \-\-outfile=result.tif \-\-calc="A+B" +gdal_calc.py \-A input1.tif \-B input2.tif \-\-outfile=result.tif \-\-calc=\(dqA+B\(dq .ft P .fi .UNINDENT @@ -257,7 +257,7 @@ .sp .nf .ft C -gdal_calc.py \-A input1.tif \-B input2.tif \-\-outfile=result.tif \-\-calc="(A+B)/2" +gdal_calc.py \-A input1.tif \-B input2.tif \-\-outfile=result.tif \-\-calc=\(dq(A+B)/2\(dq .ft P .fi .UNINDENT @@ -273,7 +273,7 @@ .sp .nf .ft C -gdal_calc.py \-A input.tif \-B input2.tif \-\-outfile=result.tif \-\-calc="(A.astype(numpy.float64) + B) / 2" +gdal_calc.py \-A input.tif \-B input2.tif \-\-outfile=result.tif \-\-calc=\(dq(A.astype(numpy.float64) + B) / 2\(dq .ft P .fi .UNINDENT @@ -287,7 +287,7 @@ .sp .nf .ft C -gdal_calc.py \-A input1.tif \-B input2.tif \-C input3.tif \-\-outfile=result.tif \-\-calc="A+B+C" +gdal_calc.py \-A input1.tif \-B input2.tif \-C input3.tif \-\-outfile=result.tif \-\-calc=\(dqA+B+C\(dq .ft P .fi .UNINDENT @@ -300,7 +300,7 @@ .sp .nf .ft C -gdal_calc.py \-A input1.tif \-A input2.tif \-A input3.tif \-\-outfile=result.tif \-\-calc="numpy.sum(A,axis=0)". +gdal_calc.py \-A input1.tif \-A input2.tif \-A input3.tif \-\-outfile=result.tif \-\-calc=\(dqnumpy.sum(A,axis=0)\(dq. .ft P .fi .UNINDENT @@ -312,7 +312,7 @@ .sp .nf .ft C -gdal_calc.py \-A input1.tif \-B input2.tif \-C input3.tif \-\-outfile=result.tif \-\-calc="(A+B+C)/3" +gdal_calc.py \-A input1.tif \-B input2.tif \-C input3.tif \-\-outfile=result.tif \-\-calc=\(dq(A+B+C)/3\(dq .ft P .fi .UNINDENT @@ -325,7 +325,7 @@ .sp .nf .ft C -gdal_calc.py \-A input1.tif input2.tif input3.tif \-\-outfile=result.tif \-\-calc="numpy.average(a,axis=0)". +gdal_calc.py \-A input1.tif input2.tif input3.tif \-\-outfile=result.tif \-\-calc=\(dqnumpy.average(a,axis=0)\(dq. .ft P .fi .UNINDENT @@ -337,7 +337,7 @@ .sp .nf .ft C -gdal_calc.py \-A input1.tif \-B input2.tif \-C input3.tif \-\-outfile=result.tif \-\-calc="numpy.max((A,B,C),axis=0)" +gdal_calc.py \-A input1.tif \-B input2.tif \-C input3.tif \-\-outfile=result.tif \-\-calc=\(dqnumpy.max((A,B,C),axis=0)\(dq .ft P .fi .UNINDENT @@ -350,7 +350,7 @@ .sp .nf .ft C -gdal_calc.py \-A input1.tif input2.tif input3.tif \-\-outfile=result.tif \-\-calc="numpy.max(A,axis=0)" +gdal_calc.py \-A input1.tif input2.tif input3.tif \-\-outfile=result.tif \-\-calc=\(dqnumpy.max(A,axis=0)\(dq .ft P .fi .UNINDENT @@ -362,7 +362,7 @@ .sp .nf .ft C -gdal_calc.py \-A input.tif \-\-outfile=result.tif \-\-calc="A*(A>0)" \-\-NoDataValue=0 +gdal_calc.py \-A input.tif \-\-outfile=result.tif \-\-calc=\(dqA*(A>0)\(dq \-\-NoDataValue=0 .ft P .fi .UNINDENT @@ -374,7 +374,7 @@ .sp .nf .ft C -gdal_calc.py \-A input.tif \-\-outfile=result.tif \-\-calc="A*logical_and(A>100,A<150)" +gdal_calc.py \-A input.tif \-\-outfile=result.tif \-\-calc=\(dqA*logical_and(A>100,A<150)\(dq .ft P .fi .UNINDENT @@ -386,7 +386,7 @@ .sp .nf .ft C -gdal_calc.py \-A input.tif \-\-A_band=1 \-B input.tif \-\-B_band=2 \-\-outfile=result.tif \-\-calc="(A+B)/2" \-\-calc="B*logical_and(A>100,A<150)" +gdal_calc.py \-A input.tif \-\-A_band=1 \-B input.tif \-\-B_band=2 \-\-outfile=result.tif \-\-calc=\(dq(A+B)/2\(dq \-\-calc=\(dqB*logical_and(A>100,A<150)\(dq .ft P .fi .UNINDENT diff -Nru gdal-3.6.2+dfsg/man/man1/gdalcompare.1 gdal-3.6.4+dfsg/man/man1/gdalcompare.1 --- gdal-3.6.2+dfsg/man/man1/gdalcompare.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdalcompare.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDALCOMPARE" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdalcompare \- Compare two images. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDALCOMPARE" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdalcompare \- Compare two images. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 diff -Nru gdal-3.6.2+dfsg/man/man1/gdal-config.1 gdal-3.6.4+dfsg/man/man1/gdal-config.1 --- gdal-3.6.2+dfsg/man/man1/gdal-config.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal-config.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL-CONFIG" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal-config \- Determines various information about a GDAL installation. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL-CONFIG" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal-config \- Determines various information about a GDAL installation. .sp Determines various information about a GDAL installation. .SH SYNOPSIS @@ -80,7 +80,7 @@ .INDENT 0.0 .TP .B \-\-ogr\-enabled -Reports "yes" or "no" to standard output depending on whether OGR is +Reports \(dqyes\(dq or \(dqno\(dq to standard output depending on whether OGR is built into GDAL. .UNINDENT .INDENT 0.0 diff -Nru gdal-3.6.2+dfsg/man/man1/gdal_contour.1 gdal-3.6.4+dfsg/man/man1/gdal_contour.1 --- gdal-3.6.2+dfsg/man/man1/gdal_contour.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal_contour.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL_CONTOUR" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal_contour \- Builds vector contour lines from a raster elevation model. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL_CONTOUR" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal_contour \- Builds vector contour lines from a raster elevation model. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -100,7 +100,7 @@ .INDENT 0.0 .TP .B \-snodata -Input pixel value to treat as "nodata". +Input pixel value to treat as \(dqnodata\(dq. .UNINDENT .INDENT 0.0 .TP @@ -133,7 +133,7 @@ .INDENT 0.0 .TP .B \-fl -Name one or more "fixed levels" to extract. +Name one or more \(dqfixed levels\(dq to extract. .UNINDENT .INDENT 0.0 .TP @@ -146,7 +146,7 @@ .INDENT 0.0 .TP .B \-nln -Provide a name for the output vector layer. Defaults to "contour". +Provide a name for the output vector layer. Defaults to \(dqcontour\(dq. .UNINDENT .INDENT 0.0 .TP diff -Nru gdal-3.6.2+dfsg/man/man1/gdal_create.1 gdal-3.6.4+dfsg/man/man1/gdal_create.1 --- gdal-3.6.2+dfsg/man/man1/gdal_create.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal_create.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL_CREATE" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal_create \- Create a raster file (without source dataset) . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL_CREATE" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal_create \- Create a raster file (without source dataset) .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -44,8 +44,8 @@ [\-ot {Byte/Int16/UInt16/UInt32/Int32/UInt64/Int64/Float32/Float64/ CInt16/CInt32/CFloat32/CFloat64}] [\-strict] [\-a_srs srs_def] [\-a_ullr ulx uly lrx lry] [\-a_nodata value] - [\-mo "META\-TAG=VALUE"]* [\-q] - [\-co "NAME=VALUE"]* + [\-mo \(dqMETA\-TAG=VALUE\(dq]* [\-q] + [\-co \(dqNAME=VALUE\(dq]* [\-if input_dataset] out_dataset .ft P diff -Nru gdal-3.6.2+dfsg/man/man1/gdaldem.1 gdal-3.6.4+dfsg/man/man1/gdaldem.1 --- gdal-3.6.2+dfsg/man/man1/gdaldem.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdaldem.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDALDEM" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdaldem \- Tools to analyze and visualize DEMs. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDALDEM" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdaldem \- Tools to analyze and visualize DEMs. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -52,7 +52,7 @@ [\-z ZFactor (default=1)] [\-s scale* (default=1)] [\-az Azimuth (default=315)] [\-alt Altitude (default=45)] [\-alg Horn|ZevenbergenThorne] [\-combined | \-multidirectional | \-igor] - [\-compute_edges] [\-b Band (default=1)] [\-of format] [\-co "NAME=VALUE"]* [\-q] + [\-compute_edges] [\-b Band (default=1)] [\-of format] [\-co \(dqNAME=VALUE\(dq]* [\-q] .ft P .fi .UNINDENT @@ -67,7 +67,7 @@ gdaldem slope input_dem output_slope_map [\-p use percent slope (default=degrees)] [\-s scale* (default=1)] [\-alg Horn|ZevenbergenThorne] - [\-compute_edges] [\-b Band (default=1)] [\-of format] [\-co "NAME=VALUE"]* [\-q] + [\-compute_edges] [\-b Band (default=1)] [\-of format] [\-co \(dqNAME=VALUE\(dq]* [\-q] .ft P .fi .UNINDENT @@ -83,7 +83,7 @@ gdaldem aspect input_dem output_aspect_map [\-trigonometric] [\-zero_for_flat] [\-alg Horn|ZevenbergenThorne] - [\-compute_edges] [\-b Band (default=1)] [\-of format] [\-co "NAME=VALUE"]* [\-q] + [\-compute_edges] [\-b Band (default=1)] [\-of format] [\-co \(dqNAME=VALUE\(dq]* [\-q] .ft P .fi .UNINDENT @@ -97,8 +97,8 @@ .ft C gdaldem color\-relief input_dem color_text_file output_color_relief_map [\-alpha] [\-exact_color_entry | \-nearest_color_entry] - [\-b Band (default=1)] [\-of format] [\-co "NAME=VALUE"]* [\-q] -where color_text_file contains lines of the format "elevation_value red green blue" + [\-b Band (default=1)] [\-of format] [\-co \(dqNAME=VALUE\(dq]* [\-q] +where color_text_file contains lines of the format \(dqelevation_value red green blue\(dq .ft P .fi .UNINDENT @@ -400,7 +400,7 @@ .TP .B \-exact_color_entry Use strict matching when searching in the color configuration file. -If none matching color entry is found, the "0,0,0,0" RGBA quadruplet will be used +If none matching color entry is found, the \(dq0,0,0,0\(dq RGBA quadruplet will be used .UNINDENT .INDENT 0.0 .TP @@ -458,7 +458,7 @@ .UNINDENT .UNINDENT .sp -To implement a "round to the floor value" mode, the elevation value can be +To implement a \(dqround to the floor value\(dq mode, the elevation value can be duplicate with a new value being slightly above the threshold. For example to have red in [0,10], green in ]10,20] and blue in ]20,30]: .INDENT 0.0 diff -Nru gdal-3.6.2+dfsg/man/man1/gdal_edit.1 gdal-3.6.4+dfsg/man/man1/gdal_edit.1 --- gdal-3.6.2+dfsg/man/man1/gdal_edit.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal_edit.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL_EDIT" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal_edit \- Edit in place various information of an existing GDAL dataset. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL_EDIT" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal_edit \- Edit in place various information of an existing GDAL dataset. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -44,7 +44,7 @@ [\-scale value] [\-offset value] [\-units value] [\-colorinterp_X red|green|blue|alpha|gray|undefined]* [\-gcp pixel line easting northing [elevation]]* - [\-unsetmd] [\-oo NAME=VALUE]* [\-mo "META\-TAG=VALUE"]* datasetname + [\-unsetmd] [\-oo NAME=VALUE]* [\-mo \(dqMETA\-TAG=VALUE\(dq]* datasetname .ft P .fi .UNINDENT @@ -61,7 +61,7 @@ .INDENT 0.0 .INDENT 3.5 Depending on the format, older values of the updated information might -still be found in the file in a "ghost" state, even if no longer accessible +still be found in the file in a \(dqghost\(dq state, even if no longer accessible through the GDAL API. This is for example the case of the \fI\%GTiff \-\- GeoTIFF File Format\fP format (this is not a exhaustive list). .UNINDENT diff -Nru gdal-3.6.2+dfsg/man/man1/gdal_fillnodata.1 gdal-3.6.4+dfsg/man/man1/gdal_fillnodata.1 --- gdal-3.6.2+dfsg/man/man1/gdal_fillnodata.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal_fillnodata.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL_FILLNODATA" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal_fillnodata \- Fill raster regions by interpolation from edges. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL_FILLNODATA" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal_fillnodata \- Fill raster regions by interpolation from edges. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 diff -Nru gdal-3.6.2+dfsg/man/man1/gdal_grid.1 gdal-3.6.4+dfsg/man/man1/gdal_grid.1 --- gdal-3.6.2+dfsg/man/man1/gdal_grid.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal_grid.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL_GRID" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal_grid \- Creates regular grid from the scattered data. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL_GRID" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal_grid \- Creates regular grid from the scattered data. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -38,7 +38,7 @@ .ft C gdal_grid [\-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/ CInt16/CInt32/CFloat32/CFloat64}] - [\-of format] [\-co "NAME=VALUE"] + [\-of format] [\-co \(dqNAME=VALUE\(dq] [\-zfield field_name] [\-z_increase increase_value] [\-z_multiply multiply_value] [\-a_srs srs_def] [\-spat xmin ymin xmax ymax] [\-clipsrc |WKT|datasource|spat_extent] @@ -533,10 +533,10 @@ .nf .ft C - + dem.csv wkbPoint - + .ft P @@ -547,7 +547,7 @@ This description specifies so called 2.5D geometry with three coordinates X, Y and Z. Z value will be used for interpolation. Now you can use \fIdem.vrt\fP with all OGR programs (start with ref ogrinfo to test that everything works -fine). The datasource will contain single layer called \fI"dem"\fP filled +fine). The datasource will contain single layer called \fI\(dqdem\(dq\fP filled with point features constructed from values in CSV file. Using this technique you can handle CSV files with more than three columns, switch columns, etc. .sp @@ -558,7 +558,7 @@ .sp .nf .ft C - + .ft P .fi .UNINDENT @@ -588,14 +588,14 @@ The next command does the same thing as the previous one, but reads values to interpolate from the attribute field specified with \fB\-zfield\fP option instead of geometry record. So in this case X and Y coordinates are being -taken from geometry and Z is being taken from the \fI"Elevation"\fP field. +taken from geometry and Z is being taken from the \fI\(dqElevation\(dq\fP field. The GDAL_NUM_THREADS is also set to parallelize the computation. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C -gdal_grid \-zfield "Elevation" \-a invdist:power=2.0:smoothing=1.0 \-txe 85000 89000 \-tye 894000 890000 \-outsize 400 400 \-of GTiff \-ot Float64 \-l dem dem.vrt dem.tiff \-\-config GDAL_NUM_THREADS ALL_CPUS +gdal_grid \-zfield \(dqElevation\(dq \-a invdist:power=2.0:smoothing=1.0 \-txe 85000 89000 \-tye 894000 890000 \-outsize 400 400 \-of GTiff \-ot Float64 \-l dem dem.vrt dem.tiff \-\-config GDAL_NUM_THREADS ALL_CPUS .ft P .fi .UNINDENT diff -Nru gdal-3.6.2+dfsg/man/man1/gdalinfo.1 gdal-3.6.4+dfsg/man/man1/gdalinfo.1 --- gdal-3.6.2+dfsg/man/man1/gdalinfo.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdalinfo.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDALINFO" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdalinfo \- Lists various information about a GDAL supported raster dataset . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDALINFO" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdalinfo \- Lists various information about a GDAL supported raster dataset .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -211,7 +211,7 @@ .IP \(bu 2 Band overview resolutions available. .IP \(bu 2 -Band unit type (i.e.. "meters" or "feet" for elevation bands). +Band unit type (i.e.. \(dqmeters\(dq or \(dqfeet\(dq for elevation bands). .IP \(bu 2 Band pseudo\-color tables. .UNINDENT @@ -231,27 +231,27 @@ Driver: GTiff/GeoTIFF Size is 512, 512 Coordinate System is: -PROJCS["NAD27 / UTM zone 11N", - GEOGCS["NAD27", - DATUM["North_American_Datum_1927", - SPHEROID["Clarke 1866",6378206.4,294.978698213901]], - PRIMEM["Greenwich",0], - UNIT["degree",0.0174532925199433]], - PROJECTION["Transverse_Mercator"], - PARAMETER["latitude_of_origin",0], - PARAMETER["central_meridian",\-117], - PARAMETER["scale_factor",0.9996], - PARAMETER["false_easting",500000], - PARAMETER["false_northing",0], - UNIT["metre",1]] +PROJCS[\(dqNAD27 / UTM zone 11N\(dq, + GEOGCS[\(dqNAD27\(dq, + DATUM[\(dqNorth_American_Datum_1927\(dq, + SPHEROID[\(dqClarke 1866\(dq,6378206.4,294.978698213901]], + PRIMEM[\(dqGreenwich\(dq,0], + UNIT[\(dqdegree\(dq,0.0174532925199433]], + PROJECTION[\(dqTransverse_Mercator\(dq], + PARAMETER[\(dqlatitude_of_origin\(dq,0], + PARAMETER[\(dqcentral_meridian\(dq,\-117], + PARAMETER[\(dqscale_factor\(dq,0.9996], + PARAMETER[\(dqfalse_easting\(dq,500000], + PARAMETER[\(dqfalse_northing\(dq,0], + UNIT[\(dqmetre\(dq,1]] Origin = (440720.000000,3751320.000000) Pixel Size = (60.000000,\-60.000000) Corner Coordinates: -Upper Left ( 440720.000, 3751320.000) (117d38\(aq28.21"W, 33d54\(aq8.47"N) -Lower Left ( 440720.000, 3720600.000) (117d38\(aq20.79"W, 33d37\(aq31.04"N) -Upper Right ( 471440.000, 3751320.000) (117d18\(aq32.07"W, 33d54\(aq13.08"N) -Lower Right ( 471440.000, 3720600.000) (117d18\(aq28.50"W, 33d37\(aq35.61"N) -Center ( 456080.000, 3735960.000) (117d28\(aq27.39"W, 33d45\(aq52.46"N) +Upper Left ( 440720.000, 3751320.000) (117d38\(aq28.21\(dqW, 33d54\(aq8.47\(dqN) +Lower Left ( 440720.000, 3720600.000) (117d38\(aq20.79\(dqW, 33d37\(aq31.04\(dqN) +Upper Right ( 471440.000, 3751320.000) (117d18\(aq32.07\(dqW, 33d54\(aq13.08\(dqN) +Lower Right ( 471440.000, 3720600.000) (117d18\(aq28.50\(dqW, 33d37\(aq35.61\(dqN) +Center ( 456080.000, 3735960.000) (117d28\(aq27.39\(dqW, 33d45\(aq52.46\(dqN) Band 1 Block=512x16 Type=Byte, ColorInterp=Gray .ft P .fi diff -Nru gdal-3.6.2+dfsg/man/man1/gdallocationinfo.1 gdal-3.6.4+dfsg/man/man1/gdallocationinfo.1 --- gdal-3.6.2+dfsg/man/man1/gdallocationinfo.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdallocationinfo.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDALLOCATIONINFO" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdallocationinfo \- Raster query tool. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDALLOCATIONINFO" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdallocationinfo \- Raster query tool. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -173,8 +173,8 @@ .nf .ft C $ gdallocationinfo \-xml \-wgs84 utm.vrt \-117.5 33.75 - - + + utm.tif diff -Nru gdal-3.6.2+dfsg/man/man1/gdalmanage.1 gdal-3.6.4+dfsg/man/man1/gdalmanage.1 --- gdal-3.6.2+dfsg/man/man1/gdalmanage.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdalmanage.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDALMANAGE" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdalmanage \- Identify, delete, rename and copy raster data files. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDALMANAGE" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdalmanage \- Identify, delete, rename and copy raster data files. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 diff -Nru gdal-3.6.2+dfsg/man/man1/gdalmdiminfo.1 gdal-3.6.4+dfsg/man/man1/gdalmdiminfo.1 --- gdal-3.6.2+dfsg/man/man1/gdalmdiminfo.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdalmdiminfo.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDALMDIMINFO" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdalmdiminfo \- Reports structure and content of a multidimensional dataset . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDALMDIMINFO" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdalmdiminfo \- Reports structure and content of a multidimensional dataset .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -129,102 +129,102 @@ .nf .ft C { - "type": "group", - "name": "/", - "attributes": { - "Conventions": "CF\-1.5" + \(dqtype\(dq: \(dqgroup\(dq, + \(dqname\(dq: \(dq/\(dq, + \(dqattributes\(dq: { + \(dqConventions\(dq: \(dqCF\-1.5\(dq }, - "dimensions": [ + \(dqdimensions\(dq: [ { - "name": "levelist", - "full_name": "/levelist", - "size": 2, - "type": "VERTICAL", - "indexing_variable": "/levelist" + \(dqname\(dq: \(dqlevelist\(dq, + \(dqfull_name\(dq: \(dq/levelist\(dq, + \(dqsize\(dq: 2, + \(dqtype\(dq: \(dqVERTICAL\(dq, + \(dqindexing_variable\(dq: \(dq/levelist\(dq }, { - "name": "longitude", - "full_name": "/longitude", - "size": 10, - "type": "HORIZONTAL_X", - "direction": "EAST", - "indexing_variable": "/longitude" + \(dqname\(dq: \(dqlongitude\(dq, + \(dqfull_name\(dq: \(dq/longitude\(dq, + \(dqsize\(dq: 10, + \(dqtype\(dq: \(dqHORIZONTAL_X\(dq, + \(dqdirection\(dq: \(dqEAST\(dq, + \(dqindexing_variable\(dq: \(dq/longitude\(dq }, { - "name": "latitude", - "full_name": "/latitude", - "size": 10, - "type": "HORIZONTAL_Y", - "direction": "NORTH", - "indexing_variable": "/latitude" + \(dqname\(dq: \(dqlatitude\(dq, + \(dqfull_name\(dq: \(dq/latitude\(dq, + \(dqsize\(dq: 10, + \(dqtype\(dq: \(dqHORIZONTAL_Y\(dq, + \(dqdirection\(dq: \(dqNORTH\(dq, + \(dqindexing_variable\(dq: \(dq/latitude\(dq }, { - "name": "time", - "full_name": "/time", - "size": 4, - "type": "TEMPORAL", - "indexing_variable": "/time" + \(dqname\(dq: \(dqtime\(dq, + \(dqfull_name\(dq: \(dq/time\(dq, + \(dqsize\(dq: 4, + \(dqtype\(dq: \(dqTEMPORAL\(dq, + \(dqindexing_variable\(dq: \(dq/time\(dq } ], - "arrays": { - "levelist": { - "datatype": "Int32", - "dimensions": [ - "/levelist" + \(dqarrays\(dq: { + \(dqlevelist\(dq: { + \(dqdatatype\(dq: \(dqInt32\(dq, + \(dqdimensions\(dq: [ + \(dq/levelist\(dq ], - "attributes": { - "long_name": "pressure_level" + \(dqattributes\(dq: { + \(dqlong_name\(dq: \(dqpressure_level\(dq }, - "unit": "millibars" + \(dqunit\(dq: \(dqmillibars\(dq }, - "longitude": { - "datatype": "Float32", - "dimensions": [ - "/longitude" + \(dqlongitude\(dq: { + \(dqdatatype\(dq: \(dqFloat32\(dq, + \(dqdimensions\(dq: [ + \(dq/longitude\(dq ], - "attributes": { - "standard_name": "longitude", - "long_name": "longitude", - "axis": "X" + \(dqattributes\(dq: { + \(dqstandard_name\(dq: \(dqlongitude\(dq, + \(dqlong_name\(dq: \(dqlongitude\(dq, + \(dqaxis\(dq: \(dqX\(dq }, - "unit": "degrees_east" + \(dqunit\(dq: \(dqdegrees_east\(dq }, - "latitude": { - "datatype": "Float32", - "dimensions": [ - "/latitude" + \(dqlatitude\(dq: { + \(dqdatatype\(dq: \(dqFloat32\(dq, + \(dqdimensions\(dq: [ + \(dq/latitude\(dq ], - "attributes": { - "standard_name": "latitude", - "long_name": "latitude", - "axis": "Y" + \(dqattributes\(dq: { + \(dqstandard_name\(dq: \(dqlatitude\(dq, + \(dqlong_name\(dq: \(dqlatitude\(dq, + \(dqaxis\(dq: \(dqY\(dq }, - "unit": "degrees_north" + \(dqunit\(dq: \(dqdegrees_north\(dq }, - "time": { - "datatype": "Float64", - "dimensions": [ - "/time" + \(dqtime\(dq: { + \(dqdatatype\(dq: \(dqFloat64\(dq, + \(dqdimensions\(dq: [ + \(dq/time\(dq ], - "attributes": { - "standard_name": "time", - "calendar": "standard" + \(dqattributes\(dq: { + \(dqstandard_name\(dq: \(dqtime\(dq, + \(dqcalendar\(dq: \(dqstandard\(dq }, - "unit": "hours since 1900\-01\-01 00:00:00" + \(dqunit\(dq: \(dqhours since 1900\-01\-01 00:00:00\(dq }, - "t": { - "datatype": "Int32", - "dimensions": [ - "/time", - "/levelist", - "/latitude", - "/longitude" + \(dqt\(dq: { + \(dqdatatype\(dq: \(dqInt32\(dq, + \(dqdimensions\(dq: [ + \(dq/time\(dq, + \(dq/levelist\(dq, + \(dq/latitude\(dq, + \(dq/longitude\(dq ], - "nodata_value": \-32767 + \(dqnodata_value\(dq: \-32767 } }, - "structural_info": { - "NC_FORMAT": "CLASSIC" + \(dqstructural_info\(dq: { + \(dqNC_FORMAT\(dq: \(dqCLASSIC\(dq } } .ft P diff -Nru gdal-3.6.2+dfsg/man/man1/gdalmdimtranslate.1 gdal-3.6.4+dfsg/man/man1/gdalmdimtranslate.1 --- gdal-3.6.2+dfsg/man/man1/gdalmdimtranslate.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdalmdimtranslate.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDALMDIMTRANSLATE" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdalmdimtranslate \- Converts multidimensional data between different formats, and perform subsetting. . .nr rst2man-indent-level 0 . @@ -30,13 +27,16 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDALMDIMTRANSLATE" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdalmdimtranslate \- Converts multidimensional data between different formats, and perform subsetting. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C -gdalmdimtranslate [\-\-help\-general] [\-co "NAME=VALUE"]* +gdalmdimtranslate [\-\-help\-general] [\-co \(dqNAME=VALUE\(dq]* [\-if format]* [\-of format] [\-array ]* [\-group ]* @@ -70,7 +70,7 @@ .TP .B \-of Select the output format. This can be a format that supports multidimensional -output (such as \fI\%NetCDF: Network Common Data Form\fP, \fI\%Multidimensional VRT\fP), or a "classic" 2D formats, if only one single 2D array +output (such as \fI\%NetCDF: Network Common Data Form\fP, \fI\%Multidimensional VRT\fP), or a \(dqclassic\(dq 2D formats, if only one single 2D array results of the other specified conversion operations. When this option is not specified, the format is guessed when possible from the extension of the destination filename. @@ -204,7 +204,7 @@ .sp .nf .ft C -$ gdalmdimtranslate in.nc out.tif \-subset \(aqtime("2010\-01\-01")\(aq \-array temperature +$ gdalmdimtranslate in.nc out.tif \-subset \(aqtime(\(dq2010\-01\-01\(dq)\(aq \-array temperature .ft P .fi .UNINDENT @@ -218,7 +218,7 @@ .sp .nf .ft C -$ gdalmdimtranslate in.nc out.nc \-scaleaxes "X(2),Y(2)" +$ gdalmdimtranslate in.nc out.nc \-scaleaxes \(dqX(2),Y(2)\(dq .ft P .fi .UNINDENT @@ -233,7 +233,7 @@ .sp .nf .ft C -$ gdalmdimtranslate in.nc out.nc \-array "name=temperature,view=[:,::\-1,:]" +$ gdalmdimtranslate in.nc out.nc \-array \(dqname=temperature,view=[:,::\-1,:]\(dq .ft P .fi .UNINDENT @@ -247,7 +247,7 @@ .sp .nf .ft C -$ gdalmdimtranslate in.nc out.nc \-array "name=temperature,transpose=[2,1,0]" +$ gdalmdimtranslate in.nc out.nc \-array \(dqname=temperature,transpose=[2,1,0]\(dq .ft P .fi .UNINDENT diff -Nru gdal-3.6.2+dfsg/man/man1/gdal_merge.1 gdal-3.6.4+dfsg/man/man1/gdal_merge.1 --- gdal-3.6.2+dfsg/man/man1/gdal_merge.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal_merge.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL_MERGE" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal_merge \- Mosaics a set of images. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL_MERGE" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal_merge \- Mosaics a set of images. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -38,7 +38,7 @@ .ft C gdal_merge.py [\-o out_filename] [\-of out_format] [\-co NAME=VALUE]* [\-ps pixelsize_x pixelsize_y] [\-tap] [\-separate] [\-q] [\-v] [\-pct] - [\-ul_lr ulx uly lrx lry] [\-init "value [value...]"] + [\-ul_lr ulx uly lrx lry] [\-init \(dqvalue [value...]\(dq] [\-n nodata_value] [\-a_nodata output_nodata_value] [\-ot datatype] [\-createonly] input_files .ft P @@ -58,7 +58,7 @@ .TP .B \-o The name of the output file, -which will be created if it does not already exist (defaults to "out.tif"). +which will be created if it does not already exist (defaults to \(dqout.tif\(dq). .UNINDENT .INDENT 0.0 .TP @@ -143,7 +143,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \-init <"value(s)"> +.B \-init <\(dqvalue(s)\(dq> Pre\-initialize the output image bands with these values. However, it is not marked as the nodata value in the output file. If only one value is given, the same value is used in all the bands. @@ -183,7 +183,7 @@ .sp .nf .ft C -gdal_merge.py \-init "0 0 255" \-o out.tif in1.tif in2.tif +gdal_merge.py \-init \(dq0 0 255\(dq \-o out.tif in1.tif in2.tif .ft P .fi .UNINDENT diff -Nru gdal-3.6.2+dfsg/man/man1/gdalmove.1 gdal-3.6.4+dfsg/man/man1/gdalmove.1 --- gdal-3.6.2+dfsg/man/man1/gdalmove.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdalmove.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDALMOVE" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdalmove \- Transform georeferencing of raster file in place. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDALMOVE" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdalmove \- Transform georeferencing of raster file in place. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 diff -Nru gdal-3.6.2+dfsg/man/man1/gdal_pansharpen.1 gdal-3.6.4+dfsg/man/man1/gdal_pansharpen.1 --- gdal-3.6.2+dfsg/man/man1/gdal_pansharpen.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal_pansharpen.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL_PANSHARPEN" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal_pansharpen \- Perform a pansharpen operation. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL_PANSHARPEN" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal_pansharpen \- Perform a pansharpen operation. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -49,7 +49,7 @@ .SH DESCRIPTION .sp The \fBgdal_pansharpen.py\fP script performs a pan\-sharpening operation. It -can create a "classic" output dataset (such as GeoTIFF), or a VRT +can create a \(dqclassic\(dq output dataset (such as GeoTIFF), or a VRT dataset describing the pan\-sharpening operation. .sp More details can be found in the \fI\%Pansharpened VRT\fP section. diff -Nru gdal-3.6.2+dfsg/man/man1/gdal_polygonize.1 gdal-3.6.4+dfsg/man/man1/gdal_polygonize.1 --- gdal-3.6.2+dfsg/man/man1/gdal_polygonize.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal_polygonize.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL_POLYGONIZE" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal_polygonize \- Produces a polygon feature layer from a raster. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL_POLYGONIZE" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal_polygonize \- Produces a polygon feature layer from a raster. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -81,9 +81,9 @@ .TP .B \-b The band on to build -the polygons from. Starting with GDAL 2.2, the value can also be set to "mask", +the polygons from. Starting with GDAL 2.2, the value can also be set to \(dqmask\(dq, to indicate that the mask band of the first band must be used (or -"mask,band_number" for the mask of a specified band) +\(dqmask,band_number\(dq for the mask of a specified band) .UNINDENT .INDENT 0.0 .TP @@ -105,7 +105,7 @@ .INDENT 0.0 .TP .B -The name of the field to create (defaults to "DN"). +The name of the field to create (defaults to \(dqDN\(dq). .UNINDENT .INDENT 0.0 .TP diff -Nru gdal-3.6.2+dfsg/man/man1/gdal_proximity.1 gdal-3.6.4+dfsg/man/man1/gdal_proximity.1 --- gdal-3.6.2+dfsg/man/man1/gdal_proximity.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal_proximity.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL_PROXIMITY" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal_proximity \- Produces a raster proximity map. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL_PROXIMITY" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal_proximity \- Produces a raster proximity map. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 diff -Nru gdal-3.6.2+dfsg/man/man1/gdal_rasterize.1 gdal-3.6.4+dfsg/man/man1/gdal_rasterize.1 --- gdal-3.6.2+dfsg/man/man1/gdal_rasterize.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal_rasterize.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL_RASTERIZE" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal_rasterize \- Burns vector geometries into a raster. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL_RASTERIZE" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal_rasterize \- Burns vector geometries into a raster. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -40,7 +40,7 @@ {[\-burn value]* | [\-a attribute_name] | [\-3d]} [\-add] [\-l layername]* [\-where expression] [\-sql select_statement] [\-dialect dialect] [\-of format] [\-a_srs srs_def] [\-to NAME=VALUE]* - [\-co "NAME=VALUE"]* [\-a_nodata value] [\-init value]* + [\-co \(dqNAME=VALUE\(dq]* [\-a_nodata value] [\-init value]* [\-te xmin ymin xmax ymax] [\-tr xres yres] [\-tap] [\-ts width height] [\-ot {Byte/Int16/UInt16/UInt32/Int32/UInt64/Int64/Float32/Float64/ CInt16/CInt32/CFloat32/CFloat64}] @@ -95,7 +95,7 @@ .INDENT 0.0 .TP .B \-3d -Indicates that a burn value should be extracted from the "Z" values of the +Indicates that a burn value should be extracted from the \(dqZ\(dq values of the feature. Works with points and lines (linear interpolation along each segment). For polygons, works properly only if the are flat (same Z value for all vertices). @@ -130,7 +130,7 @@ .B \-dialect SQL dialect. In some cases can be used to use (unoptimized) OGR SQL instead of the native SQL of an RDBMS by passing OGRSQL. The -"SQLITE" dialect can also be used with any datasource. +\(dqSQLITE\(dq dialect can also be used with any datasource. .sp New in version 2.1. @@ -282,14 +282,14 @@ .UNINDENT .UNINDENT .sp -The following would burn all "class A" buildings into the output elevation +The following would burn all \(dqclass A\(dq buildings into the output elevation file, pulling the top elevation from the ROOF_H attribute. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C -gdal_rasterize \-a ROOF_H \-where "class=\(aqA\(aq" \-l footprints footprints.shp city_dem.tif +gdal_rasterize \-a ROOF_H \-where \(dqclass=\(aqA\(aq\(dq \-l footprints footprints.shp city_dem.tif .ft P .fi .UNINDENT diff -Nru gdal-3.6.2+dfsg/man/man1/gdal_retile.1 gdal-3.6.4+dfsg/man/man1/gdal_retile.1 --- gdal-3.6.2+dfsg/man/man1/gdal_retile.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal_retile.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL_RETILE" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal_retile \- Retiles a set of tiles and/or build tiled pyramid levels. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL_RETILE" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal_retile \- Retiles a set of tiles and/or build tiled pyramid levels. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -166,7 +166,7 @@ .INDENT 0.0 .TP .B \-csvDelim -The column delimiter used in the CSV file, default value is a semicolon ";" +The column delimiter used in the CSV file, default value is a semicolon \(dq;\(dq .UNINDENT .INDENT 0.0 .TP diff -Nru gdal-3.6.2+dfsg/man/man1/gdal_sieve.1 gdal-3.6.4+dfsg/man/man1/gdal_sieve.1 --- gdal-3.6.2+dfsg/man/man1/gdal_sieve.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal_sieve.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL_SIEVE" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal_sieve \- Removes small raster polygons. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL_SIEVE" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal_sieve \- Removes small raster polygons. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 diff -Nru gdal-3.6.2+dfsg/man/man1/gdalsrsinfo.1 gdal-3.6.4+dfsg/man/man1/gdalsrsinfo.1 --- gdal-3.6.2+dfsg/man/man1/gdalsrsinfo.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdalsrsinfo.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDALSRSINFO" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdalsrsinfo \- Lists info about a given SRS in number of formats (WKT, PROJ.4, etc.) . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDALSRSINFO" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdalsrsinfo \- Lists info about a given SRS in number of formats (WKT, PROJ.4, etc.) .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -119,16 +119,16 @@ PROJ.4 : +proj=longlat +datum=WGS84 +no_defs OGC WKT : -GEOGCS["WGS 84", - DATUM["WGS_1984", - SPHEROID["WGS 84",6378137,298.257223563, - AUTHORITY["EPSG","7030"]], - AUTHORITY["EPSG","6326"]], - PRIMEM["Greenwich",0, - AUTHORITY["EPSG","8901"]], - UNIT["degree",0.0174532925199433, - AUTHORITY["EPSG","9122"]], - AUTHORITY["EPSG","4326"]] +GEOGCS[\(dqWGS 84\(dq, + DATUM[\(dqWGS_1984\(dq, + SPHEROID[\(dqWGS 84\(dq,6378137,298.257223563, + AUTHORITY[\(dqEPSG\(dq,\(dq7030\(dq]], + AUTHORITY[\(dqEPSG\(dq,\(dq6326\(dq]], + PRIMEM[\(dqGreenwich\(dq,0, + AUTHORITY[\(dqEPSG\(dq,\(dq8901\(dq]], + UNIT[\(dqdegree\(dq,0.0174532925199433, + AUTHORITY[\(dqEPSG\(dq,\(dq9122\(dq]], + AUTHORITY[\(dqEPSG\(dq,\(dq4326\(dq]] .ft P .fi .UNINDENT @@ -161,45 +161,45 @@ .sp .nf .ft C -$ gdalsrsinfo \-o wkt "EPSG:32722" +$ gdalsrsinfo \-o wkt \(dqEPSG:32722\(dq -PROJCRS["WGS 84 / UTM zone 22S", - BASEGEOGCRS["WGS 84", - DATUM["World Geodetic System 1984", - ELLIPSOID["WGS 84",6378137,298.257223563, - LENGTHUNIT["metre",1]]], - PRIMEM["Greenwich",0, - ANGLEUNIT["degree",0.0174532925199433]]], - CONVERSION["UTM zone 22S", - METHOD["Transverse Mercator", - ID["EPSG",9807]], - PARAMETER["Latitude of natural origin",0, - ANGLEUNIT["degree",0.0174532925199433], - ID["EPSG",8801]], - PARAMETER["Longitude of natural origin",\-51, - ANGLEUNIT["degree",0.0174532925199433], - ID["EPSG",8802]], - PARAMETER["Scale factor at natural origin",0.9996, - SCALEUNIT["unity",1], - ID["EPSG",8805]], - PARAMETER["False easting",500000, - LENGTHUNIT["metre",1], - ID["EPSG",8806]], - PARAMETER["False northing",10000000, - LENGTHUNIT["metre",1], - ID["EPSG",8807]]], +PROJCRS[\(dqWGS 84 / UTM zone 22S\(dq, + BASEGEOGCRS[\(dqWGS 84\(dq, + DATUM[\(dqWorld Geodetic System 1984\(dq, + ELLIPSOID[\(dqWGS 84\(dq,6378137,298.257223563, + LENGTHUNIT[\(dqmetre\(dq,1]]], + PRIMEM[\(dqGreenwich\(dq,0, + ANGLEUNIT[\(dqdegree\(dq,0.0174532925199433]]], + CONVERSION[\(dqUTM zone 22S\(dq, + METHOD[\(dqTransverse Mercator\(dq, + ID[\(dqEPSG\(dq,9807]], + PARAMETER[\(dqLatitude of natural origin\(dq,0, + ANGLEUNIT[\(dqdegree\(dq,0.0174532925199433], + ID[\(dqEPSG\(dq,8801]], + PARAMETER[\(dqLongitude of natural origin\(dq,\-51, + ANGLEUNIT[\(dqdegree\(dq,0.0174532925199433], + ID[\(dqEPSG\(dq,8802]], + PARAMETER[\(dqScale factor at natural origin\(dq,0.9996, + SCALEUNIT[\(dqunity\(dq,1], + ID[\(dqEPSG\(dq,8805]], + PARAMETER[\(dqFalse easting\(dq,500000, + LENGTHUNIT[\(dqmetre\(dq,1], + ID[\(dqEPSG\(dq,8806]], + PARAMETER[\(dqFalse northing\(dq,10000000, + LENGTHUNIT[\(dqmetre\(dq,1], + ID[\(dqEPSG\(dq,8807]]], CS[Cartesian,2], - AXIS["(E)",east, + AXIS[\(dq(E)\(dq,east, ORDER[1], - LENGTHUNIT["metre",1]], - AXIS["(N)",north, + LENGTHUNIT[\(dqmetre\(dq,1]], + AXIS[\(dq(N)\(dq,north, ORDER[2], - LENGTHUNIT["metre",1]], + LENGTHUNIT[\(dqmetre\(dq,1]], USAGE[ - SCOPE["unknown"], - AREA["World \- S hemisphere \- 54°W to 48°W \- by country"], + SCOPE[\(dqunknown\(dq], + AREA[\(dqWorld \- S hemisphere \- 54°W to 48°W \- by country\(dq], BBOX[\-80,\-54,0,\-48]], - ID["EPSG",32722]] + ID[\(dqEPSG\(dq,32722]] .ft P .fi .UNINDENT @@ -209,157 +209,157 @@ .sp .nf .ft C -$ gdalsrsinfo \-o wkt_all "EPSG:4322" +$ gdalsrsinfo \-o wkt_all \(dqEPSG:4322\(dq OGC WKT 1: -GEOGCS["WGS 72", - DATUM["World_Geodetic_System_1972", - SPHEROID["WGS 72",6378135,298.26, - AUTHORITY["EPSG","7043"]], +GEOGCS[\(dqWGS 72\(dq, + DATUM[\(dqWorld_Geodetic_System_1972\(dq, + SPHEROID[\(dqWGS 72\(dq,6378135,298.26, + AUTHORITY[\(dqEPSG\(dq,\(dq7043\(dq]], TOWGS84[0,0,4.5,0,0,0.554,0.2263], - AUTHORITY["EPSG","6322"]], - PRIMEM["Greenwich",0, - AUTHORITY["EPSG","8901"]], - UNIT["degree",0.0174532925199433, - AUTHORITY["EPSG","9122"]], - AXIS["Latitude",NORTH], - AXIS["Longitude",EAST], - AUTHORITY["EPSG","4322"]] + AUTHORITY[\(dqEPSG\(dq,\(dq6322\(dq]], + PRIMEM[\(dqGreenwich\(dq,0, + AUTHORITY[\(dqEPSG\(dq,\(dq8901\(dq]], + UNIT[\(dqdegree\(dq,0.0174532925199433, + AUTHORITY[\(dqEPSG\(dq,\(dq9122\(dq]], + AXIS[\(dqLatitude\(dq,NORTH], + AXIS[\(dqLongitude\(dq,EAST], + AUTHORITY[\(dqEPSG\(dq,\(dq4322\(dq]] OGC WKT2:2015 : BOUNDCRS[ SOURCECRS[ - GEODCRS["WGS 72", - DATUM["World Geodetic System 1972", - ELLIPSOID["WGS 72",6378135,298.26, - LENGTHUNIT["metre",1]]], - PRIMEM["Greenwich",0, - ANGLEUNIT["degree",0.0174532925199433]], + GEODCRS[\(dqWGS 72\(dq, + DATUM[\(dqWorld Geodetic System 1972\(dq, + ELLIPSOID[\(dqWGS 72\(dq,6378135,298.26, + LENGTHUNIT[\(dqmetre\(dq,1]]], + PRIMEM[\(dqGreenwich\(dq,0, + ANGLEUNIT[\(dqdegree\(dq,0.0174532925199433]], CS[ellipsoidal,2], - AXIS["geodetic latitude (Lat)",north, + AXIS[\(dqgeodetic latitude (Lat)\(dq,north, ORDER[1], - ANGLEUNIT["degree",0.0174532925199433]], - AXIS["geodetic longitude (Lon)",east, + ANGLEUNIT[\(dqdegree\(dq,0.0174532925199433]], + AXIS[\(dqgeodetic longitude (Lon)\(dq,east, ORDER[2], - ANGLEUNIT["degree",0.0174532925199433]], - AREA["World"], + ANGLEUNIT[\(dqdegree\(dq,0.0174532925199433]], + AREA[\(dqWorld\(dq], BBOX[\-90,\-180,90,180], - ID["EPSG",4322]]], + ID[\(dqEPSG\(dq,4322]]], TARGETCRS[ - GEODCRS["WGS 84", - DATUM["World Geodetic System 1984", - ELLIPSOID["WGS 84",6378137,298.257223563, - LENGTHUNIT["metre",1]]], - PRIMEM["Greenwich",0, - ANGLEUNIT["degree",0.0174532925199433]], + GEODCRS[\(dqWGS 84\(dq, + DATUM[\(dqWorld Geodetic System 1984\(dq, + ELLIPSOID[\(dqWGS 84\(dq,6378137,298.257223563, + LENGTHUNIT[\(dqmetre\(dq,1]]], + PRIMEM[\(dqGreenwich\(dq,0, + ANGLEUNIT[\(dqdegree\(dq,0.0174532925199433]], CS[ellipsoidal,2], - AXIS["latitude",north, + AXIS[\(dqlatitude\(dq,north, ORDER[1], - ANGLEUNIT["degree",0.0174532925199433]], - AXIS["longitude",east, + ANGLEUNIT[\(dqdegree\(dq,0.0174532925199433]], + AXIS[\(dqlongitude\(dq,east, ORDER[2], - ANGLEUNIT["degree",0.0174532925199433]], - ID["EPSG",4326]]], - ABRIDGEDTRANSFORMATION["WGS 72 to WGS 84 (1)", - METHOD["Position Vector transformation (geog2D domain)", - ID["EPSG",9606]], - PARAMETER["X\-axis translation",0, - ID["EPSG",8605]], - PARAMETER["Y\-axis translation",0, - ID["EPSG",8606]], - PARAMETER["Z\-axis translation",4.5, - ID["EPSG",8607]], - PARAMETER["X\-axis rotation",0, - ID["EPSG",8608]], - PARAMETER["Y\-axis rotation",0, - ID["EPSG",8609]], - PARAMETER["Z\-axis rotation",0.554, - ID["EPSG",8610]], - PARAMETER["Scale difference",1.0000002263, - ID["EPSG",8611]], - AREA["World"], + ANGLEUNIT[\(dqdegree\(dq,0.0174532925199433]], + ID[\(dqEPSG\(dq,4326]]], + ABRIDGEDTRANSFORMATION[\(dqWGS 72 to WGS 84 (1)\(dq, + METHOD[\(dqPosition Vector transformation (geog2D domain)\(dq, + ID[\(dqEPSG\(dq,9606]], + PARAMETER[\(dqX\-axis translation\(dq,0, + ID[\(dqEPSG\(dq,8605]], + PARAMETER[\(dqY\-axis translation\(dq,0, + ID[\(dqEPSG\(dq,8606]], + PARAMETER[\(dqZ\-axis translation\(dq,4.5, + ID[\(dqEPSG\(dq,8607]], + PARAMETER[\(dqX\-axis rotation\(dq,0, + ID[\(dqEPSG\(dq,8608]], + PARAMETER[\(dqY\-axis rotation\(dq,0, + ID[\(dqEPSG\(dq,8609]], + PARAMETER[\(dqZ\-axis rotation\(dq,0.554, + ID[\(dqEPSG\(dq,8610]], + PARAMETER[\(dqScale difference\(dq,1.0000002263, + ID[\(dqEPSG\(dq,8611]], + AREA[\(dqWorld\(dq], BBOX[\-90,\-180,90,180], - ID["EPSG",1237]]] + ID[\(dqEPSG\(dq,1237]]] OGC WKT2:2019 : BOUNDCRS[ SOURCECRS[ - GEOGCRS["WGS 72", - DATUM["World Geodetic System 1972", - ELLIPSOID["WGS 72",6378135,298.26, - LENGTHUNIT["metre",1]]], - PRIMEM["Greenwich",0, - ANGLEUNIT["degree",0.0174532925199433]], + GEOGCRS[\(dqWGS 72\(dq, + DATUM[\(dqWorld Geodetic System 1972\(dq, + ELLIPSOID[\(dqWGS 72\(dq,6378135,298.26, + LENGTHUNIT[\(dqmetre\(dq,1]]], + PRIMEM[\(dqGreenwich\(dq,0, + ANGLEUNIT[\(dqdegree\(dq,0.0174532925199433]], CS[ellipsoidal,2], - AXIS["geodetic latitude (Lat)",north, + AXIS[\(dqgeodetic latitude (Lat)\(dq,north, ORDER[1], - ANGLEUNIT["degree",0.0174532925199433]], - AXIS["geodetic longitude (Lon)",east, + ANGLEUNIT[\(dqdegree\(dq,0.0174532925199433]], + AXIS[\(dqgeodetic longitude (Lon)\(dq,east, ORDER[2], - ANGLEUNIT["degree",0.0174532925199433]], + ANGLEUNIT[\(dqdegree\(dq,0.0174532925199433]], USAGE[ - SCOPE["unknown"], - AREA["World"], + SCOPE[\(dqunknown\(dq], + AREA[\(dqWorld\(dq], BBOX[\-90,\-180,90,180]], - ID["EPSG",4322]]], + ID[\(dqEPSG\(dq,4322]]], TARGETCRS[ - GEOGCRS["WGS 84", - DATUM["World Geodetic System 1984", - ELLIPSOID["WGS 84",6378137,298.257223563, - LENGTHUNIT["metre",1]]], - PRIMEM["Greenwich",0, - ANGLEUNIT["degree",0.0174532925199433]], + GEOGCRS[\(dqWGS 84\(dq, + DATUM[\(dqWorld Geodetic System 1984\(dq, + ELLIPSOID[\(dqWGS 84\(dq,6378137,298.257223563, + LENGTHUNIT[\(dqmetre\(dq,1]]], + PRIMEM[\(dqGreenwich\(dq,0, + ANGLEUNIT[\(dqdegree\(dq,0.0174532925199433]], CS[ellipsoidal,2], - AXIS["latitude",north, + AXIS[\(dqlatitude\(dq,north, ORDER[1], - ANGLEUNIT["degree",0.0174532925199433]], - AXIS["longitude",east, + ANGLEUNIT[\(dqdegree\(dq,0.0174532925199433]], + AXIS[\(dqlongitude\(dq,east, ORDER[2], - ANGLEUNIT["degree",0.0174532925199433]], - ID["EPSG",4326]]], - ABRIDGEDTRANSFORMATION["WGS 72 to WGS 84 (1)", - METHOD["Position Vector transformation (geog2D domain)", - ID["EPSG",9606]], - PARAMETER["X\-axis translation",0, - ID["EPSG",8605]], - PARAMETER["Y\-axis translation",0, - ID["EPSG",8606]], - PARAMETER["Z\-axis translation",4.5, - ID["EPSG",8607]], - PARAMETER["X\-axis rotation",0, - ID["EPSG",8608]], - PARAMETER["Y\-axis rotation",0, - ID["EPSG",8609]], - PARAMETER["Z\-axis rotation",0.554, - ID["EPSG",8610]], - PARAMETER["Scale difference",1.0000002263, - ID["EPSG",8611]], + ANGLEUNIT[\(dqdegree\(dq,0.0174532925199433]], + ID[\(dqEPSG\(dq,4326]]], + ABRIDGEDTRANSFORMATION[\(dqWGS 72 to WGS 84 (1)\(dq, + METHOD[\(dqPosition Vector transformation (geog2D domain)\(dq, + ID[\(dqEPSG\(dq,9606]], + PARAMETER[\(dqX\-axis translation\(dq,0, + ID[\(dqEPSG\(dq,8605]], + PARAMETER[\(dqY\-axis translation\(dq,0, + ID[\(dqEPSG\(dq,8606]], + PARAMETER[\(dqZ\-axis translation\(dq,4.5, + ID[\(dqEPSG\(dq,8607]], + PARAMETER[\(dqX\-axis rotation\(dq,0, + ID[\(dqEPSG\(dq,8608]], + PARAMETER[\(dqY\-axis rotation\(dq,0, + ID[\(dqEPSG\(dq,8609]], + PARAMETER[\(dqZ\-axis rotation\(dq,0.554, + ID[\(dqEPSG\(dq,8610]], + PARAMETER[\(dqScale difference\(dq,1.0000002263, + ID[\(dqEPSG\(dq,8611]], USAGE[ - SCOPE["unknown"], - AREA["World"], + SCOPE[\(dqunknown\(dq], + AREA[\(dqWorld\(dq], BBOX[\-90,\-180,90,180]], - ID["EPSG",1237]]] + ID[\(dqEPSG\(dq,1237]]] OGC WKT 1 (simple) : -GEOGCS["WGS 72", - DATUM["World_Geodetic_System_1972", - SPHEROID["WGS 72",6378135,298.26], +GEOGCS[\(dqWGS 72\(dq, + DATUM[\(dqWorld_Geodetic_System_1972\(dq, + SPHEROID[\(dqWGS 72\(dq,6378135,298.26], TOWGS84[0,0,4.5,0,0,0.554,0.2263]], - PRIMEM["Greenwich",0], - UNIT["degree",0.0174532925199433]] + PRIMEM[\(dqGreenwich\(dq,0], + UNIT[\(dqdegree\(dq,0.0174532925199433]] OGC WKT 1 (no CT) : -GEOGCS["WGS 72", - DATUM["World_Geodetic_System_1972", - SPHEROID["WGS 72",6378135,298.26]], - PRIMEM["Greenwich",0], - UNIT["degree",0.0174532925199433]] +GEOGCS[\(dqWGS 72\(dq, + DATUM[\(dqWorld_Geodetic_System_1972\(dq, + SPHEROID[\(dqWGS 72\(dq,6378135,298.26]], + PRIMEM[\(dqGreenwich\(dq,0], + UNIT[\(dqdegree\(dq,0.0174532925199433]] ESRI WKT : -GEOGCS["GCS_WGS_1972", - DATUM["D_WGS_1972", - SPHEROID["WGS_1972",6378135.0,298.26]], - PRIMEM["Greenwich",0.0], - UNIT["Degree",0.0174532925199433]] +GEOGCS[\(dqGCS_WGS_1972\(dq, + DATUM[\(dqD_WGS_1972\(dq, + SPHEROID[\(dqWGS_1972\(dq,6378135.0,298.26]], + PRIMEM[\(dqGreenwich\(dq,0.0], + UNIT[\(dqDegree\(dq,0.0174532925199433]] .ft P .fi .UNINDENT diff -Nru gdal-3.6.2+dfsg/man/man1/gdaltindex.1 gdal-3.6.4+dfsg/man/man1/gdaltindex.1 --- gdal-3.6.2+dfsg/man/man1/gdaltindex.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdaltindex.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDALTINDEX" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdaltindex \- Builds a shapefile as a raster tileindex. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDALTINDEX" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdaltindex \- Builds a shapefile as a raster tileindex. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 diff -Nru gdal-3.6.2+dfsg/man/man1/gdaltransform.1 gdal-3.6.4+dfsg/man/man1/gdaltransform.1 --- gdal-3.6.2+dfsg/man/man1/gdaltransform.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdaltransform.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDALTRANSFORM" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdaltransform \- Transforms coordinates. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDALTRANSFORM" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdaltransform \- Transforms coordinates. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -37,7 +37,7 @@ .nf .ft C gdaltransform [\-\-help\-general] - [\-i] [\-s_srs srs_def] [\-t_srs srs_def] [\-to "NAME=VALUE"] + [\-i] [\-s_srs srs_def] [\-t_srs srs_def] [\-to \(dqNAME=VALUE\(dq] [\-ct proj_string] [\-order n] [\-tps] [\-rpc] [\-geoloc] [\-gcp pixel line easting northing [elevation]]* [\-output_xy] [srcfile [dstfile]] @@ -118,7 +118,7 @@ .INDENT 0.0 .TP .B \-output_xy -Restrict output to "x y" instead of "x y z" +Restrict output to \(dqx y\(dq instead of \(dqx y z\(dq .UNINDENT .INDENT 0.0 .TP @@ -160,8 +160,8 @@ .UNINDENT .UNINDENT .sp -Produces the following output in meters in the "Belge 1972 / Belgian Lambert -72" projection: +Produces the following output in meters in the \(dqBelge 1972 / Belgian Lambert +72\(dq projection: .INDENT 0.0 .INDENT 3.5 .sp @@ -210,12 +210,12 @@ .sp .nf .ft C -gdaltransform \-ct "+proj=pipeline +step +proj=unitconvert +xy_in=deg \e +gdaltransform \-ct \(dq+proj=pipeline +step +proj=unitconvert +xy_in=deg \e +xy_out=rad +step +proj=cart +step +proj=helmert +convention=position_vector \e +x=0.0127 +dx=\-0.0029 +rx=\-0.00039 +drx=\-0.00011 +y=0.0065 +dy=\-0.0002 \e +ry=0.00080 +dry=\-0.00019 +z=\-0.0209 +dz=\-0.0006 +rz=\-0.00114 +drz=0.00007 \e +s=0.00195 +ds=0.00001 +t_epoch=1988.0 +step +proj=cart +inv +step \e -+proj=unitconvert +xy_in=rad +xy_out=deg" ++proj=unitconvert +xy_in=rad +xy_out=deg\(dq 2 49 0 2000 .ft P .fi diff -Nru gdal-3.6.2+dfsg/man/man1/gdal_translate.1 gdal-3.6.4+dfsg/man/man1/gdal_translate.1 --- gdal-3.6.2+dfsg/man/man1/gdal_translate.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal_translate.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL_TRANSLATE" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal_translate \- Converts raster data between different formats. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL_TRANSLATE" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal_translate \- Converts raster data between different formats. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -53,8 +53,8 @@ [\-nogcp] [\-gcp pixel line easting northing [elevation]]* |\-colorinterp{_bn} {red|green|blue|alpha|gray|undefined}] |\-colorinterp {red|green|blue|alpha|gray|undefined},...] - [\-mo "META\-TAG=VALUE"]* [\-q] [\-sds] - [\-co "NAME=VALUE"]* [\-stats] [\-norat] [\-noxmp] + [\-mo \(dqMETA\-TAG=VALUE\(dq]* [\-q] [\-sds] + [\-co \(dqNAME=VALUE\(dq]* [\-stats] [\-norat] [\-noxmp] [\-oo NAME=VALUE]* src_dataset dst_dataset .ft P @@ -104,18 +104,18 @@ Select an input band \fBband\fP for output. Bands are numbered from 1. Multiple \fI\%\-b\fP switches may be used to select a set of input bands to write to the output file, or to reorder bands. \fBband\fP can also be set -to "mask,1" (or just "mask") to mean the mask band of the first band of the +to \(dqmask,1\(dq (or just \(dqmask\(dq) to mean the mask band of the first band of the input dataset. .UNINDENT .INDENT 0.0 .TP .B \-mask Select an input band \fBband\fP to create output dataset mask band. Bands are -numbered from 1. \fBband\fP can be set to "none" to avoid copying the global +numbered from 1. \fBband\fP can be set to \(dqnone\(dq to avoid copying the global mask of the input dataset if it exists. Otherwise it is copied by default -("auto"), unless the mask is an alpha channel, or if it is explicitly used -to be a regular band of the output dataset ("\-b mask"). \fBband\fP can also -be set to "mask,1" (or just "mask") to mean the mask band of the 1st band +(\(dqauto\(dq), unless the mask is an alpha channel, or if it is explicitly used +to be a regular band of the output dataset (\(dq\-b mask\(dq). \fBband\fP can also +be set to \(dqmask,1\(dq (or just \(dqmask\(dq) to mean the mask band of the 1st band of the input dataset. .UNINDENT .INDENT 0.0 @@ -205,8 +205,8 @@ \fBsrc_max\fP are not used to clip input values. \fI\%\-scale\fP can be repeated several times (if specified only once, it also applies to all bands of the output dataset), so as to specify per -band parameters. It is also possible to use the "\-scale_bn" syntax where bn -is a band number (e.g. "\-scale_2" for the 2nd band of the output dataset) +band parameters. It is also possible to use the \(dq\-scale_bn\(dq syntax where bn +is a band number (e.g. \(dq\-scale_2\(dq for the 2nd band of the output dataset) to specify the parameters of one or several specific bands. .UNINDENT .INDENT 0.0 @@ -216,8 +216,8 @@ of the power function (must be positive). This option must be used with the \-scale option. If specified only once, \-exponent applies to all bands of the output image. It can be repeated several times so as to specify per -band parameters. It is also possible to use the "\-exponent_bn" syntax where -bn is a band number (e.g. "\-exponent_2" for the 2nd band of the output +band parameters. It is also possible to use the \(dq\-exponent_bn\(dq syntax where +bn is a band number (e.g. \(dq\-exponent_2\(dq for the 2nd band of the output dataset) to specify the parameters of one or several specific bands. .UNINDENT .INDENT 0.0 @@ -455,7 +455,7 @@ .sp .nf .ft C -gdal_translate \-of GTiff \-co "TILED=YES" utm.tif utm_tiled.tif +gdal_translate \-of GTiff \-co \(dqTILED=YES\(dq utm.tif utm_tiled.tif .ft P .fi .UNINDENT diff -Nru gdal-3.6.2+dfsg/man/man1/gdal_viewshed.1 gdal-3.6.4+dfsg/man/man1/gdal_viewshed.1 --- gdal-3.6.2+dfsg/man/man1/gdal_viewshed.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdal_viewshed.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDAL_VIEWSHED" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdal_viewshed \- Calculates a viewshed raster from an input raster DEM for a user defined point . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDAL_VIEWSHED" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdal_viewshed \- Calculates a viewshed raster from an input raster DEM for a user defined point .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 diff -Nru gdal-3.6.2+dfsg/man/man1/gdalwarp.1 gdal-3.6.4+dfsg/man/man1/gdalwarp.1 --- gdal-3.6.2+dfsg/man/man1/gdalwarp.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gdalwarp.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GDALWARP" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gdalwarp \- Image reprojection and warping utility. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GDALWARP" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gdalwarp \- Image reprojection and warping utility. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -37,19 +37,19 @@ .nf .ft C gdalwarp [\-\-help\-general] [\-\-formats] - [\-s_srs srs_def] [\-t_srs srs_def] [\-ct string] [\-to "NAME=VALUE"]* [\-vshift | \-novshift] + [\-s_srs srs_def] [\-t_srs srs_def] [\-ct string] [\-to \(dqNAME=VALUE\(dq]* [\-vshift | \-novshift] [[\-s_coord_epoch epoch] | [\-t_coord_epoch epoch]] [\-order n | \-tps | \-rpc | \-geoloc] [\-et err_threshold] [\-refine_gcps tolerance [minimum_gcps]] [\-te xmin ymin xmax ymax] [\-te_srs srs_def] [\-tr xres yres] [\-tap] [\-ts width height] - [\-ovr level|AUTO|AUTO\-n|NONE] [\-wo "NAME=VALUE"] [\-ot Byte/Int16/...] [\-wt Byte/Int16] - [\-srcnodata "value [value...]"] [\-dstnodata "value [value...]"] + [\-ovr level|AUTO|AUTO\-n|NONE] [\-wo \(dqNAME=VALUE\(dq] [\-ot Byte/Int16/...] [\-wt Byte/Int16] + [\-srcnodata \(dqvalue [value...]\(dq] [\-dstnodata \(dqvalue [value...]\(dq] [\-srcalpha|\-nosrcalpha] [\-dstalpha] [\-r resampling_method] [\-wm memory_in_mb] [\-multi] [\-q] [\-cutline datasource] [\-cl layer] [\-cwhere expression] [\-csql statement] [\-cblend dist_in_pixels] [\-crop_to_cutline] - [\-if format]* [\-of format] [\-co "NAME=VALUE"]* [\-overwrite] + [\-if format]* [\-of format] [\-co \(dqNAME=VALUE\(dq]* [\-overwrite] [\-nomd] [\-cvmd meta_conflict_value] [\-setci] [\-oo NAME=VALUE]* [\-doo NAME=VALUE]* srcfile* dstfile @@ -61,7 +61,7 @@ .sp The \fBgdalwarp\fP utility is an image mosaicing, reprojection and warping utility. The program can reproject to any supported projection, -and can also apply GCPs stored with the image if the image is "raw" +and can also apply GCPs stored with the image if the image is \(dqraw\(dq with control information. .INDENT 0.0 .TP @@ -262,7 +262,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \-wo \(ga"NAME=VALUE"\(ga +.B \-wo \(ga\(dqNAME=VALUE\(dq\(ga Set a warp option. The \fI\%GDALWarpOptions::papszWarpOptions\fP docs show all options. Multiple \fI\%\-wo\fP options may be listed. .UNINDENT @@ -482,7 +482,7 @@ .TP .B \-cvmd Value to set metadata items that conflict between source datasets -(default is "*"). Use "" to remove conflicting items. +(default is \(dq*\(dq). Use \(dq\(dq to remove conflicting items. .UNINDENT .INDENT 0.0 .TP @@ -577,7 +577,7 @@ .sp .nf .ft C -gdalwarp \-overwrite HDF4_SDS:ASTER_L1B:"pg\-PR1B0000\-2002031402_100_001":2 pg\-PR1B0000\-2002031402_100_001_2.tif +gdalwarp \-overwrite HDF4_SDS:ASTER_L1B:\(dqpg\-PR1B0000\-2002031402_100_001\(dq:2 pg\-PR1B0000\-2002031402_100_001_2.tif .ft P .fi .UNINDENT @@ -604,7 +604,7 @@ .nf .ft C id,WKT -1,"POLYGON((....))" +1,\(dqPOLYGON((....))\(dq .ft P .fi .UNINDENT diff -Nru gdal-3.6.2+dfsg/man/man1/gnmanalyse.1 gdal-3.6.4+dfsg/man/man1/gnmanalyse.1 --- gdal-3.6.2+dfsg/man/man1/gnmanalyse.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gnmanalyse.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GNMANALYSE" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gnmanalyse \- Analyses networks . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GNMANALYSE" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gnmanalyse \- Analyses networks .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -63,7 +63,7 @@ .INDENT 0.0 .TP .B resource -Calculates the "resource distribution". The connected components search is performed using breadth\-first search and starting from that features which are marked by rules as \(aqEMITTERS\(aq. +Calculates the \(dqresource distribution\(dq. The connected components search is performed using breadth\-first search and starting from that features which are marked by rules as \(aqEMITTERS\(aq. .UNINDENT .INDENT 0.0 .TP diff -Nru gdal-3.6.2+dfsg/man/man1/gnmmanage.1 gdal-3.6.4+dfsg/man/man1/gnmmanage.1 --- gdal-3.6.2+dfsg/man/man1/gnmmanage.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/gnmmanage.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "GNMMANAGE" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -gnmmanage \- Manages networks . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "GNMMANAGE" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +gnmmanage \- Manages networks .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 diff -Nru gdal-3.6.2+dfsg/man/man1/nearblack.1 gdal-3.6.4+dfsg/man/man1/nearblack.1 --- gdal-3.6.2+dfsg/man/man1/nearblack.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/nearblack.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "NEARBLACK" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -nearblack \- Convert nearly black/white borders to black. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "NEARBLACK" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +nearblack \- Convert nearly black/white borders to black. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -37,7 +37,7 @@ .nf .ft C nearblack [\-of format] [\-white | [\-color c1,c2,c3...cn]*] [\-near dist] [\-nb non_black_pixels] - [\-setalpha] [\-setmask] [\-o outfile] [\-q] [\-co "NAME=VALUE"]* infile + [\-setalpha] [\-setmask] [\-o outfile] [\-q] [\-co \(dqNAME=VALUE\(dq]* infile .ft P .fi .UNINDENT @@ -46,7 +46,7 @@ .sp This utility will scan an image and try to set all pixels that are nearly or exactly black, white or one or more custom colors around the collar to black or white. This -is often used to "fix up" lossy compressed air photos so that color pixels can be +is often used to \(dqfix up\(dq lossy compressed air photos so that color pixels can be treated as transparent when mosaicing. The output format must use lossless compression if either alpha band or mask band is not set. .INDENT 0.0 @@ -64,7 +64,7 @@ .UNINDENT .INDENT 0.0 .TP -.B \-co \(ga"NAME=VALUE"\(ga +.B \-co \(ga\(dqNAME=VALUE\(dq\(ga Passes a creation option to the output format driver. Multiple \fI\%\-co\fP options may be listed. See \fI\%Raster drivers\fP format specific documentation for legal creation options for each format. @@ -120,9 +120,9 @@ Byte bands. .UNINDENT .sp -The algorithm processes the image one scanline at a time. A scan "in" is done +The algorithm processes the image one scanline at a time. A scan \(dqin\(dq is done from either end setting pixels to black or white until at least -"non_black_pixels" pixels that are more than "dist" gray levels away from +\(dqnon_black_pixels\(dq pixels that are more than \(dqdist\(dq gray levels away from black, white or custom colors have been encountered at which point the scan stops. The nearly black, white or custom color pixels are set to black or white. The algorithm also scans from top to bottom and from bottom to top to identify indentations in the top or bottom. diff -Nru gdal-3.6.2+dfsg/man/man1/ogr2ogr.1 gdal-3.6.4+dfsg/man/man1/ogr2ogr.1 --- gdal-3.6.2+dfsg/man/man1/ogr2ogr.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/ogr2ogr.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "OGR2OGR" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -ogr2ogr \- Converts simple features data between file formats. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "OGR2OGR" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +ogr2ogr \- Converts simple features data between file formats. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -70,7 +70,7 @@ [\-explodecollections] [\-zfield field_name] [\-gcp ungeoref_x ungeoref_y georef_x georef_y [elevation]]* [\-order n | \-tps] [[\-s_coord_epoch epoch] | [\-t_coord_epoch epoch] | [\-a_coord_epoch epoch]] - [\-nomd] [\-mo "META\-TAG=VALUE"]* [\-noNativeData] + [\-nomd] [\-mo \(dqMETA\-TAG=VALUE\(dq]* [\-noNativeData] .ft P .fi .UNINDENT @@ -107,7 +107,7 @@ \fI\%GPKG \-\- GeoPackage vector\fP and \fI\%MongoDBv3\fP\&. .sp The upsert operation uses the FID of the input feature, when it is set -and is a "significant" (that is the FID column name is not the empty string), +and is a \(dqsignificant\(dq (that is the FID column name is not the empty string), as the key to update existing features. It is crucial to make sure that the FID in the source and target layers are consistent. .sp @@ -142,8 +142,8 @@ .INDENT 0.0 .TP .B \-progress -Display progress on terminal. Only works if input layers have the "fast -feature count" capability. +Display progress on terminal. Only works if input layers have the \(dqfast +feature count\(dq capability. .UNINDENT .INDENT 0.0 .TP @@ -223,8 +223,8 @@ promote a non\-linear type to its generalized curve type (\fBPOLYGON\fP to \fBCURVEPOLYGON\fP, \fBMULTIPOLYGON\fP to \fBMULTISURFACE\fP, \fBLINESTRING\fP to \fBCOMPOUNDCURVE\fP, \fBMULTILINESTRING\fP to \fBMULTICURVE\fP). Starting with -version 2.1 the type can be defined as measured ("25D" remains as an alias for -single "Z"). Some forced geometry conversions may result in invalid +version 2.1 the type can be defined as measured (\(dq25D\(dq remains as an alias for +single \(dqZ\(dq). Some forced geometry conversions may result in invalid geometries, for example when forcing conversion of multi\-part multipolygons with \fB\-nlt POLYGON\fP, the resulting polygon will break the Simple Features rules. @@ -344,7 +344,7 @@ processed. Operates exclusive of the spatial or attribute queries. Note: if you want to select several features based on their feature id, you can also use the fact the \(aqfid\(aq is a special field recognized by OGR SQL. So, -\fI\-where "fid in (1,3,5)"\fP would select features 1, 3 and 5. +\fI\-where \(dqfid in (1,3,5)\(dq\fP would select features 1, 3 and 5. .UNINDENT .INDENT 0.0 .TP @@ -694,7 +694,7 @@ .nf .ft C ogr2ogr \e - \-where "\e"POP_EST\e" < 1000000" \e + \-where \(dq\e\(dqPOP_EST\e\(dq < 1000000\(dq \e \-f GPKG output.gpkg \e natural_earth_vector.gpkg \e ne_10m_admin_0_countries diff -Nru gdal-3.6.2+dfsg/man/man1/ogrinfo.1 gdal-3.6.4+dfsg/man/man1/ogrinfo.1 --- gdal-3.6.2+dfsg/man/man1/ogrinfo.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/ogrinfo.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "OGRINFO" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -ogrinfo \- Lists information about an OGR-supported data source. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "OGRINFO" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +ogrinfo \- Lists information about an OGR-supported data source. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -127,7 +127,7 @@ If provided, only the feature with this feature id will be reported. Operates exclusive of the spatial or attribute queries. Note: if you want to select several features based on their feature id, you can also use the -fact the \(aqfid\(aq is a special field recognized by OGR SQL. So, \fI\-where "fid in (1,3,5)"\fP +fact the \(aqfid\(aq is a special field recognized by OGR SQL. So, \fI\-where \(dqfid in (1,3,5)\(dq\fP would select features 1, 3 and 5. .UNINDENT .INDENT 0.0 @@ -274,16 +274,16 @@ # Feature Count: 23 # Extent: (\-150.000000, \-90.000000) \- (160.100000, \-60.000000) # Layer SRS WKT: - # GEOGCS["WGS 84", - # DATUM["WGS_1984", - # SPHEROID["WGS 84",6378137,298.257223563, - # AUTHORITY["EPSG","7030"]], - # AUTHORITY["EPSG","6326"]], - # PRIMEM["Greenwich",0, - # AUTHORITY["EPSG","8901"]], - # UNIT["degree",0.0174532925199433, - # AUTHORITY["EPSG","9122"]], - # AUTHORITY["EPSG","4326"]] + # GEOGCS[\(dqWGS 84\(dq, + # DATUM[\(dqWGS_1984\(dq, + # SPHEROID[\(dqWGS 84\(dq,6378137,298.257223563, + # AUTHORITY[\(dqEPSG\(dq,\(dq7030\(dq]], + # AUTHORITY[\(dqEPSG\(dq,\(dq6326\(dq]], + # PRIMEM[\(dqGreenwich\(dq,0, + # AUTHORITY[\(dqEPSG\(dq,\(dq8901\(dq]], + # UNIT[\(dqdegree\(dq,0.0174532925199433, + # AUTHORITY[\(dqEPSG\(dq,\(dq9122\(dq]], + # AUTHORITY[\(dqEPSG\(dq,\(dq4326\(dq]] # FID Column = fid # Geometry Column = geom # type: String (15.0) @@ -313,19 +313,19 @@ # Feature Count: 1 # Extent: (419794.100000, 1069031.000000) \- (419927.900000, 1069153.500000) # Layer SRS WKT: -# PROJCS["OSGB 1936 / British National Grid", -# GEOGCS["OSGB 1936", -# DATUM["OSGB_1936", -# SPHEROID["Airy 1830",6377563.396,299.3249646]], -# PRIMEM["Greenwich",0], -# UNIT["degree",0.0174532925199433]], -# PROJECTION["Transverse_Mercator"], -# PARAMETER["latitude_of_origin",49], -# PARAMETER["central_meridian",\-2], -# PARAMETER["scale_factor",0.999601272], -# PARAMETER["false_easting",400000], -# PARAMETER["false_northing",\-100000], -# UNIT["metre",1]] +# PROJCS[\(dqOSGB 1936 / British National Grid\(dq, +# GEOGCS[\(dqOSGB 1936\(dq, +# DATUM[\(dqOSGB_1936\(dq, +# SPHEROID[\(dqAiry 1830\(dq,6377563.396,299.3249646]], +# PRIMEM[\(dqGreenwich\(dq,0], +# UNIT[\(dqdegree\(dq,0.0174532925199433]], +# PROJECTION[\(dqTransverse_Mercator\(dq], +# PARAMETER[\(dqlatitude_of_origin\(dq,49], +# PARAMETER[\(dqcentral_meridian\(dq,\-2], +# PARAMETER[\(dqscale_factor\(dq,0.999601272], +# PARAMETER[\(dqfalse_easting\(dq,400000], +# PARAMETER[\(dqfalse_northing\(dq,\-100000], +# UNIT[\(dqmetre\(dq,1]] # LINE_ID: Integer (6.0) # GEOM_ID: Integer (6.0) # FEAT_CODE: String (4.0) @@ -367,7 +367,7 @@ .sp .nf .ft C -ogrinfo test.shp \-dialect sqlite \-sql "update test set attr=\(aqbar\(aq where attr=\(aqfoo\(aq" +ogrinfo test.shp \-dialect sqlite \-sql \(dqupdate test set attr=\(aqbar\(aq where attr=\(aqfoo\(aq\(dq .ft P .fi .UNINDENT diff -Nru gdal-3.6.2+dfsg/man/man1/ogr_layer_algebra.1 gdal-3.6.4+dfsg/man/man1/ogr_layer_algebra.1 --- gdal-3.6.2+dfsg/man/man1/ogr_layer_algebra.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/ogr_layer_algebra.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "OGR_LAYER_ALGEBRA" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -ogr_layer_algebra \- Performs various Vector layer algebraic operations . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "OGR_LAYER_ALGEBRA" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +ogr_layer_algebra \- Performs various Vector layer algebraic operations .sp New in version 3.6. diff -Nru gdal-3.6.2+dfsg/man/man1/ogrlineref.1 gdal-3.6.4+dfsg/man/man1/ogrlineref.1 --- gdal-3.6.2+dfsg/man/man1/ogrlineref.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/ogrlineref.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "OGRLINEREF" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -ogrlineref \- Create linear reference and provide some calculations using it. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "OGRLINEREF" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +ogrlineref \- Create linear reference and provide some calculations using it. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -57,13 +57,13 @@ .IP \(bu 2 create linear reference file from input data .IP \(bu 2 -return the "linear referenced" distance for the projection of the +return the \(dqlinear referenced\(dq distance for the projection of the input coordinates (point) on the path .IP \(bu 2 -return the coordinates (point) on the path according to the "linear -referenced" distance +return the coordinates (point) on the path according to the \(dqlinear +referenced\(dq distance .IP \(bu 2 -return the portion of the path according to the "linear referenced" +return the portion of the path according to the \(dqlinear referenced\(dq begin and end distances .UNINDENT .sp diff -Nru gdal-3.6.2+dfsg/man/man1/ogrmerge.1 gdal-3.6.4+dfsg/man/man1/ogrmerge.1 --- gdal-3.6.2+dfsg/man/man1/ogrmerge.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/ogrmerge.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "OGRMERGE" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -ogrmerge \- Merge several vector datasets into a single one. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "OGRMERGE" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +ogrmerge \- Merge several vector datasets into a single one. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -112,7 +112,7 @@ .TP .B \-nln Name of the output vector layer (in single mode, and the default is -"merged"), or template to name the output vector layers in default +\(dqmerged\(dq), or template to name the output vector layers in default mode (the default value is \fB{AUTO_NAME}\fP). The template can be a string with the following variables that will be susbstitued with a value computed from the input layer being processed: @@ -195,7 +195,7 @@ .TP .B \-progress Display progress on terminal. Only works if input layers have the -"fast feature count" capability. +\(dqfast feature count\(dq capability. .UNINDENT .INDENT 0.0 .TP diff -Nru gdal-3.6.2+dfsg/man/man1/ogrtindex.1 gdal-3.6.4+dfsg/man/man1/ogrtindex.1 --- gdal-3.6.2+dfsg/man/man1/ogrtindex.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/ogrtindex.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "OGRTINDEX" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -ogrtindex \- Creates a tileindex. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "OGRTINDEX" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +ogrtindex \- Creates a tileindex. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 diff -Nru gdal-3.6.2+dfsg/man/man1/pct2rgb.1 gdal-3.6.4+dfsg/man/man1/pct2rgb.1 --- gdal-3.6.2+dfsg/man/man1/pct2rgb.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/pct2rgb.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "PCT2RGB" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -pct2rgb \- Convert an 8bit paletted image to 24bit RGB. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "PCT2RGB" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +pct2rgb \- Convert an 8bit paletted image to 24bit RGB. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 diff -Nru gdal-3.6.2+dfsg/man/man1/rgb2pct.1 gdal-3.6.4+dfsg/man/man1/rgb2pct.1 --- gdal-3.6.2+dfsg/man/man1/rgb2pct.1 2023-01-02 14:39:17.000000000 +0000 +++ gdal-3.6.4+dfsg/man/man1/rgb2pct.1 2023-04-17 11:51:37.000000000 +0000 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH "RGB2PCT" "1" "Jan 02, 2023" "" "GDAL" -.SH NAME -rgb2pct \- Convert a 24bit RGB image to 8bit paletted. . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "RGB2PCT" "1" "Apr 17, 2023" "" "GDAL" +.SH NAME +rgb2pct \- Convert a 24bit RGB image to 8bit paletted. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -95,14 +95,14 @@ .ft C rgb2pct.py \-pct palette.vrt rgb.tif pseudo\-colored.tif more < palette.vrt - - + + Palette - - - - + + + + diff -Nru gdal-3.6.2+dfsg/NEWS.md gdal-3.6.4+dfsg/NEWS.md --- gdal-3.6.2+dfsg/NEWS.md 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/NEWS.md 2023-04-17 11:50:20.000000000 +0000 @@ -1,3 +1,300 @@ +# GDAL/OGR 3.6.4 Release Notes + +GDAL 3.6.4 is a bugfix release. + +## GDAL 3.6.4 + +### Port + +* userfaultfd: avoid it to stall on 32bit and test real working of syscall in + CPLIsUserFaultMappingSupported() + +### Core + +* RawRasterBand::FlushCache(): avoid crash in some situations +* RawRasterBand::IRasterIO(): fix wrong byte swapping in Direct IO multiline + writing code path +* RawRasterBand::IRasterIO(): fix optimized code path that wrongly triggered + on BIL layout +* RawRasterBand::IRasterIO(): avoid reading and writing too many bytes +* RawRasterBand::IRasterIO(): fix floating-point issues with ICC that could + result in wrong lines/cols being read/written + +### Algorithms + +* Rasterize all touched: tighten(decrease) the tolerance to consider that edge + of geometries match pixel obundaries (#7523) + +### Utilities + +* gdal_translate: fix crash when specifying -ovr on a dataset that has no + overviews (#7376) +* gdalcompare.py: correctly take into account NaN nodata value (#7394) +* gdal2xyz.py: fix -srcnodata and -dstnodata options (#7410) +* gdal2tiles: update 'ol-layerswitcher' widget to v4.1.1 (#7544) + +### Raster drivers + +GTiff driver: + * correctly read GCPs from ArcGIS 9 .aux.xml when TIFFTAG_RESOLUTIONUNIT=3 + (pixels/cm) (#7484) + +HDF5 driver: + * fix detecting if HDF5 library is thread-safe (refs #7340) + +LCP driver: + * CreateCopy(): fix crash on negative pixel values (#7561) + +MRF driver: + * restore SetSpatialRef() that was wrongly deleted in 3.6.0 + +netCDF driver: + * restore capability of reading CF-1.6-featureType vector layers even if the + conventions >= CF 1.8, and improve featureType=trajectory by adding the + time attribute (fixes #7550) + +## OGR 3.6.4 + +### Core + +* OGRSQL: fix 'SELECT ... WHERE ... AND ... AND ... AND ... UNION ALL ...' + (#3395) +* OGRUnionLayer::GetExtent(): do not emit error on no-geometry layer +* OGREditableLayer::IUpsertFeature(): fix memleak + +### OGRSpatialReference + +* Fix OGRSpatialReference::SetProjCS() on an existing BoundCRS; + affects GeoTIFF SRS reader (fixes gdal-dev/2023-March/057011.html) + +### Utilities + +* ogr2ogr: fix and automate conversion from list types to String(JSON) when the + output driver doesn't support list types but String(JSON) (#7397) + +### Vector drivers + +CSV driver: + * CSVSplitLine(): do not treat in a special way double quotes that appear in + the middle of a field + +FlatGeobuf driver: + * improve handling of null geoms (#7483) + +GeoPackage driver: + * Update definition of gpkg_data_columns to remove unique constraint on "name" + +OpenFileGDB driver: + * fix write corruption when re-using freespace slots in some editing scenarios + (#7504) + * relax test to detect broken .spx + * CreateField(): in approxOK mode, do not error out if default value of a + DateTime field is CURRENT_TIMESTAMP, just ignore it with a warning (#7589) + +OSM driver: + * Fix handling of closed_ways_are_polygons setting in osmconf.ini (#7488) + +S57 driver: + * s57objectclasses.csv: apply S-57 Edition 3.1 Supplement No. 2 + +SQLite driver: + * GDAL as a SQLite3 loadable extension: avoid crash on Linux + +# GDAL/OGR 3.6.3 Release Notes + +GDAL 3.6.3 is a bugfix release. + +## Build + +* CMake: Fix integration of find_package2() +* CMake: avoid HDF4 CMake error with Windows paths with spaces +* CMake: quote variables for INTERFACE_INCLUDE_DIRECTORIES / IMPORTED_LOCATION +* CMake: fix wrong test when GDAL_SET_INSTALL_RELATIVE_RPATH is set +* CMake: issue an error when the user explicitly asks for a condition-dependent + driver and the condition is not met +* CMake: add include to FindSQLite3.cmake +* fix uclibc build without NPTL +* zlib: Add ZLIB_IS_STATIC build option +* FindCryptoPP.cmake: properly take into account _LIBRARY_RELEASE/_DEBUG (#7338) +* FindPoppler.cmake: check that Poppler private headers are available (#7352) + +## GDAL 3.6.3 + +### Port + +* CPLGetPhysicalRAM(): take into account current cgroup (v1 and v2) +* CPLGetPhysicalRAM(): take into account MemTotal limit from /proc/meminfo +* /vsicurl/: fix CPL_VSIL_CURL_USE_HEAD=NO mode (#7150) +* Avoid use of deprecated ZSTD_getDecompressedSize() function with libzstd 1.3+ +* cpl_vsil_crypt.cpp: fix build isse on Windows (#7304) + +### Algorithms + +* GDALPolygonizeT(): add sanity check +* GDALRasterPolygonEnumeratorT::NewPolygon(): check memory allocation to avoid + crash (#7027) +* Warper: do not use OpenCL code path when pafUnifiedSrcDensity is not null + (#7192) +* Warper: optimize a bit when warping a chunk fully within the cutline +* Geoloc inverse transformer: fix numeric instability when quadrilaterals are + degenerate to triangles (#7302) + +### Core + +* GDALProxyPoolRasterBand::FlushCache(): fix for ref counting when calling + FlushCache() on GDALProxyPoolMaskBand or GDALProxyPoolOverviewRasterBand +* VirtualMem: Fix mremap() detection with clang 15, and disable + HAVE_VIRTUAL_MEM_VMA if HAVE_5ARGS_MREMAP not found + +### Utilities + +* gdal_translate: make -colorinterp work on a source band that is a mask band +* gdalmdimtranslate: do not require VRT driver to be registered (#7021) +* gdalmdimtranslate: fix subsetting in the situation of dataset of #7199 +* gdalwarp: fix vshift mode when vertical unit of dstSrs is non-metric +* gdalwarp: overview choice: fix longitude wrap problem (#7019) +* gdalwarp: allow up to inaccuracy in cropline coordinates up to 0.1% of a + pixel size for rounding (#7226) +* gdalsrsinfo: fix crash on 'gdalsrsinfo IAU:2015:49902 -o xml' +* gdal_retile.py: fix wrong basename for .aux.xml files (#7120) +* gdallocationinfo: fix issue with VRTComplexSource and nodata (#7183) +* gdal_rasterize: ignore features whose Z attribute is null/unset (#7241) + +### Raster drivers + +BMP driver: + * Make sure file is created at proper size if only calling Create() without + writing pixels (#7025) + * Create(): add checks and warnings for maximum dimensions + +COG driver: + * avoid warning message when using -co COMPRESS=WEBP -co QUALITY=100 (#7153) + +DIMAP driver: + * optimize performance of dataset RasterIO() + +GRIB driver: + * fix reading South Polar Stereographic from GRIB1 datasets (#7298) + * degrib: replace use of sprintf() with snprintf() + +GTiff driver: + * GTiffJPEGOverviewBand::IReadBlock(): remove hack that causes read errors in + some circumstances + * do not use implicit JPEG overviews with non-nearest resampling + * fix generation of external overviews on 1xsmall_height rasters (#7194) + +GTX driver: + * fix (likely harmless in practice) integer overflow (ossfuzz#55718) + +HDF5 driver: + * add a GDAL_ENABLE_HDF5_GLOBAL_LOCK build option to add a global lock when + the HDF5 library is not built with thread-safety enabled (#7340) + +HFA driver: + * ERDAS Imagine SRS support: various fixes: Vertical Perspective projection, + LCC_1SP, Mercator_2SP, Eqirectanglar, Hotine Obliqe Mercator Azimuth Center + +JPEG driver: + * Correctly read GCPS when an .aux.xml sidecar has GeodataXform present in the + ESRI metadata element instead of root element + +JPEGXL driver: + * CreateCopy(): fix memory leak when writing georeferencing + +MBTiles driver: + * fix nullptr deref when calling GetMetadata() on a dataset returned by + Create() (#7067) + +netCDF driver: + * quote variable name in subdataset list if it contains a column character + (#7061) + * report GEOLOCATION metadata for a lon/lat indexed variable where lon and/or + lat has irregular spacing + * netCDFDimension::GetIndexingVariable(): be more restrictive + * resolve variable names beyond the parent group (#7325) + +NITF driver: + * update CLEVEL to appropriate values when using compression / multiple image + segments + * fix bug that prevents adding subsequent TREs after a HEX TRE (#6827) + +PDF driver: + * skip JP2ECW driver if ECW_ENCODE_KEY required but not found + +TileDB driver: + * fix compatibility with tiledb 2.14 + +VRT: + * warp: fix issue when warping a Float32 raster with nodata = +/- FLOAT_MAX + +ZMap creation: + * fix potential truncation of nodata value (#7203) + +## OGR 3.6.3 + +### Core + +* OGRSQL: fix crash when comparing integer array fields (#6714) +* OGRSQL: fix SetAttributeFilter() when dialect=OGRSQL and not forwarding the + initial where clause to the source layer (#7087) + +### Utilities + +* ogr2ogr: fix -clipsrc/-clipdst when clip dataset has SRS != features's + geometry (#7126) + +### Vector drivers + +GeoJSON driver: + * avoid duplication of FID in streaming parser (#7258) + * declare GDAL_DCAP_MEASURED_GEOMETRIES and ODsCMeasuredGeometries + * fix mixed type field not flagged as JSON if first is a string (#7313) + * writer: take into account COORDINATE_PRECISION for top bbox (#7319) + * writer: fix json mixed types roundtrip (#7368) + +GeoJSONSeq driver: + * fix writing to /vsigzip/ (#7130) + +GeoPackage driver: + * avoid issue with duplicated column names in some cases (#6976) + * GetNextArrowArray(): fix retrieving only the geometry (geopandas/pyogrio#212) + * restore async RTree building for 1st layer (broken by GDAL 3.6.2) + +GML driver: + * fix CurvePolygon export of CompoundCurve and CircularString child elements + (#7294) + +HANA driver: + * fix DSN open option + +MITAB driver: + * handle projection methods 34 (extended transverse mercator) and 35 (Hotine + Oblique Mercator) (#7161) + * Fix possible crash on NULL feature text (#7341) + * Fix a typo at MITABGetCustomDatum + +NAS driver: + * fix file descriptor leak in error code path + +OpenFileGDB driver: + * fix performance issue when identifying a CRS + * detect broken .spx file with wrong index depth (qgis/qgis#32534) + * index reading: avoid integer overflow on index larger than 2 GB + * allow CreateField() with OBJECTID as the column name (qgis/qgis#51435) + * make Delete() method to remove the directory (fixes #7216) + +Shapefile driver: + * fix adding features in a .dbf without columns (qgis/qgis#51247) + * make sure eAccess = GA_Update is set on creation (#7311) + +## SWIG bindings + +* add missing OLCUpsertFeature constant + +## Python bindings + +* fix setup.py dir-list issue on macOS + # GDAL/OGR 3.6.2 Release Notes GDAL 3.6.2 is a bugfix release. diff -Nru gdal-3.6.2+dfsg/ogr/CMakeLists.txt gdal-3.6.4+dfsg/ogr/CMakeLists.txt --- gdal-3.6.2+dfsg/ogr/CMakeLists.txt 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/ogr/CMakeLists.txt 2023-04-17 11:50:19.000000000 +0000 @@ -115,7 +115,7 @@ if (NOT GDAL_USE_ZLIB_INTERNAL) target_compile_definitions(ogr PRIVATE -DHAVE_ZLIB_H -DHAVE_ZLIB) - if (MSVC) + if (MSVC AND NOT ZLIB_IS_STATIC) target_compile_definitions(ogr PRIVATE -DZLIB_DLL) endif () gdal_target_link_libraries(ogr PRIVATE ZLIB::ZLIB) @@ -170,7 +170,7 @@ COMMAND ${CMAKE_COMMAND} "-DIN_FILE=swq_parser.y" "-DTARGET=generate_swq_parser" - "-DEXPECTED_MD5SUM=6213b394532642ebbe6cb3304f2860fc" + "-DEXPECTED_MD5SUM=44620ffbb37fb8665887a175b299781b" "-DFILENAME_CMAKE=${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt" -P "${PROJECT_SOURCE_DIR}/cmake/helpers/check_md5sum.cmake" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" diff -Nru gdal-3.6.2+dfsg/ogr/ogr2gmlgeometry.cpp gdal-3.6.4+dfsg/ogr/ogr2gmlgeometry.cpp --- gdal-3.6.2+dfsg/ogr/ogr2gmlgeometry.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/ogr/ogr2gmlgeometry.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -792,11 +792,18 @@ for (int i = 0; i < poCC->getNumCurves(); i++) { AppendString(ppszText, pnLength, pnMaxLength, ""); + + char *pszGMLIdSub = nullptr; + if (pszGMLId != nullptr) + pszGMLIdSub = CPLStrdup(CPLSPrintf("%s.%d", pszGMLId, i)); + CPL_IGNORE_RET_VAL(OGR2GML3GeometryAppend( poCC->getCurve(i), poSRS, ppszText, pnLength, pnMaxLength, true, - eSRSNameFormat, bCoordSwap, bLineStringAsCurve, nullptr, + eSRSNameFormat, bCoordSwap, bLineStringAsCurve, pszGMLIdSub, nSRSDimensionLocFlags, false, nullptr, nullptr)); + CPLFree(pszGMLIdSub); + AppendString(ppszText, pnLength, pnMaxLength, ""); } AppendString(ppszText, pnLength, pnMaxLength, ""); @@ -826,33 +833,89 @@ // Free tag buffer. CPLFree(pszPolyTagName); + const auto AppendCompoundCurveMembers = + [&](const OGRGeometry *poRing, const char *pszGMLIdRing) + { + const auto eRingType = wkbFlatten(poRing->getGeometryType()); + if (eRingType == wkbCompoundCurve) + { + AppendString(ppszText, pnLength, pnMaxLength, ""); + const auto poCC = poRing->toCompoundCurve(); + const int nNumCurves = poCC->getNumCurves(); + for (int i = 0; i < nNumCurves; i++) + { + AppendString(ppszText, pnLength, pnMaxLength, + ""); + + char *pszGMLIdSub = nullptr; + if (pszGMLIdRing != nullptr) + pszGMLIdSub = + CPLStrdup(CPLSPrintf("%s.%d", pszGMLIdRing, i)); + + CPL_IGNORE_RET_VAL(OGR2GML3GeometryAppend( + poCC->getCurve(i), poSRS, ppszText, pnLength, + pnMaxLength, true, eSRSNameFormat, bCoordSwap, + bLineStringAsCurve, pszGMLIdSub, nSRSDimensionLocFlags, + false, nullptr, nullptr)); + + CPLFree(pszGMLIdSub); + + AppendString(ppszText, pnLength, pnMaxLength, + ""); + } + AppendString(ppszText, pnLength, pnMaxLength, ""); + } + else + { + if (eRingType != wkbLineString) + { + AppendString(ppszText, pnLength, pnMaxLength, + ""); + } + + CPL_IGNORE_RET_VAL(OGR2GML3GeometryAppend( + poRing, poSRS, ppszText, pnLength, pnMaxLength, true, + eSRSNameFormat, bCoordSwap, bLineStringAsCurve, + pszGMLIdRing, nSRSDimensionLocFlags, true, nullptr, + nullptr)); + + if (eRingType != wkbLineString) + { + AppendString(ppszText, pnLength, pnMaxLength, + ""); + } + } + }; + // Don't add srsName to polygon rings. - if (poCP->getExteriorRingCurve() != nullptr) + const auto poExteriorRing = poCP->getExteriorRingCurve(); + if (poExteriorRing != nullptr) { AppendString(ppszText, pnLength, pnMaxLength, ""); - CPL_IGNORE_RET_VAL(OGR2GML3GeometryAppend( - poCP->getExteriorRingCurve(), poSRS, ppszText, pnLength, - pnMaxLength, true, eSRSNameFormat, bCoordSwap, - bLineStringAsCurve, nullptr, nSRSDimensionLocFlags, true, - nullptr, nullptr)); + AppendCompoundCurveMembers( + poExteriorRing, + pszGMLId ? (std::string(pszGMLId) + ".exterior").c_str() + : nullptr); AppendString(ppszText, pnLength, pnMaxLength, ""); - } - - for (int iRing = 0; iRing < poCP->getNumInteriorRings(); iRing++) - { - const OGRCurve *poRing = poCP->getInteriorRingCurve(iRing); - - AppendString(ppszText, pnLength, pnMaxLength, ""); - - CPL_IGNORE_RET_VAL(OGR2GML3GeometryAppend( - poRing, poSRS, ppszText, pnLength, pnMaxLength, true, - eSRSNameFormat, bCoordSwap, bLineStringAsCurve, nullptr, - nSRSDimensionLocFlags, true, nullptr, nullptr)); - AppendString(ppszText, pnLength, pnMaxLength, ""); + for (int iRing = 0; iRing < poCP->getNumInteriorRings(); iRing++) + { + const OGRCurve *poRing = poCP->getInteriorRingCurve(iRing); + + AppendString(ppszText, pnLength, pnMaxLength, ""); + + AppendCompoundCurveMembers( + poRing, pszGMLId ? (std::string(pszGMLId) + ".interior." + + std::to_string(iRing)) + .c_str() + : nullptr); + + AppendString(ppszText, pnLength, pnMaxLength, + ""); + } } AppendString(ppszText, pnLength, pnMaxLength, "GetFieldDefnUnsafe(iDstField)->GetSubType(); + if (eDstSubType == OFSTJSON && + (eSrcType == OFTIntegerList || eSrcType == OFTInteger64List || + eSrcType == OFTRealList || eSrcType == OFTStringList)) + { + char *pszVal = poSrcFeature->GetFieldAsSerializedJSon(iField); + if (pszVal) + { + SetField(iDstField, pszVal); + CPLFree(pszVal); + continue; + } + } + } + switch (eSrcType) { case OFTInteger: diff -Nru gdal-3.6.2+dfsg/ogr/ogr_fromepsg.cpp gdal-3.6.4+dfsg/ogr/ogr_fromepsg.cpp --- gdal-3.6.2+dfsg/ogr/ogr_fromepsg.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/ogr/ogr_fromepsg.cpp 2023-04-17 11:50:19.000000000 +0000 @@ -310,7 +310,8 @@ /* guessing it. */ /* -------------------------------------------------------------------- */ if ((IsProjected() || IsGeographic()) && - GetAuthorityCode("GEOGCS") == nullptr) + GetAuthorityCode("GEOGCS") == nullptr && + GetAttrValue("PROJCRS|BASEGEOGCRS|ID") == nullptr) { const int nGCS = GetEPSGGeogCS(); if (nGCS != -1) diff -Nru gdal-3.6.2+dfsg/ogr/ogrsf_frmts/filegdb/FGdbDriver.cpp gdal-3.6.4+dfsg/ogr/ogrsf_frmts/filegdb/FGdbDriver.cpp --- gdal-3.6.2+dfsg/ogr/ogrsf_frmts/filegdb/FGdbDriver.cpp 2023-01-02 14:38:17.000000000 +0000 +++ gdal-3.6.4+dfsg/ogr/ogrsf_frmts/filegdb/FGdbDriver.cpp 2023-04-17 11:50:20.000000000 +0000 @@ -935,7 +935,7 @@ "description='Whether to write geometries of layers of type " "MultiPolygon as MultiPatch' default='NO'/>" "