Skip to content

Commit

Permalink
** Fixed a bug that crashed QGIS when loading rasters from a project …
Browse files Browse the repository at this point in the history
…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 bd69e29
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Expand Up @@ -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 */
------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion configure.in
Expand Up @@ -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
Expand Down
40 changes: 22 additions & 18 deletions src/qgsrasterlayer.cpp
Expand Up @@ -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
Expand All @@ -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


Expand Down

0 comments on commit bd69e29

Please sign in to comment.