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.
Import the layer from Web GIS to QGIS by selecting it in NextGIS Connect and pressing Add to QGIS.
Enter the edit mode from the layer’s context menu or from the toolbar.
Make the changes.
Exit edit mode. Confirm changes in the pop-up window.
The layer will be automatically synchronized.
To check when the layer was last synchronized, hover over the sync symbol.
Press the symbol to open the layer status window.
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.
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:
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.
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 Add to QGIS button on NextGIS Connect control panel or select Add to QGIS in the service context menu;
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;
Press the “Edit” button to finish editing and press “Save” in the opened window.
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.
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 Add to Web GIS and in the dropdown menu select “Add new style to layer” or “Update style”.
To update layer’s style you don’t need to select a specific one.
If the layer has only one style, this style is updated;
If the layer has multiple styles, selection dialog appears;
If the layer has no style, the style is added to it.
This operation is also available in the layer’s context menu in QGIS Layers panel:
.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.