[qgis] 02/07: New upstream version 2.14.16+dfsg

Bas Couwenberg sebastic at debian.org
Fri Jun 23 15:03:04 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 185b10634308f8cf4229131b84d2449803a76b6f
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Fri Jun 23 14:20:56 2017 +0200

    New upstream version 2.14.16+dfsg
---
 CMakeLists.txt                                     |  2 +-
 ChangeLog                                          | 62 ++++++++++++++++
 debian/changelog                                   | 10 ++-
 debian/python-qgis.install.in                      |  1 +
 python/CMakeLists.txt                              | 10 +++
 python/QtWebKit/qtwebkit.py                        | 51 +++++++++++++
 python/plugins/processing/algs/r/RAlgorithm.py     |  2 +-
 src/plugins/dxf2shp_converter/CMakeLists.txt       |  3 +
 .../dxf2shp_converter/shapelib-1.2.10/dbfopen.c    | 84 ++++++++++++----------
 .../dxf2shp_converter/shapelib-1.2.10/shapefil.h   | 57 ++++++++++++++-
 .../dxf2shp_converter/shapelib-1.2.10/shpopen.c    | 67 ++++++++---------
 src/providers/ogr/qgsogrfeatureiterator.cpp        |  8 ++-
 src/providers/ogr/qgsogrprovider.cpp               | 13 +++-
 src/server/qgswmsprojectparser.cpp                 |  6 ++
 tests/src/python/test_qgsserver.py                 |  2 +-
 tests/src/python/test_qgsserver_accesscontrol.py   | 60 ++++++++++++++++
 tests/testdata/qgis_server/getcontext.txt          | 31 ++++++++
 17 files changed, 386 insertions(+), 83 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9fef78..d283e60 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 "15")
+SET(CPACK_PACKAGE_VERSION_PATCH "16")
 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 926463f..31fd80b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,65 @@
+Juergen E. Fischer <jef at norbit.de>	2017-06-19
+
+    include uic qtwebkit.py
+
+    (cherry picked from commit c39e4fcecd630655175ac996c617020357a0c065)
+
+rldhont <rldhont at gmail.com>	2017-06-06
+
+    [BUGFIX][Processing][Rscript] Write to R_OUTPUT_VALUES file  if saveOutputValues
+
+    Fixes #16618 Processing rscripts: cannot concatenate 'str' and 'NoneType' objects
+
+Even Rouault <even.rouault at spatialys.com>	2017-03-14
+
+    [OGR provider] Use OGR_F_IsFieldSetAndNotNull() when available.
+
+    Starting with GDAL 2.2, there are 2 concepts: unset fields and null fields
+    whereas previously there was only unset fields. For QGIS purposes, both
+    states (unset/null) are equivalent.
+
+    Cherry-picked from 47dd83dd75c7f86fa59510a4b65c453f27fb3771
+
+Even Rouault <even.rouault at spatialys.com>	2017-04-25
+
+    Fix build of dxf2shp plugin with GDAL 2.2
+
+    Up to know the plugin relied on the fact that GDAL exported the symbols of
+    its internal shapelib. Since GDAL 2.2 this is no longer the case. So build
+    the internal copy of shapelib in the plugin, but to avoid symbol name clashes,
+    prefix the shapelib symbols with qgis_. And also use GDAL VSI large API for I/O
+    so that on Windows on particular non ASCII filenames are properly handled.
+
+rldhont <rldhont at gmail.com>	2017-05-24
+
+    [Server] Fix WMS GetContext accesscontrol and add tests
+
+rldhont <rldhont at gmail.com>	2017-05-23
+
+    [Server] Add GetContext test
+
+rldhont <rldhont at gmail.com>	2017-05-23
+
+    Revert "[Server] Add tests (GetContext and access control project)"
+
+    This reverts commit 5d9b460fac429556237d8e30cefa5c47a3c5a3ac.
+
+rldhont <rldhont at gmail.com>	2017-05-23
+
+    [Server] Add tests (GetContext and access control project)
+
+rldhont <rldhont at gmail.com>	2017-05-20
+
+    [Server] Fix indent Add GetProjectSettings tests in AccessControl test
+
+rldhont <rldhont at gmail.com>	2017-05-20
+
+    [Server] Add GetProjectSettings tests in AccessControl test
+
+Juergen E. Fischer <jef at norbit.de>	2017-05-19
+
+    Release of 2.14.15
+
 Juergen E. Fischer <jef at norbit.de>	2017-05-18
 
     indentation fix
diff --git a/debian/changelog b/debian/changelog
index 6892c18..7f9e50f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,14 @@
-qgis (2.14.15) UNRELEASED; urgency=medium
+qgis (2.14.16) UNRELEASED; urgency=medium
+
+  * Release of 2.14.16
+
+ -- Jürgen E. Fischer <jef at norbit.de>  Fri, 23 Jun 2017 14:00:04 +0200
+
+qgis (2.14.15) unstable; urgency=medium
 
   * Release of 2.14.15
 
- -- Jürgen E. Fischer <jef at norbit.de>  Fri, 19 May 2017 14:00:04 +0200
+ -- Jürgen E. Fischer <jef at norbit.de>  Fri, 23 Jun 2017 14:00:04 +0200
 
 qgis (2.14.14) unstable; urgency=medium
 
diff --git a/debian/python-qgis.install.in b/debian/python-qgis.install.in
index a5d64e1..20bac09 100644
--- a/debian/python-qgis.install.in
+++ b/debian/python-qgis.install.in
@@ -10,3 +10,4 @@ usr/lib/python*/*-packages/qgis/testing/*
 #wheezy precise#usr/lib/python*/*-packages/pyspatialite/*.py
 #wheezy precise#usr/lib/python*/*-packages/pyspatialite/*.so
 #sid stretch#usr/lib/python*/*-packages/PyQt4/*.so
+#sid stretch#usr/lib/python*/*-packages/PyQt4/uic/widget-plugins/qtwebkit.py
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index df06f1d..8e43308 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -310,6 +310,16 @@ ENDFOREACH(module)
 
 SET (WITH_INTERNAL_WEBKIT_BINDINGS FALSE CACHE BOOL "Build internal QtWebKit bindings")
 IF(WITH_INTERNAL_WEBKIT_BINDINGS)
