Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Server WFS fix describefeaturetype double virtual fields
Fixes #29767
  • Loading branch information
elpaso committed May 27, 2019
1 parent b737588 commit f37141d
Show file tree
Hide file tree
Showing 3 changed files with 719 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/services/wfs/qgswfsdescribefeaturetype.cpp
Expand Up @@ -291,7 +291,7 @@ namespace QgsWfs
}
else if ( attributeType == QVariant::Double )
{
if ( field.length() != 0 && field.precision() == 0 )
if ( field.length() > 0 && field.precision() == 0 )
attElem.setAttribute( QStringLiteral( "type" ), QStringLiteral( "integer" ) );
else
attElem.setAttribute( QStringLiteral( "type" ), QStringLiteral( "decimal" ) );
Expand Down
7 changes: 7 additions & 0 deletions tests/src/python/test_qgsserver_wfs.py
Expand Up @@ -454,6 +454,13 @@ def test_describeFeatureType(self):
self.wfs_request_compare("DescribeFeatureType", '1.1.0', "TYPENAME=does_not_exist&",
'wfs_describeFeatureType_1_1_0_typename_wrong', project_file=project_file)

def test_describeFeatureTypeVirtualFields(self):
"""Test DescribeFeatureType with virtual fields: bug GH-29767"""

project_file = "bug_gh29767_double_vfield.qgs"
self.wfs_request_compare("DescribeFeatureType", '1.1.0', "",
'wfs_describeFeatureType_1_1_0_virtual_fields', project_file=project_file)

def test_getFeatureFeature_0_nulls(self):
"""Test that 0 and null in integer columns are reported correctly"""

Expand Down

0 comments on commit f37141d

Please sign in to comment.