Skip to content
Permalink
Browse files

Merge pull request #8252 from borysiasty/gpkg_raster_append_fix

Don't append raster layer to an existing GPKG, if a vector layer with the same name already exists
  • Loading branch information
elpaso committed Oct 23, 2018
2 parents d277fb8 + 006b130 commit 17f30f5762f92e5ddf19788a1329302cee97a4d0
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 17f30f5

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