Skip to content
Permalink
Browse files
** Fixed a bug that crashed QGIS when loading rasters from a project …
…file

git-svn-id: http://svn.osgeo.org/qgis/trunk@2558 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
larsl committed Jan 1, 2005
1 parent 4919d87 commit bd69e2967a317784334aea1d06a068368977bec1
Showing with 26 additions and 19 deletions.
  1. +3 −0 ChangeLog
  2. +1 −1 configure.in
  3. +22 −18 src/qgsrasterlayer.cpp
@@ -2,6 +2,9 @@



QGIS Change Log
2005-01-01 [larsl] 0.6.0devel3
** Fixed a bug that crashed QGIS when loading rasters from a project file
QGIS Change Log
/* ChangeLog,v 1.214 2004/11/12 00:42:21 gsherman Exp */
------------------------------------------------------------------------------
@@ -26,7 +26,7 @@ dnl ---------------------------------------------------------------------------
MAJOR_VERSION=0
MINOR_VERSION=6
MICRO_VERSION=0
EXTRA_VERSION=2
EXTRA_VERSION=3
if test $EXTRA_VERSION -eq 0; then
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}
else
@@ -403,11 +403,32 @@ QgsRasterLayer::QgsRasterLayer(QString path, QString baseName)
layerTitle = layerTitle.left(1).upper() + layerTitle.mid(1);
setLayerName(layerTitle);
}

// Set the layers destination CS
//hard coding to geo/wgs84 for now
QString myDestWKT = "GEOGCS[\"WGS 84\", "
" DATUM[\"WGS_1984\", "
" SPHEROID[\"WGS 84\",6378137,298.257223563, "
" AUTHORITY[\"EPSG\",7030]], "
" TOWGS84[0,0,0,0,0,0,0], "
" AUTHORITY[\"EPSG\",6326]], "
" PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",8901]], "
" UNIT[\"DMSH\",0.0174532925199433,AUTHORITY[\"EPSG\",9108]], "
" AXIS[\"Lat\",NORTH], "
" AXIS[\"Long\",EAST], "
" AUTHORITY[\"EPSG\",4326]]";

// load the file if one specified
if ( ! path.isEmpty() )
{
readFile( path ); // XXX add check for false?
if ( readFile( path ) )
{
// Get the layer's projection info and set up the
// QgsCoordinateTransform for this layer
QString mySourceWKT = getProjectionWKT();
mCoordinateTransform =
new QgsCoordinateTransform(mySourceWKT,myDestWKT);
}
}

// Transparency slider for popup meni
@@ -417,23 +438,6 @@ QgsRasterLayer::QgsRasterLayer(QString path, QString baseName)
// // emit a signal asking for a repaint
// emit repaintRequested();

//
// Get the layers project info and set up the QgsCoordinateTransform for this layer
//
QString mySourceWKT = getProjectionWKT();
//hard coding to geo/wgs84 for now
QString myDestWKT = "GEOGCS[\"WGS 84\", "
" DATUM[\"WGS_1984\", "
" SPHEROID[\"WGS 84\",6378137,298.257223563, "
" AUTHORITY[\"EPSG\",7030]], "
" TOWGS84[0,0,0,0,0,0,0], "
" AUTHORITY[\"EPSG\",6326]], "
" PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",8901]], "
" UNIT[\"DMSH\",0.0174532925199433,AUTHORITY[\"EPSG\",9108]], "
" AXIS[\"Lat\",NORTH], "
" AXIS[\"Long\",EAST], "
" AUTHORITY[\"EPSG\",4326]]";
mCoordinateTransform = new QgsCoordinateTransform(mySourceWKT,myDestWKT);
} // QgsRasterLayer ctor


0 comments on commit bd69e29

Please sign in to comment.