Skip to content
Permalink
Browse files
Revert "Revert back to 3.16.12"
This reverts commit e6f70e4.
  • Loading branch information
nyalldawson committed Nov 6, 2021
1 parent a8618a9 commit 043eae9ec99be61deced440b4c7d236d8f3b52cd
Showing with 3,313 additions and 713 deletions.
  1. +19 −5 .github/workflows/release.yml
  2. +6 −0 python/core/auto_generated/qgsfeature.sip.in
  3. +10 −0 python/core/auto_generated/qgsmapsettings.sip.in
  4. +1 −0 python/gui/auto_generated/qgsmapcanvas.sip.in
  5. +4 −0 python/gui/auto_generated/qgsnewvectorlayerdialog.sip.in
  6. +1 −6 python/gui/auto_generated/raster/qgshillshaderendererwidget.sip.in
  7. +4 −1 python/gui/auto_generated/raster/qgsmultibandcolorrendererwidget.sip.in
  8. +4 −1 python/gui/auto_generated/raster/qgspalettedrendererwidget.sip.in
  9. +1 −1 python/gui/auto_generated/raster/qgsrastercontourrendererwidget.sip.in
  10. +20 −0 python/gui/auto_generated/raster/qgsrasterrendererwidget.sip.in
  11. +4 −1 python/gui/auto_generated/raster/qgssinglebandgrayrendererwidget.sip.in
  12. +2 −2 python/gui/auto_generated/raster/qgssinglebandpseudocolorrendererwidget.sip.in
  13. +2 −2 python/plugins/db_manager/db_plugins/postgis/connector.py
  14. +18 −0 python/plugins/db_manager/db_plugins/postgis/plugin.py
  15. +1 −1 python/plugins/db_manager/db_tree.py
  16. +8 −0 python/server/auto_generated/qgsserverapicontext.sip.in
  17. +2 −1 python/server/auto_generated/qgsserverogcapi.sip.in
  18. +3 −21 src/3d/mesh/qgsmeshterraingenerator.cpp
  19. +1 −0 src/analysis/processing/qgsalgorithmmergevector.cpp
  20. +1 −1 src/app/decorations/qgsdecorationgrid.cpp
  21. +1 −0 src/app/qgisapp.cpp
  22. +1 −1 src/core/geometry/qgsrectangle.h
  23. +5 −3 src/core/labeling/qgslabelingengine.cpp
  24. +5 −5 src/core/processing/qgsprocessingparameters.cpp
  25. +74 −3 src/core/providers/gdal/qgsgdalprovider.cpp
  26. +3 −0 src/core/providers/ogr/qgsogrprovider.cpp
  27. +4 −1 src/core/qgsfeature.h
  28. +13 −0 src/core/qgsfield.cpp
  29. +10 −3 src/core/qgsfieldformatter.cpp
  30. +1 −1 src/core/qgsmaplayer.cpp
  31. +1 −1 src/core/qgsmaprendererjob.cpp
  32. +24 −2 src/core/qgsmapsettings.cpp
  33. +8 −0 src/core/qgsmapsettings.h
  34. +21 −1 src/core/qgsogcutils.cpp
  35. +4 −0 src/core/qgsogcutils.h
  36. +30 −10 src/core/qgsvectorlayerjoinbuffer.cpp
  37. +100 −96 src/core/raster/qgspalettedrasterrenderer.cpp
  38. +1 −1 src/core/raster/qgsrasterlayer.cpp
  39. +25 −2 src/core/raster/qgsrasterpipe.cpp
  40. +12 −2 src/core/symbology/qgscategorizedsymbolrenderer.cpp
  41. +18 −0 src/core/symbology/qgslinesymbollayer.cpp
  42. +10 −0 src/core/textrenderer/qgstextrenderer.cpp
  43. +5 −0 src/gui/layout/qgslayoutattributetablewidget.cpp
  44. +4 −0 src/gui/processing/qgsprocessingmultipleselectiondialog.cpp
  45. +16 −1 src/gui/qgsexpressionbuilderwidget.cpp
  46. +2 −0 src/gui/qgsmanageconnectionsdialog.cpp
  47. +19 −10 src/gui/qgsmapcanvas.cpp
  48. +6 −0 src/gui/qgsmapcanvas.h
  49. +40 −31 src/gui/qgsnewvectorlayerdialog.cpp
  50. +5 −0 src/gui/qgsnewvectorlayerdialog.h
  51. +1 −5 src/gui/raster/qgshillshaderendererwidget.h
  52. +4 −1 src/gui/raster/qgsmultibandcolorrendererwidget.h
  53. +4 −1 src/gui/raster/qgspalettedrendererwidget.h
  54. +1 −1 src/gui/raster/qgsrastercontourrendererwidget.h
  55. +18 −0 src/gui/raster/qgsrasterrendererwidget.h
  56. +4 −1 src/gui/raster/qgssinglebandgrayrendererwidget.h
  57. +4 −2 src/gui/raster/qgssinglebandpseudocolorrendererwidget.h
  58. +1 −1 src/gui/symbology/qgsheatmaprendererwidget.cpp
  59. +1 −1 src/gui/symbology/qgspointclusterrendererwidget.cpp
  60. +1 −1 src/plugins/geometry_checker/qgsgeometrycheckerresulttab.cpp
  61. +13 −3 src/providers/postgres/qgspostgresprovider.cpp
  62. +2 −1 src/providers/postgres/raster/qgspostgresrasterprovider.cpp
  63. +4 −3 src/providers/wfs/qgsbackgroundcachedshareddata.cpp
  64. +7 −4 src/providers/wfs/qgsbackgroundcachedshareddata.h
  65. +1 −1 src/providers/wfs/qgsoapifprovider.cpp
  66. +2 −2 src/providers/wfs/qgsoapifprovider.h
  67. +1 −3 src/providers/wfs/qgswfscapabilities.cpp
  68. +25 −1 src/providers/wfs/qgswfsfeatureiterator.cpp
  69. +25 −4 src/providers/wfs/qgswfsprovider.cpp
  70. +16 −1 src/providers/wfs/qgswfsshareddata.cpp
  71. +8 −2 src/providers/wfs/qgswfsshareddata.h
  72. +11 −3 src/providers/wms/qgswmscapabilities.cpp
  73. +1 −0 src/providers/wms/qgswmscapabilities.h
  74. +14 −0 src/server/qgsserverapicontext.cpp
  75. +8 −0 src/server/qgsserverapicontext.h
  76. +6 −1 src/server/qgsserverogcapi.cpp
  77. +2 −1 src/server/qgsserverogcapi.h
  78. +3 −2 src/server/qgsserverogcapihandler.cpp
  79. +14 −2 src/server/services/wfs/qgswfsgetfeature.cpp
  80. +6 −5 src/server/services/wms/qgswmsrestorer.cpp
  81. +12 −8 tests/src/analysis/testqgsprocessing.cpp
  82. +6 −0 tests/src/core/testqgsfield.cpp
  83. +26 −0 tests/src/core/testqgsmapsettings.cpp
  84. +17 −0 tests/src/core/testqgsogcutils.cpp
  85. +27 −0 tests/src/core/testqgsrectangle.cpp
  86. +43 −0 tests/src/core/testqgsvectorlayerjoinbuffer.cpp
  87. +79 −0 tests/src/python/test_provider_postgres.py
  88. +201 −0 tests/src/python/test_provider_wfs.py
  89. +83 −0 tests/src/python/test_qgsexpressionbuilderwidget.py
  90. +37 −0 tests/src/python/test_qgsfieldformatters.py
  91. +137 −0 tests/src/python/test_qgsrasterlayer.py
  92. +35 −0 tests/src/python/test_qgsrulebasedrenderer.py
  93. +55 −0 tests/src/python/test_qgsserver_api.py
  94. +39 −0 tests/src/python/test_qgsserver_wms.py
  95. +7 −0 tests/src/python/test_qgsserver_wms_getlegendgraphic.py
  96. +19 −0 tests/src/python/test_qgsserver_wms_getmap.py
  97. +22 −0 tests/src/python/test_qgstextrenderer.py
  98. BIN ..._images/qgis_server/WMS_GetMap_Tiled_Rotated_Labels_True/WMS_GetMap_Tiled_Rotated_Labels_True.png
  99. BIN ..._images/text_renderer/background_rect_buffer_rotated_text/background_rect_buffer_rotated_text.png
  100. BIN ...ol_images/text_renderer/background_rect_fixed_rotated_text/background_rect_fixed_rotated_text.png
  101. BIN tests/testdata/control_images/text_renderer/text_buffer_mapunits/text_buffer_mapunits_mask.png
  102. +1 −1 tests/testdata/qgis_server/wfs_getFeature_1_1_0_epsgbbox_1_feature.txt
  103. +1 −1 tests/testdata/qgis_server/wfs_getFeature_1_1_0_epsgbbox_1_feature_3857.txt
  104. +1 −1 tests/testdata/qgis_server/wfs_getFeature_1_1_0_epsgbbox_3_feature.txt
  105. +1 −1 tests/testdata/qgis_server/wfs_getFeature_1_1_0_epsgbbox_3_feature_3857.txt
  106. +22 −0 tests/testdata/qgis_server/wms_getlegendgraphic_json_multiple_symbol.txt
  107. +1,654 −431 tests/testdata/qgis_server/wms_tile_buffer.qgs
