Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/.vitepress/sidebar/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export default {
{ text: 'Synchronisation in Mergin Maps Mobile App', link: '/field/autosync/' },
{ text: 'Measurement Tools', link: '/field/measure/' },
{ text: 'Layers in Mergin Maps Mobile App', link: '/field/layers/' },
{ text: 'Filtering Features', link: '/field/filtering/' },
{ text: 'Map Sketching', link: '/field/map-sketching/' },
{ text: 'Photo Sketching', link: '/field/photo-sketching/' },
{ text: 'How to Add, Edit, Delete Features', link: '/field/mobile-features/' },
Expand Down
76 changes: 76 additions & 0 deletions src/field/filtering/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
description: Add custom filters to sort and display only those features that you need during your field survey.
---

# Filtering Features in Mergin Maps mobile app
[[toc]]

Custom filters can be added to the <MobileAppNameShort /> to easily filter features displayed on the map as well as in the [survey layers](../layers/#browsing-features).

## Enable and define filtering in QGIS
Filters can be enabled and defined in QGIS in **Project Properties**.

::: tip Plugin upgrade
If you do not see the **Filtering** option in the **Project properties**, check for [plugin upgrades](../../setup/install-mergin-maps-plugin-for-qgis/#plugin-upgrade).
:::

Check the :heavy_check_mark: **Enable filtering** option in the <MainPlatformName /> tab, click on the **Add filter** button and select a filter type from the list. The list of available [filter types](#filter-types) and their properties can be found below.

Then, define the filter:
- **Type** - the filter type (in general, it should match the widget type of the filtered field)
- **Layer** - choose from the project's layers
- **Field** - choose from the fields of the layer. Only fields with data types compatible with the selected filter type are offered.
- **Title** - the name of the filter, which will be displayed in the <MobileAppNameShort />

![Filtering in QGIS Mergin Maps project](./qgis-project-properties-enable-filtering.webp "Filtering in QGIS Mergin Maps project")

You can add as many filters as you need by using the **Add filter** button.

The order of filters can be changed by selecting a filter and using the **Up** and **Down** buttons. To remove a filter, select it and click the **Remove** button.
![Filtering in QGIS Mergin Maps project](./qgis-filtering.webp "Filtering in QGIS Mergin Maps project")

qgis-filtering.webp
Don't forget to save your project and synchronise changes so that you can use the filters in the <MobileAppNameShort />.


### Filter types

**Text** filter uses simple text input. Results are filtered based the SQL expression `"field" ILIKE '%input%'`. Available for text and number field types.

**Number** filter provides *from* and *to* number inputs. Results are filtered based on SQL expression `"field" >= 'input_from' AND "field" <= 'input_to'`. Available for text and number field types.

**Date** filter provides *from* and *to* date (calendar) inputs. Results are filtered based on SQL expression `"field" >= 'input_from' AND "field" <= 'input_to'`. Available for date field types configured with the [Date and time widget](../../layer/date-time/).

**Boolean** filter provides a toggle between *all*, *true* and *false* values. Results are filtered based on SQL expression `"field" == 'input'`. Available for Boolean, text and integer field types configured with the [Checkbox widget](../../layer/checkbox/).

**Single select** filter provides a drop-down menu of field values. One value can be selected at once. The results are filtered based on SQL expression `"field" == 'input'`. Available for text and number field types configured with the [Value map or Value relation widget](../../layer/value-select/).

**Multi select** filter provides a drop-down menu of field values. Multiple values can be selected at once. The results are filtered based on SQL expression `"field" IN ('input')`. Available for text and number field types configured with the [Value map or Value relation widget](../../layer/value-select/#value-relation).

In the <MobileAppNameShort />, the filter types looks as follows:

![Filter types in Mergin Maps mobile app](./mobile-filter-types.webp "Filter types in Mergin Maps mobile app")

## Filtering features in the mobile app
Filters defined in [<MainPlatformName /> project in QGIS](#enable-and-define-filtering-in-qgis) can be used in the <MobileAppNameShort />. You can filter features across multiple layers by entering or selecting values in corresponding filters. The filtering affects both the map display and the feature browsing list.

:::warning Filters reset
Filters are reset when the project is synced. Also, they do not stay saved when the app is restarted.
:::

Here is an example of how filtering works:

1. Tap the **Filters** button to open filters defined in the project
![Filtering button in Mergin Maps mobile app](./mobile-open-filters.webp "Filtering button in Mergin Maps mobile app")

2. Enter or select values in the filters. Here, we will use a *Single select* filter on the *trees* layer and select a *tree species* value from the list.

You can use more filters at once.

Tap on the **Apply filters** button to confirm the filtering.
![Filtering in Mergin Maps mobile app](./mobile-filter-single-selection.webp "Filtering in Mergin Maps mobile app")

3. With active filters, only features that match the criteria are displayed on the map as well as when [browsing features](../layers/#layers-legend-and-features).

If filters are applied
![Active filter in Mergin Maps mobile app](./mobile-filtered-features.webp "Active filter in Mergin Maps mobile app")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added src/field/filtering/mobile-filter-types.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/field/filtering/mobile-filter-types.xcf
Binary file not shown.
Binary file added src/field/filtering/mobile-filtered-features.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/field/filtering/mobile-filtered-features.xcf
Binary file not shown.
Binary file added src/field/filtering/mobile-filtering.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/field/filtering/mobile-open-filters.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/field/filtering/mobile-open-filters.xcf
Binary file not shown.
Binary file added src/field/filtering/qgis-filtering.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/field/filtering/qgis-filtering.xcf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
8 changes: 6 additions & 2 deletions src/gis/features/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ If the map tip has `# image` marker on the first line, the following line is und
## Background layers
Various online and offline maps can be used as background layers for navigation during the field survey. You can find more information in [Background Maps](../settingup_background_map/).

## Map themes
[Map Themes](../setup_themes/) make possible to switch between different background maps, combinations of visible layers or their styles both in QGIS and in <MobileAppName />.

## Project settings
- Ensure the paths are set to *Relative* in the **General** tab in Project Properties. All paths to the project data in <MobileAppName /> are relative to the project location.
Expand Down Expand Up @@ -179,7 +181,9 @@ There is an option to define the order in which layers are displayed in the <Mob

![Layer order in QGIS Mergin Maps project](./project-layer-order.jpg "Layer order in QGIS Mergin Maps project")

### Map themes
[Map Themes](../setup_themes/) make possible to switch between different background maps in <MobileAppName /> (e.g. cartography maps and aerial imagery)
### Filtering features
Filters for features in the <MobileAppNameShort /> can be enabled in the **<MainPlatformName />** tab in **Project properties**.

![Enable filtering in QGIS Mergin Maps project](./project-filtering.webp "Enable filtering in QGIS Mergin Maps project")

You can find more details about how this works in [Filtering Features](../../field/filtering/).
Binary file added src/gis/features/project-filtering.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/gis/features/project-filtering.xcf
Binary file not shown.
1 change: 1 addition & 0 deletions src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ The ecosystem consist of various components:
- [Synchronisation in <MobileAppName />](./field/autosync/)
- [Measurement Tools](./field/measure/)
- [Layers in <MobileAppName />](./field/layers/)
- [Filtering Features in <MobileAppName />](./field/filtering/)
- [Map Sketching in <MobileAppName />](./field/map-sketching/)
- [Photo Sketching in <MobileAppName />](./field/photo-sketching/)
- [How to Add, Edit, Delete Features](./field/mobile-features/)
Expand Down
3 changes: 3 additions & 0 deletions src/manage/plugin/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
description: Create, set up and synchronise your Mergin Maps projects with Mergin Maps QGIS plugin. The plugin brings Mergin Maps functionalities to QGIS.

outline: deep
---

# Mergin Maps QGIS Plugin Overview
Expand Down Expand Up @@ -98,6 +100,7 @@ Some settings of your [<MainPlatformName /> project](../project/) can be done th
- Enable [**Map sketching**](../../field/map-sketching/)
- Set [**Layer order**](../../field/layers/#layer-order) for the <MobileAppNameShort />
- Enable [**Photo sketching**](../../field/photo-sketching/) to annotate pictures in the <MobileAppNameShort />
- Enable [**Filtering**](../../field/filtering) features in the <MobileAppNameShort />

![Mergin Maps Project Properties in QGIS](./qgis-mergin-maps-project-properties.jpg "Mergin Maps Project Properties in QGIS")

Expand Down
Binary file modified src/manage/plugin/qgis-mergin-maps-project-properties-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading