Skip to content

Commit

Permalink
Fixed some rev-up for rasters
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@7934 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Jan 11, 2008
1 parent 5e59df4 commit 488bffb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
26 changes: 23 additions & 3 deletions src/core/qgsprojectfiletransform.cpp
Expand Up @@ -28,8 +28,8 @@ typedef QgsProjectVersion PFV;

QgsProjectFileTransform::transform QgsProjectFileTransform::transformers[] = {
{PFV(0,8,1), PFV(0,9,0), &QgsProjectFileTransform::transform081to090},
{PFV(0,9,0), PFV(0,9,1), &QgsProjectFileTransform::transform090to091},
{PFV(0,9,1), PFV(0,9,2), &QgsProjectFileTransform::transformNull}
{PFV(0,9,0), PFV(0,9,1), &QgsProjectFileTransform::transformNull},
{PFV(0,9,1), PFV(0,9,2), &QgsProjectFileTransform::transform091to092}
};

bool QgsProjectFileTransform::updateRevision(QgsProjectVersion newVersion)
Expand Down Expand Up @@ -174,11 +174,31 @@ void QgsProjectFileTransform::transform081to090()

};

void QgsProjectFileTransform::transform090to091()
void QgsProjectFileTransform::transform091to092()
{
QgsDebugMsg("entering");
if ( ! mDom.isNull() )
{
// Insert transforms here!
QDomNodeList rasterPropertyList = mDom.elementsByTagName("rasterproperties");
QgsDebugMsg(QString("Raster properties file entries: ") + QString::number(rasterPropertyList.count()));
for (int i = 0; i < rasterPropertyList.count(); i++)
{
// Get one rasterproperty element from list, and rename the sub-properties.
QDomNode rasterProperty = rasterPropertyList.item(i);
// rasterProperty.namedItem("").toElement().setTagName("");

rasterProperty.namedItem("stdDevsToPlotDouble").toElement().setTagName("mStandardDeviations");

rasterProperty.namedItem("invertHistogramFlag").toElement().setTagName("mInvertPixelsFlag");
rasterProperty.namedItem("showDebugOverLayFlag").toElement().setTagName("mDebugOverLayFlag");

rasterProperty.namedItem("redBandNameQString").toElement().setTagName("mRedBandName");
rasterProperty.namedItem("blueBandNameQString").toElement().setTagName("mBlueBandName");
rasterProperty.namedItem("greenBandNameQString").toElement().setTagName("mGreenBandName");
rasterProperty.namedItem("grayBandNameQString").toElement().setTagName("mGrayBandName");
}

}
return;

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsprojectfiletransform.h
Expand Up @@ -75,7 +75,7 @@ class QgsProjectFileTransform
// to the transformArray with proper version number
void transformNull() {}; // Do absolutely nothing
void transform081to090();
void transform090to091();
void transform091to092();
};


Expand Down
8 changes: 4 additions & 4 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -4092,12 +4092,12 @@ double QgsRasterLayer::readValue ( void *data, GDALDataType type, int index )
<layername>Wynoochee_dem</layername>
<datasource>/home/mcoletti/mnt/MCOLETTIF8F9/c/Toolkit_Course/Answers/Training_Data/wynoochee_dem.img</datasource>
<zorder>0</zorder>
<transparencyLevelInt>255</transparencyLevelInt>
<rasterproperties>
<mDebugOverlayFlag boolean="false"/>
<drawingStyle>SINGLE_BAND_GRAY</drawingStyle>
<mInvertPixelsFlag boolean="false"/>
<mStandardDeviations>0</mStandardDeviations>
<transparencyLevel>255</transparencyLevel>
<mRedBandName>Not Set</mRedBandName>
<mGreenBandName>Not Set</mGreenBandName>
<mBlueBandName>Not Set</mBlueBandName>
Expand Down Expand Up @@ -4212,12 +4212,12 @@ bool QgsRasterLayer::readXML_( QDomNode & layer_node )

snode = mnl.namedItem("mGrayBandName");
myElement = snode.toElement();
std::cout << __FILE__ << ":" << __LINE__<< " Setting gray band to : " << myElement.text().data() << std::endl;
QgsDebugMsg(QString(" Setting gray band to : ") + myElement.text());
setGrayBandName(myElement.text());

snode = mnl.namedItem("mStandardDeviations");
myElement = snode.toElement();
setStdDevsToPlot(myElement.text().toInt());
setStdDevsToPlot(myElement.text().toDouble());

snode = mnl.namedItem("contrastEnhancementAlgorithm");
myElement = snode.toElement();
Expand Down Expand Up @@ -4250,7 +4250,7 @@ bool QgsRasterLayer::readXML_( QDomNode & layer_node )
snode = mnl.namedItem("mNoDataValue");
myElement = snode.toElement();
setNoDataValue(myElement.text().toDouble());
if(myElement.attribute("mValidNoDataValue") == "false")
if(myElement.attribute("mValidNoDataValue", "false") != "true")
{
mValidNoDataValue = false;
}
Expand Down

0 comments on commit 488bffb

Please sign in to comment.