Skip to content
Permalink
Browse files

Merge branch 'master' into overlay-alg-fixes-1

  • Loading branch information
wonder-sk committed Apr 18, 2018
2 parents 45b264d + 0e0e133 commit 721c5361859a180d208bed6133636f7db411c6c8
Showing with 1,771 additions and 540 deletions.
  1. +2 −1 .ci/travis/linux/before_script.sh
  2. +15 −14 debian/control.in
  3. +1 −1 debian/libqgis-dev.install.in
  4. +1 −1 debian/rules
  5. +2 −2 external/libdxfrw/drw_base.h
  6. +2 −2 external/libdxfrw/intern/drw_dbg.cpp
  7. +2 −2 external/libdxfrw/intern/drw_dbg.h
  8. +4 −4 external/libdxfrw/libdwgr.cpp
  9. +6 −5 external/libdxfrw/libdxfrw.cpp
  10. +29 −0 python/core/expression/qgsexpression.sip.in
  11. +20 −0 python/core/qgsproject.sip.in
  12. +18 −21 python/plugins/db_manager/dlg_import_vector.py
  13. +97 −98 python/plugins/db_manager/ui/DlgImportVector.ui
  14. +2 −2 python/plugins/processing/modeler/ModelerParameterDefinitionDialog.py
  15. +2 −2 python/plugins/processing/script/ScriptTemplate.py
  16. +86 −0 python/plugins/processing/tests/testdata/expected/autoincrement_sort.gml
  17. +44 −0 python/plugins/processing/tests/testdata/expected/autoincrement_sort.xsd
  18. +16 −0 python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml
  19. +36 −30 scripts/mkuidefaults.py
  20. +1 −1 scripts/spell_check/spell_test.sh
  21. +1 −1 scripts/verify-indentation.sh
  22. +28 −1 src/analysis/processing/qgsalgorithmaddincrementalfield.cpp
  23. +7 −0 src/analysis/processing/qgsalgorithmaddincrementalfield.h
  24. +28 −3 src/app/qgisapp.cpp
  25. +16 −2 src/app/qgsapplayertreeviewmenuprovider.cpp
  26. +3 −0 src/app/qgsapplayertreeviewmenuprovider.h
  27. +37 −0 src/app/qgsprojectproperties.cpp
  28. +3 −0 src/app/qgsprojectproperties.h
  29. +9 −4 src/core/expression/qgsexpression.cpp
  30. +49 −0 src/core/expression/qgsexpression.h
  31. +1 −1 src/core/processing/qgsprocessingalgorithm.cpp
  32. +4 −4 src/core/qgsapplication.cpp
  33. +14 −2 src/core/qgsconditionalstyle.cpp
  34. +16 −0 src/core/qgsexpressionlexer.ll
  35. +33 −12 src/core/qgsexpressionparser.yy
  36. +3 −0 src/core/qgsexpressionprivate.h
  37. +5 −10 src/core/qgsfeaturefiltermodel.cpp
  38. +4 −1 src/core/qgsogcutils.cpp
  39. +5 −5 src/core/qgsogrutils.cpp
  40. +10 −10 src/core/qgsogrutils.h
  41. +22 −0 src/core/qgsproject.cpp
  42. +18 −0 src/core/qgsproject.h
  43. +2 −2 src/core/qgssqlexpressioncompiler.cpp
  44. +12 −5 src/core/symbology/qgsrulebasedrenderer.cpp
  45. +1 −1 src/gui/editorwidgets/qgsrelationreferencewidgetwrapper.cpp
  46. +5 −5 src/gui/processing/qgsprocessingalgorithmconfigurationwidget.h
  47. +1 −1 src/gui/qgsattributeform.cpp
  48. +48 −1 src/gui/qgsexpressionbuilderwidget.cpp
  49. +1 −0 src/gui/qgsexpressionbuilderwidget.h
  50. +8 −0 src/gui/symbology/qgsstyleexportimportdialog.cpp
  51. +4 −0 src/gui/symbology/qgsstylemanagerdialog.cpp
  52. +8 −20 src/plugins/gps_importer/qgsgpsplugingui.cpp
  53. +1 −2 src/providers/ogr/qgsogrprovider.cpp
  54. +38 −6 src/providers/oracle/qgsoracleexpressioncompiler.cpp
  55. +1 −0 src/providers/oracle/qgsoracleexpressioncompiler.h
  56. +43 −35 src/providers/oracle/qgsoraclefeatureiterator.cpp
  57. +1 −1 src/providers/oracle/qgsoraclefeatureiterator.h
  58. +4 −0 src/server/services/wcs/qgswcsdescribecoverage.cpp
  59. +4 −0 src/server/services/wcs/qgswcsgetcapabilities.cpp
  60. +4 −0 src/server/services/wcs/qgswcsgetcoverage.cpp
  61. +4 −0 src/server/services/wfs/qgswfsdescribefeaturetype.cpp
  62. +4 −0 src/server/services/wfs/qgswfsgetfeature.cpp
  63. +4 −0 src/server/services/wfs/qgswfstransaction.cpp
  64. +5 −0 src/server/services/wms/qgswmsrenderer.cpp
  65. +0 −3 src/ui/layout/qgssvgexportoptions.ui
  66. +23 −1 src/ui/qgsprojectpropertiesbase.ui
  67. +63 −196 src/ui/qgsrasterlayerpropertiesbase.ui
  68. +1 −0 tests/src/analysis/CMakeLists.txt
  69. +133 −0 tests/src/analysis/testqgsninecellfilters.cpp
  70. +30 −0 tests/src/core/testqgsexpression.cpp
  71. +35 −0 tests/src/core/testqgsproject.cpp
  72. +4 −0 tests/src/python/featuresourcetestbase.py
  73. +4 −18 tests/src/python/test_provider_oracle.py
  74. +36 −0 tests/src/python/test_qgsrulebasedrenderer.py
  75. +20 −1 tests/src/python/test_qgsserver_wms_getmap.py
  76. BIN tests/testdata/analysis/aspect.tif
  77. BIN tests/testdata/analysis/dem.tif
  78. BIN tests/testdata/analysis/hillshade.tif
  79. BIN tests/testdata/analysis/ruggedness.tif
  80. BIN tests/testdata/analysis/slope.tif
  81. BIN tests/testdata/analysis/totalcurvature.tif
  82. BIN ...s/testdata/control_images/qgis_server/WMS_GetMap_ContextRendering/WMS_GetMap_ContextRendering.png
  83. +517 −0 tests/testdata/qgis_server/test_project_render_context.qgs
