External routing

External routing

The original version of this document is located at https://docs.qfield.org/how-to/navigation-and-positioning/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 in the field.

Workflow

🖥️ Desktop preparation

  1. In QGIS Create a new field in your feature layer with the datatype text
  2. Under Vector Properties Find the “attribute form” setting
  3. As widget type select “attachment”
  4. Tick “Display a hyperlink for document path (read-only)”.
  5. 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' )

  6. (Optional) Tick “Apply default value on update” in case you make changes to your geometry.

Show Feature Location only

  1. Follow the same steps (1-4) as above
  2. This time use the following expression:

sql 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')

📱 Fieldwork

  1. In QField select the feature layer where you added the field.
  2. Edit the layer and find the according attribute.
  3. 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/navigation-and-positioning/gnss Positioning (GNSS) QField can make use of the internal GNSS (Global Navigation Satellite System, like GPS, GLONASS, Galileo or Beidou). ...
    • Get Started with QField and QFieldCloud

      The original version of this document is located at https://docs.qfield.org/get-started/index Get started with QField and QFieldCloud QField What is it? QField is an open-source application that allows painless fieldwork and synchronisation with your ...
    • Project selection

      The original version of this document is located at https://docs.qfield.org/how-to/general/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 as field defaults, constraints or also to control ...
    • 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 ...