Variables de expresión en QField¶
QField supports various expression variables that can be used as field defaults, constraints or also to control the visibility of your attribute forms. These include not only all the expression variables available in QGIS but also additional variables provided by QField to access positioning information and give explicit information about the QFieldCloud data.
QFieldCloud¶
Para los usuarios de QFieldCloud, se pueden utilizar dos variables de expresión en formularios o valores predeterminados:
@cloud_username
- Devuelve el nombre del usuario de QFieldCloud actualmente conectado.@cloud_useremail
- Devuelve la dirección de correo electrónico del usuario de QFieldCloud actualmente conectado.
Positioning and GNSS Variables¶
Accurate positioning information can be relevant in a lot of contexts. When your location is activated, the specific variables will populate the pre-configured fields. These variables are commonly used in default values expressions to track the quality and details of individual measured points.
In case you are connecting to an external positioning device, it is possible to interchange the @position_*
variable with the @gnss_*
variable to directly connect its position instead.
Watch
Make sure that your positioning is enabled, otherwise the fields will not be populated.
List of Positioning and GNSS Variables¶
Note: In order for the positioning variable to be available is when the crosshair is snapped to the sensor.
@position_source_name
- The name of the device providing the location information, as reported by the sensor. If the position is manually set and not snapped to the cursor, the source name is "manual".@position_quality_description
- A human-readable and translated description of the quality as reported by the sensor (e.g., "Fixed RTK").@position_coordinate
- A point containing the WGS84 coordinate (longitude, latitude, altitude) as delivered by the sensor.@position_horizontal_accuracy
- The horizontal accuracy of the coordinate (in meters), as reported by the sensor.-
@position_timestamp
- The timestamp of the position in UTC, as reported by the sensor. -
@position_direction
- The direction of movement in degrees from true north, as reported by the sensor. -
@position_orientation
- La orientación del propio dispositivo, independientemente de su movimiento, con respecto al norte verdadero (de 0° a 359°). -
@position_ground_speed
- Groundspeed (in m/s), as reported by the sensor. -
@position_magnetic_variation
- The angle between the magnetic field's horizontal component and true north (magnetic declination). A positive value indicates a clockwise direction from true north; a negative value indicates counter-clockwise. -
@position_vertical_accuracy
- The vertical accuracy of the coordinate (in meters), as reported by the sensor. -
@position_3d_accuracy
- The three-dimensional accuracy of the coordinate (in meters), as reported by the sensor. -
@position_vertical_speed
- The vertical speed (in m/s), as reported by the sensor. @position_averaged_count
- Número de posiciones recogidas a partir de las cuales se ha calculado una posición promediada. Si no se promedia, el valor es0
(cero).@position_pdop
- Position dilution of precision, as reported by the sensor.@position_hdop
- Horizontal dilution of precision, as reported by the sensor.@position_vdop
- Vertical dilution of precision, as reported by the sensor.-
@position_number_of_used_satellites
- The number of satellites used by the sensor. -
@position_used_satellites
- A list of satellites in use (PRI), as reported by the sensor. -
@position_fix_status_description
- The GPS fix status ("NoData", "NoFix", "Fix2D", or "Fix3D"), as reported by the sensor. -
@position_fix_mode
- The fix mode ("M" = Manual, "A" = Automatic), as reported by the sensor. -
@position_imu_correction
- Returns true of the position information was improved by an IMU device. -
@position_imu_roll
- The roll value of an active IMU device providing positioning corrections. @position_imu_pitch
- The pitch value of an active IMU device providing positioning corrections.@position_imu_heading
- The heading value of an active IMU device providing positioning corrections.@position_imu_steering
- The steering value of an active IMU device providing positioning corrections.
Ejemplo¶
While being in the field it may happen that the GNSS receiver fails and you wish to fall back to your internal positioning. You can configure your attribute field in such a way that it will exactly do that. Simply use the expression coalesce()
Example
coalesce(@gnss_horizontal_accuracy, @position_horizontal_accuracy)
Información
- I: Fuente de posición interna, E: Fuente de posición externa (NMEA).
- Las variables que contienen
satélites
no están disponibles en iOS.
Note
The gnss_*
variables always report the GNSS sensor values, even when the crosshair is not snapped.
- Cuando la cruz se ajusta al sensor:
- @gnss_horizontal_accuracy
> Informa de la precisión horizontal del sensor (en metros).
- @position_horizontal_accuracy
> Informa del mismo valor que el valor gnss
correspondiente.
- @position_source_name
> Informa del nombre del sensor.
- Cuando la cruz se mueve manualmente:
@gnss_horizontal_accuracy
> Informa de la precisión horizontal del sensor (en metros).@position_horizontal_accuracy
> El valor esNULL
.@position_source_name
> El valor esmanual
.