+  ADD_CUSTOM_TARGET(pyqtwebkit ALL)
+  INSTALL(FILES QtWebKit/qtwebkit.py DESTINATION "${PYUIC_WIDGET_PLUGIN_DIRECTORY}")
+  ADD_CUSTOM_COMMAND(TARGET pyqtwebkit
+      POST_BUILD
+      COMMAND ${CMAKE_COMMAND} -E make_directory "${QGIS_PYTHON_OUTPUT_DIRECTORY}/PyQt4/uic/widget-plugins"
+      COMMAND ${CMAKE_COMMAND} -E copy QtWebKit/qtwebkit.py "${QGIS_PYTHON_OUTPUT_DIRECTORY}/PyQt4/uic/widget-plugins"
+      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+      DEPENDS QtWebKit/qtwebkit.py
+    )
+
   INCLUDE_DIRECTORIES(${QT_QTWEBKIT_INCLUDE_DIR})
   FILE(GLOB_RECURSE sip_files_qtwebkit QtWebKit/*.sip)
   SET(SIP_EXTRA_FILES_DEPEND ${sip_files_qtwebkit})
diff --git a/python/QtWebKit/qtwebkit.py b/python/QtWebKit/qtwebkit.py
new file mode 100644
index 0000000..9c64b88
--- /dev/null
+++ b/python/QtWebKit/qtwebkit.py
@@ -0,0 +1,51 @@
+#############################################################################
+##
+## Copyright (C) 2011 Riverbank Computing Limited.
+## Copyright (C) 2006 Thorsten Marek.
+## All right reserved.
+##
+## This file is part of PyQt.
+##
+## You may use this file under the terms of the GPL v2 or the revised BSD
+## license as follows:
+##
+## "Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+##   * Redistributions of source code must retain the above copyright
+##     notice, this list of conditions and the following disclaimer.
+##   * Redistributions in binary form must reproduce the above copyright
+##     notice, this list of conditions and the following disclaimer in
+##     the documentation and/or other materials provided with the
+##     distribution.
+##   * Neither the name of the Riverbank Computing Limited nor the names
+##     of its contributors may be used to endorse or promote products
+##     derived from this software without specific prior written
+##     permission.
+##
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
+#############################################################################
+
+
+# If pluginType is MODULE, the plugin loader will call moduleInformation.  The
+# variable MODULE is inserted into the local namespace by the plugin loader.
+pluginType = MODULE
+
+
+# moduleInformation() must return a tuple (module, widget_list).  If "module"
+# is "A" and any widget from this module is used, the code generator will write
+# "import A".  If "module" is "A[.B].C", the code generator will write
+# "from A[.B] import C".  Each entry in "widget_list" must be unique.
+def moduleInformation():
+    return "PyQt4.QtWebKit", ("QWebView", )
diff --git a/python/plugins/processing/algs/r/RAlgorithm.py b/python/plugins/processing/algs/r/RAlgorithm.py
index cb05cf9..241930d 100644
--- a/python/plugins/processing/algs/r/RAlgorithm.py
+++ b/python/plugins/processing/algs/r/RAlgorithm.py
@@ -400,7 +400,7 @@ class RAlgorithm(GeoAlgorithm):
                 value = out.value
                 value = value.replace('\\', '/')
                 commands.append('write.csv(' + out.name + ',"' + value + '")')
-            elif out.name != RAlgorithm.R_OUTPUT_VALUES:
+            elif out.name != RAlgorithm.R_OUTPUT_VALUES and self.saveOutputValues:
                 commands.append('cat("##' + out.name + '",file="' + outputDataFile + '",sep="\n",append=TRUE)')
                 commands.append('cat(' + out.name + ',file="' + outputDataFile + '",sep="\n",append=TRUE)')
 
diff --git a/src/plugins/dxf2shp_converter/CMakeLists.txt b/src/plugins/dxf2shp_converter/CMakeLists.txt
index 7b420c1..a1d362a 100644
--- a/src/plugins/dxf2shp_converter/CMakeLists.txt
+++ b/src/plugins/dxf2shp_converter/CMakeLists.txt
@@ -8,6 +8,8 @@ SET (dxf2shpconverter_SRCS
      builder.cpp
      dxflib/src/dl_dxf.cpp
      dxflib/src/dl_writer_ascii.cpp
+     shapelib-1.2.10/dbfopen.c
+     shapelib-1.2.10/shpopen.c
      )
 
 SET (dxf2shpconverter_UIS dxf2shpconvertergui.ui)
@@ -32,6 +34,7 @@ ADD_LIBRARY (dxf2shpconverterplugin MODULE ${dxf2shpconverter_SRCS} ${dxf2shpcon
 
 INCLUDE_DIRECTORIES(
      ${CMAKE_CURRENT_BINARY_DIR}
+     ${GDAL_INCLUDE_DIR}
      ../../core
      ../../core/geometry
      ../../core/raster
diff --git a/src/plugins/dxf2shp_converter/shapelib-1.2.10/dbfopen.c b/src/plugins/dxf2shp_converter/shapelib-1.2.10/dbfopen.c
index c63e751..0fd6ce8 100644
--- a/src/plugins/dxf2shp_converter/shapelib-1.2.10/dbfopen.c
+++ b/src/plugins/dxf2shp_converter/shapelib-1.2.10/dbfopen.c
@@ -182,8 +182,10 @@
  * Added header.
  */
 
+#if 0
 static char rcsid[] =
   "$Id: dbfopen.c,v 1.48 2003/03/10 14:51:27 warmerda Exp $";
+#endif
 
 #include "shapefil.h"
 
@@ -256,9 +258,9 @@ static void DBFWriteHeader( DBFHandle psDBF )
   /*      Write the initial 32 byte file header, and all the field        */
   /*      descriptions.                                       */
   /* -------------------------------------------------------------------- */
-  fseek( psDBF->fp, 0, 0 );
-  fwrite( abyHeader, XBASE_FLDHDR_SZ, 1, psDBF->fp );
-  fwrite( psDBF->pszHeader, XBASE_FLDHDR_SZ, psDBF->nFields, psDBF->fp );
+  VSIFSeekL( psDBF->fp, 0, 0 );
+  VSIFWriteL( abyHeader, XBASE_FLDHDR_SZ, 1, psDBF->fp );
+  VSIFWriteL( psDBF->pszHeader, XBASE_FLDHDR_SZ, psDBF->nFields, psDBF->fp );
 
   /* -------------------------------------------------------------------- */
   /*      Write out the newline character if there is room for it.        */
@@ -268,7 +270,7 @@ static void DBFWriteHeader( DBFHandle psDBF )
     char cNewline;
 
     cNewline = 0x0d;
-    fwrite( &cNewline, 1, 1, psDBF->fp );
+    VSIFWriteL( &cNewline, 1, 1, psDBF->fp );
   }
 }
 
