9.8. Edit data

NextGIS Connect plugin allows to quickly edit geometries and attribute values of features in Web GIS Vector layers right after adding them to QGIS. This allows the layer to be edited even with no Internet connection. The changes will be saved to the device and transfered to Web GIS when the connection is restored.

This functionality is only available for vector data formats used in QGIS.

Warning

By default only one user at a time can edit the layer directly.

  1. Import the layer from Web GIS to QGIS by selecting it in NextGIS Connect and pressing button_to_qgis Add to QGIS.

  2. Enter the edit mode from the layer’s context menu or from the toolbar.

  3. Make the changes.

  4. Exit edit mode. Confirm changes in the pop-up window.

  5. The layer will be automatically synchronized.

To check when the layer was last synchronized, hover over the sync symbol.

Sync information

Pic. 9.45. Synchronization information

Press the symbol to open the layer status window.

../../_images/ngc_layer_status_en1.png

Pic. 9.46. Layer status dialog

It has the date and time of the latest synchronization and the status: synchronized or not synchronized.

You can start the process manually by pressing the Synchronization button.

Important

While the layer is in edit mode, synchronization is not available.

If changes have been made to the layer in Web GIS since the last synchronization, further synchronization will not be possible. Press the sync symbol by the layer, “Layer status” window will open. In the dropdown menu select Reset layer. Keep in mind that if you reset the layer, all local changes that had not been synchronized will be lost.

Sync information

Pic. 9.47. Layer synchronization symbol

../../_images/ngc_layer_status_en1.png

Pic. 9.48. Layer status dialog. To reset the layer, press the downward arrow by the “Synchronization” button and select “Reset layer”

If the edits made in the cloud were incorrect and you need to replace them with local ones, you can use the Data overwrite function.

Only the data itself is synchronized. If the data structure changes, it makes synchronization impossible. The layer needs to be downloaded again.

9.8.1. Multi user editing

Layers can be edited by several people at once or from several different devices/platforms. The options for collaborative editing are:

  1. Use OGC API — Features or WFS services. You can create them in Web GIS (WFS, OGC API — Features) or directly in the Connect plugin and then use them to edit data.

  2. Edit directly in QGIS with enabled versioning of vector layers. Turn on versioning in the layer’s settings in Web GIS. When versioning is on, all changes made to the layer are logged in the system. That allows Connect to access edits made on other devices and process them without resetting the layer.

9.8.2. Edit layer with WFS

You can also edit a vector layer using the standard WFS protocol (with feature edit support):

  • Publish via WFS protocol the Vector layer you’re going to edit;

  • Select in NextGIS Connect Resources panel the relevant WFS service;

  • Press button_to_qgis Add to QGIS button on NextGIS Connect control panel or select Add to QGIS in the service context menu;

../../_images/NGConnect_edit_add_en1.png

Pic. 9.49. Adding layer to QGIS using WFS service

  • If the operation is successful you’ll see in QGIS Layers panel a new group of WFS layers published via the selected WFS service;

  • Enter Edit mode and modify geometries and attributes in the added WFS layer using standard QGIS tools;

../../_images/NGConnect_edit_process_en1.png

Pic. 9.50. Features editing

  • Press the “Edit” button to finish editing and press “Save” in the opened window.

../../_images/NGConnect_edit_save_en1.png

Pic. 9.51. Saving changes

  • If the editing was successful, you’ll be able to see the changes in the Web GIS at once, both in the Feature table and on the Web Map web client.

9.8.3. Update data

NextGIS Connect allows you to update the content of an existing Web GIS vector layer keeping its styles, attribute aliases and other settings.

Warning

When a layer is updated, all data of the target layer including attachments (photos, documents) is cleared. If you need to keep the attachments intact, use WFS. When you update a style, it does not affect attachments.

To update (overwrite) layer’s data:

  • In the QGIS Layers panel, select the vector layer that has features you want to send to an existing Web GIS vector layer;

  • In the NextGIS Connect panel select the vector layer , select the vector layer the contents of which you need to replace;

  • Right click on the target layer and choose Overwrite selected layer.

Layer resource ID stays the same. The attribute structure of the source and target layers must be the same, otherwise you cannot overwrite data.

../../_images/NGconnect_vector_overwrite_en_21.png

Pic. 9.52. Overwriting layer with the new version via context menu

You can also edit features directly or via WFS.

9.8.4. Update style

You can add another style to a layer or replace its existing style with a new one. When a style is updated, the NextGIS Connect module removes the old style of the layer from the Web GIS and loads the new one leaving all data and attachments intact.

  • Add layer to QGIS via Connect;

  • Change the style of the layer (color, line width, etc.);

  • Select the layer in QGIS Layers panel as well as in the Connect panel.

  • In Connect toolbar press button_to_wg Add to Web GIS and in the dropdown menu select “Add new style to layer” or “Update style”.

../../_images/connect_add_style_en_2.png

Pic. 9.53. Adding style to a layer

To update layer’s style you don’t need to select a specific one.

  1. If the layer has only one style, this style is updated;

  2. If the layer has multiple styles, selection dialog appears;

  3. If the layer has no style, the style is added to it.

../../_images/connect_replace_select_style_en.png

Pic. 9.54. Selecting one of the styles to update

This operation is also available in the layer’s context menu in QGIS Layers panel: NextGIS Connect ‣ Add new style to layer / Update layer style.

../../_images/connect_replace_add_style_context_en.png

Pic. 9.55. Updating/adding a style from context menu

9.8.5. Copy style from Web GIS

With Connect you can copy QML style from Web GIS and apply it to a local style in QGIS.

Watch on youtube.

Click on the layer in the Connect panel to view the styles and right-click on the QML-style. Select “Copy style” in the context menu. Then in the QGIS Layers panel paste style via context menu as usual.

../../_images/connect_copy_style_en.png

Pic. 9.56. Copying a style

../../_images/connect_paste_style_en.png

Pic. 9.57. Pasting a style

../../_images/connect_result_style_en.png

Pic. 9.58. Copied style in the QGIS project