File tree 2 files changed +30
-0
lines changed
2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -323,6 +323,24 @@ namespace QgsWfs
323
323
else
324
324
attElem.setAttribute ( QStringLiteral ( " type" ), QStringLiteral ( " dateTime" ) );
325
325
}
326
+ else if ( setup.type () == QStringLiteral ( " Range" ) )
327
+ {
328
+ const QVariantMap config = setup.config ();
329
+ if ( config.contains ( QStringLiteral ( " Precision" ) ) )
330
+ {
331
+ // if precision in range config is not the same as the attributePrec
332
+ // we need to update type
333
+ bool ok;
334
+ int configPrec ( config[ QStringLiteral ( " Precision" ) ].toInt ( &ok ) );
335
+ if ( ok && configPrec != field.precision () )
336
+ {
337
+ if ( configPrec == 0 )
338
+ attElem.setAttribute ( QStringLiteral ( " type" ), QStringLiteral ( " integer" ) );
339
+ else
340
+ attElem.setAttribute ( QStringLiteral ( " type" ), QStringLiteral ( " decimal" ) );
341
+ }
342
+ }
343
+ }
326
344
327
345
sequenceElem.appendChild ( attElem );
328
346
Original file line number Diff line number Diff line change @@ -1467,6 +1467,18 @@ namespace QgsWfs
1467
1467
return date.toString ( fieldFormat );
1468
1468
}
1469
1469
}
1470
+ else if ( setup.type () == QStringLiteral ( " Range" ) )
1471
+ {
1472
+ const QVariantMap config = setup.config ();
1473
+ if ( config.contains ( QStringLiteral ( " Precision" ) ) )
1474
+ {
1475
+ // if precision is defined, use it
1476
+ bool ok;
1477
+ int precision ( config[ QStringLiteral ( " Precision" ) ].toInt ( &ok ) );
1478
+ if ( ok )
1479
+ return QString::number ( value.toDouble (), ' f' , precision );
1480
+ }
1481
+ }
1470
1482
1471
1483
switch ( value.type () )
1472
1484
{
You can’t perform that action at this time.
0 commit comments