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

Bas Couwenberg sebastic at debian.org
Fri Jul 21 21:55:39 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 19088cc97d5a6b422534bb37b9b5b0d81a9d69f6
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Fri Jul 21 20:12:36 2017 +0200

    New upstream version 2.14.17+dfsg
---
 CMakeLists.txt                                     |  2 +-
 ChangeLog                                          | 36 +++++++++++++++++
 debian/changelog                                   | 10 ++++-
 debian/control.in                                  |  2 +-
 src/core/geometry/qgscompoundcurvev2.cpp           | 31 ++++----------
 src/core/geometry/qgscurvepolygonv2.cpp            | 25 +++++++-----
 src/core/geometry/qgsgeometryutils.cpp             | 12 +++++-
 src/core/geometry/qgslinestringv2.cpp              | 11 ++---
 src/core/geometry/qgsmultilinestringv2.cpp         |  2 +-
 src/core/geometry/qgspointv2.cpp                   | 11 ++++-
 src/core/qgsvectorfilewriter.cpp                   | 12 ++++++
 src/providers/ogr/qgsogrprovider.cpp               | 22 ++++++++++
 src/server/qgswfsserver.cpp                        | 18 ++++++++-
 tests/src/core/testqgsgeometry.cpp                 | 47 +++++++++++++++-------
 .../testdata/qgis_server/wfs_getfeature_limit2.txt | 12 +++---
 .../testdata/qgis_server/wfs_getfeature_nobbox.txt | 18 ++++-----
 .../qgis_server/wfs_getfeature_start1_limit1.txt   |  6 +--
 .../qgis_server/wfs_getfeature_startindex2.txt     |  6 +--
 18 files changed, 196 insertions(+), 87 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d283e60..c199bae 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 "16")
+SET(CPACK_PACKAGE_VERSION_PATCH "17")
 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 31fd80b..0741c33 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,39 @@
