Skip to content
Permalink
Browse files

Don't append raster layer to an existing GPKG, if a vector layer with…

… the same name already exists.
  • Loading branch information
borysiasty committed Oct 21, 2018
1 parent b379d75 commit 006b130e8a85dbba9e499642a8493a515cf41aa0
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/gui/qgsrasterlayersaveasdialog.cpp
@@ -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>
@@ -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()

0 comments on commit 006b130

Please sign in to comment.
You can’t perform that action at this time.