@@ -364,7 +364,7 @@ void QgsRasterLayer::buildSupportedRasterFileFilter( QString & theFileFiltersStr
364
364
if ( !( myGdalDriverExtension.isEmpty () || myGdalDriverLongName.isEmpty () ) )
365
365
{
366
366
// XXX add check for SDTS; in that case we want (*CATD.DDF)
367
- QString glob = " *." + myGdalDriverExtension.replace (" /" , " *." );
367
+ QString glob = " *." + myGdalDriverExtension.replace ( " /" , " *." );
368
368
// Add only the first JP2 driver found to the filter list (it's the one GDAL uses)
369
369
if ( myGdalDriverDescription == " JPEG2000" ||
370
370
myGdalDriverDescription.startsWith ( " JP2" ) ) // JP2ECW, JP2KAK, JP2MrSID
@@ -1558,14 +1558,23 @@ bool QgsRasterLayer::draw( QgsRenderContext& rendererContext )
1558
1558
1559
1559
int currentPixelOffsetY = 0 ; // top y-coordinate of current raster part
1560
1560
// the width of a WMS image part
1561
- int pixelWidth = ( myRasterExtent.xMaximum () - myRasterExtent.xMinimum () ) / theQgsMapToPixel.mapUnitsPerPixel ();
1561
+ int pixelWidth = ( myRasterExtent.xMaximum () - myRasterExtent.xMinimum () ) / theQgsMapToPixel.mapUnitsPerPixel () + 0.5 ;
1562
1562
for ( int i = 0 ; i < numParts; ++i )
1563
1563
{
1564
1564
// fetch a small overlap of 2 pixels between two adjacent tiles to avoid white stripes
1565
1565
QgsRectangle rasterPartRect ( myRasterExtent.xMinimum (), myRasterExtent.yMaximum () - ( currentPixelOffsetY + numRowsPerPart + 2 ) * theQgsMapToPixel.mapUnitsPerPixel (),
1566
1566
myRasterExtent.xMaximum (), myRasterExtent.yMaximum () - currentPixelOffsetY * theQgsMapToPixel.mapUnitsPerPixel () );
1567
1567
1568
- int pixelHeight = rasterPartRect.height () / theQgsMapToPixel.mapUnitsPerPixel ();
1568
+ int pixelHeight = rasterPartRect.height () / theQgsMapToPixel.mapUnitsPerPixel () + 0.5 ;
1569
+
1570
+ /*
1571
+ QgsDebugMsg( "**********WMS tile parameter***************" );
1572
+ QgsDebugMsg( "pixelWidth: " + QString::number( pixelWidth ) );
1573
+ QgsDebugMsg( "pixelHeight: " + QString::number( pixelHeight ) );
1574
+ QgsDebugMsg( "mapWidth: " + QString::number( rasterPartRect.width() ) );
1575
+ QgsDebugMsg( "mapHeight: " + QString::number( rasterPartRect.height(), 'f', 8 ) );
1576
+ QgsDebugMsg( "mapUnitsPerPixel: " + QString::number( theQgsMapToPixel.mapUnitsPerPixel() ) );*/
1577
+
1569
1578
QImage* image = mDataProvider ->draw ( rasterPartRect, pixelWidth, pixelHeight );
1570
1579
1571
1580
if ( !image )
0 commit comments