mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Merge pull request #1104 from leyan/projectCRS
Consistent management of project CRS properties in project file
This commit is contained in:
commit
00680cd78b
@ -3299,7 +3299,9 @@ void QgisApp::fileNew( bool thePromptToSaveFlag, bool forceBlank )
|
||||
srs.createFromOgcWmsCrs( defCrs );
|
||||
myRenderer->setDestinationCrs( srs );
|
||||
// write the projections _proj string_ to project settings
|
||||
prj->writeEntry( "SpatialRefSys", "/ProjectCrs", defCrs );
|
||||
prj->writeEntry( "SpatialRefSys", "/ProjectCRSProj4String", srs.toProj4() );
|
||||
prj->writeEntry( "SpatialRefSys", "/ProjectCrs", srs.authid() );
|
||||
prj->writeEntry( "SpatialRefSys", "/ProjectCRSID", (int) srs.srsid() );
|
||||
prj->dirty( false );
|
||||
if ( srs.mapUnits() != QGis::UnknownUnit )
|
||||
{
|
||||
@ -8086,9 +8088,6 @@ void QgisApp::updateCRSStatusBar()
|
||||
|
||||
void QgisApp::destinationSrsChanged()
|
||||
{
|
||||
// save this information to project
|
||||
long srsid = mMapCanvas->mapRenderer()->destinationCrs().srsid();
|
||||
QgsProject::instance()->writeEntry( "SpatialRefSys", "/ProjectCRSID", ( int )srsid );
|
||||
updateCRSStatusBar();
|
||||
}
|
||||
|
||||
|
@ -589,6 +589,8 @@ void QgsProjectProperties::apply()
|
||||
// write the currently selected projections _proj string_ to project settings
|
||||
QgsDebugMsg( QString( "SpatialRefSys/ProjectCRSProj4String: %1" ).arg( projectionSelector->selectedProj4String() ) );
|
||||
QgsProject::instance()->writeEntry( "SpatialRefSys", "/ProjectCRSProj4String", projectionSelector->selectedProj4String() );
|
||||
QgsProject::instance()->writeEntry( "SpatialRefSys", "/ProjectCRSID", (int) projectionSelector->selectedCrsId() );
|
||||
QgsProject::instance()->writeEntry( "SpatialRefSys", "/ProjectCrs", projectionSelector->selectedAuthId() );
|
||||
|
||||
// Set the map units to the projected coordinates if we are projecting
|
||||
if ( isProjected() )
|
||||
|
Loading…
x
Reference in New Issue
Block a user