diff --git a/README.md b/README.md index 244f7ded..7eb24bfa 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # Mergin Maps Documentation - - [Staging/Dev deployment](https://dev.merginmaps.com/docshttps://dev.merginmaps.com/docs) + - [Staging/Dev deployment](https://dev.merginmaps.com/docs) - [Production deployment](https://merginmaps.com/docs) Source code for documentation hosted on [merginmaps.com/docs](https://merginmaps.com/docs) @@ -13,6 +13,8 @@ Source code for documentation hosted on [merginmaps.com/docs](https://merginmaps Use GitHub Pull Requests to propose changes, we will review and merge your changes! +
Join our community chat
and ask questions!
+ ## Development Workflow - For new features coming in the next release create pull request to `dev` branch. diff --git a/src/.vuepress/components/CommunityJoin.vue b/src/.vuepress/components/CommunityJoin.vue new file mode 100644 index 00000000..c6e5b0e4 --- /dev/null +++ b/src/.vuepress/components/CommunityJoin.vue @@ -0,0 +1,34 @@ + + + \ No newline at end of file diff --git a/src/.vuepress/public/slack.svg b/src/.vuepress/public/slack.svg new file mode 100644 index 00000000..0a609f71 --- /dev/null +++ b/src/.vuepress/public/slack.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/howto/contribute.md b/src/howto/contribute.md index f33266f8..eb6182e9 100644 --- a/src/howto/contribute.md +++ b/src/howto/contribute.md @@ -5,6 +5,8 @@ How to contribute to the project? We are happy to help to promote work or co-author and place on our websites or give special offer for Mergin Maps Cloud for project contributors. + + ## Use and Review Write a review of the application on App Store or Android Google Play diff --git a/src/howto/project/input_forms_many-photos.png b/src/howto/project/input_forms_many-photos.png new file mode 100644 index 00000000..c18640e0 Binary files /dev/null and b/src/howto/project/input_forms_many-photos.png differ diff --git a/src/howto/project/input_forms_many-relations1.png b/src/howto/project/input_forms_many-relations1.png new file mode 100644 index 00000000..9e9a2d9e Binary files /dev/null and b/src/howto/project/input_forms_many-relations1.png differ diff --git a/src/howto/project/input_forms_many-relations2.png b/src/howto/project/input_forms_many-relations2.png new file mode 100644 index 00000000..0822c9ec Binary files /dev/null and b/src/howto/project/input_forms_many-relations2.png differ diff --git a/src/howto/project/input_forms_many-relations_concept1.png b/src/howto/project/input_forms_many-relations_concept1.png new file mode 100644 index 00000000..28c46f7e Binary files /dev/null and b/src/howto/project/input_forms_many-relations_concept1.png differ diff --git a/src/howto/project/input_forms_many-relations_concept2.png b/src/howto/project/input_forms_many-relations_concept2.png new file mode 100644 index 00000000..e6fa3fb4 Binary files /dev/null and b/src/howto/project/input_forms_many-relations_concept2.png differ diff --git a/src/howto/project/input_forms_many-relations_concept3.png b/src/howto/project/input_forms_many-relations_concept3.png new file mode 100644 index 00000000..6a22f6f8 Binary files /dev/null and b/src/howto/project/input_forms_many-relations_concept3.png differ diff --git a/src/howto/project/input_forms_one-to-many.png b/src/howto/project/input_forms_one-to-many.png new file mode 100644 index 00000000..5b1a4bfb Binary files /dev/null and b/src/howto/project/input_forms_one-to-many.png differ diff --git a/src/howto/project/settingup_forms.md b/src/howto/project/settingup_forms.md index 86fe868c..06ba0b6e 100644 --- a/src/howto/project/settingup_forms.md +++ b/src/howto/project/settingup_forms.md @@ -6,6 +6,8 @@ You can follow the examples in this section by cloning the following projects: - - - + - + - ::: @@ -99,7 +101,7 @@ To use the numeric widget in your form from Input: ![slider](./input_forms_number1.png) -## Slider +## Slider For setting up a slider, ensure your field type is an integer. @@ -145,9 +147,9 @@ To have a more advanced form with drill-down menu option, see cascade form setup ## QR code reader To be able to use your camera in forms to scan QR codes and populate the text in the field -### QGIS +### QGIS -To be able to scan QR codes in your forms, your field or the alias for the field should contain **qrcode** (the text is not case sensitive and it can be be in combination of lower or upper case letters). For an example, see the +To be able to scan QR codes in your forms, your field or the alias for the field should contain **qrcode** (the text is not case sensitive and it can be be in combination of lower or upper case letters). For an example, see the ### Input @@ -164,7 +166,7 @@ To use the QR code scanner in the form from Input: ![slider](./input_forms_qrcode.jpg) -## Datetime +## Datetime If you want to record time and date when you capture the feature, you need to make sure you have a field with **Date** or **Date and Time** type present in your survey layer. Note that all GIS data formats support these types of field. It is assumed, you use Geopackage layer, hence this field type is supported. @@ -310,3 +312,71 @@ To use the drop-down widget in the form from Input: ![slider](./input_forms_valuerelation1.png) ![slider](./input_forms_valuerelation2.png) ![slider](./input_forms_valuerelation3.png) + +## 1-N relations + +It is often the case that you have a set of spatial features and you want to record some parameters every now and then. For example, there is a GIS layer representing the manholes and the surveyors carry out regular inspections of the manholes. Instead of duplicating the manhole layer and recording each inspection, you can create a non-spatial table and store each inspection as a new line. + +The image below shows the manholes locations: + +![Manhole locations](./input_forms_many-relations_concept1.png) + +The manhole point layer has the following attribute table: + +![Manhole locations](./input_forms_many-relations_concept2.png) + +In a separate table (which is non-spatial), we can record the inspections: + +![Manhole locations](./input_forms_many-relations_concept3.png) + +In QGIS, we are using the **Manhole ID** from the point layer and the inspection table, to create a 1-N relationship between the two tables. + +Another example is when you try to capture multiple photos for a single feature. + +In the sections below, you can see how this type of relations can be set up in QGIS and utilised in the Input app. + +### Project preparation in QGIS + +See the example projects: +- Assigning multiple inspections to a single feature: +- Adding multiple photos to a single feature: + +To configure 1-N relations in QGIS: +- From the main menu, select **Projects** > **Properties ...** +- In the new window, select the **Relations** tab +- Select **Add Relation** to create a new one +- A new window will appear, where we can define the parent and child layers and the fields to link the two layers: + - For **Name** type **Inspection** + - For the **Referenced(parent)** layer, select **manhole_locations** + - For **Field 1** of the **Referenced(parent)** layer, select **Manhole** + - For the **Referencing(child)** layer, select **inspections** + - For **Field 1** of the **Referencing(child)** layer, select **Manhole ID** + +![1-N relations in QGIS](./input_forms_many-relations1.png) + +This should now allow you to add multiple inspections for each manhole location (**manhole_locations** point layer). The inspections records will be stored in the **inspections** table. + +When you open the form for an existing record in the **manhole_locations** point layer, you should be able to see the existing inspection records and optionally add, delete or edit the records: + +![1-N relations in QGIS - form view](./input_forms_many-relations2.png) + +The same project when you open add inspection to a manhole in Input will look like the image below: + +![Many photos to a single feature](./input_forms_one-to-many.png) + +### Link multiple photos to a single feature + +Another use-case for having multiple photos linked to a single feature is using 1-N relation. + +To set up a project in QGIS, similar to the previous example, we need a unique field to link the following two tables: +- Survey layer (containing spatial information) +- A non-spatial table containing path to the photos + +The key part when linking the above to table is to avoid using **FID** field in the GeoPackage. Mergin uses the FID to consolidate changes and therefore can change the FIDs. This will result in having photos linked to the incorrect feature on the map. + +For that, we can create a new field and use the **uuid()** as the default value. To learn more about how this can be configured, you can see . + +Input detects the type of 1-N relation is for "Attachment" widget and displays the image viewer for the relations. + +![Many photos to a single feature](./input_forms_many-photos.png) + diff --git a/src/index.md b/src/index.md index eee37a02..d39a8c4b 100644 --- a/src/index.md +++ b/src/index.md @@ -16,6 +16,7 @@ Enjoy the feeling when you make sense of your geo-data on maps - Setup and analyze the project on desktop with QGIS. :computer: - All open-source and easily integrated to your existing toolset :bulb: + ## Get started diff --git a/src/project/input_forms_one-to-many_concept3.png b/src/project/input_forms_one-to-many_concept3.png new file mode 100644 index 00000000..6a22f6f8 Binary files /dev/null and b/src/project/input_forms_one-to-many_concept3.png differ