Skip to content

Commit

Permalink
Server WFS fix describefeaturetype double virtual fields
Browse files Browse the repository at this point in the history
Fixes #29767
  • Loading branch information
elpaso committed May 27, 2019
1 parent 26f8815 commit e0d2618
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
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,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
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,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
Loading

0 comments on commit e0d2618

Please sign in to comment.