@@ -290,8 +292,8 @@ static void DBFFlushRecord( DBFHandle psDBF )
     nRecordOffset = psDBF->nRecordLength * psDBF->nCurrentRecord
                     + psDBF->nHeaderLength;
 
-    fseek( psDBF->fp, nRecordOffset, 0 );
-    fwrite( psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp );
+    VSIFSeekL( psDBF->fp, nRecordOffset, 0 );
+    VSIFWriteL( psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp );
   }
 }
 
@@ -342,12 +344,12 @@ DBFOpen( const char * pszFilename, const char * pszAccess )
   sprintf( pszFullname, "%s.dbf", pszBasename );
 
   psDBF = ( DBFHandle ) calloc( 1, sizeof( DBFInfo ) );
-  psDBF->fp = fopen( pszFullname, pszAccess );
+  psDBF->fp = VSIFOpenL( pszFullname, pszAccess );
 
   if ( psDBF->fp == NULL )
   {
     sprintf( pszFullname, "%s.DBF", pszBasename );
-    psDBF->fp = fopen( pszFullname, pszAccess );
+    psDBF->fp = VSIFOpenL( pszFullname, pszAccess );
   }
 
   free( pszBasename );
@@ -367,9 +369,9 @@ DBFOpen( const char * pszFilename, const char * pszAccess )
   /*  Read Table Header info                                              */
   /* -------------------------------------------------------------------- */
   pabyBuf = ( unsigned char * ) malloc( 500 );
