Skip to content
Permalink
Browse files

By default use the reference OGC dpi

Calculate from the OGC reference pixel size
  • Loading branch information
Stéphane Brunner
Stéphane Brunner committed Sep 13, 2013
1 parent 902995e commit 617fa6872239561469884a01fca552ab0a751dc4
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/mapserver/qgswmsserver.cpp
@@ -1109,16 +1109,18 @@ QImage* QgsWMSServer::createImage( int width, int height ) const

//apply DPI parameter if present. This is an extension of QGIS mapserver compared to WMS 1.3.
//Because of backwards compatibility, this parameter is optional
double OGC_PX_M = 0.00028; // OGC referance pixel size in meter, also used by qgis
int dpm = 1 / OGC_PX_M;
if ( mParameterMap.contains( "DPI" ) )
{
int dpi = mParameterMap[ "DPI" ].toInt( &conversionSuccess );
if ( conversionSuccess )
{
int dpm = dpi / 0.0254;
theImage->setDotsPerMeterX( dpm );
theImage->setDotsPerMeterY( dpm );
dpm = dpi / 0.0254;
}
}
theImage->setDotsPerMeterX( dpm );
theImage->setDotsPerMeterY( dpm );
return theImage;
}

0 comments on commit 617fa68

Please sign in to comment.
You can’t perform that action at this time.