@@ -32,6 +32,7 @@ echo "${bold}Travis environment variables${endbold}"
echo "TRAVIS_BRANCH: $TRAVIS_BRANCH"
echo "TRAVIS_EVENT_TYPE: $TRAVIS_EVENT_TYPE"
echo "DOCKER_TAG: $DOCKER_TAG"
echo "TRAVIS_COMMIT_MESSAGE: $TRAVIS_COMMIT_MESSAGE"
echo "DOCKER_DEPS_PUSH: $DOCKER_DEPS_PUSH"
echo "DOCKER_DEPS_IMAGE_REBUILD: $DOCKER_DEPS_IMAGE_REBUILD"
echo "DOCKER_QGIS_IMAGE_BUILD_PUSH: $DOCKER_QGIS_IMAGE_BUILD_PUSH"
@@ -48,10 +49,10 @@ if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH =~ false ]]; then
docker-compose -f $DOCKER_COMPOSE config
fi

docker pull "qgis/qgis3-build-deps:${DOCKER_TAG}" || true
if [[ $DOCKER_DEPS_IMAGE_REBUILD =~ true ]]; then
docker build --no-cache -t "qgis/qgis3-build-deps:${DOCKER_TAG}" -f qgis3-build-deps.dockerfile .
else
docker pull "qgis/qgis3-build-deps:${DOCKER_TAG}" || true
docker build --cache-from "qgis/qgis3-build-deps:${DOCKER_TAG}" -t "qgis/qgis3-build-deps:${DOCKER_TAG}" -f qgis3-build-deps.dockerfile .
fi
echo "travis_fold:end:docker_build"
@@ -38,7 +38,8 @@ Build-Depends:
graphviz,
xvfb, xauth,
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable,
#sid buster artful bionic# libosgearth-dev, qt3d5-dev, qt3d-assimpsceneimport-plugin, qt3d-defaultgeometryloader-plugin, qt3d-gltfsceneio-plugin, qt3d-scene2d-plugin,
#sid buster artful bionic# libosgearth-dev,
#artful bionic# qt3d5-dev, qt3d-assimpsceneimport-plugin, qt3d-defaultgeometryloader-plugin, qt3d-gltfsceneio-plugin, qt3d-scene2d-plugin,
#oracle# oracle-instantclient12.1-devel, oracle-instantclient12.1-basiclite, qtbase5-private-dev,
locales, ca-certificates, ninja-build
Build-Conflicts: libqgis-dev, qgis-dev
@@ -145,19 +146,19 @@ Description: QGIS - shared native gui library
.
This package contains the shared native gui library.

