8.9. Edit vector features

You can modify geometries and attributes of vector features via Web interface: in the Feature table or on a Web Map (see below), - as well as in QGIS desktop app.

8.9.1. Allow editing

By default editing of a Web Map is disabled. To allow users to modify the layers of the map, enable editing in the Web Map settings. To find out how to open the “Update resource” dialog, see this chapter.

You can enable or disable editing of all Web Map layers on the “Settings” tab by selecting the corresponding option in the dropdown menu (see Pic. 8.94.).

../../_images/webgis_allow_editting_en.png

Pic. 8.94. “Enable layers editing” is turned on

Note

By default layer editing is turned off.

Editing is available for users who have permissions to read and modify data. The “Modify data” permission can be set for the entire resource group where the data is stored or for individual layers.

Users who do not have “Modify data” permission won’t be able to activate the edit mode. How to check user permissions.

../../_images/webgis_permiss_editing_en.png

Pic. 8.95. Permissions set for the Data resource group to allow editing

8.9.2. Edit mode on a Web Map

  1. Open Web Map and select the layer with the feature you need to edit.

  2. Open dropdown menu by pressing the three dots to the right of the layer name (see Pic. 8.96.), then select “Edit”.

../../_images/webgis_edit_objects_en_2.png

Pic. 8.96. Entering the editing mode

  1. Editing toolbar will appear on the Web Map (see Pic. 8.97.):

../../_images/webmap_edit_panel_en.png

Pic. 8.97. Editing toolbar

Also, for polygons one more tool is available:

Below you can find detailed description of these operations.

Features available for editing are highlighed. You can edit multiple layers at once, each is highlighted with a different color.

8.9.3. Create a new feature (point, line, polygon)

  1. Enter Edit mode. The + in a circle “Create” tool is active by default (the button is blue). If you used some other tool before that, click on the button to activate feature creation.

../../_images/webmap_create_point_en.png

Pic. 8.98. “Create feature” button on the toolbar and the mark by the mouse pointer

  1. A colored circle will appear nearby a mouse pointer, with it you can add new features. Click on the map to create a new feature.

  2. A dialog opens where you can add attribute values.

Click OK to finish creating a feature. To clear the attribute form, click Reset.

../../_images/webgis_attr_new_objects_en_2.png

Pic. 8.99. Entering attribute values for the new feature

You can enter multiple features one after the other.

When creating a line, click on the map to indicate its start and end points. While creating a polygon each new click on the map adds a new vertex. To finish a polygon you need to click on its starting point. You can use adhesion while creating vertices.

Note

If you need to create a polygon with a hole, first draw the outer ring and complete feature creation, then use scissors tool to cut the hole.

4. To save created features to the layer, click floppy disc “Stop editing”. In the opened dialog select “Save” to save changes, “Don’t save” to discard them, or “Cancel” to stay in the edit mode:

../../_images/webgis_finish_editting_en.png

Pic. 8.100. Dialog for finishing the edits

8.9.4. Delete feature

  1. Enter the edit mode. On the editing toolbar click on the trash can “Delete” button.

  2. Click on the features you want to delete. The highlighted contour of the editable features disappears.

../../_images/webmap_delete_polygon_en.png

Pic. 8.101. Editing polygon layer. Polygons highlighted in red, remain in the layer, polygon without the red contour is deleted.

4. To finish deleting features, click floppy disc “Stop editing”. In the opened dialog select “Save” to save changes, “Don’t save” to discard them, or “Cancel” to stay in the edit mode (see Pic. 8.100.).

8.9.5. Move feature

  1. To move en etire feature, enter the Edit mode and activate outward arrows “Move” tool.

  2. Click on the feature to select it, then drag to a new location.

Both the old position (style colors) and the new position (selection color) are shown.

../../_images/webmap_move_point_en.png

Pic. 8.102. Moving a point. The new position is marked in blue

../../_images/webmap_move_polygon_en.png

Pic. 8.103. Moving a polygon feature. The new position is marked in red

  1. Click floppy disc “Stop editing” and save the changes.

Also you can move individual vertices of lines and polygons.

8.9.6. Edit vertices

  1. On the toolbar click on the pencil “Edit” button.

Editable features are highlighted.

  1. Click on a vertex and drag it to a new position by holding the left mouse button. Snapping is active by default.

../../_images/webgis_edit_vertices_en.png

Pic. 8.104. Editing polygon vertices. The changed geometry is shown in red

  1. To finish editing click floppy disc “Stop editing” and save the changes (see Pic. 8.100.).

Note

You can edit several layers simultaneously. To do it enter the edit mode in every layer you want to edit. Snapping works for features of all these layers.

8.9.7. Add and delete vertices

To delete a vertice enter the Edit mode, then activate the pencil “Edit” tool, hold Shift and click on the vertex.

To add a vertex, click on the line between two existing vertices and drag it to the desired location.

../../_images/ngw_new_vertex_en.png

Pic. 8.105. Creating a new vertex

8.9.8. Create holes

If you need to create a polygon that has one or seleral areas cut from it:

  1. First add the outer contour using the + in a circle Create tool.

  2. Activate the scissors Cut hole tool and draw a closed boundary of the hole.

../../_images/cutting_hole_en.png

Pic. 8.106. Polygon with a hole

  1. To finish editing click floppy disc “Stop editing” and save the changes (see Pic. 8.100.).

