Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • malat/gdal
  • mmomtchev/gdal
  • debian-gis-team/gdal
  • jbicha/gdal
  • yayclam-guest/gdal
5 results
Show changes
Showing
with 89 additions and 61 deletions
......@@ -47,7 +47,7 @@
#include "ogr_core.h"
#include "ogr_spatialref.h"
CPL_CVSID("$Id: gdalpamdataset.cpp ec7b85e6bb8f9737693a31f0bf7166e31e10992e 2018-04-16 00:08:36 +0200 Even Rouault $")
CPL_CVSID("$Id: gdalpamdataset.cpp c177435f4370e56575870773ffc107c4bc44942e 2018-07-12 15:26:22 +0200 Even Rouault $")
/************************************************************************/
/* GDALPamDataset() */
......@@ -249,14 +249,13 @@ CPLXMLNode *GDALPamDataset::SerializeToXML( const char *pszUnused )
for( int iBand = 0; iBand < GetRasterCount(); iBand++ )
{
GDALPamRasterBand * const poBand =
cpl::down_cast<GDALPamRasterBand *>(
GetRasterBand(iBand+1) );
GDALRasterBand * const poBand = GetRasterBand(iBand+1);
if( poBand == nullptr || !(poBand->GetMOFlags() & GMO_PAM_CLASS) )
continue;
CPLXMLNode * const psBandTree = poBand->SerializeToXML( pszUnused );
CPLXMLNode * const psBandTree =
cpl::down_cast<GDALPamRasterBand *>(poBand)->SerializeToXML( pszUnused );
if( psBandTree != nullptr )
{
......@@ -499,13 +498,15 @@ CPLErr GDALPamDataset::XMLInit( CPLXMLNode *psTree, const char *pszUnused )
if( nBand < 1 || nBand > GetRasterCount() )
continue;
GDALPamRasterBand *poBand = cpl::down_cast<GDALPamRasterBand *>(
GetRasterBand(nBand) );
GDALRasterBand *poBand = GetRasterBand(nBand);
if( poBand == nullptr || !(poBand->GetMOFlags() & GMO_PAM_CLASS) )
continue;
poBand->XMLInit( psBandTree, pszUnused );
GDALPamRasterBand *poPamBand = cpl::down_cast<GDALPamRasterBand *>(
GetRasterBand(nBand) );
poPamBand->XMLInit( psBandTree, pszUnused );
}
/* -------------------------------------------------------------------- */
......@@ -991,15 +992,16 @@ CPLErr GDALPamDataset::CloneInfo( GDALDataset *poSrcDS, int nCloneFlags )
{
for( int iBand = 0; iBand < GetRasterCount(); iBand++ )
{
GDALPamRasterBand *poBand = cpl::down_cast<GDALPamRasterBand *>(
GetRasterBand(iBand+1) );
GDALRasterBand *poBand = GetRasterBand(iBand+1);
if( poBand == nullptr || !(poBand->GetMOFlags() & GMO_PAM_CLASS) )
continue;
if( poSrcDS->GetRasterCount() >= iBand+1 )
poBand->CloneInfo( poSrcDS->GetRasterBand(iBand+1),
nCloneFlags );
{
cpl::down_cast<GDALPamRasterBand *>(poBand)->
CloneInfo( poSrcDS->GetRasterBand(iBand+1), nCloneFlags );
}
else
CPLDebug(
"GDALPamDataset",
......
......@@ -52,7 +52,7 @@
#include "gdal_rat.h"
#include "gdal_priv_templates.hpp"
CPL_CVSID("$Id: gdalrasterband.cpp 65afca42e358f638a4b2ba1d9e8462412685c4cf 2018-05-03 14:08:54 +0200 Even Rouault $")
CPL_CVSID("$Id: gdalrasterband.cpp 12e52bca5d2ef4d60eac422db198aefa9577be63 2018-07-14 19:04:33 +0200 Even Rouault $")
/************************************************************************/
/* GDALRasterBand() */
......@@ -2875,6 +2875,41 @@ GDALDatasetH CPL_STDCALL GDALGetBandDataset( GDALRasterBandH hBand )
return GDALDataset::ToHandle(poBand->GetDataset());
}
/************************************************************************/
/* ComputeFloatNoDataValue() */
/************************************************************************/
static inline void ComputeFloatNoDataValue( GDALDataType eDataType,
double dfNoDataValue,
int& bGotNoDataValue,
float& fNoDataValue,
bool& bGotFloatNoDataValue )
{
if( eDataType == GDT_Float32 && bGotNoDataValue )
{
if (GDALIsValueInRange<float>(dfNoDataValue) )
{
fNoDataValue = static_cast<float>(dfNoDataValue);
bGotFloatNoDataValue = true;
bGotNoDataValue = false;
}
else if( fabs(dfNoDataValue - std::numeric_limits<float>::max()) <
1e-10 * std::numeric_limits<float>::max() )
{
fNoDataValue = std::numeric_limits<float>::max();
bGotFloatNoDataValue = true;
bGotNoDataValue = false;
}
else if( fabs(dfNoDataValue - (-std::numeric_limits<float>::max())) <
1e-10 * std::numeric_limits<float>::max() )
{
fNoDataValue = -std::numeric_limits<float>::max();
bGotFloatNoDataValue = true;
bGotNoDataValue = false;
}
}
}
/************************************************************************/
/* GetHistogram() */
/************************************************************************/
......@@ -2973,13 +3008,8 @@ CPLErr GDALRasterBand::GetHistogram( double dfMin, double dfMax,
!CPLTestBool(CPLGetConfigOption("GDAL_NODATA_IN_HISTOGRAM", "NO"));
bool bGotFloatNoDataValue = false;
float fNoDataValue = 0.0f;
if( eDataType == GDT_Float32 && bGotNoDataValue &&
GDALIsValueInRange<float>(dfNoDataValue) )
{
fNoDataValue = static_cast<float>(dfNoDataValue);
bGotFloatNoDataValue = true;
bGotNoDataValue = false;
}
ComputeFloatNoDataValue( eDataType, dfNoDataValue, bGotNoDataValue,
fNoDataValue, bGotFloatNoDataValue );
const char* pszPixelType = GetMetadataItem("PIXELTYPE", "IMAGE_STRUCTURE");
const bool bSignedByte =
......@@ -4802,13 +4832,8 @@ GDALRasterBand::ComputeStatistics( int bApproxOK,
bGotNoDataValue = bGotNoDataValue && !CPLIsNan(dfNoDataValue);
bool bGotFloatNoDataValue = false;
float fNoDataValue = 0.0f;
if( eDataType == GDT_Float32 && bGotNoDataValue &&
GDALIsValueInRange<float>(dfNoDataValue) )
{
fNoDataValue = static_cast<float>(dfNoDataValue);
bGotFloatNoDataValue = true;
bGotNoDataValue = false;
}
ComputeFloatNoDataValue( eDataType, dfNoDataValue, bGotNoDataValue,
fNoDataValue, bGotFloatNoDataValue );
const char* pszPixelType =
GetMetadataItem("PIXELTYPE", "IMAGE_STRUCTURE");
......@@ -5456,14 +5481,8 @@ CPLErr GDALRasterBand::ComputeRasterMinMax( int bApproxOK,
bGotNoDataValue = bGotNoDataValue && !CPLIsNan(dfNoDataValue);
bool bGotFloatNoDataValue = false;
float fNoDataValue = 0.0f;
if( eDataType == GDT_Float32 && bGotNoDataValue &&
(fabs(dfNoDataValue) <= std::numeric_limits<float>::max() ||
CPLIsInf(dfNoDataValue)) )
{
fNoDataValue = static_cast<float>(dfNoDataValue);
bGotFloatNoDataValue = true;
bGotNoDataValue = false;
}
ComputeFloatNoDataValue( eDataType, dfNoDataValue, bGotNoDataValue,
fNoDataValue, bGotFloatNoDataValue );
const char* pszPixelType = GetMetadataItem("PIXELTYPE", "IMAGE_STRUCTURE");
const bool bSignedByte =
......@@ -6090,9 +6109,10 @@ GDALRasterBand *GDALRasterBand::GetMaskBand()
/* Check for nodata case. */
/* -------------------------------------------------------------------- */
int bHaveNoData = FALSE;
GetNoDataValue( &bHaveNoData );
const double dfNoDataValue = GetNoDataValue( &bHaveNoData );
if( bHaveNoData )
if( bHaveNoData &&
GDALNoDataMaskBand::IsNoDataInRange(dfNoDataValue, eDataType) )
{
nMaskFlags = GMF_NODATA;
try
......
......@@ -53,7 +53,7 @@
#include "gdalsse_priv.h"
#endif
CPL_CVSID("$Id: overview.cpp c2eb6132acf89dbdc55936c607a10f185f4028fe 2018-06-18 21:56:30 +0200 Even Rouault $")
CPL_CVSID("$Id: overview.cpp 71db677289b365a10aaf2f99746a847bd6e61426 2018-08-09 10:38:42 +0200 Even Rouault $")
/************************************************************************/
/* GDALResampleChunk32R_Near() */
......@@ -774,10 +774,10 @@ GDALResampleChunk32R_Gauss( double dfXRatioDstToSrc, double dfYRatioDstToSrc,
}
int nYShiftGaussMatrix = 0;
if(nSrcYOff < 0)
if(nSrcYOff < nChunkYOff)
{
nYShiftGaussMatrix = -nSrcYOff;
nSrcYOff = 0;
nYShiftGaussMatrix = -(nSrcYOff - nChunkYOff);
nSrcYOff = nChunkYOff;
}
const float * const pafSrcScanline =
......@@ -796,6 +796,12 @@ GDALResampleChunk32R_Gauss( double dfXRatioDstToSrc, double dfYRatioDstToSrc,
int nSrcXOff2 =
static_cast<int>(0.5 + (iDstPixel+1) * dfXRatioDstToSrc) + 1;
if( nSrcXOff < nChunkXOff )
{
nSrcXOff = nChunkXOff;
nSrcXOff2++;
}
const int iSizeX = nSrcXOff2 - nSrcXOff;
nSrcXOff = nSrcXOff + iSizeX/2 - nGaussMatrixDim/2;
nSrcXOff2 = nSrcXOff + nGaussMatrixDim;
......@@ -808,10 +814,10 @@ GDALResampleChunk32R_Gauss( double dfXRatioDstToSrc, double dfYRatioDstToSrc,
}
int nXShiftGaussMatrix = 0;
if(nSrcXOff < 0)
if(nSrcXOff < nChunkXOff)
{
nXShiftGaussMatrix = -nSrcXOff;
nSrcXOff = 0;
nXShiftGaussMatrix = -(nSrcXOff - nChunkXOff);
nSrcXOff = nChunkXOff;
}
if( poColorTable == nullptr )
......
.TH "gdal-config" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdal-config" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......
.TH "gdal2tiles" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdal2tiles" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......
.TH "gdal_calc" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdal_calc" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......
.TH "gdal_contour" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdal_contour" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......
.TH "gdal_edit" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdal_edit" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......
.TH "gdal_fillnodata" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdal_fillnodata" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......
.TH "gdal_grid" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdal_grid" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......
.TH "gdal_merge" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdal_merge" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......
.TH "gdal_pansharpen" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdal_pansharpen" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......
.TH "gdal_polygonize" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdal_polygonize" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......
.TH "gdal_proximity" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdal_proximity" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......
.TH "gdal_rasterize" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdal_rasterize" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......
.TH "gdal_retile" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdal_retile" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......
.TH "gdal_sieve" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdal_sieve" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......
.TH "gdal_translate" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdal_translate" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......
.TH "gdal_utilities" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdal_utilities" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......
.TH "gdaladdo" 1 "Sat Jun 23 2018" "GDAL" \" -*- nroff -*-
.TH "gdaladdo" 1 "Fri Sep 21 2018" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
......