-  if ( fread( pabyBuf, 32, 1, psDBF->fp ) != 1 )
+  if ( VSIFReadL( pabyBuf, 32, 1, psDBF->fp ) != 1 )
   {
-    fclose( psDBF->fp );
+    VSIFCloseL( psDBF->fp );
     free( pabyBuf );
     free( psDBF );
     return NULL;
@@ -389,12 +391,13 @@ DBFOpen( const char * pszFilename, const char * pszAccess )
   /*  Read in Field Definitions                                           */
   /* -------------------------------------------------------------------- */
 
-  pabyBuf = psDBF->pszHeader = ( unsigned char * ) SfRealloc( pabyBuf, nHeadLen );
+  psDBF->pszHeader = ( char * ) SfRealloc( pabyBuf, nHeadLen );
+  pabyBuf = ( unsigned char* )psDBF->pszHeader;
 
-  fseek( psDBF->fp, 32, 0 );
-  if ( fread( pabyBuf, nHeadLen - 32, 1, psDBF->fp ) != 1 )
+  VSIFSeekL( psDBF->fp, 32, 0 );
+  if ( VSIFReadL( pabyBuf, nHeadLen - 32, 1, psDBF->fp ) != 1 )
   {
-    fclose( psDBF->fp );
+    VSIFCloseL( psDBF->fp );
     free( pabyBuf );
     free( psDBF );
     return NULL;
@@ -456,8 +459,8 @@ DBFClose( DBFHandle psDBF )
   {
     unsigned char  abyFileHeader[32];
 
-    fseek( psDBF->fp, 0, 0 );
-    fread( abyFileHeader, 32, 1, psDBF->fp );
+    VSIFSeekL( psDBF->fp, 0, 0 );
+    VSIFReadL( abyFileHeader, 32, 1, psDBF->fp );
 
     abyFileHeader[1] = 95;   /* YY */
     abyFileHeader[2] = 7;   /* MM */
@@ -468,14 +471,14 @@ DBFClose( DBFHandle psDBF )
     abyFileHeader[6] = ( psDBF->nRecords / ( 256 * 256 ) ) % 256;
     abyFileHeader[7] = ( psDBF->nRecords / ( 256 * 256 * 256 ) ) % 256;
 
-    fseek( psDBF->fp, 0, 0 );
-    fwrite( abyFileHeader, 32, 1, psDBF->fp );
+    VSIFSeekL( psDBF->fp, 0, 0 );
+    VSIFWriteL( abyFileHeader, 32, 1, psDBF->fp );
   }
 
   /* -------------------------------------------------------------------- */
   /*      Close, and free resources.                                      */
   /* -------------------------------------------------------------------- */
-  fclose( psDBF->fp );
+  VSIFCloseL( psDBF->fp );
 
   if ( psDBF->panFieldOffset != NULL )
   {
@@ -509,7 +512,7 @@ DBFCreate( const char *pszFilename )
 
 {
   DBFHandle psDBF;
-  FILE *fp;
+  VSILFILE *fp;
   char *pszFullname, *pszBasename;
   int  i;
 
@@ -534,17 +537,20 @@ DBFCreate( const char *pszFilename )
   /* -------------------------------------------------------------------- */
   /*      Create the file.                                                */
   /* -------------------------------------------------------------------- */
-  fp = fopen( pszFullname, "wb" );
+  fp = VSIFOpenL( pszFullname, "wb" );
   if ( fp == NULL )
   {
     free( pszFullname );
     return( NULL );
   }
 
-  fputc( 0, fp );
-  fclose( fp );
+  {
+    char ch = 0;
+    VSIFWriteL( &ch, 1, 1, fp );
+  }
+  VSIFCloseL( fp );
 
-  fp = fopen( pszFullname, "rb+" );
+  fp = VSIFOpenL( pszFullname, "rb+" );
   if ( fp == NULL )
   {
     free( pszFullname );
@@ -716,17 +722,17 @@ static void *DBFReadAttribute( DBFHandle psDBF, int hEntity, int iField,
 
     nRecordOffset = psDBF->nRecordLength * hEntity + psDBF->nHeaderLength;
 
-    if ( fseek( psDBF->fp, nRecordOffset, 0 ) != 0 )
+    if ( VSIFSeekL( psDBF->fp, nRecordOffset, 0 ) != 0 )
     {
       fprintf( stderr, "fseek(%d) failed on DBF file.\n",
                nRecordOffset );
       return NULL;
     }
 
-    if ( fread( psDBF->pszCurrentRecord, psDBF->nRecordLength,
-                1, psDBF->fp ) != 1 )
+    if ( VSIFReadL( psDBF->pszCurrentRecord, psDBF->nRecordLength,
+                    1, psDBF->fp ) != 1 )
     {
-      fprintf( stderr, "fread(%d) failed on DBF file.\n",
+      fprintf( stderr, "VSIFReadL(%d) failed on DBF file.\n",
                psDBF->nRecordLength );
       return NULL;
     }
@@ -790,7 +796,7 @@ static void *DBFReadAttribute( DBFHandle psDBF, int hEntity, int iField,
 }
 
 /************************************************************************/
-/*                        DBFReadIntAttribute()                         */
+/*                        DBFReadIntegerAttribute()                         */
 /*                                                                      */
 /*      Read an integer attribute.                                      */
 /************************************************************************/
@@ -1013,8 +1019,8 @@ static int DBFWriteAttribute( DBFHandle psDBF, int hEntity, int iField,
 
     nRecordOffset = psDBF->nRecordLength * hEntity + psDBF->nHeaderLength;
 
-    fseek( psDBF->fp, nRecordOffset, 0 );
-    fread( psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp );
+    VSIFSeekL( psDBF->fp, nRecordOffset, 0 );
+    VSIFReadL( psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp );
 
     psDBF->nCurrentRecord = hEntity;
   }
@@ -1073,7 +1079,7 @@ static int DBFWriteAttribute( DBFHandle psDBF, int hEntity, int iField,
       {
         int  nWidth = psDBF->panFieldSize[iField];
 
-        if ( sizeof( szSField ) - 2 < nWidth )
+        if (( int )sizeof( szSField ) - 2 < nWidth )
           nWidth = sizeof( szSField ) - 2;
 
         sprintf( szFormat, "%%%dd", nWidth );
@@ -1091,7 +1097,7 @@ static int DBFWriteAttribute( DBFHandle psDBF, int hEntity, int iField,
       {
         int  nWidth = psDBF->panFieldSize[iField];
 
-        if ( sizeof( szSField ) - 2 < nWidth )
+        if (( int )sizeof( szSField ) - 2 < nWidth )
           nWidth = sizeof( szSField ) - 2;
 
         sprintf( szFormat, "%%%d.%df",
@@ -1182,8 +1188,8 @@ int DBFWriteAttributeDirectly( DBFHandle psDBF, int hEntity, int iField,
 
     nRecordOffset = psDBF->nRecordLength * hEntity + psDBF->nHeaderLength;
 
-    fseek( psDBF->fp, nRecordOffset, 0 );
-    fread( psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp );
+    VSIFSeekL( psDBF->fp, nRecordOffset, 0 );
+    VSIFReadL( psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp );
 
     psDBF->nCurrentRecord = hEntity;
   }
@@ -1328,8 +1334,8 @@ DBFWriteTuple( DBFHandle psDBF, int hEntity, void * pRawTuple )
 
     nRecordOffset = psDBF->nRecordLength * hEntity + psDBF->nHeaderLength;
 
-    fseek( psDBF->fp, nRecordOffset, 0 );
-    fread( psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp );
+    VSIFSeekL( psDBF->fp, nRecordOffset, 0 );
+    VSIFReadL( psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp );
 
     psDBF->nCurrentRecord = hEntity;
   }
@@ -1372,8 +1378,8 @@ DBFReadTuple( DBFHandle psDBF, int hEntity )
 
     nRecordOffset = psDBF->nRecordLength * hEntity + psDBF->nHeaderLength;
 
-    fseek( psDBF->fp, nRecordOffset, 0 );
-    fread( psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp );
+    VSIFSeekL( psDBF->fp, nRecordOffset, 0 );
+    VSIFReadL( psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp );
 
     psDBF->nCurrentRecord = hEntity;
   }
diff --git a/src/plugins/dxf2shp_converter/shapelib-1.2.10/shapefil.h b/src/plugins/dxf2shp_converter/shapelib-1.2.10/shapefil.h
index bf07768..5e3e313 100644
--- a/src/plugins/dxf2shp_converter/shapelib-1.2.10/shapefil.h
+++ b/src/plugins/dxf2shp_converter/shapelib-1.2.10/shapefil.h
@@ -116,10 +116,61 @@
 
 #include <stdio.h>
 
+#include "cpl_vsi.h"
+
 #ifdef USE_DBMALLOC
 #include <dbmalloc.h>
 #endif
 
+#define SHPOpen qgis_SHPOpen
+#define SHPCreate qgis_SHPCreate
+#define SHPGetInfo qgis_SHPGetInfo
+#define SHPReadObject qgis_SHPReadObject
+#define SHPWriteObject qgis_SHPWriteObject
+#define SHPDestroyObject qgis_SHPDestroyObject
+#define SHPComputeExtents qgis_SHPComputeExtents
+#define SHPCreateObject qgis_SHPCreateObject
+#define SHPCreateSimpleObject qgis_SHPCreateSimpleObject
+#define SHPRewindObject qgis_SHPRewindObject
+#define SHPClose qgis_SHPClose
+#define SHPTypeName qgis_SHPTypeName
+#define SHPPartTypeName qgis_SHPPartTypeName
+#define SHPCreateTree qgis_SHPCreateTree
+#define SHPDestroyTree qgis_SHPDestroyTree
+#define SHPWriteTree qgis_SHPWriteTree
+#define SHPReadTree qgis_SHPReadTree
+#define SHPTreeAddObject qgis_SHPTreeAddObject
+#define SHPTreeAddShapeId qgis_SHPTreeAddShapeId
+#define SHPTreeRemoveShapeId qgis_SHPTreeRemoveShapeId
+#define SHPTreeTrimExtraNodes qgis_SHPTreeTrimExtraNodes
+#define SHPTreeFindLikelyShapes qgis_SHPTreeFindLikelyShapes
+#define SHPCheckBoundsOverlap qgis_SHPCheckBoundsOverlap
+#define DBFOpen qgis_DBFOpen
+#define DBFCreate qgis_DBFCreate
+#define DBFGetFieldCount qgis_DBFGetFieldCount
+#define DBFGetRecordCount qgis_DBFGetRecordCount
+#define DBFAddField qgis_DBFAddField
+#define DBFFieldType qgis_DBFFieldType
+#define DBFGetFieldInfo qgis_DBFGetFieldInfo
+#define DBFGetFieldIndex qgis_DBFGetFieldIndex
+#define DBFReadIntegerAttribute qgis_DBFReadIntegerAttribute
+#define DBFReadDoubleAttribute qgis_DBFReadDoubleAttribute
+#define DBFReadStringAttribute qgis_DBFReadStringAttribute
+#define DBFReadLogicalAttribute qgis_DBFReadLogicalAttribute
+#define DBFIsAttributeNULL qgis_DBFIsAttributeNULL
+#define DBFWriteIntegerAttribute qgis_DBFWriteIntegerAttribute
+#define DBFWriteDoubleAttribute qgis_DBFWriteDoubleAttribute
+#define DBFWriteStringAttribute qgis_DBFWriteStringAttribute
+#define DBFWriteNULLAttribute qgis_DBFWriteNULLAttribute
+#define DBFWriteLogicalAttribute qgis_DBFWriteLogicalAttribute
+#define DBFWriteAttributeDirectly qgis_DBFWriteAttributeDirectly
+#define DBFReadTuple qgis_DBFReadTuple
+#define DBFWriteTuple qgis_DBFWriteTuple
+#define DBFCloneEmpty qgis_DBFCloneEmpty
+#define DBFClose qgis_DBFClose
+#define DBFGetNativeFieldType qgis_DBFGetNativeFieldType
+
+
 #ifdef __cplusplus
 extern "C"
 {
@@ -189,8 +240,8 @@ extern "C"
   /************************************************************************/
   typedef struct
   {
-    FILE        *fpSHP;
-    FILE *fpSHX;
+    VSILFILE        *fpSHP;
+    VSILFILE *fpSHX;
 
     int  nShapeType;    /* SHPT_* */
 
@@ -382,7 +433,7 @@ extern "C"
   /************************************************************************/
   typedef struct
   {
-    FILE *fp;
+    VSILFILE *fp;
 
     int         nRecords;
 
diff --git a/src/plugins/dxf2shp_converter/shapelib-1.2.10/shpopen.c b/src/plugins/dxf2shp_converter/shapelib-1.2.10/shpopen.c
index 0b1be79..3aeeaff 100644
--- a/src/plugins/dxf2shp_converter/shapelib-1.2.10/shpopen.c
+++ b/src/plugins/dxf2shp_converter/shapelib-1.2.10/shpopen.c
@@ -158,8 +158,10 @@
  *
  */
 
+#if 0
 static char rcsid[] =
   "$Id: shpopen.c,v 1.39 2002/08/26 06:46:56 warmerda Exp $";
+#endif
 
 #include "shapefil.h"
 
@@ -299,8 +301,8 @@ static void SHPWriteHeader( SHPHandle psSHP )
   /* -------------------------------------------------------------------- */
   /*      Write .shp file header.                                         */
   /* -------------------------------------------------------------------- */
-  fseek( psSHP->fpSHP, 0, 0 );
-  fwrite( abyHeader, 100, 1, psSHP->fpSHP );
+  VSIFSeekL( psSHP->fpSHP, 0, 0 );
+  VSIFWriteL( abyHeader, 100, 1, psSHP->fpSHP );
 
   /* -------------------------------------------------------------------- */
   /*      Prepare, and write .shx file header.                            */
@@ -309,8 +311,8 @@ static void SHPWriteHeader( SHPHandle psSHP )
   ByteCopy( &i32, abyHeader + 24, 4 );
   if ( !bBigEndian ) SwapWord( 4, abyHeader + 24 );
 
-  fseek( psSHP->fpSHX, 0, 0 );
-  fwrite( abyHeader, 100, 1, psSHP->fpSHX );
+  VSIFSeekL( psSHP->fpSHX, 0, 0 );
+  VSIFWriteL( abyHeader, 100, 1, psSHP->fpSHX );
 
   /* -------------------------------------------------------------------- */
   /*      Write out the .shx contents.                                    */
@@ -325,7 +327,7 @@ static void SHPWriteHeader( SHPHandle psSHP )
     if ( !bBigEndian ) SwapWord( 4, panSHX + i*2 + 1 );
   }
 
-  fwrite( panSHX, sizeof( int32 ) * 2, psSHP->nRecords, psSHP->fpSHX );
+  VSIFWriteL( panSHX, sizeof( int32 ) * 2, psSHP->nRecords, psSHP->fpSHX );
 
   free( panSHX );
 }
@@ -395,11 +397,11 @@ SHPOpen( const char * pszLayer, const char * pszAccess )
   /* -------------------------------------------------------------------- */
   pszFullname = ( char * ) malloc( strlen( pszBasename ) + 5 );
   sprintf( pszFullname, "%s.shp", pszBasename );
-  psSHP->fpSHP = fopen( pszFullname, pszAccess );
+  psSHP->fpSHP = VSIFOpenL( pszFullname, pszAccess );
   if ( psSHP->fpSHP == NULL )
   {
     sprintf( pszFullname, "%s.SHP", pszBasename );
-    psSHP->fpSHP = fopen( pszFullname, pszAccess );
+    psSHP->fpSHP = VSIFOpenL( pszFullname, pszAccess );
   }
 
   if ( psSHP->fpSHP == NULL )
@@ -411,16 +413,16 @@ SHPOpen( const char * pszLayer, const char * pszAccess )
   }
 
   sprintf( pszFullname, "%s.shx", pszBasename );
-  psSHP->fpSHX = fopen( pszFullname, pszAccess );
+  psSHP->fpSHX = VSIFOpenL( pszFullname, pszAccess );
   if ( psSHP->fpSHX == NULL )
   {
     sprintf( pszFullname, "%s.SHX", pszBasename );
-    psSHP->fpSHX = fopen( pszFullname, pszAccess );
+    psSHP->fpSHX = VSIFOpenL( pszFullname, pszAccess );
   }
 
   if ( psSHP->fpSHX == NULL )
   {
-    fclose( psSHP->fpSHP );
+    VSIFCloseL( psSHP->fpSHP );
     free( psSHP );
     free( pszBasename );
     free( pszFullname );
@@ -434,7 +436,7 @@ SHPOpen( const char * pszLayer, const char * pszAccess )
   /*  Read the file size from the SHP file.    */
   /* -------------------------------------------------------------------- */
   pabyBuf = ( uchar * ) malloc( 100 );
-  fread( pabyBuf, 100, 1, psSHP->fpSHP );
+  VSIFReadL( pabyBuf, 100, 1, psSHP->fpSHP );
 
   psSHP->nFileSize = ( pabyBuf[24] * 256 * 256 * 256
                        + pabyBuf[25] * 256 * 256
@@ -444,15 +446,15 @@ SHPOpen( const char * pszLayer, const char * pszAccess )
   /* -------------------------------------------------------------------- */
   /*  Read SHX file Header info                                           */
   /* -------------------------------------------------------------------- */
-  fread( pabyBuf, 100, 1, psSHP->fpSHX );
+  VSIFReadL( pabyBuf, 100, 1, psSHP->fpSHX );
 
   if ( pabyBuf[0] != 0
        || pabyBuf[1] != 0
        || pabyBuf[2] != 0x27
        || ( pabyBuf[3] != 0x0a && pabyBuf[3] != 0x0d ) )
   {
-    fclose( psSHP->fpSHP );
-    fclose( psSHP->fpSHX );
+    VSIFCloseL( psSHP->fpSHP );
+    VSIFCloseL( psSHP->fpSHX );
     free( psSHP );
     free( pabyBuf );
 
@@ -468,8 +470,8 @@ SHPOpen( const char * pszLayer, const char * pszAccess )
   if ( psSHP->nRecords < 0 || psSHP->nRecords > 256000000 )
   {
     /* this header appears to be corrupt.  Give up. */
-    fclose( psSHP->fpSHP );
-    fclose( psSHP->fpSHX );
+    VSIFCloseL( psSHP->fpSHP );
+    VSIFCloseL( psSHP->fpSHX );
     free( psSHP );
 
     free( pabyBuf );
@@ -526,7 +528,7 @@ SHPOpen( const char * pszLayer, const char * pszAccess )
     ( int * ) malloc( sizeof( int ) * MAX( 1, psSHP->nMaxRecords ) );
 
   pabyBuf = ( uchar * ) malloc( 8 * MAX( 1, psSHP->nRecords ) );
-  fread( pabyBuf, 8, psSHP->nRecords, psSHP->fpSHX );
+  VSIFReadL( pabyBuf, 8, psSHP->nRecords, psSHP->fpSHX );
 
   for ( i = 0; i < psSHP->nRecords; i++ )
   {
@@ -570,8 +572,8 @@ SHPClose( SHPHandle psSHP )
   free( psSHP->panRecOffset );
   free( psSHP->panRecSize );
 
-  fclose( psSHP->fpSHX );
-  fclose( psSHP->fpSHP );
+  VSIFCloseL( psSHP->fpSHX );
+  VSIFCloseL( psSHP->fpSHP );
 
   if ( psSHP->pabyRec != NULL )
   {
@@ -622,7 +624,7 @@ SHPCreate( const char * pszLayer, int nShapeType )
 {
   char *pszBasename, *pszFullname;
   int  i;
-  FILE *fpSHP, *fpSHX;
+  VSILFILE *fpSHP, *fpSHX;
   uchar      abyHeader[100];
   int32 i32;
   double dValue;
@@ -655,7 +657,7 @@ SHPCreate( const char * pszLayer, int nShapeType )
   /* -------------------------------------------------------------------- */
   pszFullname = ( char * ) malloc( strlen( pszBasename ) + 5 );
   sprintf( pszFullname, "%s.shp", pszBasename );
-  fpSHP = fopen( pszFullname, "wb" );
+  fpSHP = VSIFOpenL( pszFullname, "wb" );
   if ( fpSHP == NULL )
   {
     free( pszBasename );
@@ -664,12 +666,12 @@ SHPCreate( const char * pszLayer, int nShapeType )
   }
 
   sprintf( pszFullname, "%s.shx", pszBasename );
-  fpSHX = fopen( pszFullname, "wb" );
+  fpSHX = VSIFOpenL( pszFullname, "wb" );
   if ( fpSHX == NULL )
   {
     free( pszBasename );
     free( pszFullname );
-    fclose( fpSHP );
+    VSIFCloseL( fpSHP );
     return( NULL );
   }
 
@@ -706,7 +708,7 @@ SHPCreate( const char * pszLayer, int nShapeType )
   /* -------------------------------------------------------------------- */
   /*      Write .shp file header.                                         */
   /* -------------------------------------------------------------------- */
-  fwrite( abyHeader, 100, 1, fpSHP );
+  VSIFWriteL( abyHeader, 100, 1, fpSHP );
 
   /* -------------------------------------------------------------------- */
   /*      Prepare, and write .shx file header.                            */
@@ -715,13 +717,13 @@ SHPCreate( const char * pszLayer, int nShapeType )
   ByteCopy( &i32, abyHeader + 24, 4 );
   if ( !bBigEndian ) SwapWord( 4, abyHeader + 24 );
 
-  fwrite( abyHeader, 100, 1, fpSHX );
+  VSIFWriteL( abyHeader, 100, 1, fpSHX );
 
   /* -------------------------------------------------------------------- */
   /*      Close the files, and then open them as regular existing files.  */
   /* -------------------------------------------------------------------- */
-  fclose( fpSHP );
-  fclose( fpSHX );
+  VSIFCloseL( fpSHP );
+  VSIFCloseL( fpSHX );
 
   return( SHPOpen( pszLayer, "r+b" ) );
 }
@@ -1237,10 +1239,10 @@ SHPWriteObject( SHPHandle psSHP, int nShapeId, SHPObject * psObject )
   /* -------------------------------------------------------------------- */
   /*      Write out record.                                               */
   /* -------------------------------------------------------------------- */
-  if ( fseek( psSHP->fpSHP, nRecordOffset, 0 ) != 0
-       || fwrite( pabyRec, nRecordSize, 1, psSHP->fpSHP ) < 1 )
+  if ( VSIFSeekL( psSHP->fpSHP, nRecordOffset, 0 ) != 0
+       || VSIFWriteL( pabyRec, nRecordSize, 1, psSHP->fpSHP ) < 1 )
   {
-    printf( "Error in fseek() or fwrite().\n" );
+    printf( "Error in fseek() or VSIFWriteL().\n" );
     free( pabyRec );
     return -1;
   }
@@ -1308,8 +1310,8 @@ SHPReadObject( SHPHandle psSHP, int hEntity )
   /* -------------------------------------------------------------------- */
   /*      Read the record.                                                */
   /* -------------------------------------------------------------------- */
-  fseek( psSHP->fpSHP, psSHP->panRecOffset[hEntity], 0 );
-  fread( psSHP->pabyRec, psSHP->panRecSize[hEntity] + 8, 1, psSHP->fpSHP );
+  VSIFSeekL( psSHP->fpSHP, psSHP->panRecOffset[hEntity], 0 );
+  VSIFReadL( psSHP->pabyRec, psSHP->panRecSize[hEntity] + 8, 1, psSHP->fpSHP );
 
   /* -------------------------------------------------------------------- */
   /* Allocate and minimally initialize the object.   */
@@ -1738,6 +1740,7 @@ SHPRewindObject( SHPHandle hSHP, SHPObject * psObject )
 
 {
   int  iOpRing, bAltered = 0;
+  ( void )hSHP;
 
   /* -------------------------------------------------------------------- */
   /*      Do nothing if this is not a polygon object.                     */
diff --git a/src/providers/ogr/qgsogrfeatureiterator.cpp b/src/providers/ogr/qgsogrfeatureiterator.cpp
index d5c45fd..87dac83 100644
--- a/src/providers/ogr/qgsogrfeatureiterator.cpp
+++ b/src/providers/ogr/qgsogrfeatureiterator.cpp
@@ -33,6 +33,12 @@
 // - mAttributeFields
 // - mEncoding
 
+// Starting with GDAL 2.2, there are 2 concepts: unset fields and null fields
+// whereas previously there was only unset fields. For QGIS purposes, both
+// states (unset/null) are equivalent.
+#ifndef OGRNullMarker
+#define OGR_F_IsFieldSetAndNotNull OGR_F_IsFieldSet
+#endif
 
 QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrFeatureSource* source, bool ownSource, const QgsFeatureRequest& request )
     : QgsAbstractFeatureIteratorFromSource<QgsOgrFeatureSource>( source, ownSource, request )
@@ -335,7 +341,7 @@ void QgsOgrFeatureIterator::getFeatureAttribute( OGRFeatureH ogrFet, QgsFeature
 
   QVariant value;
 
-  if ( OGR_F_IsFieldSet( ogrFet, attindex ) )
+  if ( OGR_F_IsFieldSetAndNotNull( ogrFet, attindex ) )
   {
     switch ( mSource->mFields.at( attindex ).type() )
     {
diff --git a/src/providers/ogr/qgsogrprovider.cpp b/src/providers/ogr/qgsogrprovider.cpp
index 4335927..3626ff4 100644
--- a/src/providers/ogr/qgsogrprovider.cpp
+++ b/src/providers/ogr/qgsogrprovider.cpp
@@ -55,6 +55,13 @@ email                : sherman at mrcc.com
 #include <sys/vfs.h>
 #endif
 
+// Starting with GDAL 2.2, there are 2 concepts: unset fields and null fields
+// whereas previously there was only unset fields. For QGIS purposes, both
+// states (unset/null) are equivalent.
+#ifndef OGRNullMarker
+#define OGR_F_IsFieldSetAndNotNull OGR_F_IsFieldSet
+#endif
+
 static const QString TEXT_PROVIDER_KEY = "ogr";
 static const QString TEXT_PROVIDER_DESCRIPTION =
   QString( "OGR data provider" )
@@ -2595,7 +2602,7 @@ void QgsOgrProvider::uniqueValues( int index, QList<QVariant> &uniqueValues, int
   OGRFeatureH f;
   while (( f = OGR_L_GetNextFeature( l ) ) )
   {
-    uniqueValues << ( OGR_F_IsFieldSet( f, 0 ) ? convertValue( fld.type(), mEncoding->toUnicode( OGR_F_GetFieldAsString( f, 0 ) ) ) : QVariant( fld.type() ) );
+    uniqueValues << ( OGR_F_IsFieldSetAndNotNull( f, 0 ) ? convertValue( fld.type(), mEncoding->toUnicode( OGR_F_GetFieldAsString( f, 0 ) ) ) : QVariant( fld.type() ) );
     OGR_F_Destroy( f );
 
     if ( limit >= 0 && uniqueValues.size() >= limit )
@@ -2637,7 +2644,7 @@ QVariant QgsOgrProvider::minimumValue( int index )
     return QVariant();
   }
 
-  QVariant value = OGR_F_IsFieldSet( f, 0 ) ? convertValue( fld.type(), mEncoding->toUnicode( OGR_F_GetFieldAsString( f, 0 ) ) ) : QVariant( fld.type() );
+  QVariant value = OGR_F_IsFieldSetAndNotNull( f, 0 ) ? convertValue( fld.type(), mEncoding->toUnicode( OGR_F_GetFieldAsString( f, 0 ) ) ) : QVariant( fld.type() );
   OGR_F_Destroy( f );
 
   OGR_DS_ReleaseResultSet( ogrDataSource, l );
@@ -2676,7 +2683,7 @@ QVariant QgsOgrProvider::maximumValue( int index )
     return QVariant();
   }
 
-  QVariant value = OGR_F_IsFieldSet( f, 0 ) ? convertValue( fld.type(), mEncoding->toUnicode( OGR_F_GetFieldAsString( f, 0 ) ) ) : QVariant( fld.type() );
+  QVariant value = OGR_F_IsFieldSetAndNotNull( f, 0 ) ? convertValue( fld.type(), mEncoding->toUnicode( OGR_F_GetFieldAsString( f, 0 ) ) ) : QVariant( fld.type() );
   OGR_F_Destroy( f );
 
   OGR_DS_ReleaseResultSet( ogrDataSource, l );
diff --git a/src/server/qgswmsprojectparser.cpp b/src/server/qgswmsprojectparser.cpp
index fd2c66d..a2aefca 100644
--- a/src/server/qgswmsprojectparser.cpp
+++ b/src/server/qgswmsprojectparser.cpp
@@ -1607,6 +1607,12 @@ void QgsWMSProjectParser::addOWSLayers( QDomDocument &doc,
       {
         continue;
       }
+#ifdef HAVE_SERVER_PYTHON_PLUGINS
+      if ( !mAccessControl->layerReadPermission( currentLayer ) )
+      {
+        continue;
+      }
+#endif
       if ( nonIdentifiableLayers.contains( currentLayer->id() ) )
       {
         layerElem.setAttribute( "queryable", "false" );
diff --git a/tests/src/python/test_qgsserver.py b/tests/src/python/test_qgsserver.py
index 986b9e3..3b477fe 100644
--- a/tests/src/python/test_qgsserver.py
+++ b/tests/src/python/test_qgsserver.py
@@ -187,7 +187,7 @@ class TestQgsServer(unittest.TestCase):
 
     def test_project_wms(self):
         """Test some WMS request"""
-        for request in ('GetCapabilities', 'GetProjectSettings'):
+        for request in ('GetCapabilities', 'GetProjectSettings', 'GetContext'):
             self.wms_request_compare(request)
 
         # Test getfeatureinfo response
diff --git a/tests/src/python/test_qgsserver_accesscontrol.py b/tests/src/python/test_qgsserver_accesscontrol.py
index 2d58d77..6a38960 100644
--- a/tests/src/python/test_qgsserver_accesscontrol.py
+++ b/tests/src/python/test_qgsserver_accesscontrol.py
@@ -28,6 +28,7 @@ from PyQt4.QtCore import QSize
 import tempfile
 import urllib
 import base64
+import re
 
 
 XML_NS = \
@@ -207,6 +208,64 @@ class TestQgsServerAccessControl(unittest.TestCase):
             str(response).find("<Name>Country</Name>") != -1,
             "Country layer in GetCapabilities\n%s" % response)
 
+    def test_wms_getprojectsettings(self):
+        query_string = "&".join(["%s=%s" % i for i in {
+            "MAP": urllib.quote(self.projectPath),
+            "SERVICE": "WMS",
+            "VERSION": "1.1.1",
+            "REQUEST": "GetProjectSettings"
+        }.items()])
+
+        response, headers = self._get_fullaccess(query_string)
+        self.assertTrue(
+            str(response).find("<TreeName>Hello</TreeName>") != -1,
+            "No Hello layer in GetProjectSettings\n%s" % response)
+        self.assertTrue(
+            str(response).find("<TreeName>Country</TreeName>") != -1,
+            "No Country layer in GetProjectSettings\n%s" % response)
+        self.assertTrue(
+            str(response).find("<LayerDrawingOrder>Country_Labels,Country,dem,Hello_Filter_SubsetString,Hello_Project_SubsetString,Hello_SubsetString,Hello,db_point</LayerDrawingOrder>") != -1,
+            "LayerDrawingOrder in GetProjectSettings\n%s" % response)
+
+        response, headers = self._get_restricted(query_string)
+        self.assertTrue(
+            str(response).find("<TreeName>Hello</TreeName>") != -1,
+            "No Hello layer in GetProjectSettings\n%s" % response)
+        self.assertFalse(
+            str(response).find("<TreeName>Country</TreeName>") != -1,
+            "Country layer in GetProjectSettings\n%s" % response)
+        self.assertTrue(
+            str(response).find("<LayerDrawingOrder>Country_Labels,dem,Hello_Filter_SubsetString,Hello_Project_SubsetString,Hello_SubsetString,Hello,db_point</LayerDrawingOrder>") != -1,
+            "LayerDrawingOrder in GetProjectSettings\n%s" % response)
+
+    def test_wms_getcontext(self):
+        query_string = "&".join(["%s=%s" % i for i in {
+            "MAP": urllib.quote(self.projectPath),
+            "SERVICE": "WMS",
+            "VERSION": "1.1.1",
+            "REQUEST": "GetContext"
+        }.items()])
+
+        response, headers = self._get_fullaccess(query_string)
+        self.assertTrue(
+            str(response).find("<Layer opacity=\"1\" queryable=\"true\" hidden=\"false\" id=\"Hello\" name=\"Hello\">") != -1,
+            "No Hello layer in GetContext\n%s" % response)
+        self.assertTrue(
+            str(response).find("<Layer opacity=\"1\" queryable=\"true\" hidden=\"false\" id=\"Country\" name=\"Country\">") != -1,
+            "No Country layer in GetContext\n%s" % response)
+        self.assertTrue(
+            str(response).find("<Layer opacity=\"1\" queryable=\"true\" hidden=\"false\" id=\"Country\" name=\"Country\">")
+            < str(response).find("<Layer opacity=\"1\" queryable=\"true\" hidden=\"false\" id=\"Hello\" name=\"Hello\">"),
+            "Hello layer not after Country layer\n%s" % response)
+
+        response, headers = self._get_restricted(query_string)
+        self.assertTrue(
+            str(response).find("<Layer opacity=\"1\" queryable=\"true\" hidden=\"false\" id=\"Hello\" name=\"Hello\">") != -1,
+            "No Hello layer in GetContext\n%s" % response)
+        self.assertFalse(
+            str(response).find("<Layer opacity=\"1\" queryable=\"true\" hidden=\"false\" id=\"Country\" name=\"Country\">") != -1,
+            "Country layer in GetContext\n%s" % response)
+
     def test_wms_describelayer_hello(self):
         query_string = "&".join(["%s=%s" % i for i in {
             "MAP": urllib.quote(self.projectPath),
@@ -1488,5 +1547,6 @@ class TestQgsServerAccessControl(unittest.TestCase):
                 str(response).find("<qgs:color>{color}</qgs:color>".format(color=color)) != -1,
                 "Wrong color in result\n%s" % response)
 
+
 if __name__ == "__main__":
     unittest.main()
diff --git a/tests/testdata/qgis_server/getcontext.txt b/tests/testdata/qgis_server/getcontext.txt
new file mode 100644
index 0000000..fb7a5b5
--- /dev/null
+++ b/tests/testdata/qgis_server/getcontext.txt
@@ -0,0 +1,31 @@
+
+Content-Type: text/xml; charset=utf-8
+
+<?xml version="1.0" encoding="utf-8"?>
+<OWSContext xmlns:ogc="http://www.opengis.net/ogc" version="0.3.1" xmlns:context="http://www.opengis.net/context" xmlns="http://www.opengis.net/ows-context" xmlns:xal="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ows-context="http://www.opengis.net/ows-context" xmlns:sld="http://www.opengis.net/sld" xmlns:gml="http://www.opengis.net/gml" id="ows-context-test_project" xmlns:ows="http://www.opengis.net [...]
+ <General>
+  <Window width="800" height="600"/>
+  <ows:Title>QGIS TestProject</ows:Title>
+  <ows:Abstract>Some UTF8 text èòù</ows:Abstract>
+  <ows:BoundingBox crs="EPSG:4326">
+   <ows:LowerCorner>44.9012 8.20315</ows:LowerCorner>
+   <ows:UpperCorner>44.9016 8.20416</ows:UpperCorner>
+  </ows:BoundingBox>
+ </General>
+ <ResourceList>
+  <Layer opacity="1" queryable="true" hidden="false" id="testlayer_èé" name="testlayer èé">
+   <ows:Title>A test vector layer</ows:Title>
+   <ows:OutputFormat>image/png</ows:OutputFormat>
+   <Server version="1.3.0" default="true" service="urn:ogc:serviceType:WMS">
+    <OnlineResource xlink:href="http:?&"/>
+   </Server>
+   <ows:Abstract>A test vector layer with unicode òà</ows:Abstract>
+   <StyleList>
+    <Style current="true">
+     <Name>default</Name>
+     <Title>default</Title>
+    </Style>
+   </StyleList>
+  </Layer>
+ </ResourceList>
+</OWSContext>

-- 
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