Skip to content

Commit

Permalink
Iss 195 input snapping, splitting geometries (#199)
Browse files Browse the repository at this point in the history
* fix #195 input snapping

* fix #195 input snapping

* #195 unref pics deleted

* fix #195 snapping options

* fix #194 splitting geometries

* fix #194 splitting geometries

* fix #194 splitting geometries - minor fixes

* check fix

* wordlist - crosshairs
  • Loading branch information
alex-cit authored Jul 11, 2022
1 parent 11e2d9d commit a56ed66
Show file tree
Hide file tree
Showing 48 changed files with 119 additions and 22 deletions.
1 change: 1 addition & 0 deletions scripts/wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ BeiDou
Benz
Bing
CRS
crosshairs
CSV
CharlieColleague
DAF
Expand Down
1 change: 1 addition & 0 deletions src/.vuepress/sidebar/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ module.exports = {
'/gis/settingup_background_map',
'/gis/setup_themes',
'/gis/enable_digitising',
'/gis/snapping/',
'/gis/proj',
'/gis/supported_formats'
]
Expand Down
Binary file modified src/field/input-active-layer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/field/input-active-layer.xcf
Binary file not shown.
Binary file modified src/field/input-capture-line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/field/input-capture-line.xcf
Binary file not shown.
Binary file added src/field/input-delete.png
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/input-delete.xcf
Binary file not shown.
Binary file removed src/field/input-edit-delete.png
Binary file not shown.
Binary file removed src/field/input-edit-delete.xcf
Binary file not shown.
Binary file added src/field/input-edit-feature.png
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/input-edit-feature.xcf
Binary file not shown.
Binary file added src/field/input-edit-geometry.png
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/input-edit-geometry.xcf
Binary file not shown.
Binary file added src/field/input-edit.png
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/input-edit.xcf
Binary file not shown.
Binary file modified src/field/input-record.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/field/input-record.xcf
Binary file not shown.
Binary file added src/field/input-split-geom-done.png
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/input-split-geom-done.xcf
Binary file not shown.
Binary file added src/field/input-split-geom-point.png
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/input-split-geom-point.xcf
Binary file not shown.
Binary file added src/field/input-split-geometry.png
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/input-split-geometry.xcf
Binary file not shown.
40 changes: 33 additions & 7 deletions src/field/input_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ A warning will appear when [GPS accuracy](./gps_accuracy/) falls below a thresho
:::

Surveyed features are added to the active layer, which is shown just above the bottom panel. You can change the active layer by tapping on it and selecting one from the list of editable layers in the project.

![](../tutorials/mobile/merginmaps-mobile-active-layer.jpg)
![active layer](./input-active-layer.png)

### Capture points
The cross hairs you will see on your map will be used as the recorded location. You can change the position of your point by pinching and dragging the background map. If you want to recenter the map to your current position, tap the **GPS** button.
The crosshairs you will see on your map will be used as the recorded location. You can change the position of your point by pinching and dragging the background map. If you want to recenter the map to your current position, tap the **GPS** button.

To capture your point, press **Add Point**. A form will open where you can fill in the attributes.

Expand All @@ -39,15 +38,42 @@ Once you are finished, press **Done**. If your feature is an area, the shape wil

![Capturing lines](./input-capture-line.png)

## Edit or delete features
### Snapping features
<Badge text="since Input 1.6.0" type="tip"/>

Snapping can be enabled in your <MainPlatformName /> project to make the field survey easier. [How to Set Up Snapping](../gis/snapping/) will guide you through the snapping options.

If snapping is enabled, the crosshairs will turn purple and snap to vertices (left) or segments (right) of existing features when capturing new features.
![input snapping](../gis/snapping/input_basic_snapping.png)

## Edit features
Tap on a feature and press the edit button.
![Edit button](../tutorials/mobile/merginmaps-mobile-edit-button.jpg)
![Edit button](./input-edit.png)

Now you can change the attributes in the form and modify the shape of the feature using **Edit geometry**. Adjust the location by panning the map or use **GPS** in the same manner as when adding new features. Once you are happy with your changes, press **Save**.
![Edit geometry](./input-edit-geometry.png)

### Split geometry of lines or areas
<Badge text="since Input 1.6.0" type="tip"/>
Lines and areas can be split into two or more new features that will keep the same attributes as the original feature.

To split geometry of a feature:
1. Tap on a feature and press the edit button.
![Edit button](./input-edit-feature.png)

2. Tap **Split geometry**
![split geometry](./input-split-geometry.png)

3. Create the splitting line by adding points. When finished, tap **Done**
![split geometry](./input-split-geom-point.png)

4. In this case, two individual features are created. Both have the same attributes, except for `Feature ID` (one feature keeps the original id, the other gets a new one).
![split geometry](./input-split-geom-done.png)

If you want to delete the feature, press the **Delete** button.
## Delete features
If you want to delete the feature, tap on it and press the edit button. Here you have the option to **Delete** the selected feature.

![Edit and delete](./input-edit-delete.png)
![Edit and delete](./input-delete.png)

## Synchronise changes
Don't forget to upload your changes to Mergin Maps!
Expand Down
4 changes: 1 addition & 3 deletions src/field/input_ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ Tapping the GPS accuracy tab opens the GPS info panel:

## Record
**Record tab** is where you can [survey new features](./input_features/).

The active layer currently used for survey is displayed above the bottom navigation panel. Tapping on it opens a list of all editable layers in the project.

![Record](./input-record.png)

The active layer currently used for survey is displayed above the bottom navigation panel. Tapping on it opens a list of all editable layers in the project.
![Active layer](./input-active-layer.png)


Expand Down
14 changes: 6 additions & 8 deletions src/gis/enable_digitising.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Enable Digitising

- Open QGIS Desktop with you QGIS Project
- In the Menu>Project>Properties click on "Data Sources"
![Map Themes](./qgis_data_sources.png)
- You need to have at least one layer without "Read-only" check
- Save the project
- Sync the project again back to your device
# How to Enable Digitising

1. Open QGIS Desktop with your <MainPlatformName /> Project
2. Navigate to the **Data Sources** in the **Project Properties**
![Map Themes](./qgis_digitising.png)
You need to have at least one layer without "Read-only" check
3. **Apply** the changes. Don't forget to save and sync your project!
6 changes: 3 additions & 3 deletions src/gis/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ If you want to use snapping in <MobileAppName /> during the field survey, you ne
![resize pics](./project_snapping.png)

The snapping options are:
- *No snapping* - snapping is not allowed (default)
- *No snapping* - snapping is not enabled (default)
- *Basic snapping* - features are snapped to the vertices and segments of vector features in the project
- *Follow QGIS snapping* - uses the snapping preferences defined in the **Snapping toolbar** in QGIS
- *Follow QGIS snapping* - uses the snapping preferences defined in the <MainPlatformName /> project in QGIS

:::tip
If you cannot see the **Snapping toolbar** in QGIS, ensure it's enabled under **View** (top-level menu) > **Toolbars**.
[How to Set Up Snapping for <MobileAppName />](./snapping/) contains detailed steps that may help you with the snapping setup.
:::

## Survey layers
Expand Down
Binary file modified src/gis/project_snapping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/gis/project_snapping.xcf
Binary file not shown.
Binary file added src/gis/qgis_digitising.png
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/qgis_digitising.xcf
Binary file not shown.
73 changes: 73 additions & 0 deletions src/gis/snapping/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# How to Set Up Snapping for Mergin Maps Input
<Badge text="since plugin 2022.5" type="warning"/><Badge text="since Input 1.6.0" type="tip"/>

[[toc]]

Capturing data in the field using <MobileAppName /> can be easier, if you can snap the vertices of new features to existing geometries. Snapping can also help you avoid creating topological errors in your datasets.

[<QGISPluginName />](../../manage/plugin-sync-project/) provides three snapping options:
- *No snapping* - snapping is not enabled (default)
- *Basic snapping* - features are snapped to the vertices and segments of vector features in the project
- *Follow QGIS snapping* - uses the snapping preferences defined in the QGIS project


## Basic snapping
To set up basic snapping:
1. Open your <MainPlatformName /> project in QGIS
2. Go to the **Project Properties**
![project properties](./qgis-project-properties.png)

3. Navigate to the **<MainPlatformName />** tab and change the snapping settings to **Basic snapping**
![project properties](../project_snapping.png)

4. Apply the changes, save and sync your project.

Don't forget to synchronise the project also in <MobileAppName /> before the fieldwork.

Now you can use basic snapping in <MobileAppName />!

When capturing a new feature near an existing one, the crosshairs will turn purple and snap to its vertex (left) or to its segment (right).
![project properties](./input_basic_snapping.png)

:::tip
If you don't want the crosshairs to snap to a feature, try zooming in. The snapping threshold is 20 pixels, so the more you zoom in, the closer you can place the vertex to the existing geometry without snapping.

If you want to change the snapping threshold, use the *[Follow QGIS snapping](#follow-qgis-snapping)* option and define the snapping tolerance in your <MainPlatformName /> project in QGIS.
:::


## Follow QGIS snapping
<QGISPluginName /> gives you the option to use the snapping preferences defined in QGIS project. This means you can, for instance, exclude some layers from snapping, choose the snapping mode or change the snapping threshold.

1. Navigate to the **<MainPlatformName />** tab in the **Project Properties** and change the snapping settings to **Follow QGIS snapping**
![follow qgis snapping](./plugin-qgis-snapping.png)

2. Enable snapping in the **Snapping toolbar** and set your snapping preferences.
![snapping](./qgis-snapping-enable.png)

::: tip
If you cannot see the **Snapping toolbar** in QGIS, ensure it's enabled under **View** (top-level menu) > **Toolbars**
:::

3. Snapping preferences can also be set through the **Snapping Options** in the **Project** menu
![snapping options](./qgis-snapping-options.png)

4. Switch to **Advanced Configuration**
![advanced configuration](./qgis-snapping-advanced.png)

5. Here, snapping settings can be defined for each layer individually:
- enable/disable snapping for specific layers. Layers that are not checked will not be used for snapping.
- in the *Type* column, you can choose if you want to snap to vertices, segments or both
- set the *Tolerance* (the snapping threshold). This defines how close the crosshairs need to be to an existing feature to snap to its geometry.

![snapping settings](./qgis-snapping-settings.png)

4. Save and sync your project.

Don't forget to synchronise the project also in <MobileAppName /> before the fieldwork.

Snapping in <MobileAppName /> will now follow the snapping settings as defined in the QGIS project.

:::tip
You can learn more about snapping in QGIS in <QGISHelp ver="3.22" link="user_manual/working_with_vector/editing_geometry_attributes.html?highlight=snapping#snapping-and-digitizing-options" text="QGIS User Guide" />.
:::
Binary file added src/gis/snapping/input_basic_snapping.png
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/snapping/input_basic_snapping.xcf
Binary file not shown.
Binary file added src/gis/snapping/plugin-qgis-snapping.png
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/snapping/plugin-qgis-snapping.xcf
Binary file not shown.
Binary file added src/gis/snapping/qgis-project-properties.png
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/snapping/qgis-project-properties.xcf
Binary file not shown.
Binary file added src/gis/snapping/qgis-snapping-advanced.png
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/snapping/qgis-snapping-advanced.xcf
Binary file not shown.
Binary file added src/gis/snapping/qgis-snapping-enable.png
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/snapping/qgis-snapping-enable.xcf
Binary file not shown.
Binary file added src/gis/snapping/qgis-snapping-options.png
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/snapping/qgis-snapping-options.xcf
Binary file not shown.
Binary file added src/gis/snapping/qgis-snapping-settings.png
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/snapping/qgis-snapping-settings.xcf
Binary file not shown.
2 changes: 1 addition & 1 deletion src/layer/position_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Following variables are supported:
- `@position_horizontal_accuracy` - The accuracy of the provided latitude-longitude value, in meters.
- `@position_vertical_accuracy` - The accuracy of the provided altitude value, in meters.
- `@position_from_gps` - True, if recorder/edited feature's geometry correspond with current user's position
(Position marker has the same location as the cross-hair marker).
(Position marker has the same location as the crosshairs marker).

0 comments on commit a56ed66

Please sign in to comment.