Skip to content

Commit

Permalink
Don't append raster layer to an existing GPKG, if a vector layer with…
Browse files Browse the repository at this point in the history
… the same name already exists.
  • Loading branch information
borysiasty committed Oct 21, 2018
1 parent b379d75 commit 006b130
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gui/qgsrasterlayersaveasdialog.cpp
Expand Up @@ -25,9 +25,11 @@
#include "qgsprojectionselectiondialog.h"
#include "qgssettings.h"
#include "qgsrasterfilewriter.h"
#include "qgsvectorlayer.h"
#include "cpl_string.h"
#include "qgsproject.h"
#include <gdal.h>
#include "qgsmessagelog.h"

#include <QFileDialog>
#include <QMessageBox>
Expand Down Expand Up @@ -918,8 +920,9 @@ bool QgsRasterLayerSaveAsDialog::outputLayerExists() const
uri = outputFileName();
}

std::unique_ptr< QgsRasterLayer > layer( new QgsRasterLayer( uri, "", QStringLiteral( "gdal" ) ) );
return layer->isValid();
std::unique_ptr< QgsRasterLayer > rastLayer( new QgsRasterLayer( uri, "", QStringLiteral( "gdal" ) ) );
std::unique_ptr< QgsVectorLayer > vectLayer( new QgsVectorLayer( uri, "", QStringLiteral( "ogr" ) ) );
return ( rastLayer->isValid() || vectLayer->isValid() );
}

void QgsRasterLayerSaveAsDialog::accept()
Expand Down

0 comments on commit 006b130

Please sign in to comment.