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, pt 2

git-svn-id: http://svn.osgeo.org/qgis/trunk@2559 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
larsl committed Jan 1, 2005
1 parent bd69e29 commit 8b956c1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 24 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Expand Up @@ -2,6 +2,9 @@



QGIS Change Log
2005-01-01 [larsl] 0.6.0devel4
** Fixed a bug that crashed QGIS when loading rasters from a project file, pt 2
QGIS Change Log
2005-01-01 [larsl] 0.6.0devel3
** Fixed a bug that crashed QGIS when loading rasters from a project file
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=3
EXTRA_VERSION=4
if test $EXTRA_VERSION -eq 0; then
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}
else
Expand Down
42 changes: 19 additions & 23 deletions src/qgsrasterlayer.cpp
Expand Up @@ -404,31 +404,10 @@ QgsRasterLayer::QgsRasterLayer(QString path, QString baseName)
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() )
{
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);
}
readFile( path ); // XXX check for failure?
}

// Transparency slider for popup meni
Expand Down Expand Up @@ -584,7 +563,24 @@ QgsRasterLayer::readFile( QString const & fileName )
grayBandNameQString = "Undefined"; // sensible default
}
}


// Get the layer's projection 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);

return true;

} // QgsRasterLayer::readFile
Expand Down

0 comments on commit 8b956c1

Please sign in to comment.