#artful bionic buster sid#Package: libqgis-3d{QGIS_ABI}
#artful bionic buster sid#Architecture: any
#artful bionic buster sid#Section: libs
#artful bionic buster sid#Depends:
#artful bionic buster sid# qt3d-assimpsceneimport-plugin, qt3d-defaultgeometryloader-plugin, qt3d-gltfsceneio-plugin, qt3d-scene2d-plugin,
#artful bionic buster sid# ${shlibs:Depends},
#artful bionic buster sid# ${misc:Depends}
#artful bionic buster sid#Description: QGIS - shared 3d library
#artful bionic buster sid# QGIS is a Geographic Information System (GIS) which manages, analyzes and
#artful bionic buster sid# display databases of geographic information.
#artful bionic buster sid# .
#artful bionic buster sid# This package contains the shared 3d library.
#artful bionic buster sid#
#artful bionic#Package: libqgis-3d{QGIS_ABI}
#artful bionic#Architecture: any
#artful bionic#Section: libs
#artful bionic#Depends:
#artful bionic# qt3d-assimpsceneimport-plugin, qt3d-defaultgeometryloader-plugin, qt3d-gltfsceneio-plugin, qt3d-scene2d-plugin,
#artful bionic# ${shlibs:Depends},
#artful bionic# ${misc:Depends}
#artful bionic#Description: QGIS - shared 3d library
#artful bionic# QGIS is a Geographic Information System (GIS) which manages, analyzes and
#artful bionic# display databases of geographic information.
#artful bionic# .
#artful bionic# This package contains the shared 3d library.
#artful bionic#
Package: libqgisgrass{GRASSVER}-{QGIS_ABI}
Architecture: any
Section: libs
@@ -8,4 +8,4 @@ usr/lib/libqgis_server.so
usr/lib/libqgisgrass{GRASSVER}.so
usr/lib/libqgispython.so
usr/share/qgis/FindQGIS.cmake
#sid buster artful bionic#usr/lib/libqgis_3d.so
#artful bionic#usr/lib/libqgis_3d.so
@@ -102,7 +102,7 @@ ifneq (,$(findstring $(DISTRIBUTION),"sid buster stretch"))
CMAKE_OPTS += -DPOSTGRES_LIBRARY=/usr/lib/$(DEB_BUILD_MULTIARCH)/libpq.so
endif

ifneq (,$(findstring $(DISTRIBUTION),"artful bionic buster sid"))
ifneq (,$(findstring $(DISTRIBUTION),"artful bionic"))
CMAKE_OPTS += \
-DWITH_3D=TRUE \
-DGEOS_LIBRARY=/usr/lib/$(DEB_BUILD_MULTIARCH)/libgeos_c.so
@@ -93,8 +93,8 @@ namespace DRW

enum DBG_LEVEL
{
NONE,
DEBUG
none,
debug
};

//! Special codes for colors
@@ -67,7 +67,7 @@ DRW_dbg *DRW_dbg::getInstance()

