Ausdruckvariable in 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¶
Für QFieldCloud-Benutzer können zwei Ausdrucksvariablen in Formularen oder Standardwerten verwendet werden:
@cloud_username
- Gibt den Namen des aktuell angemeldeten QFieldCloud-Benutzers zurück.@cloud_useremail
- Gibt die E-Mail-Adresse des aktuell angemeldeten QFieldCloud-Benutzers zurück.
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
- Die Ausrichtung des Geräts selbst, unabhängig von seiner Bewegung, relativ zum geografischen Norden (von 0° bis 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
- Die Anzahl der gesammelten Positionen, aus denen eine gemittelte Position berechnet wurde. Wenn keine Mittelung stattfand, ist der Wert0
(zero).@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.
Beispiel¶
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)
Info
- I: Interne Positionsquelle, E: Externe (NMEA) Positionsquelle.
- Variable, die
Satelliten
enthalten, sind unter iOS nicht verfügbar.
Note
The gnss_*
variables always report the GNSS sensor values, even when the crosshair is not snapped.
- Wenn das Fadenkreuz am Sensor eingerastet ist:
- @gnss_horizontal_accuracy
> Meldet die horizontale Genauigkeit des Sensors (in Metern).
- @position_horizontal_accuracy
> Gibt denselben Wert wie der entsprechende gnss
Wert an.
- @position_source_name
> Gibt den Namen des Sensors an.
- Wenn das Fadenkreuz manuell bewegt wird:
- @gnss_horizontal_accuracy
> Meldet die horizontale Genauigkeit des Sensors (in Metern).
- @position_horizontal_accuracy
> Der Wert ist NULL
.
- @position_source_name
> Der Wert ist manual
.