Skip to content
Permalink
Browse files
More wms optimisations: create pallabeling only once, take crs from c…
…ache
  • Loading branch information
mhugent committed Dec 7, 2012
1 parent 2da5cc9 commit ea4e77af04a6dd8930348d83afde33681211a26b
Showing with 5 additions and 4 deletions.
  1. +3 −2 src/core/qgscoordinatereferencesystem.cpp
  2. +2 −0 src/mapserver/qgis_map_serv.cpp
  3. +0 −2 src/mapserver/qgswmsserver.cpp
@@ -286,8 +286,9 @@ void QgsCoordinateReferenceSystem::validate()
mCustomSrsValidation( this );

if ( !mIsValidFlag )
// set the default
createFromOgcWmsCrs( GEO_EPSG_CRS_AUTHID );
{
*this = QgsCRSCache::instance()->crsByAuthId( GEO_EPSG_CRS_AUTHID );
}
}

bool QgsCoordinateReferenceSystem::createFromSrid( long id )
@@ -29,6 +29,7 @@ map service syntax for SOAP/HTTP POST
#include "qgswfsserver.h"
#include "qgsmaprenderer.h"
#include "qgsmapserviceexception.h"
#include "qgspallabeling.h"
#include "qgsprojectparser.h"
#include "qgssldparser.h"
#include <QDomDocument>
@@ -198,6 +199,7 @@ int main( int argc, char * argv[] )

//creating QgsMapRenderer is expensive (access to srs.db), so we do it here before the fcgi loop
QgsMapRenderer* theMapRenderer = new QgsMapRenderer();
theMapRenderer->setLabelingEngine( new QgsPalLabeling() );

while ( fcgi_accept() >= 0 )
{
@@ -24,7 +24,6 @@
#include "qgsmaplayerregistry.h"
#include "qgsmaprenderer.h"
#include "qgsmaptopixel.h"
#include "qgspallabeling.h"
#include "qgsproject.h"
#include "qgsrasterlayer.h"
#include "qgsscalecalculator.h"
@@ -941,7 +940,6 @@ QImage* QgsWMSServer::initializeRendering( QStringList& layersList, QStringList&
delete theImage;
return 0;
}
mMapRenderer->setLabelingEngine( new QgsPalLabeling() );

//find out the current scale denominater and set it to the SLD parser
QgsScaleCalculator scaleCalc(( theImage->logicalDpiX() + theImage->logicalDpiY() ) / 2 , mMapRenderer->destinationCrs().mapUnits() );

0 comments on commit ea4e77a

Please sign in to comment.