Skip to content

Commit a18ae68

Browse files
committed
Improve WMS server performance
1 parent 0ec5dc4 commit a18ae68

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/core/qgscoordinatetransform.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,11 @@ void QgsCoordinateTransform::transformInPlace( double& x, double& y, double& z,
321321

322322
void QgsCoordinateTransform::transformPolygon( QPolygonF& poly, TransformDirection direction ) const
323323
{
324+
if ( mShortCircuit || !mInitialisedFlag )
325+
{
326+
return;
327+
}
328+
324329
//create x, y arrays
325330
int nVertices = poly.size();
326331

src/mapserver/qgshttprequesthandler.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -571,17 +571,17 @@ void QgsHttpRequestHandler::imageColors( QHash<QRgb, int>& colors, const QImage&
571571
int width = image.width();
572572
int height = image.height();
573573

574-
QRgb currentColor;
574+
const QRgb* currentScanLine = 0;
575575
QHash<QRgb, int>::iterator colorIt;
576576
for ( int i = 0; i < height; ++i )
577577
{
578+
currentScanLine = ( const QRgb* )( image.scanLine( i ) );
578579
for ( int j = 0; j < width; ++j )
579580
{
580-
currentColor = image.pixel( j, i );
581-
colorIt = colors.find( currentColor );
581+
colorIt = colors.find( currentScanLine[j] );
582582
if ( colorIt == colors.end() )
583583
{
584-
colors.insert( currentColor, 1 );
584+
colors.insert( currentScanLine[j], 1 );
585585
}
586586
else
587587
{

0 commit comments

Comments
 (0)