Skip to content

Commit

Permalink
Write resampler types to xml
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jan 19, 2012
1 parent 6641652 commit f93beaf
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions src/core/raster/qgsrasterlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ email : tim at linfiniti.com
#include "qgssinglebandpseudocolorrenderer.h"
#include "qgssinglebandgrayrenderer.h"

//resamplers
#include "qgsbilinearrasterresampler.h"
#include "qgscubicrasterresampler.h"

#include <cstdio>
#include <cmath>
#include <limits>
Expand Down Expand Up @@ -3277,14 +3281,31 @@ bool QgsRasterLayer::writeSymbology( QDomNode & layer_node, QDomDocument & docum
QDomElement rasterPropertiesElement = document.createElement( "rasterproperties" );
layer_node.appendChild( rasterPropertiesElement );

#if 0
// resampler
QString resamplerName = mResampler ? mResampler->type() : "nearest neighbour";
QDomElement resamplerElem = document.createElement( "resampler" );
QDomText resamplerText = document.createTextNode( resamplerName );
resamplerElem.appendChild( resamplerText );
rasterPropertiesElement.appendChild( resamplerElem );
#endif //0
if ( mRenderer )
{
QString zoomedInResamplerString = "nearest";
const QgsRasterResampler* zoomedInResampler = mRenderer->zoomedInResampler();
if ( zoomedInResampler )
{
zoomedInResamplerString = zoomedInResampler->type();
}
QDomElement zoomedInResamplerElem = document.createElement( "zoomedInResampler" );
QDomText zoomedInResamplerText = document.createTextNode( zoomedInResamplerString );
zoomedInResamplerElem.appendChild( zoomedInResamplerText );
rasterPropertiesElement.appendChild( zoomedInResamplerElem );

QString zoomedOutResamplerString = "nearest";
const QgsRasterResampler* zoomedOutResampler = mRenderer->zoomedOutResampler();
if ( zoomedOutResampler )
{
zoomedOutResamplerString = zoomedOutResampler->type();
}
QDomElement zoomedOutResamplerElem = document.createElement( "zoomedOutResampler" );
QDomText zoomedOutResamplerText = document.createTextNode( zoomedOutResamplerString );
zoomedOutResamplerElem.appendChild( zoomedOutResamplerText );
rasterPropertiesElement.appendChild( zoomedOutResamplerElem );
}

QStringList sl = subLayers();
QStringList sls = mDataProvider->subLayerStyles();
Expand Down

0 comments on commit f93beaf

Please sign in to comment.