@@ -11,18 +11,32 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Prepare release names
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Version URL
run: |
VERSION=$(echo ${RELEASE_VERSION} | cut -d '-' -f 2 )
if [ ${VERSION: -1} = "0" ]
then
VERSION=$(echo ${VERSION} | cut -d '_' -f1,2 | sed 's/_/\./g')
echo "version_url=https://changelog.qgis.org/en/qgis/version/${VERSION}" >> $GITHUB_ENV
else
PREVIOUS=$(echo ${VERSION} | sed 's/_/\./g' | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF-1)%(10^length($NF))); print}' | sed 's/\./_/g')
echo "version_url=https://github.com/qgis/QGIS/compare/final-${PREVIOUS}%5E...final-${VERSION}" >> $GITHUB_ENV
fi
- name: Version name
run: |
VERSION_CHANGELOG=$(echo ${{ github.ref }} | cut -d '-' -f 2 | cut -d '_' -f1,2 | sed 's/_/\./g')
echo "version_url=https://changelog.qgis.org/en/qgis/version/${VERSION_CHANGELOG}" >> $GITHUB_ENV
VERSION_NAME=$(echo ${{ github.ref }} | cut -d '-' -f 2 | sed 's/_/\./g')
VERSION_NAME=$(echo ${{ env.RELEASE_VERSION }} | cut -d '-' -f 2 | sed 's/_/\./g')
echo "version_name=${VERSION_NAME}" >> $GITHUB_ENV
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_BOT }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ env.version_name }}
@@ -177,6 +177,12 @@ Sets the feature ID for this feature.
:param id: feature id

