mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Fix projections broken by my last commit
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@3220 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
93ac42625c
commit
199ba75978
@ -91,7 +91,7 @@ void QgsCoordinateTransform::initialise()
|
||||
" AUTHORITY[\"EPSG\",4326]]";
|
||||
//default input projection to geo wgs84
|
||||
// XXX Warning - multiple return paths in this block!!
|
||||
if (mSourceSRS->isValid())
|
||||
if (!mSourceSRS->isValid())
|
||||
{
|
||||
//mSourceSRS = defaultWkt;
|
||||
// Pass through with no projection since we have no idea what the layer
|
||||
@ -100,7 +100,7 @@ void QgsCoordinateTransform::initialise()
|
||||
return;
|
||||
}
|
||||
|
||||
if (mDestSRS->isValid())
|
||||
if (!mDestSRS->isValid())
|
||||
{
|
||||
//No destination projection is set so we set the default output projection to
|
||||
//be the same as input proj. This only happens on the first layer loaded
|
||||
@ -122,11 +122,12 @@ void QgsCoordinateTransform::initialise()
|
||||
// Transform must take place
|
||||
mShortCircuit=false;
|
||||
}
|
||||
|
||||
mProj4DestParms=mDestSRS->toProjString().latin1();
|
||||
mProj4SrcParms=mSourceSRS->toProjString().latin1();
|
||||
|
||||
// init the projections (destination and source)
|
||||
mDestinationProjection = pj_init_plus(mDestSRS->toProjString().latin1());
|
||||
mSourceProjection = pj_init_plus(mSourceSRS->toProjString().latin1());
|
||||
mDestinationProjection = pj_init_plus(mProj4DestParms);
|
||||
mSourceProjection = pj_init_plus(mProj4SrcParms);
|
||||
|
||||
#ifdef QGISDEBUG
|
||||
//OGRErr sourceValid = mSourceOgrSpatialRef.Validate();
|
||||
|
@ -107,7 +107,8 @@ void QgsSpatialRefSys::createFromUserSrsId (long theSrsId)
|
||||
|
||||
QString QgsSpatialRefSys::toProjString () const
|
||||
{
|
||||
|
||||
//place holder for now....shoudl concatenate proj family, elliposid and parameters
|
||||
return mParameters;
|
||||
}
|
||||
|
||||
bool QgsSpatialRefSys::isValid() const
|
||||
|
@ -2652,6 +2652,9 @@ void QgsVectorLayer::setCoordinateSystem()
|
||||
//QString defaultWkt = QgsSpatialReferences::instance()->getSrsBySrid("4326")->srText();
|
||||
QString myDestWKT = QgsProject::instance()->readEntry("SpatialRefSys","/WKT","");
|
||||
|
||||
|
||||
|
||||
/* XXXX DONT THING WE NEED THIS HERE ANYMORE XXXXXXXXXXXX
|
||||
// try again with a morph from esri
|
||||
// set up the spatial ref
|
||||
OGRSpatialReference myInputSpatialRefSys;
|
||||
@ -2663,6 +2666,7 @@ void QgsVectorLayer::setCoordinateSystem()
|
||||
OGRSpatialReference myOutputSpatialRefSys;
|
||||
pWkt = (char *) myDestWKT.ascii();
|
||||
myOutputSpatialRefSys.importFromWkt(&pWkt);
|
||||
*/
|
||||
|
||||
//
|
||||
// Sort out what to do with this layer's coordinate system (CS). We have
|
||||
@ -2724,8 +2728,8 @@ void QgsVectorLayer::setCoordinateSystem()
|
||||
mCoordinateTransform = new QgsCoordinateTransform(mySourceWKT, myDestWKT);
|
||||
#ifdef QGISDEBUG
|
||||
std::cout << ">>>>>>>>>>>> Transform for layer created:" << std::endl;
|
||||
std::cout << ">>>>>>>>>>>> LayerCS:\n" << mySourceWKT << std::endl;
|
||||
std::cout << ">>>>>>>>>>>> ProjectCS:\n" << myDestWKT << std::endl;
|
||||
std::cout << ">>>>>>>>>>>> LayerCS:\n" << mCoordinateTransform->sourceSRS()->parameters() << std::endl;
|
||||
std::cout << ">>>>>>>>>>>> ProjectCS:\n" << mCoordinateTransform->destSRS()->parameters() << std::endl;
|
||||
std::cout << ">>>>>>>>>>>> ----------------------------------------------------" << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user