1.25. How to edit data
Note
You can use described functionality in Web GIS created in nextgis.com service on Premium plan
Web GIS allows to edit objects and their attributes and to add descriptions and attachments (including photos) of features in Vector layers and PostGIS layers.
1.25.1. How to set up editing permission
By default, Web Map editing is always disabled. In order for the user to be able to make changes to the layers on the map, editing must be enabled in the Web Map settings. You can change permission for editing in “Update resource” dialog of a Web Map. You can find how to enter it in Update resource of NextGIS Web documentation. You can allow or deny editing of all map layers on the “Settings” tab by ticking or clearing a box next to “Enable layers editing” field (see Pic. 6.151.):
Note
By default a box next to “Enable layers editing” field is clear.
To forbid some users to edit layers add a rule to deny specified users or groups of users to write data (permission "Resource:Modify"
) on the “Permissions” tab of the “Update resorce” dialog (see Pic. 6.152.). For user without permission the edit mode is unavailable.
1.25.2. Edit a feature on a Web Map
Open Web Map and select the layer with the feature you need to edit.
Open dropdown menu by pressing the “Layer” button (see Pic. 6.156.), then tick the box next to “Editing”.
Editing toolbar will appear on the Web Map (see Pic. 6.157.):
1.25.2.1. Create a new feature (point, line, polygon)
On the editing toolbar activate “Create features” button (see Pic. 6.158.):
A blue circle will appear nearby a mouse pointer, with it you can add new features. Click on the map to create a new feature. You can add several new features one after another. While creating a line you need to indicate its start and end points by clicking on the map. While creating a polygon each new click on the map will indicate its new vertice, to finish a polygon you need to click on its start point. You can use adhesion while creating vertices.
To finish creation of the new feature press “Layer” button (see Pic. 6.156.) and clear the tick box next to “Editing”.
In the opened dialog select “Save” to save changes, “Don’t save” to discard them, or “Cancel” to stay in the edit mode:
1.25.2.2. Delete a feature
On the editing toolbar activate “Delete features” button (see Pic. 6.160.):
Features you can modify will reduce their color intensity and have a blue outline. The pointer will become a black cross.
Left-click to select the features you would like to delete.
Press “Layer” button (see Pic. 6.156.) and clear the tick box next to “Editing”.
In the opened dialog select “Save” (see Pic. 6.159.).
1.25.2.3. Modify a feature
On the editing toolbar activate “Modify features” button (pencil icon, see Pic. 6.162.):
Features you can modify will reduce their color intensity.
Select a feature (point) or one of its vertices (line, polygon) with the pointer and drag it, then release on a new place. For vertices modifying an adhesion will work.
Press “Layer” button (see Pic. 6.156.) and clear the tick box next to “Editing”.
In the opened dialog select “Save” (see Pic. 6.159.).
Note
You can edit several layers simultaneously. To do it enter the edit mode in every layer you want to edit. Adhesion will work for features of all these layers.
1.25.3. Edit feature’s attributes
There are 2 ways to edit feature’s attributes: 1) using edit form in Feature table or 2) using edit form in Web Map web client (if the relevant layer is added to Web Map).
1.25.3.1. Edit attributes using Feature table
Open the Properties page of Vector layer or PostGIS layer;
Select admin console;
on the right side of Web GISIn the opened dialog window select a feature you want to edit (if necessary search it by its attributes using Search bar) and press Edit button;
In the opened form edit feature attributes values in Attributes tab, add description and attachments in Description and Attachments tabs;
Press Save button. If attributes, description and attachments are saved successfully you’ll be able to view them by selecting the feature in Feature table and pressing Open button.
1.25.3.2. Edit attributes using Web Map
Open Web Map and switch on the visibility of the relevant layer;
Find the feature on the Web Map (if necessary search it by its attributes using Search bar in the Toolbar or in the Feature table which can be opened via Layer dropdown menu in the upper left corner of Web Map web client. You can quickly find the selected feature on Web Map using Go to button in Feature table);
Click on the feature. In the opened dialog window with feature properties press Edit button;
In the opened form edit the values of feature attributes in Attributes tab, add description and attachments in Description and Attachments tabs;
Press Save button. If attributes, description and attachments are saved successfully you’ll be able to view them on the Web Map by clicking on the feature or by selecting the feature in the Feature table and pressing the Open button.
Note
Updated attributes in PostGIS layers are saved directly to the external PostGIS database. Updated attributes in Vector layers, as well as descriptions and attachments in Vector layers and PostGIS layers are saved to your Web GIS.
Note
You can also edit geometries and attributes of Vector layers features with desktop app QGIS.
Read more on data editing here.