External routing

External routing

The original version of this document is located at https://docs.qfield.org/how-to/external-routing

External routing

It can come in handy to calculate an itinerary to one of your features in the field.
By an easy configuration of your attribute form in QGIS, you can quickly access the navigation tools from Google Maps via a hyperlink when working on the field.

Configure attribute form widget in QGIS

🖥️ Desktop preparation

Here is an example for navigation to features of a point layer.

Create a new field in your data table (type text). In the attribute form settings, select “attachment” as widget type. Tick “Display a hyperlink for document path (read-only)”.
Then enter the following expression as default value:

sql concat( 'https://www.google.com/maps/dir/?api=1&destination=', y(transform($geometry, layer_property(@layer, 'crs'), 'EPSG:4326')), '%2C', x(transform($geometry, layer_property(@layer, 'crs'), 'EPSG:4326')), '&travelmode=driving' )

And tick “Apply default value on update” in case you make changes to your geometry.

If you simply want to show your feature location in Google Maps, you can use the following expression:
concat( ‘https://maps.google.com?q= ‘,y(transform($geometry, layer_property(@layer, ‘crs’),’EPSG:4326’)), ‘%2C’, x(transform($geometry, layer_property(@layer, ‘crs’),’EPSG:4326’)), ‘&zoom=19&t=h’)

Usage

📱 Fieldwork

Click on the feature on the map where you want navigation to or that you want to open in Google Maps. In the attribute form, click on the link towards Google Maps.

    • Related Articles

    • Positioning (GNSS)

      The original version of this document is located at https://docs.qfield.org/how-to/gnss Positioning (GNSS) QField can make use of the internal GNSS (Global Navigation Satellite System, like GPS, GLONASS, Galileo or Beidou). QField can also connect to ...
    • Shared local datasets

      The original version of this document is located at https://docs.qfield.org/how-to/outside-layers Shared local datasets It is possible to use a layer which is stored outside the project folder. This is useful if a basemap is used in more than one ...
    • Project selection

      The original version of this document is located at https://docs.qfield.org/how-to/projects Project selection QField has a file selector that allows to open a project from the device locally. To open files from the cloud see QFieldCloud . Note ...
    • Expression Variables

      The original version of this document is located at https://docs.qfield.org/reference/expression_variables Expression Variables in QField QField supports various expression variables that can be used in forms, expressions, and field defaults. These ...
    • Geologic Mapping

      The original version of this document is located at https://docs.qfield.org/success-stories/geologic-mapping Geologic Mapping with QField By Rohanna Gibson, Structural Geologist, Terrane Geoscience Goal To collect new data on bedrock geology and view ...