DRW_dbg::DRW_dbg()
{
level = NONE;
level = none;
prClass = new print_none;
}

@@ -77,7 +77,7 @@ void DRW_dbg::setLevel( LEVEL lvl )
delete prClass;
switch ( level )
{
case DEBUG:
case debug:
prClass = new print_debug;
break;
default:
@@ -32,8 +32,8 @@ class DRW_dbg
public:
enum LEVEL
{
NONE,
DEBUG
none,
debug
};
void setLevel( LEVEL lvl );
LEVEL getLevel();
@@ -53,7 +53,7 @@ dwgR::dwgR( const char *name )
, writer( nullptr )
#endif
{
DRW_DBGSL( DRW_dbg::NONE );
DRW_DBGSL( DRW_dbg::none );
}

dwgR::~dwgR()
@@ -65,11 +65,11 @@ void dwgR::setDebug( DRW::DBG_LEVEL lvl )
{
switch ( lvl )
{
case DRW::DEBUG:
DRW_DBGSL( DRW_dbg::DEBUG );
case DRW::debug:
DRW_DBGSL( DRW_dbg::debug );
break;
default:
DRW_DBGSL( DRW_dbg::NONE );
DRW_DBGSL( DRW_dbg::none );
}
}

@@ -62,7 +62,7 @@ dxfRW::dxfRW( const char *name )
, elParts( 128 ) //parts number when convert ellipse to polyline
, currHandle( 0 )
{
DRW_DBGSL( DRW_dbg::NONE );
DRW_DBGSL( DRW_dbg::none );
}

dxfRW::~dxfRW()
@@ -79,11 +79,11 @@ void dxfRW::setDebug( DRW::DBG_LEVEL lvl )
{
switch ( lvl )
{
case DRW::DEBUG:
DRW_DBGSL( DRW_dbg::DEBUG );
case DRW::debug:
DRW_DBGSL( DRW_dbg::debug );
break;
default:
DRW_DBGSL( DRW_dbg::NONE );
DRW_DBGSL( DRW_dbg::none );
}
}

@@ -3398,7 +3398,8 @@ bool dxfRW::processImageDef()
return true;
}

/** Utility function
/**
* Utility function
* convert a int to string in hex
**/
std::string dxfRW::toHexStr( int n )
@@ -66,6 +66,28 @@ Implicit sharing was added in 2.14
%End
public:

struct ParserError
{
enum ParserErrorType
{
Unknown,
FunctionUnknown,
FunctionWrongArgs,
FunctionInvalidParams,
FunctionNamedArgsError
};

ParserErrorType errorType;

int firstLine;

int firstColumn;

int lastLine;

int lastColumn;
};

QgsExpression( const QString &expr );
%Docstring
Creates a new expression based on the provided string.
@@ -109,6 +131,13 @@ Returns true if an error occurred when parsing the input expression
QString parserErrorString() const;
%Docstring
Returns parser error
%End

ParserError parserError() const;
%Docstring
Returns parser error details including location of error.

.. versionadded:: 3.0
%End

const QgsExpressionNode *rootNode() const;
@@ -952,6 +952,26 @@ Sets the project's ``metadata`` store.
.. seealso:: :py:func:`metadata`

.. seealso:: :py:func:`metadataChanged`
%End

QSet<QgsMapLayer *> requiredLayers() const;
%Docstring
Returns a set of map layers that are required in the project and therefore they should not get
removed from the project. The set of layers may be configured by users in project properties.
and it is mainly a hint for the user interface to protect users from removing layers that important
in the project. The removeMapLayer(), removeMapLayers() calls do not block removal of layers listed here.

.. versionadded:: 3.2
%End

void setRequiredLayers( const QSet<QgsMapLayer *> &layers );
%Docstring
Configures a set of map layers that are required in the project and therefore they should not get
removed from the project. The set of layers may be configured by users in project properties.
and it is mainly a hint for the user interface to protect users from removing layers that important
in the project. The removeMapLayer(), removeMapLayers() calls do not block removal of layers listed here.

.. versionadded:: 3.2
%End

