Skip to content

Commit 8a1460f

Browse files
[app] Fix Paste Features As New Vector Layer
when the pasted features don't have the CRS information
1 parent 9b78cf9 commit 8a1460f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/app/qgisapp.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -8378,8 +8378,15 @@ QString QgisApp::saveAsVectorFileGeneral( QgsVectorLayer *vlayer, bool symbology
83788378

83798379
if ( destCRS.isValid() )
83808380
{
8381-
QgsDatumTransformDialog::run( vlayer->crs(), destCRS, this, mMapCanvas );
8382-
ct = QgsCoordinateTransform( vlayer->crs(), destCRS, QgsProject::instance() );
8381+
if ( !vlayer->crs().isValid() )
8382+
{
8383+
vlayer->setCrs( destCRS );
8384+
}
8385+
else if ( vlayer->crs() != destCRS )
8386+
{
8387+
QgsDatumTransformDialog::run( vlayer->crs(), destCRS, this, mMapCanvas );
8388+
ct = QgsCoordinateTransform( vlayer->crs(), destCRS, QgsProject::instance() );
8389+
}
83838390
}
83848391

83858392
QgsRectangle filterExtent = dialog->filterExtent();

0 commit comments

Comments
 (0)