mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-10 00:04:23 -04:00
fix windows build
git-svn-id: http://svn.osgeo.org/qgis/trunk@15426 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
9724f79ab6
commit
eeceed42a3
@ -4,5 +4,6 @@ SET OSGEO4W_ROOT=@osgeo4w@
|
||||
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
|
||||
call "%OSGEO4W_ROOT%"\bin\grass-env.bat
|
||||
@echo off
|
||||
SET GDAL_DRIVER_PATH=%OSGEO4W_ROOT%\bin\gdalplugins\1.8
|
||||
path %PATH%;%GISBASE%\bin
|
||||
start "Quantum GIS" /B "%OSGEO4W_ROOT%"\apps\@package@\bin\qgis.exe %*
|
||||
|
@ -22,8 +22,6 @@
|
||||
#include "qgsgdalprovider.h"
|
||||
#include "qgsconfig.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "qgsapplication.h"
|
||||
#include "qgscoordinatetransform.h"
|
||||
#include "qgsrectangle.h"
|
||||
@ -302,7 +300,7 @@ QgsGdalProvider::QgsGdalProvider( QString const & uri )
|
||||
// This block of code was in old version in QgsRasterLayer::bandStatistics
|
||||
//ifdefs below to remove compiler warning about unused vars
|
||||
#ifdef QGISDEBUG
|
||||
/*
|
||||
#if 0
|
||||
int success;
|
||||
double GDALminimum = GDALGetRasterMinimum( myGdalBand, &success );
|
||||
|
||||
@ -341,7 +339,7 @@ QgsGdalProvider::QgsGdalProvider( QString const & uri )
|
||||
QgsLogger::debug( "exactly computed GDALmaximum:", GDALrange[1] );
|
||||
|
||||
QgsDebugMsg( "starting manual stat computation" );
|
||||
*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
mValid = true;
|
||||
@ -559,20 +557,20 @@ void QgsGdalProvider::readBlock( int theBandNo, QgsRectangle const & theExtent,
|
||||
|
||||
if ( myRasterExtent.yMaximum() < theExtent.yMaximum() )
|
||||
{
|
||||
top = static_cast<int> ( round( ( theExtent.yMaximum() - myRasterExtent.yMaximum() ) / yRes ) );
|
||||
top = qRound(( theExtent.yMaximum() - myRasterExtent.yMaximum() ) / yRes );
|
||||
}
|
||||
if ( myRasterExtent.yMinimum() > theExtent.yMinimum() )
|
||||
{
|
||||
bottom = static_cast<int> ( round( ( theExtent.yMaximum() - myRasterExtent.yMinimum() ) / yRes ) - 1 );
|
||||
bottom = qRound(( theExtent.yMaximum() - myRasterExtent.yMinimum() ) / yRes ) - 1;
|
||||
}
|
||||
|
||||
if ( myRasterExtent.xMinimum() > theExtent.xMinimum() )
|
||||
{
|
||||
left = static_cast<int> ( round( ( myRasterExtent.xMinimum() - theExtent.xMinimum() ) / xRes ) );
|
||||
left = qRound(( myRasterExtent.xMinimum() - theExtent.xMinimum() ) / xRes );
|
||||
}
|
||||
if ( myRasterExtent.xMaximum() < theExtent.xMaximum() )
|
||||
{
|
||||
right = static_cast<int> ( round( ( myRasterExtent.xMaximum() - theExtent.xMinimum() ) / xRes ) - 1 );
|
||||
right = qRound(( myRasterExtent.xMaximum() - theExtent.xMinimum() ) / xRes ) - 1;
|
||||
}
|
||||
QgsDebugMsg( QString( "top = %1 bottom = %2 left = %3 right = %4" ).arg( top ).arg( bottom ).arg( left ).arg( right ) );
|
||||
|
||||
@ -653,21 +651,17 @@ void QgsGdalProvider::readBlock( int theBandNo, QgsRectangle const & theExtent,
|
||||
|
||||
QgsDebugMsg( QString( "width = %1 height = %2 rasterWidth = %3 rasterHeight = %4" ).arg( width ).arg( height ).arg( rasterWidth ).arg( rasterHeight ) );
|
||||
|
||||
|
||||
double rasterXRes = extent().width() / xSize();
|
||||
double rasterYRes = extent().height() / ySize();
|
||||
|
||||
// TODO: what is better floor/ceil, can be negative?
|
||||
// should be similar
|
||||
//double xAdd = rasterWidth*rasterXRes - width*xRes;
|
||||
double xAdd = leftSpace + rightSpace;
|
||||
int xAddPixels = static_cast<int> ( round( xAdd / xRes ) );
|
||||
int leftAddPixels = static_cast<int> ( round( leftSpace / xRes ) );
|
||||
int xAddPixels = qRound( xAdd / xRes );
|
||||
int leftAddPixels = qRound( leftSpace / xRes );
|
||||
|
||||
//double leftAdd = rasterWidth*rasterXRes - width*xRes;
|
||||
double yAdd = topSpace + bottomSpace;
|
||||
int yAddPixels = static_cast<int> ( round( yAdd / yRes ) );
|
||||
int topAddPixels = static_cast<int> ( round( topSpace / yRes ) );
|
||||
int yAddPixels = qRound( yAdd / yRes );
|
||||
int topAddPixels = qRound( topSpace / yRes );
|
||||
|
||||
QgsDebugMsg( QString( "xAddPixels = %1 yAddPixels = %2 leftAddPixels = %3 topAddPixels = %4" ).arg( xAddPixels ).arg( yAddPixels ).arg( leftAddPixels ).arg( topAddPixels ) );
|
||||
// Currently only positive allowed, verify if negative has sense and check following use
|
||||
@ -708,7 +702,8 @@ void QgsGdalProvider::readBlock( int theBandNo, QgsRectangle const & theExtent,
|
||||
|
||||
// Cal nLineSpace if raster does not cover whole extent
|
||||
int nLineSpace = size * thePixelWidth;
|
||||
if ( left != 0 ) {
|
||||
if ( left != 0 )
|
||||
{
|
||||
block += size * left;
|
||||
}
|
||||
CPLErr err = GDALRasterIO( gdalBand, GF_Read,
|
||||
@ -736,7 +731,8 @@ void QgsGdalProvider::readBlock( int theBandNo, QgsRectangle const & theExtent,
|
||||
return;
|
||||
}
|
||||
|
||||
for ( int i = 0; i < height; i++ ) {
|
||||
for ( int i = 0; i < height; i++ )
|
||||
{
|
||||
int r = i + topAddPixels;
|
||||
char *src = ( char * )tmpBlock + size * r * totalWidth + size * leftAddPixels;
|
||||
char *dst = ( char * )theBlock + size * ( top + i ) * thePixelWidth + size * ( left );
|
||||
@ -846,7 +842,7 @@ void QgsGdalProvider::readBlock( int theBandNo, QgsRectangle const & theExtent,
|
||||
+ QString::fromUtf8( CPLGetLastErrorMsg() ) );
|
||||
return;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
//CPLAssert( myWarpOptions->pTransformerArg != NULL );
|
||||
myWarpOptions->pfnTransformer = GDALGenImgProjTransform;
|
||||
@ -877,7 +873,7 @@ void QgsGdalProvider::readBlock( int theBandNo, QgsRectangle const & theExtent,
|
||||
+ QString::fromUtf8( CPLGetLastErrorMsg() ) );
|
||||
return;
|
||||
|
||||
};
|
||||
}
|
||||
CPLErrorReset();
|
||||
CPLErr myErr;
|
||||
myErr = myOperation.ChunkAndWarpImage( 0, 0, thePixelWidth, thePixelHeight );
|
||||
@ -1615,7 +1611,7 @@ QGISEXTERN void buildSupportedRasterFileFilter( QString & theFileFiltersString )
|
||||
{
|
||||
QgsDebugMsg( "Entered" );
|
||||
// first get the GDAL driver manager
|
||||
//registerGdalDrivers();
|
||||
QgsGdalProvider::registerGdalDrivers();
|
||||
|
||||
// then iterate through all of the supported drivers, adding the
|
||||
// corresponding file filter
|
||||
@ -1785,7 +1781,7 @@ QGISEXTERN bool isValidRasterFileName( QString const & theFileNameQString, QStri
|
||||
{
|
||||
GDALDatasetH myDataset;
|
||||
|
||||
GDALAllRegister();
|
||||
QgsGdalProvider::registerGdalDrivers();
|
||||
|
||||
CPLErrorReset();
|
||||
|
||||
|
@ -23,8 +23,6 @@
|
||||
#include "qgsgrassrasterprovider.h"
|
||||
#include "qgsconfig.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "qgsapplication.h"
|
||||
#include "qgscoordinatetransform.h"
|
||||
#include "qgsrectangle.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user