signals:
@@ -68,6 +68,8 @@ def __init__(self, inLayer, outDb, outUri, parent=None):
# updates of UI
self.setupWorkingMode(self.mode)
self.cboSchema.currentIndexChanged.connect(self.populateTables)
self.widgetSourceSrid.setCrs(QgsProject.instance().crs())
self.widgetTargetSrid.setCrs(QgsProject.instance().crs())

def setupWorkingMode(self, mode):
""" hide the widget to select a layer/file if the input layer is already set """
@@ -210,9 +212,10 @@ def updateInputLayer(self):
self.editGeomColumn.setText(geom)

srcCrs = self.inLayer.crs()
srid = srcCrs.postgisSrid() if srcCrs.isValid() else 4326
self.editSourceSrid.setText("%s" % srid)
self.editTargetSrid.setText("%s" % srid)
if not srcCrs.isValid():
srcCrs = QgsCoordinateReferenceSystem(4326)
self.widgetSourceSrid.setCrs(srcCrs)
self.widgetTargetSrid.setCrs(srcCrs)

return True

@@ -270,27 +273,23 @@ def accept(self):

# sanity checks
if self.inLayer is None:
QMessageBox.information(self, self.tr("Import to database"), self.tr("Input layer missing or not valid"))
QMessageBox.critical(self, self.tr("Import to Database"), self.tr("Input layer missing or not valid."))
return

if self.cboTable.currentText() == "":
QMessageBox.information(self, self.tr("Import to database"), self.tr("Output table name is required"))
QMessageBox.critical(self, self.tr("Import to Database"), self.tr("Output table name is required."))
return

if self.chkSourceSrid.isEnabled() and self.chkSourceSrid.isChecked():
try:
sourceSrid = self.editSourceSrid.text()
except ValueError:
QMessageBox.information(self, self.tr("Import to database"),
self.tr("Invalid source srid: must be an integer"))
if not self.widgetSourceSrid.crs().isValid():
QMessageBox.critical(self, self.tr("Import to Database"),
self.tr("Invalid source srid: must be a valid crs."))
return

if self.chkTargetSrid.isEnabled() and self.chkTargetSrid.isChecked():
try:
targetSrid = self.editTargetSrid.text()
except ValueError:
QMessageBox.information(self, self.tr("Import to database"),
self.tr("Invalid target srid: must be an integer"))
if not self.widgetTargetSrid.crs().isValid():
QMessageBox.critical(self, self.tr("Import to Database"),
self.tr("Invalid target srid: must be a valid crs."))
return

with OverrideCursor(Qt.WaitCursor):
@@ -344,13 +343,11 @@ def accept(self):

outCrs = QgsCoordinateReferenceSystem()
if self.chkTargetSrid.isEnabled() and self.chkTargetSrid.isChecked():
targetSrid = int(self.editTargetSrid.text())
outCrs = QgsCoordinateReferenceSystem(targetSrid)
outCrs = self.widgetTargetSrid.crs()

# update input layer crs and encoding
if self.chkSourceSrid.isEnabled() and self.chkSourceSrid.isChecked():
sourceSrid = int(self.editSourceSrid.text())
inCrs = QgsCoordinateReferenceSystem(sourceSrid)
inCrs = self.widgetSourceSrid.crs()
self.inLayer.setCrs(inCrs)

if self.chkEncoding.isEnabled() and self.chkEncoding.isChecked():
@@ -372,7 +369,7 @@ def accept(self):

if ret != 0:
output = QgsMessageViewer()
output.setTitle(self.tr("Import to database"))
output.setTitle(self.tr("Import to Database"))
output.setMessageAsPlainText(self.tr("Error {0}\n{1}").format(ret, errMsg))
output.showMessage()
return
@@ -383,7 +380,7 @@ def accept(self):

self.db.connection().reconnect()
self.db.refresh()
QMessageBox.information(self, self.tr("Import to database"), self.tr("Import was successful."))
QMessageBox.information(self, self.tr("Import to Database"), self.tr("Import was successful."))
return QDialog.accept(self)

def closeEvent(self, event):

0 comments on commit 721c536

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