Skip to content
Permalink
Browse files

Write resampler types to xml

  • Loading branch information
mhugent committed Jan 19, 2012
1 parent 6641652 commit f93beafe2976d42ff668a6f4afca16844290b52c
Showing with 28 additions and 7 deletions.
  1. +28 −7 src/core/raster/qgsrasterlayer.cpp
@@ -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>
@@ -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();

0 comments on commit f93beaf

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