+Even Rouault <even.rouault at spatialys.com>	2017-07-08
+
+    [OGR] Use OGR_F_SetFieldNull() with GDAL >= 2.2 to avoid GeoJSON fields to be unset (fixes #16812)
+
+rldhont <rldhont at gmail.com>	2017-07-05
+
+    Fix GML2 after Port GML3 improvements to 2.14 branch
+
+Marco Hugentobler <marco.hugentobler at sourcepole.ch>	2017-02-22
+
+    Port GML3 improvements to 2.14 branch
+
+Juergen E. Fischer <jef at norbit.de>	2017-07-04
+
+    debian packaging: drop explicit libopenscenegraph-dev build dependency
+
+rldhont <rldhont at gmail.com>	2017-06-30
+
+    Identation [BUGFIX] QgsCurvePolygonV2::asGML3, build right GML3 polygon
+
+rldhont <rldhont at gmail.com>	2017-06-30
+
+    [BUGFIX] QgsCurvePolygonV2::asGML3, build right GML3 polygon
+
+rldhont <rldhont at gmail.com>	2017-06-28
+
+    [BUGFIX] QgsCurvePolygonV2::asGML, add interior ring only if one exists
+
+rldhont <rldhont at gmail.com>	2017-06-28
+
+    [BUGFIX] QgsCurvePolygonV2::asGML, add interior ring only if one exists
+
+Juergen E. Fischer <jef at norbit.de>	2017-06-23
+
+    Release of 2.14.16
+
 Juergen E. Fischer <jef at norbit.de>	2017-06-19
 
     include uic qtwebkit.py
diff --git a/debian/changelog b/debian/changelog
index 7f9e50f..57fbf42 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,14 @@
-qgis (2.14.16) UNRELEASED; urgency=medium
+qgis (2.14.17) UNRELEASED; urgency=medium
+
+  * Release of 2.14.17
+
+ -- Jürgen E. Fischer <jef at norbit.de>  Fri, 21 Jul 2017 14:00:03 +0200
+
+qgis (2.14.16) unstable; urgency=medium
 
   * Release of 2.14.16
 
- -- Jürgen E. Fischer <jef at norbit.de>  Fri, 23 Jun 2017 14:00:04 +0200
+ -- Jürgen E. Fischer <jef at norbit.de>  Fri, 21 Jul 2017 14:00:03 +0200
 
 qgis (2.14.15) unstable; urgency=medium
 
diff --git a/debian/control.in b/debian/control.in
index b613507..4690f4f 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -52,7 +52,6 @@ Build-Depends:
  python-sip (>= 4.5.0),
  python-sip-dev (>= 4.5.0),
  libosgearth-dev,
- libopenscenegraph-dev,
  libqscintilla2-dev,
  git,
  doxygen,
@@ -451,6 +450,7 @@ Depends:
  qgis-providers (= ${binary:Version}),
  ${shlibs:Depends},
  ${misc:Depends}
+Suggests: xvfb
 Conflicts: qgis-mapserver
 Provides: qgis-mapserver
 Replaces: qgis-mapserver
diff --git a/src/core/geometry/qgscompoundcurvev2.cpp b/src/core/geometry/qgscompoundcurvev2.cpp
index 819b2bf..76a37c3 100644
--- a/src/core/geometry/qgscompoundcurvev2.cpp
+++ b/src/core/geometry/qgscompoundcurvev2.cpp
@@ -255,33 +255,16 @@ QDomElement QgsCompoundCurveV2::asGML2( QDomDocument& doc, int precision, const
 
 QDomElement QgsCompoundCurveV2::asGML3( QDomDocument& doc, int precision, const QString& ns ) const
 {
-  QDomElement elemCurve = doc.createElementNS( ns, "Curve" );
-
-  QDomElement elemSegments = doc.createElementNS( ns, "segments" );
-
+  QDomElement compoundCurveElem = doc.createElementNS( ns, "CompositeCurve" );
   Q_FOREACH ( const QgsCurveV2* curve, mCurves )
   {
-    if ( dynamic_cast<const QgsLineStringV2*>( curve ) )
-    {
-      QgsPointSequenceV2 pts;
-      curve->points( pts );
-
-      QDomElement elemLineStringSegment = doc.createElementNS( ns, "LineStringSegment" );
-      elemLineStringSegment.appendChild( QgsGeometryUtils::pointsToGML3( pts, doc, precision, ns, is3D() ) );
-      elemSegments.appendChild( elemLineStringSegment );
-    }
-    else if ( dynamic_cast<const QgsCircularStringV2*>( curve ) )
-    {
-      QgsPointSequenceV2 pts;
-      curve->points( pts );
-
-      QDomElement elemArcString = doc.createElementNS( ns, "ArcString" );
-      elemArcString.appendChild( QgsGeometryUtils::pointsToGML3( pts, doc, precision, ns, is3D() ) );
-      elemSegments.appendChild( elemArcString );
-    }
+    QDomElement curveMemberElem = doc.createElementNS( ns, "curveMember" );
+    QDomElement curveElem = curve->asGML3( doc, precision, ns );
+    curveMemberElem.appendChild( curveElem );
+    compoundCurveElem.appendChild( curveMemberElem );
   }
-  elemCurve.appendChild( elemSegments );
-  return elemCurve;
+
+  return compoundCurveElem;
 }
 
 QString QgsCompoundCurveV2::asJSON( int precision ) const
diff --git a/src/core/geometry/qgscurvepolygonv2.cpp b/src/core/geometry/qgscurvepolygonv2.cpp
index c751aab..92a09d9 100644
--- a/src/core/geometry/qgscurvepolygonv2.cpp
+++ b/src/core/geometry/qgscurvepolygonv2.cpp
@@ -300,16 +300,16 @@ QDomElement QgsCurvePolygonV2::asGML2( QDomDocument& doc, int precision, const Q
   elemOuterBoundaryIs.appendChild( outerRing );
   delete exteriorLineString;
   elemPolygon.appendChild( elemOuterBoundaryIs );
-  QDomElement elemInnerBoundaryIs = doc.createElementNS( ns, "innerBoundaryIs" );
   for ( int i = 0, n = numInteriorRings(); i < n; ++i )
   {
+    QDomElement elemInnerBoundaryIs = doc.createElementNS( ns, "innerBoundaryIs" );
     QgsLineStringV2* interiorLineString = interiorRing( i )->curveToLine();
     QDomElement innerRing = interiorLineString->asGML2( doc, precision, ns );
     innerRing.toElement().setTagName( "LinearRing" );
     elemInnerBoundaryIs.appendChild( innerRing );
     delete interiorLineString;
+    elemPolygon.appendChild( elemInnerBoundaryIs );
   }
-  elemPolygon.appendChild( elemInnerBoundaryIs );
   return elemPolygon;
 }
 
@@ -317,18 +317,25 @@ QDomElement QgsCurvePolygonV2::asGML3( QDomDocument& doc, int precision, const Q
 {
   QDomElement elemCurvePolygon = doc.createElementNS( ns, "Polygon" );
   QDomElement elemExterior = doc.createElementNS( ns, "exterior" );
-  QDomElement outerRing = exteriorRing()->asGML2( doc, precision, ns );
-  outerRing.toElement().setTagName( "LinearRing" );
-  elemExterior.appendChild( outerRing );
+  QDomElement curveElem = exteriorRing()->asGML3( doc, precision, ns );
+  if ( curveElem.tagName() == "LineString" )
+  {
+    curveElem.setTagName( "LinearRing" );
+  }
+  elemExterior.appendChild( curveElem );
   elemCurvePolygon.appendChild( elemExterior );
-  QDomElement elemInterior = doc.createElementNS( ns, "interior" );
+
   for ( int i = 0, n = numInteriorRings(); i < n; ++i )
   {
-    QDomElement innerRing = interiorRing( i )->asGML2( doc, precision, ns );
-    innerRing.toElement().setTagName( "LinearRing" );
+    QDomElement elemInterior = doc.createElementNS( ns, "interior" );
+    QDomElement innerRing = interiorRing( i )->asGML3( doc, precision, ns );
+    if ( innerRing.tagName() == "LineString" )
+    {
+      innerRing.setTagName( "LinearRing" );
+    }
     elemInterior.appendChild( innerRing );
+    elemCurvePolygon.appendChild( elemInterior );
   }
-  elemCurvePolygon.appendChild( elemInterior );
   return elemCurvePolygon;
 }
 
diff --git a/src/core/geometry/qgsgeometryutils.cpp b/src/core/geometry/qgsgeometryutils.cpp
index f913c0a..8ba201b 100644
--- a/src/core/geometry/qgsgeometryutils.cpp
+++ b/src/core/geometry/qgsgeometryutils.cpp
@@ -631,12 +631,20 @@ QDomElement QgsGeometryUtils::pointsToGML2( const QgsPointSequenceV2 &points, QD
 {
   QDomElement elemCoordinates = doc.createElementNS( ns, "coordinates" );
 
+  // coordinate separator
+  QString cs = ",";
+  // tupel separator
+  QString ts = " ";
+
+  elemCoordinates.setAttribute( "cs", cs );
+  elemCoordinates.setAttribute( "ts", ts );
+
   QString strCoordinates;
 
   Q_FOREACH ( const QgsPointV2& p, points )
-    strCoordinates += qgsDoubleToString( p.x(), precision ) + ',' + qgsDoubleToString( p.y(), precision ) + ' ';
+    strCoordinates += qgsDoubleToString( p.x(), precision ) + cs + qgsDoubleToString( p.y(), precision ) + ts;
 
-  if ( strCoordinates.endsWith( ' ' ) )
+  if ( strCoordinates.endsWith( ts ) )
     strCoordinates.chop( 1 ); // Remove trailing space
 
   elemCoordinates.appendChild( doc.createTextNode( strCoordinates ) );
diff --git a/src/core/geometry/qgslinestringv2.cpp b/src/core/geometry/qgslinestringv2.cpp
index e2f2d48..e59504c 100644
--- a/src/core/geometry/qgslinestringv2.cpp
+++ b/src/core/geometry/qgslinestringv2.cpp
@@ -209,14 +209,9 @@ QDomElement QgsLineStringV2::asGML3( QDomDocument& doc, int precision, const QSt
   QgsPointSequenceV2 pts;
   points( pts );
 
-  QDomElement elemCurve = doc.createElementNS( ns, "Curve" );
-  QDomElement elemSegments = doc.createElementNS( ns, "segments" );
-  QDomElement elemArcString = doc.createElementNS( ns, "LineStringSegment" );
-  elemArcString.appendChild( QgsGeometryUtils::pointsToGML3( pts, doc, precision, ns, is3D() ) );
-  elemSegments.appendChild( elemArcString );
-  elemCurve.appendChild( elemSegments );
-
-  return elemCurve;
+  QDomElement elemLineString = doc.createElementNS( ns, "LineString" );
+  elemLineString.appendChild( QgsGeometryUtils::pointsToGML3( pts, doc, precision, ns, is3D() ) );
+  return elemLineString;
 }
 
 QString QgsLineStringV2::asJSON( int precision ) const
diff --git a/src/core/geometry/qgsmultilinestringv2.cpp b/src/core/geometry/qgsmultilinestringv2.cpp
index a83bdc6..3107fac 100644
--- a/src/core/geometry/qgsmultilinestringv2.cpp
+++ b/src/core/geometry/qgsmultilinestringv2.cpp
@@ -54,7 +54,7 @@ QDomElement QgsMultiLineStringV2::asGML2( QDomDocument& doc, int precision, cons
 
 QDomElement QgsMultiLineStringV2::asGML3( QDomDocument& doc, int precision, const QString& ns ) const
 {
-  QDomElement elemMultiCurve = doc.createElementNS( ns, "MultiLineString" );
+  QDomElement elemMultiCurve = doc.createElementNS( ns, "MultiCurve" );
   Q_FOREACH ( const QgsAbstractGeometryV2 *geom, mGeometries )
   {
     if ( dynamic_cast<const QgsLineStringV2*>( geom ) )
diff --git a/src/core/geometry/qgspointv2.cpp b/src/core/geometry/qgspointv2.cpp
index 3caadca..7cda68a 100644
--- a/src/core/geometry/qgspointv2.cpp
+++ b/src/core/geometry/qgspointv2.cpp
@@ -213,7 +213,16 @@ QDomElement QgsPointV2::asGML2( QDomDocument& doc, int precision, const QString&
 {
   QDomElement elemPoint = doc.createElementNS( ns, "Point" );
   QDomElement elemCoordinates = doc.createElementNS( ns, "coordinates" );
-  QString strCoordinates = qgsDoubleToString( mX, precision ) + ',' + qgsDoubleToString( mY, precision );
+
+  // coordinate separator
+  QString cs = ",";
+  // tupel separator
+  QString ts = " ";
+
+  elemCoordinates.setAttribute( "cs", cs );
+  elemCoordinates.setAttribute( "ts", ts );
+
+  QString strCoordinates = qgsDoubleToString( mX, precision ) + cs + qgsDoubleToString( mY, precision );
   elemCoordinates.appendChild( doc.createTextNode( strCoordinates ) );
   elemPoint.appendChild( elemCoordinates );
   return elemPoint;
diff --git a/src/core/qgsvectorfilewriter.cpp b/src/core/qgsvectorfilewriter.cpp
index 536147b..a563118 100644
--- a/src/core/qgsvectorfilewriter.cpp
+++ b/src/core/qgsvectorfilewriter.cpp
@@ -1771,7 +1771,19 @@ OGRFeatureH QgsVectorFileWriter::createFeature( QgsFeature& feature )
     int ogrField = mAttrIdxToOgrIdx[ fldIdx ];
 
     if ( !attrValue.isValid() || attrValue.isNull() )
+    {
+// Starting with GDAL 2.2, there are 2 concepts: unset fields and null fields
+// whereas previously there was only unset fields. For a GeoJSON output,
+// leaving a field unset will cause it to not appear at all in the output
+// feature.
+// When all features of a layer have a field unset, this would cause the
+// field to not be present at all in the output, and thus on reading to
+// have disappeared. #16812
+#ifdef OGRNullMarker
+      OGR_F_SetFieldNull( poFeature, ogrField );
+#endif
       continue;
+    }
 
     switch ( attrValue.type() )
     {
diff --git a/src/providers/ogr/qgsogrprovider.cpp b/src/providers/ogr/qgsogrprovider.cpp
index 3626ff4..32719b1 100644
--- a/src/providers/ogr/qgsogrprovider.cpp
+++ b/src/providers/ogr/qgsogrprovider.cpp
@@ -1035,7 +1035,18 @@ bool QgsOgrProvider::addFeature( QgsFeature& f )
     QVariant attrVal = attrs.at( targetAttributeId );
     if ( attrVal.isNull() || ( type != OFTString && attrVal.toString().isEmpty() ) )
     {
+// Starting with GDAL 2.2, there are 2 concepts: unset fields and null fields
+// whereas previously there was only unset fields. For a GeoJSON output,
+// leaving a field unset will cause it to not appear at all in the output
+// feature.
+// When all features of a layer have a field unset, this would cause the
+// field to not be present at all in the output, and thus on reading to
+// have disappeared. #16812
+#ifdef OGRNullMarker
+      OGR_F_SetFieldNull( feature, targetAttributeId );
+#else
       OGR_F_UnsetField( feature, targetAttributeId );
+#endif
     }
     else
     {
@@ -1323,7 +1334,18 @@ bool QgsOgrProvider::changeAttributeValues( const QgsChangedAttributesMap &attr_
 
       if ( it2->isNull() || ( type != OFTString && it2->toString().isEmpty() ) )
       {
+// Starting with GDAL 2.2, there are 2 concepts: unset fields and null fields
+// whereas previously there was only unset fields. For a GeoJSON output,
+// leaving a field unset will cause it to not appear at all in the output
+// feature.
+// When all features of a layer have a field unset, this would cause the
+// field to not be present at all in the output, and thus on reading to
+// have disappeared. #16812
+#ifdef OGRNullMarker
+        OGR_F_SetFieldNull( of, f );
+#else
         OGR_F_UnsetField( of, f );
+#endif
       }
       else
       {
diff --git a/src/server/qgswfsserver.cpp b/src/server/qgswfsserver.cpp
index c682167..00b34a8 100644
--- a/src/server/qgswfsserver.cpp
+++ b/src/server/qgswfsserver.cpp
@@ -2004,7 +2004,14 @@ QDomElement QgsWFSServer::createFeatureGML2( QgsFeature* feat, QDomDocument& doc
       delete centroid;
     }
     else
-      gmlElem = QgsOgcUtils::geometryToGML( geom, doc, prec );
+    {
+      QgsAbstractGeometryV2* abstractGeom = geom->geometry();
+      if ( abstractGeom )
+      {
+        gmlElem = abstractGeom->asGML2( doc, prec, "http://www.opengis.net/gml" );
+      }
+    }
+
     if ( !gmlElem.isNull() )
     {
       QgsRectangle box = geom->boundingBox();
@@ -2081,7 +2088,14 @@ QDomElement QgsWFSServer::createFeatureGML3( QgsFeature* feat, QDomDocument& doc
       delete centroid;
     }
     else
-      gmlElem = QgsOgcUtils::geometryToGML( geom, doc, "GML3", prec );
+    {
+      QgsAbstractGeometryV2* abstractGeom = geom->geometry();
+      if ( abstractGeom )
+      {
+        gmlElem = abstractGeom->asGML3( doc, prec, "http://www.opengis.net/gml" );
+      }
+    }
+
     if ( !gmlElem.isNull() )
     {
       QgsRectangle box = geom->boundingBox();
diff --git a/tests/src/core/testqgsgeometry.cpp b/tests/src/core/testqgsgeometry.cpp
index 0c9b6e1..48abc2d 100644
--- a/tests/src/core/testqgsgeometry.cpp
+++ b/tests/src/core/testqgsgeometry.cpp
@@ -564,9 +564,9 @@ void TestQgsGeometry::pointV2()
   QgsPointV2 exportPoint( 1, 2 );
   QgsPointV2 exportPointFloat( 1 / 3.0, 2 / 3.0 );
   QDomDocument doc( "gml" );
-  QString expectedGML2( "<Point xmlns=\"gml\"><coordinates xmlns=\"gml\">1,2</coordinates></Point>" );
+  QString expectedGML2( "<Point xmlns=\"gml\"><coordinates xmlns=\"gml\" cs=\",\" ts=\" \">1,2</coordinates></Point>" );
   QCOMPARE( elemToString( exportPoint.asGML2( doc ) ), expectedGML2 );
-  QString expectedGML2prec3( "<Point xmlns=\"gml\"><coordinates xmlns=\"gml\">0.333,0.667</coordinates></Point>" );
+  QString expectedGML2prec3( "<Point xmlns=\"gml\"><coordinates xmlns=\"gml\" cs=\",\" ts=\" \">0.333,0.667</coordinates></Point>" );
   QCOMPARE( elemToString( exportPointFloat.asGML2( doc, 3 ) ), expectedGML2prec3 );
 
   //asGML3
@@ -1402,15 +1402,15 @@ void TestQgsGeometry::lineStringV2()
                              << QgsPointV2( 1 + 1 / 3.0, 1 + 2 / 3.0 )
                              << QgsPointV2( 2 + 1 / 3.0, 2 + 2 / 3.0 ) );
   QDomDocument doc( "gml" );
-  QString expectedGML2( "<LineString xmlns=\"gml\"><coordinates xmlns=\"gml\">31,32 41,42 51,52</coordinates></LineString>" );
+  QString expectedGML2( "<LineString xmlns=\"gml\"><coordinates xmlns=\"gml\" cs=\",\" ts=\" \">31,32 41,42 51,52</coordinates></LineString>" );
   QCOMPARE( elemToString( exportLine.asGML2( doc ) ), expectedGML2 );
-  QString expectedGML2prec3( "<LineString xmlns=\"gml\"><coordinates xmlns=\"gml\">0.333,0.667 1.333,1.667 2.333,2.667</coordinates></LineString>" );
+  QString expectedGML2prec3( "<LineString xmlns=\"gml\"><coordinates xmlns=\"gml\" cs=\",\" ts=\" \">0.333,0.667 1.333,1.667 2.333,2.667</coordinates></LineString>" );
   QCOMPARE( elemToString( exportLineFloat.asGML2( doc, 3 ) ), expectedGML2prec3 );
 
   //asGML3
-  QString expectedGML3( "<Curve xmlns=\"gml\"><segments xmlns=\"gml\"><LineStringSegment xmlns=\"gml\"><posList xmlns=\"gml\" srsDimension=\"2\">31 32 41 42 51 52</posList></LineStringSegment></segments></Curve>" );
+  QString expectedGML3( "<LineString xmlns=\"gml\"><posList xmlns=\"gml\" srsDimension=\"2\">31 32 41 42 51 52</posList></LineString>" );
   QCOMPARE( elemToString( exportLine.asGML3( doc ) ), expectedGML3 );
-  QString expectedGML3prec3( "<Curve xmlns=\"gml\"><segments xmlns=\"gml\"><LineStringSegment xmlns=\"gml\"><posList xmlns=\"gml\" srsDimension=\"2\">0.333 0.667 1.333 1.667 2.333 2.667</posList></LineStringSegment></segments></Curve>" );
+  QString expectedGML3prec3( "<LineString xmlns=\"gml\"><posList xmlns=\"gml\" srsDimension=\"2\">0.333 0.667 1.333 1.667 2.333 2.667</posList></LineString>" );
   QCOMPARE( elemToString( exportLineFloat.asGML3( doc, 3 ) ), expectedGML3prec3 );
 
   //asJSON
@@ -2840,12 +2840,29 @@ void TestQgsGeometry::polygonV2()
                   << QgsPointV2( QgsWKBTypes::Point, 0, 10 ) << QgsPointV2( QgsWKBTypes::Point, 10, 10 )
                   << QgsPointV2( QgsWKBTypes::Point, 10, 0 ) << QgsPointV2( QgsWKBTypes::Point, 0, 0 ) );
   exportPolygon.setExteriorRing( ext );
+
+  // GML document for compare
+  QDomDocument doc( "gml" );
+
+  // as GML2
+  QString expectedSimpleGML2( "<Polygon xmlns=\"gml\"><outerBoundaryIs xmlns=\"gml\"><LinearRing xmlns=\"gml\"><coordinates xmlns=\"gml\" cs=\",\" ts=\" \">0,0 0,10 10,10 10,0 0,0</coordinates></LinearRing></outerBoundaryIs></Polygon>" );
+  QCOMPARE( elemToString( exportPolygon.asGML2( doc ) ), expectedSimpleGML2 );
+
+  //as GML3
+  QString expectedSimpleGML3( "<Polygon xmlns=\"gml\"><exterior xmlns=\"gml\"><LinearRing xmlns=\"gml\"><posList xmlns=\"gml\" srsDimension=\"2\">0 0 0 10 10 10 10 0 0 0</posList></LinearRing></exterior></Polygon>" );
+  QCOMPARE( elemToString( exportPolygon.asGML3( doc ) ), expectedSimpleGML3 );
+
+  // as JSON
+  QString expectedSimpleJson( "{\"type\": \"Polygon\", \"coordinates\": [[ [0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]] }" );
+  QCOMPARE( exportPolygon.asJSON(), expectedSimpleJson );
+
   ring = new QgsLineStringV2();
   ring->setPoints( QgsPointSequenceV2() << QgsPointV2( QgsWKBTypes::Point, 1, 1 )
                    << QgsPointV2( QgsWKBTypes::Point, 1, 9 ) << QgsPointV2( QgsWKBTypes::Point, 9, 9 )
                    << QgsPointV2( QgsWKBTypes::Point, 9, 1 ) << QgsPointV2( QgsWKBTypes::Point, 1, 1 ) );
   exportPolygon.addInteriorRing( ring );
 
+  // as JSON
   QString expectedJson( "{\"type\": \"Polygon\", \"coordinates\": [[ [0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [ [1, 1], [1, 9], [9, 9], [9, 1], [1, 1]]] }" );
   QCOMPARE( exportPolygon.asJSON(), expectedJson );
 
@@ -2861,24 +2878,24 @@ void TestQgsGeometry::polygonV2()
                    << QgsPointV2( QgsWKBTypes::Point, 4 / 3.0, 2 / 3.0 ) << QgsPointV2( QgsWKBTypes::Point, 2 / 3.0, 2 / 3.0 ) );
   exportPolygonFloat.addInteriorRing( ring );
 
+  // as JSON
   QString expectedJsonPrec3( "{\"type\": \"Polygon\", \"coordinates\": [[ [1.111, 1.111], [1.111, 11.111], [11.111, 11.111], [11.111, 1.111], [1.111, 1.111]], [ [0.667, 0.667], [0.667, 1.333], [1.333, 1.333], [1.333, 0.667], [0.667, 0.667]]] }" );
   QCOMPARE( exportPolygonFloat.asJSON( 3 ), expectedJsonPrec3 );
 
   // as GML2
-  QDomDocument doc( "gml" );
-  QString expectedGML2( "<Polygon xmlns=\"gml\"><outerBoundaryIs xmlns=\"gml\"><LinearRing xmlns=\"gml\"><coordinates xmlns=\"gml\">0,0 0,10 10,10 10,0 0,0</coordinates></LinearRing></outerBoundaryIs>" );
-  expectedGML2 += QString( "<innerBoundaryIs xmlns=\"gml\"><LinearRing xmlns=\"gml\"><coordinates xmlns=\"gml\">1,1 1,9 9,9 9,1 1,1</coordinates></LinearRing></innerBoundaryIs></Polygon>" );
+  QString expectedGML2( "<Polygon xmlns=\"gml\"><outerBoundaryIs xmlns=\"gml\"><LinearRing xmlns=\"gml\"><coordinates xmlns=\"gml\" cs=\",\" ts=\" \">0,0 0,10 10,10 10,0 0,0</coordinates></LinearRing></outerBoundaryIs>" );
+  expectedGML2 += QString( "<innerBoundaryIs xmlns=\"gml\"><LinearRing xmlns=\"gml\"><coordinates xmlns=\"gml\" cs=\",\" ts=\" \">1,1 1,9 9,9 9,1 1,1</coordinates></LinearRing></innerBoundaryIs></Polygon>" );
   QCOMPARE( elemToString( exportPolygon.asGML2( doc ) ), expectedGML2 );
-  QString expectedGML2prec3( "<Polygon xmlns=\"gml\"><outerBoundaryIs xmlns=\"gml\"><LinearRing xmlns=\"gml\"><coordinates xmlns=\"gml\">1.111,1.111 1.111,11.111 11.111,11.111 11.111,1.111 1.111,1.111</coordinates></LinearRing></outerBoundaryIs>" );
-  expectedGML2prec3 += QString( "<innerBoundaryIs xmlns=\"gml\"><LinearRing xmlns=\"gml\"><coordinates xmlns=\"gml\">0.667,0.667 0.667,1.333 1.333,1.333 1.333,0.667 0.667,0.667</coordinates></LinearRing></innerBoundaryIs></Polygon>" );
+  QString expectedGML2prec3( "<Polygon xmlns=\"gml\"><outerBoundaryIs xmlns=\"gml\"><LinearRing xmlns=\"gml\"><coordinates xmlns=\"gml\" cs=\",\" ts=\" \">1.111,1.111 1.111,11.111 11.111,11.111 11.111,1.111 1.111,1.111</coordinates></LinearRing></outerBoundaryIs>" );
+  expectedGML2prec3 += QString( "<innerBoundaryIs xmlns=\"gml\"><LinearRing xmlns=\"gml\"><coordinates xmlns=\"gml\" cs=\",\" ts=\" \">0.667,0.667 0.667,1.333 1.333,1.333 1.333,0.667 0.667,0.667</coordinates></LinearRing></innerBoundaryIs></Polygon>" );
   QCOMPARE( elemToString( exportPolygonFloat.asGML2( doc, 3 ) ), expectedGML2prec3 );
 
   //as GML3
-  QString expectedGML3( "<Polygon xmlns=\"gml\"><exterior xmlns=\"gml\"><LinearRing xmlns=\"gml\"><coordinates xmlns=\"gml\">0,0 0,10 10,10 10,0 0,0</coordinates></LinearRing></exterior>" );
-  expectedGML3 += QString( "<interior xmlns=\"gml\"><LinearRing xmlns=\"gml\"><coordinates xmlns=\"gml\">1,1 1,9 9,9 9,1 1,1</coordinates></LinearRing></interior></Polygon>" );
+  QString expectedGML3( "<Polygon xmlns=\"gml\"><exterior xmlns=\"gml\"><LinearRing xmlns=\"gml\"><posList xmlns=\"gml\" srsDimension=\"2\">0 0 0 10 10 10 10 0 0 0</posList></LinearRing></exterior>" );
+  expectedGML3 += QString( "<interior xmlns=\"gml\"><LinearRing xmlns=\"gml\"><posList xmlns=\"gml\" srsDimension=\"2\">1 1 1 9 9 9 9 1 1 1</posList></LinearRing></interior></Polygon>" );
   QCOMPARE( elemToString( exportPolygon.asGML3( doc ) ), expectedGML3 );
-  QString expectedGML3prec3( "<Polygon xmlns=\"gml\"><exterior xmlns=\"gml\"><LinearRing xmlns=\"gml\"><coordinates xmlns=\"gml\">1.111,1.111 1.111,11.111 11.111,11.111 11.111,1.111 1.111,1.111</coordinates></LinearRing></exterior>" );
-  expectedGML3prec3 += QString( "<interior xmlns=\"gml\"><LinearRing xmlns=\"gml\"><coordinates xmlns=\"gml\">0.667,0.667 0.667,1.333 1.333,1.333 1.333,0.667 0.667,0.667</coordinates></LinearRing></interior></Polygon>" );
+  QString expectedGML3prec3( "<Polygon xmlns=\"gml\"><exterior xmlns=\"gml\"><LinearRing xmlns=\"gml\"><posList xmlns=\"gml\" srsDimension=\"2\">1.111 1.111 1.111 11.111 11.111 11.111 11.111 1.111 1.111 1.111</posList></LinearRing></exterior>" );
+  expectedGML3prec3 += QString( "<interior xmlns=\"gml\"><LinearRing xmlns=\"gml\"><posList xmlns=\"gml\" srsDimension=\"2\">0.667 0.667 0.667 1.333 1.333 1.333 1.333 0.667 0.667 0.667</posList></LinearRing></interior></Polygon>" );
   QCOMPARE( elemToString( exportPolygonFloat.asGML3( doc, 3 ) ), expectedGML3prec3 );
 
   //removing the fourth to last vertex removes the whole ring
diff --git a/tests/testdata/qgis_server/wfs_getfeature_limit2.txt b/tests/testdata/qgis_server/wfs_getfeature_limit2.txt
index bcb35f5..6b06407 100644
--- a/tests/testdata/qgis_server/wfs_getfeature_limit2.txt
+++ b/tests/testdata/qgis_server/wfs_getfeature_limit2.txt
@@ -13,9 +13,9 @@ Content-Type: text/xml; charset=utf-8
    </gml:Box>
   </gml:boundedBy>
   <qgs:geometry>
-   <gml:Point srsName="EPSG:4326">
-    <gml:coordinates cs="," ts=" ">8.20349634,44.90148253</gml:coordinates>
-   </gml:Point>
+   <Point xmlns="http://www.opengis.net/gml" srsName="EPSG:4326">
+    <coordinates xmlns="http://www.opengis.net/gml" cs="," ts=" ">8.20349634,44.90148253</coordinates>
+   </Point>
   </qgs:geometry>
   <qgs:id>1</qgs:id>
   <qgs:name>one</qgs:name>
@@ -30,9 +30,9 @@ Content-Type: text/xml; charset=utf-8
    </gml:Box>
   </gml:boundedBy>
   <qgs:geometry>
-   <gml:Point srsName="EPSG:4326">
-    <gml:coordinates cs="," ts=" ">8.20354699,44.90143568</gml:coordinates>
-   </gml:Point>
+   <Point xmlns="http://www.opengis.net/gml" srsName="EPSG:4326">
+    <coordinates xmlns="http://www.opengis.net/gml" cs="," ts=" ">8.20354699,44.90143568</coordinates>
+   </Point>
   </qgs:geometry>
   <qgs:id>2</qgs:id>
   <qgs:name>two</qgs:name>
diff --git a/tests/testdata/qgis_server/wfs_getfeature_nobbox.txt b/tests/testdata/qgis_server/wfs_getfeature_nobbox.txt
index d13aefc..4efb472 100644
--- a/tests/testdata/qgis_server/wfs_getfeature_nobbox.txt
+++ b/tests/testdata/qgis_server/wfs_getfeature_nobbox.txt
@@ -13,9 +13,9 @@ Content-Type: text/xml; charset=utf-8
    </gml:Box>
   </gml:boundedBy>
   <qgs:geometry>
-   <gml:Point srsName="EPSG:4326">
-    <gml:coordinates cs="," ts=" ">8.20349634,44.90148253</gml:coordinates>
-   </gml:Point>
+   <Point xmlns="http://www.opengis.net/gml" srsName="EPSG:4326">
+    <coordinates xmlns="http://www.opengis.net/gml" cs="," ts=" ">8.20349634,44.90148253</coordinates>
+   </Point>
   </qgs:geometry>
   <qgs:id>1</qgs:id>
   <qgs:name>one</qgs:name>
@@ -30,9 +30,9 @@ Content-Type: text/xml; charset=utf-8
    </gml:Box>
   </gml:boundedBy>
   <qgs:geometry>
-   <gml:Point srsName="EPSG:4326">
-    <gml:coordinates cs="," ts=" ">8.20354699,44.90143568</gml:coordinates>
-   </gml:Point>
+   <Point xmlns="http://www.opengis.net/gml" srsName="EPSG:4326">
+    <coordinates xmlns="http://www.opengis.net/gml" cs="," ts=" ">8.20354699,44.90143568</coordinates>
+   </Point>
   </qgs:geometry>
   <qgs:id>2</qgs:id>
   <qgs:name>two</qgs:name>
@@ -47,9 +47,9 @@ Content-Type: text/xml; charset=utf-8
    </gml:Box>
   </gml:boundedBy>
   <qgs:geometry>
-   <gml:Point srsName="EPSG:4326">
-    <gml:coordinates cs="," ts=" ">8.20345931,44.90139484</gml:coordinates>
-   </gml:Point>
+   <Point xmlns="http://www.opengis.net/gml" srsName="EPSG:4326">
+    <coordinates xmlns="http://www.opengis.net/gml" cs="," ts=" ">8.20345931,44.90139484</coordinates>
+   </Point>
   </qgs:geometry>
   <qgs:id>3</qgs:id>
   <qgs:name>three</qgs:name>
diff --git a/tests/testdata/qgis_server/wfs_getfeature_start1_limit1.txt b/tests/testdata/qgis_server/wfs_getfeature_start1_limit1.txt
index 9408334..922dd22 100644
--- a/tests/testdata/qgis_server/wfs_getfeature_start1_limit1.txt
+++ b/tests/testdata/qgis_server/wfs_getfeature_start1_limit1.txt
@@ -13,9 +13,9 @@ Content-Type: text/xml; charset=utf-8
    </gml:Box>
   </gml:boundedBy>
   <qgs:geometry>
-   <gml:Point srsName="EPSG:4326">
-    <gml:coordinates cs="," ts=" ">8.20354699,44.90143568</gml:coordinates>
-   </gml:Point>
+   <Point xmlns="http://www.opengis.net/gml" srsName="EPSG:4326">
+    <coordinates xmlns="http://www.opengis.net/gml" cs="," ts=" ">8.20354699,44.90143568</coordinates>
+   </Point>
   </qgs:geometry>
   <qgs:id>2</qgs:id>
   <qgs:name>two</qgs:name>
diff --git a/tests/testdata/qgis_server/wfs_getfeature_startindex2.txt b/tests/testdata/qgis_server/wfs_getfeature_startindex2.txt
index 534f7a1..e506e12 100644
--- a/tests/testdata/qgis_server/wfs_getfeature_startindex2.txt
+++ b/tests/testdata/qgis_server/wfs_getfeature_startindex2.txt
@@ -13,9 +13,9 @@ Content-Type: text/xml; charset=utf-8
    </gml:Box>
   </gml:boundedBy>
   <qgs:geometry>
-   <gml:Point srsName="EPSG:4326">
-    <gml:coordinates cs="," ts=" ">8.20345931,44.90139484</gml:coordinates>
-   </gml:Point>
+   <Point xmlns="http://www.opengis.net/gml" srsName="EPSG:4326">
+    <coordinates xmlns="http://www.opengis.net/gml" cs="," ts=" ">8.20345931,44.90139484</coordinates>
+   </Point>
   </qgs:geometry>
   <qgs:id>3</qgs:id>
   <qgs:name>three</qgs:name>

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