mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-12 00:06:54 -05:00
Fix long, unsigned types get converted to string when writing to MVT
This commit is contained in:
parent
b59313238a
commit
bafab316db
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -286,14 +286,37 @@ void QgsVectorTileMVTEncoder::addFeature( vector_tile::Tile_Layer *tileLayer, co
|
||||
valueIndex = tileLayer->values_size() - 1;
|
||||
mKnownValues[v] = valueIndex;
|
||||
|
||||
if ( v.userType() == QMetaType::Type::Double )
|
||||
switch ( v.userType() )
|
||||
{
|
||||
case QMetaType::Type::Double:
|
||||
value->set_double_value( v.toDouble() );
|
||||
else if ( v.userType() == QMetaType::Type::Int )
|
||||
value->set_int_value( v.toInt() );
|
||||
else if ( v.userType() == QMetaType::Type::Bool )
|
||||
break;
|
||||
|
||||
case QMetaType::Type::Float:
|
||||
value->set_float_value( v.toFloat() );
|
||||
break;
|
||||
|
||||
case QMetaType::Type::Int:
|
||||
case QMetaType::Type::Long:
|
||||
case QMetaType::Type::LongLong:
|
||||
value->set_int_value( v.toLongLong() );
|
||||
break;
|
||||
|
||||
case QMetaType::Type::UInt:
|
||||
case QMetaType::Type::ULong:
|
||||
case QMetaType::Type::ULongLong:
|
||||
value->set_uint_value( v.toULongLong() );
|
||||
break;
|
||||
|
||||
case QMetaType::Type::Bool:
|
||||
value->set_bool_value( v.toBool() );
|
||||
else
|
||||
break;
|
||||
|
||||
default:
|
||||
value->set_string_value( v.toString().toUtf8().toStdString() );
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
feature->add_tags( static_cast<quint32>( i ) );
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user