Skip to content

Commit

Permalink
Merge pull request #29970 from elpaso/bugfix-gh29767-server-wfs-doubl…
Browse files Browse the repository at this point in the history
…e-virtual-fields

Server WFS fix describefeaturetype double virtual fields
  • Loading branch information
elpaso authored May 28, 2019
2 parents 575b0de + 49b381f commit bede196
Show file tree
Hide file tree
Showing 4 changed files with 740 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 @@ -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
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit bede196

Please sign in to comment.