.. seealso:: :py:func:`id`

.. warning::

Feature IDs will be automatically changed whenever a feature is added to vector layer or data provider.
This method is not designed to allow a specific feature ID to be assigned to a feature which will be added to a
layer or data provider, and the results will be unpredictable
%End

QgsAttributes attributes() const;
@@ -486,6 +486,16 @@ Returns the visible area as a polygon (may be rotated)

.. versionadded:: 2.8
%End

QPolygonF visiblePolygonWithBuffer() const;
%Docstring
Returns the visible area as a polygon (may be rotated) with extent buffer included

.. seealso:: :py:func:`extentBuffer`

.. versionadded:: 3.22
%End

double mapUnitsPerPixel() const;
%Docstring
Returns the distance in geographical coordinates that equals to one pixel in the map
@@ -133,6 +133,7 @@ Make sure to remove any rendered images from cache (does nothing if cache is not
.. versionadded:: 2.4
%End


void waitWhileRendering();
%Docstring
Blocks until the rendering job has finished.
@@ -107,6 +107,10 @@ Sets the ``crs`` value for the new layer in the dialog.
.. versionadded:: 3.0
%End

public slots:
virtual void accept();


};

/************************************************************************
@@ -37,13 +37,8 @@ Renderer widget for the hill shade renderer.
Factory method to create the renderer for this type.
%End

virtual QgsRasterRenderer *renderer();
virtual QgsRasterRenderer *renderer() /Factory/;

%Docstring
The renderer for the widget.

:return: A new renderer for the the config in the widget
%End

void setFromRenderer( const QgsRasterRenderer *renderer );
%Docstring
@@ -20,12 +20,15 @@ class QgsMultiBandColorRendererWidget: QgsRasterRendererWidget
QgsMultiBandColorRendererWidget( QgsRasterLayer *layer, const QgsRectangle &extent = QgsRectangle() );
static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent );

virtual QgsRasterRenderer *renderer();
virtual QgsRasterRenderer *renderer() /Factory/;

virtual void setMapCanvas( QgsMapCanvas *canvas );


void setFromRenderer( const QgsRasterRenderer *r );
%Docstring
Sets the widget state from the specified renderer.
%End

virtual QString min( int index = 0 );

@@ -23,10 +23,13 @@ class QgsPalettedRendererWidget: QgsRasterRendererWidget
~QgsPalettedRendererWidget();
static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) /Factory/;

virtual QgsRasterRenderer *renderer();
virtual QgsRasterRenderer *renderer() /Factory/;


void setFromRenderer( const QgsRasterRenderer *r );
%Docstring
Sets the widget state from the specified renderer.
%End

};

@@ -30,7 +30,7 @@ Constructs the widget
Widget creation function (mainly for the use by the renderer registry)
%End

virtual QgsRasterRenderer *renderer();
virtual QgsRasterRenderer *renderer() /Factory/;

};

@@ -13,6 +13,10 @@

class QgsRasterRendererWidget: QWidget
{
%Docstring

Abstract base class for widgets which configure a QgsRasterRenderer.
%End

%TypeHeaderCode
#include "qgsrasterrendererwidget.h"
@@ -22,9 +26,25 @@ class QgsRasterRendererWidget: QWidget
QgsRasterRendererWidget( QgsRasterLayer *layer, const QgsRectangle &extent );

virtual QgsRasterRenderer *renderer() = 0 /Factory/;
%Docstring
Creates a new renderer, using the properties defined in the widget.

The caller takes ownership of the returned renderer.
%End

void setRasterLayer( QgsRasterLayer *layer );
%Docstring
Sets the raster ``layer`` associated with the widget.

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

const QgsRasterLayer *rasterLayer() const;
%Docstring
Returns the raster layer associated with the widget.

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

virtual void setMapCanvas( QgsMapCanvas *canvas );
%Docstring
@@ -21,12 +21,15 @@ class QgsSingleBandGrayRendererWidget: QgsRasterRendererWidget

static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) /Factory/;

virtual QgsRasterRenderer *renderer();
virtual QgsRasterRenderer *renderer() /Factory/;

virtual void setMapCanvas( QgsMapCanvas *canvas );


void setFromRenderer( const QgsRasterRenderer *r );
%Docstring
Sets the widget state from the specified renderer.
%End

virtual QString min( int index = 0 );
virtual QString max( int index = 0 );
@@ -33,7 +33,7 @@ Creates new raster renderer widget
Creates new raster renderer widget
%End

virtual QgsRasterRenderer *renderer();
virtual QgsRasterRenderer *renderer() /Factory/;

virtual void setMapCanvas( QgsMapCanvas *canvas );

@@ -49,7 +49,7 @@ Returns the current raster band number

void setFromRenderer( const QgsRasterRenderer *r );
%Docstring
Set state of the widget from renderer settings
Sets the widget state from the specified renderer.
%End

public slots:
@@ -96,7 +96,7 @@ def _toStrResultSet(self, res):
return newres

def _execute(self, sql=None):
if self.sql == sql and self.result is not None:
if (sql is None or self.sql == sql) and self.result is not None:
return
if (sql is not None):
self.sql = sql
@@ -168,7 +168,7 @@ def fetchone(self):
self._execute()
if len(self.result) - self.cursor:
res = self.result[self.cursor]
++self.cursor
self.cursor += 1
return res
return None

@@ -308,6 +308,24 @@ def runAction(self, action):
return True
return VectorTable.runAction(self, action)

def geometryType(self):
""" Returns the proper WKT type.
PostGIS records type like this:
| WKT Type | geomType | geomDim |
|--------------|-------------|---------|
| LineString | LineString | 2 |
| LineStringZ | LineString | 3 |
| LineStringM | LineStringM | 3 |
| LineStringZM | LineString | 4 |
"""
geometryType = self.geomType
if self.geomDim == 3 and self.geomType[-1] != "M":
geometryType += "Z"
elif self.geomDim == 4:
geometryType += "ZM"

return geometryType


class PGRasterTable(PGTable, RasterTable):

@@ -159,7 +159,7 @@ def delete(self):
def addLayer(self):
table = self.currentTable()
if table is not None:
layer = table.toMapLayer()
layer = table.toMapLayer(table.geometryType())
layers = QgsProject.instance().addMapLayers([layer])
if len(layers) != 1:
QgsMessageLog.logMessage(
@@ -87,6 +87,14 @@ Returns the API root path
void setRequest( const QgsServerRequest *request );
%Docstring
Sets context request to ``request``
%End

QString handlerPath( ) const;
%Docstring
Returns the handler component of the URL path, i.e. the part of the path that comes
after the API path.

.. versionadded:: 3.22
%End

};
@@ -105,7 +105,8 @@ Registers an OGC API ``handler``, ownership of the handler is transferred to the

static QUrl sanitizeUrl( const QUrl &url );
%Docstring
Returns a sanitized ``url`` with extra slashes removed
Returns a sanitized ``url`` with extra slashes removed and the path URL component that
always starts with a slash.
%End

static std::string relToString( const QgsServerOgcApi::Rel &rel );
@@ -72,7 +72,7 @@ float QgsMeshTerrainGenerator::rootChunkError( const Qgs3DMapSettings & ) const
void QgsMeshTerrainGenerator::rootChunkHeightRange( float &hMin, float &hMax ) const
{
float min = std::numeric_limits<float>::max();
float max = std::numeric_limits<float>::min();
float max = -std::numeric_limits<float>::max();

for ( int i = 0; i < mTriangularMesh.vertices().count(); ++i )
{
@@ -123,25 +123,7 @@ QgsTerrainGenerator::Type QgsMeshTerrainGenerator::type() const {return QgsTerra

QgsRectangle QgsMeshTerrainGenerator::extent() const
{
QgsRectangle layerextent;
if ( mLayer )
layerextent = mLayer->extent();
else
return QgsRectangle();

QgsCoordinateTransform terrainToMapTransform( mLayer->crs(), mCrs, mTransformContext );
QgsRectangle extentInMap;

try
{
extentInMap = terrainToMapTransform.transform( mLayer->extent() );
}
catch ( QgsCsException & )
{
extentInMap = mLayer->extent();
}

return extentInMap;
return mTriangularMesh.extent();
}

void QgsMeshTerrainGenerator::writeXml( QDomElement &elem ) const
@@ -182,7 +164,7 @@ void QgsMeshTerrainGenerator::updateTriangularMesh()
{
if ( meshLayer() )
{
QgsCoordinateTransform transform( mCrs, meshLayer()->crs(), mTransformContext );
const QgsCoordinateTransform transform( meshLayer()->crs(), mCrs, mTransformContext );
meshLayer()->updateTriangularMesh( transform );
mTriangularMesh = *meshLayer()->triangularMesh();
}
@@ -157,6 +157,7 @@ QVariantMap QgsMergeVectorAlgorithm::processAlgorithm( const QVariantMap &parame
destField.setType( QVariant::String );
destField.setSubType( QVariant::Invalid );
destField.setLength( 0 );
destField.setPrecision( 0 );
}
break;
}
@@ -361,7 +361,7 @@ void QgsDecorationGrid::drawCoordinateAnnotation( QgsRenderContext &context, QPo
else //Vertical
{
xpos -= textDescent;
ypos -= textWidth - mAnnotationFrameDistance;
ypos -= textWidth + mAnnotationFrameDistance;
rotation = 4.71239;
}
break;
@@ -13387,6 +13387,7 @@ void QgisApp::closeProject()
// clear out any stuff from project
mMapCanvas->setLayers( QList<QgsMapLayer *>() );
mMapCanvas->clearCache();
mMapCanvas->cancelJobs();
mOverviewCanvas->setLayers( QList<QgsMapLayer *>() );

// Avoid unnecessary layer changed handling for each layer removed - instead,
@@ -287,7 +287,7 @@ class CORE_EXPORT QgsRectangle
{
if ( p.x() < xMinimum() )
setXMinimum( p.x() );
else if ( p.x() > xMaximum() )
if ( p.x() > xMaximum() )
setXMaximum( p.x() );
if ( p.y() < yMinimum() )
setYMinimum( p.y() );
@@ -297,8 +297,11 @@ void QgsLabelingEngine::solve( QgsRenderContext &context )

QPainter *painter = context.painter();

QgsGeometry extentGeom = QgsGeometry::fromRect( mMapSettings.visibleExtent() );
QPolygonF visiblePoly = mMapSettings.visiblePolygon();
QgsRectangle r1 = mMapSettings.visibleExtent();
r1.grow( mMapSettings.extentBuffer() );
QgsGeometry extentGeom = QgsGeometry::fromRect( r1 );

QPolygonF visiblePoly = mMapSettings.visiblePolygonWithBuffer();
visiblePoly.append( visiblePoly.at( 0 ) ); //close polygon

// get map label boundary geometry - if one hasn't been explicitly set, we use the whole of the map's visible polygon
@@ -773,4 +776,3 @@ QgsLabeling::LinePlacementFlags QgsLabelingUtils::decodeLinePlacementFlags( cons
flags |= QgsLabeling::LinePlacementFlag::MapOrientation;
return flags;
}

Loading

0 comments on commit 043eae9

Please sign in to comment.