[qgis] 01/05: Imported Upstream version 2.14.15+dfsg
Bas Couwenberg
sebastic at debian.org
Fri May 26 19:54:19 UTC 2017
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch master
in repository qgis.
commit 5aaf99a6bcc6faf03ae28ecff9818c078b3461c1
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Fri May 26 19:42:07 2017 +0200
Imported Upstream version 2.14.15+dfsg
---
CMakeLists.txt | 2 +-
ChangeLog | 50 +++++++++++++
debian/changelog | 10 ++-
.../plugins/processing/algs/qgis/Intersection.py | 15 ++--
python/plugins/processing/algs/r/RAlgorithm.py | 83 +++++++++++++++++++++-
src/core/qgscoordinatereferencesystem.cpp | 4 +-
src/server/qgsowsserver.cpp | 5 +-
src/server/qgsserver.cpp | 4 +-
src/server/qgsserverprojectparser.cpp | 2 +-
src/server/qgswmsprojectparser.cpp | 2 +-
10 files changed, 156 insertions(+), 21 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5d530b4..e9fef78 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
SET(CPACK_PACKAGE_VERSION_MINOR "14")
-SET(CPACK_PACKAGE_VERSION_PATCH "14")
+SET(CPACK_PACKAGE_VERSION_PATCH "15")
SET(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
SET(RELEASE_NAME "Essen")
IF (POLICY CMP0048) # in CMake 3.0.0+
diff --git a/ChangeLog b/ChangeLog
index 806ff27..926463f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,53 @@
+Juergen E. Fischer <jef at norbit.de> 2017-05-18
+
+ indentation fix
+
+Juergen E. Fischer <jef at norbit.de> 2017-05-18
+
+ crssync: check result of CSVReadParseLine instead of feof
+
+ (cherry picked from commit 27f4b0e1e008d3ed60ee0f7f178f93b22bacabe9)
+
+Merge: 6feed195ca b830eab6af
+rldhont <rldhont at gmail.com> 2017-05-16
+
+ Merge pull request #4545 from rldhont/release-2_14-processing-rscripts-outputs
+
+ [BUGFIX][Processing] R scripts do not have enough outputs
+
+Alexander Bruy <alexander.bruy at gmail.com> 2017-05-13
+
+ [processing] stop algorithm execution if geometry/feature error occured
+ (fix #11986)
+
+rldhont <rldhont at gmail.com> 2017-05-12
+
+ [BUGFIX][Processing] R scripts do not have enough outputs
+
+ R scripts in processing only supports Vector, Raster and Table.
+ This commit adds fix the file output and adds directory, number and string outputs.
+
+Marco Hugentobler <marco.hugentobler at sourcepole.ch> 2017-04-18
+
+ Fix layer drawing order in server to also work in complex projects and with custom drawing order
+
+rldhont <rldhont at gmail.com> 2017-04-27
+
+ [BUGFIX][Server] QgsOWSServer restorer modifying layers and not well restoring them
+
+ The Subsetstring is updated through QgsVectorLayer::setSubsetString and restored by QgsVectorDataProvider::setSubsetString and it's not idempotent.
+ The solution is to use QgsVectorLayer::setSubsetString in the 2 cases.
+
+Even Rouault <even.rouault at spatialys.com> 2016-10-06
+
+ Properly deal with empty cache/directory in server
+
+ backport 41693604674384ddd2b3869378db9b9d645d61a4
+
+Juergen E. Fischer <jef at norbit.de> 2017-04-21
+
+ Release of 2.14.14
+
rldhont <rldhont at gmail.com> 2017-04-20
[BUGFIX][Processing] Fix spatialite version comparison
diff --git a/debian/changelog b/debian/changelog
index 9bb89ee..6892c18 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,14 @@
-qgis (2.14.14) UNRELEASED; urgency=medium
+qgis (2.14.15) UNRELEASED; urgency=medium
+
+ * Release of 2.14.15
+
+ -- Jürgen E. Fischer <jef at norbit.de> Fri, 19 May 2017 14:00:04 +0200
+
+qgis (2.14.14) unstable; urgency=medium
* Release of 2.14.14
- -- Jürgen E. Fischer <jef at norbit.de> Fri, 21 Apr 2017 14:36:44 +0200
+ -- Jürgen E. Fischer <jef at norbit.de> Fri, 19 May 2017 14:00:04 +0200
qgis (2.14.13) unstable; urgency=medium
diff --git a/python/plugins/processing/algs/qgis/Intersection.py b/python/plugins/processing/algs/qgis/Intersection.py
index 2977c38..62ff0d9 100644
--- a/python/plugins/processing/algs/qgis/Intersection.py
+++ b/python/plugins/processing/algs/qgis/Intersection.py
@@ -92,11 +92,10 @@ class Intersection(GeoAlgorithm):
int_sym = geom.symDifference(tmpGeom)
int_geom = QgsGeometry(int_com.difference(int_sym))
if int_geom.isGeosEmpty() or not int_geom.isGeosValid():
- ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
- self.tr('GEOS geoprocessing error: One or '
- 'more input features have invalid '
- 'geometry.'))
- break
+ raise GeoAlgorithmExecutionException(
+ self.tr('GEOS geoprocessing error: One or '
+ 'more input features have invalid '
+ 'geometry.'))
try:
if int_geom.wkbType() in wkbTypeGroups[wkbTypeGroups[int_geom.wkbType()]]:
outFeat.setGeometry(int_geom)
@@ -106,8 +105,8 @@ class Intersection(GeoAlgorithm):
outFeat.setAttributes(attrs)
writer.addFeature(outFeat)
except:
- ProcessingLog.addToLog(ProcessingLog.LOG_INFO,
- self.tr('Feature geometry error: One or more output features ignored due to invalid geometry.'))
- continue
+ raise GeoAlgorithmExecutionException(
+ self.tr('Feature geometry error: One or more '
+ 'output features ignored due to invalid geometry.'))
del writer
diff --git a/python/plugins/processing/algs/r/RAlgorithm.py b/python/plugins/processing/algs/r/RAlgorithm.py
index 1fe7b30..cb05cf9 100644
--- a/python/plugins/processing/algs/r/RAlgorithm.py
+++ b/python/plugins/processing/algs/r/RAlgorithm.py
@@ -51,7 +51,11 @@ from processing.core.outputs import OutputVector
from processing.core.outputs import OutputRaster
from processing.core.outputs import OutputHTML
from processing.core.outputs import OutputFile
+from processing.core.outputs import OutputDirectory
+from processing.core.outputs import OutputString
+from processing.core.outputs import OutputNumber
from processing.tools.system import isWindows
+from processing.tools.system import setTempOutput
from processing.script.WrongScriptException import WrongScriptException
from RUtils import RUtils
@@ -60,6 +64,7 @@ class RAlgorithm(GeoAlgorithm):
R_CONSOLE_OUTPUT = 'R_CONSOLE_OUTPUT'
RPLOTS = 'RPLOTS'
+ R_OUTPUT_VALUES = 'R_OUTPUT_VALUES'
def getCopy(self):
newone = RAlgorithm(self.descriptionFile)
@@ -97,6 +102,7 @@ class RAlgorithm(GeoAlgorithm):
self.commands = []
self.showPlots = False
self.showConsoleOutput = False
+ self.saveOutputValues = False
self.useRasterPackage = True
self.passFileNames = False
self.verboseCommands = []
@@ -106,7 +112,7 @@ class RAlgorithm(GeoAlgorithm):
if line.startswith('##'):
try:
self.processParameterLine(line)
- except Exception:
+ except Exception as e:
raise WrongScriptException(
self.tr('Could not load R script: %s.\n Problem with line %s' % (self.descriptionFile, line)))
elif line.startswith('>'):
@@ -269,8 +275,24 @@ class RAlgorithm(GeoAlgorithm):
out = OutputVector()
elif token.lower().strip().startswith('table'):
out = OutputTable()
- elif token.lower().strip().startswith('file'):
- out = OutputFile()
+ else:
+ if token.lower().strip().startswith('file'):
+ out = OutputFile()
+ ext = token.strip()[len('file') + 1:]
+ if ext:
+ out.ext = ext
+ elif token.lower().strip().startswith('directory'):
+ out = OutputDirectory()
+ elif token.lower().strip().startswith('number'):
+ out = OutputNumber()
+ elif token.lower().strip().startswith('string'):
+ out = OutputString()
+
+ if not self.saveOutputValues and out:
+ outVal = OutputFile(RAlgorithm.R_OUTPUT_VALUES, self.tr('R Output values'), ext='txt')
+ outVal.hidden = True
+ self.addOutput(outVal)
+ self.saveOutputValues = True
return out
@@ -288,6 +310,10 @@ class RAlgorithm(GeoAlgorithm):
progress.setCommand(line)
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, loglines)
RUtils.executeRAlgorithm(self, progress)
+ if self.saveOutputValues:
+ with open(self.getOutputValue(RAlgorithm.R_OUTPUT_VALUES), 'r') as f:
+ lines = [line.strip() for line in f]
+ self.parseOutputValues(iter(lines))
if self.showPlots:
htmlfilename = self.getOutputValue(RAlgorithm.RPLOTS)
f = open(htmlfilename, 'w')
@@ -299,6 +325,37 @@ class RAlgorithm(GeoAlgorithm):
f.write(RUtils.getConsoleOutput())
f.close()
+ def parseOutputValues(self, lines):
+ if not self.saveOutputValues:
+ return
+
+ out = None
+ ender = 0
+ line = lines.next().strip('\n').strip('\r')
+ while ender < 10:
+ if line.startswith('##'):
+ name = line.replace('#', '')
+ out = self.getOutputFromName(name)
+ else:
+ if line == '':
+ ender += 1
+ else:
+ ender = 0
+ if out:
+ if isinstance(out, OutputNumber):
+ out.setValue(float(line) if '.' in line else int(line))
+ elif isinstance(out, OutputString):
+ if not out.value:
+ out.setValue(line)
+ else:
+ out.value += '\n\r' + line
+ else:
+ out.setValue(line)
+ try:
+ line = lines.next().strip('\n').strip('\r')
+ except:
+ break
+
def getFullSetOfRCommands(self):
commands = []
commands += self.getImportCommands()
@@ -309,6 +366,15 @@ class RAlgorithm(GeoAlgorithm):
def getExportCommands(self):
commands = []
+
+ # Output Values
+ outputDataFile = None
+ if self.saveOutputValues:
+ outputDataFile = self.getOutputValue(RAlgorithm.R_OUTPUT_VALUES)
+ if not outputDataFile:
+ setTempOutput(self.getOutputFromName(RAlgorithm.R_OUTPUT_VALUES), self)
+ outputDataFile = self.getOutputValue(RAlgorithm.R_OUTPUT_VALUES)
+
for out in self.outputs:
if isinstance(out, OutputRaster):
value = out.value
@@ -334,6 +400,9 @@ class RAlgorithm(GeoAlgorithm):
value = out.value
value = value.replace('\\', '/')
commands.append('write.csv(' + out.name + ',"' + value + '")')
+ elif out.name != RAlgorithm.R_OUTPUT_VALUES:
+ commands.append('cat("##' + out.name + '",file="' + outputDataFile + '",sep="\n",append=TRUE)')
+ commands.append('cat(' + out.name + ',file="' + outputDataFile + '",sep="\n",append=TRUE)')
if self.showPlots:
commands.append('dev.off()')
@@ -358,6 +427,7 @@ class RAlgorithm(GeoAlgorithm):
commands.append('library("raster")')
commands.append('library("rgdal")')
+ # Add parameters
for param in self.parameters:
if isinstance(param, ParameterRaster):
if param.value is None:
@@ -476,6 +546,13 @@ class RAlgorithm(GeoAlgorithm):
s += ')\n'
commands.append(s)
+ # Set outputs
+ for out in self.outputs:
+ if isinstance(out, OutputFile) or isinstance(out, OutputDirectory):
+ if not out.value:
+ setTempOutput(out, self)
+ commands.append(out.name + ' = "' + out.value + '"')
+
if self.showPlots:
htmlfilename = self.getOutputValue(RAlgorithm.RPLOTS)
self.plotsFilename = htmlfilename + '.png'
diff --git a/src/core/qgscoordinatereferencesystem.cpp b/src/core/qgscoordinatereferencesystem.cpp
index 7c00a63..acff095 100644
--- a/src/core/qgscoordinatereferencesystem.cpp
+++ b/src/core/qgscoordinatereferencesystem.cpp
@@ -2097,9 +2097,11 @@ bool QgsCoordinateReferenceSystem::syncDatumTransform( const QString& dbPath )
QStringList v;
v.reserve( sizeof( map ) / sizeof( *map ) );
- while ( !feof( fp ) )
+ for ( ;; )
{
char **values = CSVReadParseLine( fp );
+ if ( !values )
+ break;
v.clear();
diff --git a/src/server/qgsowsserver.cpp b/src/server/qgsowsserver.cpp
index 5768aa0..5b9d758 100644
--- a/src/server/qgsowsserver.cpp
+++ b/src/server/qgsowsserver.cpp
@@ -57,10 +57,9 @@ void QgsOWSServer::restoreLayerFilters( const QHash<QgsMapLayer*, QString>& filt
QgsVectorLayer* filteredLayer = qobject_cast<QgsVectorLayer*>( filterIt.key() );
if ( filteredLayer )
{
- QgsVectorDataProvider* dp = filteredLayer->dataProvider();
- if ( dp )
+ if ( !filteredLayer->setSubsetString( filterIt.value() ) )
{
- dp->setSubsetString( filterIt.value() );
+ QgsMessageLog::logMessage( "Layer does not support Subset String" );
}
}
}
diff --git a/src/server/qgsserver.cpp b/src/server/qgsserver.cpp
index e26d34c..26f8c11 100644
--- a/src/server/qgsserver.cpp
+++ b/src/server/qgsserver.cpp
@@ -113,7 +113,9 @@ void QgsServer::setupNetworkAccessManager()
QSettings settings;
QgsNetworkAccessManager *nam = QgsNetworkAccessManager::instance();
QNetworkDiskCache *cache = new QNetworkDiskCache( nullptr );
- QString cacheDirectory = settings.value( "cache/directory", QgsApplication::qgisSettingsDirPath() + "cache" ).toString();
+ QString cacheDirectory = settings.value( "cache/directory" ).toString();
+ if ( cacheDirectory.isEmpty() )
+ cacheDirectory = QgsApplication::qgisSettingsDirPath() + "cache";
qint64 cacheSize = settings.value( "cache/size", 50 * 1024 * 1024 ).toULongLong();
QgsMessageLog::logMessage( QString( "setCacheDirectory: %1" ).arg( cacheDirectory ), "Server", QgsMessageLog::INFO );
QgsMessageLog::logMessage( QString( "setMaximumCacheSize: %1" ).arg( cacheSize ), "Server", QgsMessageLog::INFO );
diff --git a/src/server/qgsserverprojectparser.cpp b/src/server/qgsserverprojectparser.cpp
index 491f37c..2a8ba49 100644
--- a/src/server/qgsserverprojectparser.cpp
+++ b/src/server/qgsserverprojectparser.cpp
@@ -1227,7 +1227,7 @@ bool QgsServerProjectParser::findUseLayerIDs() const
void QgsServerProjectParser::layerFromLegendLayer( const QDomElement& legendLayerElem, QMap< int, QgsMapLayer*>& layers, bool useCache ) const
{
QString id = legendLayerElem.firstChild().firstChild().toElement().attribute( "layerid" );
- int drawingOrder = updateLegendDrawingOrder() ? -1 : mCustomLayerOrder.indexOf( id );
+ int drawingOrder = updateLegendDrawingOrder() ? mCustomLayerOrder.indexOf( id ) : -1;
QHash< QString, QDomElement >::const_iterator layerIt = mProjectLayerElementsById.find( id );
if ( layerIt != mProjectLayerElementsById.constEnd() )
diff --git a/src/server/qgswmsprojectparser.cpp b/src/server/qgswmsprojectparser.cpp
index e2c5321..fd2c66d 100644
--- a/src/server/qgswmsprojectparser.cpp
+++ b/src/server/qgswmsprojectparser.cpp
@@ -203,7 +203,7 @@ QList<QgsMapLayer*> QgsWMSProjectParser::mapLayerFromStyle( const QString& lName
if ( !groupElement.isNull() )
{
addLayersFromGroup( groupElement, layers, useCache );
- return QgsConfigParserUtils::layerMapToList( layers, mProjectParser->updateLegendDrawingOrder() );
+ return QgsConfigParserUtils::layerMapToList( layers, false );
}
//still not found. Check if it is a single embedded layer (embedded layers are not contained in mProjectLayerElementsByName)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/qgis.git
More information about the Pkg-grass-devel
mailing list