8.9.9. Edit feature’s attributes

NextGIS Web software allows users to edit attributes of geographical features. There are several ways to open the dialog:

  • From the resource list:

    • Click on the table table symbol by the vector layer (or open the layer resource page and select “Feature table” in the actions pane).

    • Feature table opens. Click on the entry in the table to select it.

    • Click on the Edit button in the table toolbar.

../../_images/ngweb_editing_attributes_en.png

Pic. 8.107. Editing attributes using Feature table

If you are in the Web Map map and magnifying glass display mode.

  • From the Feature table:

    • In the layer’s context menu select “Feature table” and then follow the steps described above.

  • In the Edit mode:

    • In the layer’s context menu select “Edit”.

    • In the toolbar on the map select three lines.

    • Click on the feature on the map.

  • From the Identify panel:

    • Click on the feature on the map.

    • In the Identify panel click on the “Edit” symbol (see Pic. 8.108.).

../../_images/editing_when_viewing_map_open_en.png

Pic. 8.108. Editing attribute values from the Identify panel

Editing dialog has the following tabs:

  • “Attributes” tab:

../../_images/ngweb_tab_attributes_eng_2.png

Pic. 8.109. Attributes tab

To edit an attribute click on the field.

Numbers can be typed in or modified with arrows that appear on the right end of the field.

Dates also can be typed in or selected in the calender. To open the calender click the icon on the right end of the field.

Add a Lookup table to a field to be able to pick a value from a dropdown list.

../../_images/ngweb_tab_attachment_eng_2.png

Pic. 8.110. Attachments tab

  • “Description” tab - the description is displayed in the Identify panel when you click on a featre.

../../_images/ngweb_tab_description_eng_2.png

Pic. 8.111. Description tab

Note

If you opened the feature attributes dialog from the Feature table on a separate page, you can edit the feature’s geometry in the fourth tab. If you opened the edit dialog from a Web Map, to edit the geometry activate Edit mode.

8.9.10. Attachments

NextGIS Web software supports adding photos, panoramas and other files to the features. If a feature has attachments, they will be shown along with description and attributes in the identify window (see Pic. 8.112.).

../../_images/attachm_tab_en.png

Pic. 8.112. Identify window for a feature with attached photos

Files in the following formats can be viewed directly in the web client:

  • JPEG, PNG images. GIF format not supported.

  • Panoramas complying with the specification.

Other types of files can be added as attachments, but won’t be viewed in the interface.

After a click on a photo preview a lightbox window is open (a javascript powered window in browser). Photo size is adjusted to fit the window. Photos have descriptions and user can navigate through them using left and right arrow keys on the keyboard (see Pic. 8.113.).

../../_images/webmap_ident_photo_lightbox.png

Pic. 8.113. A lightbox with uploaded photo for the identified feature

To navigate within the panorama, use the mouse. Hold down the left mouse button to rotate the camera. Use the wheel to zoom in and out. Panorama mode can be disabled by clicking on the blue round button in the upper right corner.

../../_images/panorama_opened_en.png

Pic. 8.114. Panorama opened from Web Map

8.9.10.1. Add attachments to a feature

To add an attachment to a feature, go to the edit window. There are several ways to open it:

  • Click on the feature on the Web Map, then in the pop-up window press the Edit button.

  • Open the feature table on the Web Map, select the feature and click Edit in the toolbar.

  • Open the feature table from the resource page, select the feature and click Edit in the toolbar.

On the Edit page open the Attachments tab and upload the files.

../../_images/add_attachment_en.png

Pic. 8.115. Adding file as attachment

Enter titles for the attachments and press Save.

After uploading you can see previews of photos and panoramas on the “Attachments” tab of the identify window (see attach_tab_pic).

Note

By default attachments could be added by any user but there is an option to limit number of users who can upload photos (see Managing access rights).

You can edit file names and descriptions of the added attachments. To delete an attachment, press the cross icon to its right. If you’ve made an error during editing, press Reset, all modifications will be cancelled.

To delete an attachment select it on the “Attachments” tab of the edit window, click Delete, and then click Save button.

See the process of adding attachments in our video:

Watch on youtube.

8.9.10.2. How to use panoramas

Not only photos, but also panoramas can be added as attachments. They allow to immerse explore new locations or find new details in familiar places.

Uploaded panoramic images must comply with the Google XMP Photo Sphere specification.

See how to work with panoramas in our video:

Watch on youtube.

8.9.10.3. Export and import attachments

To copy feature attachments between different layers or to create a backup you can save them to your device as an archive (Standard layer saving does not include attachments).

Navigate to the layer resource page and select Manage attachments.

../../_images/manage_att_select_en.png

Pic. 8.117. Managing attachments

To save the attachments, go to the Export tab and press Export attachments to ZIP archive. The resulting ZIP archive will contain all of the attachments put in directories named after feature IDs. Attachment metadata are put into a separate JSON file.

../../_images/manage_att_export_en.png

Pic. 8.118. Exporting attachments as ZIP archive

The resulting archive can be imported to add the attachments to the layer features. Open the Import tab, click Import attachments from ZIP archive and select the archive on your device. An archive must contain directories named after feature IDs. Each folder can contain one or many attachments. Duplicates will be ignored. If you need to replace the current attachments, tick “Delete existing attachments”.

../../_images/manage_att_import_en.png

Pic. 8.119. Importing attachments from ZIP archive