Skip to content

Commit

Permalink
Merge pull request #8252 from borysiasty/gpkg_raster_append_fix
Browse files Browse the repository at this point in the history
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 17f30f5
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 17f30f5

Please sign in to comment.