Skip to content

Commit bc38b7a

Browse files
sorting features and values in the mobile app (#513)
* sorting features and values in the mobile app * fix broken links * Update src/gis/search_data.md --------- Co-authored-by: Tomas Mizera <tomas.mizera@lutraconsulting.co.uk>
1 parent a16f0df commit bc38b7a

23 files changed

+81
-30
lines changed

src/field/layers/index.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The **Layers** button is located in the bottom navigation panel.
55

66
It provides the overview of layers and features in your <MainPlatformNameLink /> project in <MobileAppName />, as well as the option to turn the visibility of specific layers on/off or to see a layer's legend.
77

8-
![Layers in Mergin Maps mobile app](../mobile-app-ui/mobile-app-layers.jpg "Layers in Mergin Maps mobile app")
8+
![Layers in Mergin Maps mobile app](../../layer/non-spatial-data/mobile-app-non-spatial-layers.jpg "Layers in Mergin Maps mobile app")
99

1010
## Layers visibility
1111

@@ -16,8 +16,26 @@ The visibility of layers on the map can be easily turned on and off by toggling
1616
![Mergin Maps mobile app Layers visibility](./mobile-app-layers-off.jpg "Mergin Maps mobile app Layers visibility")
1717

1818
## Layers legend and features
19-
Select a layer in the **Layers** panel to browse features and [search for attributes values](../../gis/search_data/#searching-for-values-in-mergin-maps-mobile-app). Tap on the record to zoom to the feature on the map and display its form.
19+
Select a layer in the **Layers** panel to browse features and [search for attributes values](#browsing-features). Tap on the record to zoom to the feature on the map and display its form.
2020

2121
Swipe right or tap **Layer info** to see the layer's legend and to toggle on/off its visibility on the map.
2222

2323
![Mergin Maps mobile app Layers legend and features](./mobile-app-layers.jpg "Layers legend and features")
24+
25+
## Browsing features
26+
Attribute data can be browsed in the <MobileAppNameShort /> by tapping **Layers**.
27+
28+
In the **Layers** window, choose a layer or a table from the list to open the list of features.
29+
30+
![Layers overview in Mergin Maps mobile app](../mobile-app-ui/mobile-app-layers.jpg "Layers overview in Mergin Maps mobile app")
31+
32+
Here, you can browse the features. The search bar can be used to shortlist matching records. The search looks up for a match in all searchable attributes values and is not case sensitive.
33+
34+
:::tip Sorting features and searching for field values
35+
The way how features are sorted in the <MobileAppNameShort /> can be affected by [settings in the QGIS project](../../gis/search_data/).
36+
:::
37+
38+
Tap on the record to zoom to the feature on the map and display its form.
39+
40+
![Mergin Maps mobile app browse data](./mobile-app-search-data.jpg "Mergin Maps mobile app browse data")
41+

src/gis/mobile-layers.jpg

167 KB
Loading

src/gis/mobile-layers.xcf

1.07 MB
Binary file not shown.

src/gis/mobile-sort-updated-at.jpg

45.2 KB
Loading

src/gis/mobile-sort-updated-at.xcf

172 KB
Binary file not shown.
52.3 KB
Loading
220 KB
Binary file not shown.
85.7 KB
Loading
367 KB
Binary file not shown.
Loading
Binary file not shown.

src/gis/qgis-attribute-table-sort.jpg

109 KB
Loading

src/gis/qgis-attribute-table-sort.xcf

134 KB
Binary file not shown.
Loading
Binary file not shown.
203 KB
Loading
335 KB
Binary file not shown.
Loading
Binary file not shown.

src/gis/search_data.md

Lines changed: 60 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,78 @@
1-
# Searching for Values in Attribute Fields
1+
# Sorting and Search Setup
22
[[toc]]
33

4-
In <MobileAppName />, you can search for the content of fields in spatial layers and non-spatial tables, as well as searching values from multiple fields.
4+
There are some settings related to sorting, searching and browsing features in <MobileAppName /> that can be done in the QGIS project, such as define the order of features and values or include/exclude layers and fields from the search.
5+
6+
Working with layers in the <MobileAppNameShort />, including browsing features and values, is described in [Layers in <MobileAppName />](../field/layers/).
7+
8+
9+
## Sorting features and value list
10+
The <MobileAppNameShort /> follows the sorting of features in the attribute table and of values in the value relation widget as set in the QGIS project.
11+
12+
### Order value list by value
13+
The [Value relation](../layer/form-widgets/#value-relation) widget has the option *Order by value*. When checked, values in the drop-down list will be listed in alphabetical or numerical order.
14+
15+
![QGIS Value relation order by value](./qgis-order-by-value-value-relation.jpg "QGIS Value relation order by value")
16+
17+
This setting is also followed by the <MobileAppNameShort />.
18+
19+
On the left, you can see the default list of options in the drop-down menu. On the right, the option *Order by value* is used and observed by the <MobileAppNameShort />.
20+
![QGIS Value relation order by value](./mobile-value-relation-sorted.jpg "QGIS Value relation order by value")
21+
22+
23+
### Sorting features by field value
24+
By default, the <MobileAppNameShort /> orders features in a layer based on their `Feature ID`. The order of features can be defined in the Attribute table in QGIS.
25+
26+
Simple sorting based on ascending or descending value of the attributes can be used:
27+
28+
1. Open your project in QGIS
29+
2. Right-click on a survey layer and open the **Attribute table**
30+
3. In the **Attribute table**, click on the name of a field to sort the features according to the field values.
31+
Here, we use the `update_at` field to sort features by the last update. The feature that was updated last will be the first in the list.
32+
![QGIS Attribute table order by value](./qgis-sorting-attribute-table-updated-at.jpg "QGIS Attribute table order by value")
33+
4. Save and synchronise the project.
34+
35+
In the <MobileAppNameShort />, features in a layer can be browsed by tapping the **Layers** button and selecting the layer from the list.
36+
![Mobile app sort features by value](./mobile-layers.jpg "Mobile app sort features by value")
37+
38+
Features in this layer are sorted by the same field value as was defined in the QGIS project. So, instead of the default sorting by the `Feature ID`, the features are ordered by the date and time of their last update.
39+
![Mobile app sort features by value](./mobile-sort-updated-at.jpg "Mobile app sort features by value")
40+
41+
### Sorting features by expression
42+
Similarly, an expression can be used to sort features in the Attribute table and subsequently in the <MobileAppNameShort />.
43+
44+
1. Open your project in QGIS
45+
2. Right-click on a survey layer and open the **Attribute table**
46+
3. Right-click on a field name that you want to use for sorting features and use the **Sort...** option
47+
![Mobile app sort features by value](./qgis-attribute-table-sort.jpg "Mobile app sort features by value")
48+
4. Enter the expression you want to use to sort this field.
49+
Here, we use `length( "notes" )` to sort features based on the length of the text in the `notes` field.
50+
![QGIS sorting features by text length](./qgis-attribute-table-sort-expression.jpg "QGIS sorting features by text length")
51+
![QGIS features sorted by text length](./qgis-attribute-table-sorted-by-length.jpg "QGIS features sorted by text length")
52+
5. Save and synchronise the project.
53+
54+
When browsing features in the <MobileAppNameShort />, they will be sorted by the text length.
55+
![Mobile app sort features by value](./mobile-sorting-by-text-lentgh.jpg "Mobile app sort features by value")
56+
557

658
## Setting identifiable layers in QGIS project
7-
To be able to browse the attributes of a layer, it needs to be set as *Identifiable* in your <QGISHelp ver="3.22" link="user_manual/introduction/qgis_configuration.html?highlight=properties#data-sources-properties" text="QGIS project" />.
59+
To be able to browse the attributes of a layer, it needs be *Identifiable* in your <QGISHelp ver="latest" link="user_manual/introduction/qgis_configuration.html?highlight=properties#data-sources-properties" text="QGIS project" />. Layers are *identifiable* by default.
60+
61+
If you define a layer as **not identifiable**, you won't be able to tap it in the <MobileAppNameShort /> or use the **Identify tool** in QGIS to see its attribute form. This may be useful for layers that are only used as background layers.
862

963
1. Open your QGIS project
1064
2. In the Menu > Project > Properties click on **Data Sources**
1165
3. Check and uncheck layers in the **Identifiable** column to define which layers you want to be able to browse in your project.
1266

1367
![QGIS identifiable data sources](./qgis_data_sources.jpg "QGIS identifiable data sources")
1468

15-
:::warning
16-
If you define a layer as **not identifiable**, you won't be able to tap it in <MobileAppName /> or use the **Identify tool** in QGIS to see its attribute form.
17-
:::
1869

1970
## Exclude a field from the search
2071
By default, all attributes are searchable. You can exclude a field from the search in the **Layer properties**.
21-
1. Navigate to the **Fields** tab
22-
2. Check the **Not searchable** option in the **Configuration** column
23-
![QGIS Not searchable field](./not_searchable.jpg "QGIS Not searchable field")
2472

25-
:::warning
2673
If a field is marked in a field configuration as **Not searchable**, it will be omitted from the search. There will be no search results, even if you search for a specific existing value of this field.
27-
:::
28-
29-
## Searching for values in Mergin Maps mobile app
30-
Attribute data can be browsed in <MobileAppName /> by tapping **Layers**.
31-
32-
In the **Layers** window, choose a layer or a table from the list to open the attribute table.
3374

34-
![Layers overview in Mergin Maps mobile app](./mobile-app-layers.jpg "Layers overview in Mergin Maps mobile app")
35-
36-
Here, you can browse the features. The search bar can be used to shortlist matching records.
37-
38-
Tap on the record to zoom to the feature on the map and display its form.
39-
40-
![Mergin Maps mobile app browse data](./mobile-app-search-data.jpg "Mergin Maps mobile app browse data")
41-
42-
:::tip
43-
The search looks up for a match in all searchable attributes values and is not case sensitive.
44-
:::
75+
1. Navigate to the **Fields** tab
76+
2. Check the **Not searchable** option in the **Configuration** column
77+
![QGIS Not searchable field](./not_searchable.jpg "QGIS Not searchable field")
4578

src/layer/non-spatial-data/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ Tap the [**Layers**](../../field/layers/) button to open the list of layers, inc
1717

1818
![Layers in Mergin Maps mobile app](./mobile-app-non-spatial-layers.jpg "Layers in Mergin Maps mobile app")
1919

20-
Tap on a layer to open its attributes table where you can browse the data and [search for values](../../gis/search_data/#searching-for-values-in-mergin-maps-mobile-app). It is also possible to [add and edit](../../field/mobile-features/#add-non-spatial-features) entries in the table.
20+
Tap on a layer to open its attributes table where you can browse the data and [search for values](../../field/layers/#browsing-features). It is also possible to [add and edit](../../field/mobile-features/#add-non-spatial-features) entries in the table.
2121

0 commit comments

Comments
 (0)