Skip to content
Permalink
Browse files
** Fixed a bug that crashed QGIS when loading rasters from a project …
…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 8b956c1fc79d51725c23bac2b95eac3e7bb7c797
Showing with 23 additions and 24 deletions.
  1. +3 −0 ChangeLog
  2. +1 −1 configure.in
  3. +19 −23 src/qgsrasterlayer.cpp
@@ -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
@@ -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
@@ -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
@@ -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

0 comments on commit 8b956c1

Please sign in to comment.