Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
More wms optimisations: create pallabeling only once, take crs from c…
…ache
  • Loading branch information
mhugent committed Dec 7, 2012
1 parent 2da5cc9 commit ea4e77a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -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 )
Expand Down
2 changes: 2 additions & 0 deletions src/mapserver/qgis_map_serv.cpp
Expand Up @@ -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>
Expand Down Expand Up @@ -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 )
{
Expand Down
2 changes: 0 additions & 2 deletions src/mapserver/qgswmsserver.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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() );
Expand Down

0 comments on commit ea4e77a

Please sign in to comment.