mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -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;
 | 
					      valueIndex = tileLayer->values_size() - 1;
 | 
				
			||||||
      mKnownValues[v] = valueIndex;
 | 
					      mKnownValues[v] = valueIndex;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if ( v.userType() == QMetaType::Type::Double )
 | 
					      switch ( v.userType() )
 | 
				
			||||||
        value->set_double_value( v.toDouble() );
 | 
					      {
 | 
				
			||||||
      else if ( v.userType() == QMetaType::Type::Int )
 | 
					        case QMetaType::Type::Double:
 | 
				
			||||||
        value->set_int_value( v.toInt() );
 | 
					          value->set_double_value( v.toDouble() );
 | 
				
			||||||
      else if ( v.userType() == QMetaType::Type::Bool )
 | 
					          break;
 | 
				
			||||||
        value->set_bool_value( v.toBool() );
 | 
					
 | 
				
			||||||
      else
 | 
					        case QMetaType::Type::Float:
 | 
				
			||||||
        value->set_string_value( v.toString().toUtf8().toStdString() );
 | 
					          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() );
 | 
				
			||||||
 | 
					          break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        default:
 | 
				
			||||||
 | 
					          value->set_string_value( v.toString().toUtf8().toStdString() );
 | 
				
			||||||
 | 
					          break;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    feature->add_tags( static_cast<quint32>( i ) );
 | 
					    feature->add_tags( static_cast<quint32>( i ) );
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user