Editing on line

Activation and configuration

Thanks to the integration with the QGIS API, G3W-SUITE allows you to edit all the formats (geographic and not) edited by QGIS through the OGR/GDAL library and other specific providers.

Consult the list of formats managed by QGIS.

The tool also allows you to manage 1:N relational editing.

Be careful: in this release editing is not available on simple join (1:1/n:1) data

The editing settings are defined partly at the QGIS project level (editing form structure, widgets associated with individual attributes, 1:n relationships) and partly at the Administration level (users with editing power, activation scale, any geoconstraints).

It should be noted that this function manages multi-user editing through a features-lock system.

When an enabled user activates the editing function at the map client level, the features visible on the map at that time will be blocked, in relation to the editing aspect, for all the other enabled users who will still be able to edit features present outside this geographical extension. .

This block will be deactivated when the user exits the editing mode.

QGIS project settings

Definition of the attribute editing form

In the QGIS project, for each layer it is possible to define the structure of the attribute display module.

The same structure will be used in the cartographic client when editing attributes.

The definition of the form structure can be managed, on QGIS, from the Properties of the vector, in the Attributes Form section.

_images/editing_qgis_form_widget.png

Definition of editing widgets associated with individual attributes

At the QGIS project level (always from Vector Properties, Attribute Form section) it is possible to define an alias and an editing widget for each attribute.

The alias and editing widgets defined at the project level will be available during web editing with some limitations.

Below are the available widgets and any limitations:

  • Checkbox

  • Date/time: management of the date only

  • Attachment

  • Range

  • Text edit with this excluded options:

    • multiline

    • html

  • Unique values

  • Value map

  • Value relations with this excluded options:

    • sort by value

    • allow multiple selections

    • filter expression

With regard to the Attachment widget, it is necessary to specify that the association of a multimedia file with a feature requires that this file is uploaded to a dedicated space (exposed on the web) on the server and that the association takes place via a URL that refers to that file.

This solution allows you to consult the associated attachments also from QGIS or from other GIS software.

Additional settings at single layer level

In the Attribute Form section of the Layer Properties it is also possible to define for every fields:

  • mandatory and/or unique constraints

  • enable/disable editing

  • default values

Definition of 1:n relations

In the event that, at the QGIS project level, one or more 1: n type relationships have been associated with a layer (Project menu Properties…, Relations section), it will be possible to carry out relational editing also on the webgis platform.

Also for the tables related in 1:n mode it will be possible to define the attribute form structure, aliases and editing widgets in the QGIS project.

These configurations and tools will automatically available on the webgis platform.

Transaction Group

Use transaction group to edit, save or rollback multiple layers changes at once

When working with layers with the same source (es. layer from the same PostGreSQL database), activate the Automatically create transaction groups where possible option in Project Properties… Data Sources to sync their behavior (enter or exit the edit mode, save or rollback changes at the same time).

_images/datasources.png

Administration settings

Activation of layer editing

To activate the online editing functions, access the Layer list section of the project within the administration panel of G3W-ADMIN.

Identify the layer on which you want to activate the editing function and click on the Editing layer icon _images/icon_editing.png located on the left.

Attention: check the list of formats supported by QGIS for editing.

_images/editing_layer_list.png

Identify the layer on which you want to activate the editing function and click on the Editing layer icon _images/icon_editing.png located on the left

Attention: check that the layer format is among those supported by QGIS for the editing function

Clicking on the icon will open a modal window that will allow you to:

  • define the editing activation scale (only for geometric tables)

  • define the Viewer users (individuals or groups) enabled for online editing

With regard to the last aspect, it should be noted that:

  • Viewers users (individuals or groups) available in the drop-down menu will be limited to those who have allowed access in consultation to the WebGis project

  • Editor1 and Editor2 users, owners of the project, are enabled by default to the online editing function

_images/editing_setting.png

1:N relational editing

To allow editing on the related table in mode 1: n , the editing function must also be activated (always in the same way) also for the related table present in the project layers list.

Constraints setting

G3W-SUITE allows you to manage two types of constraints:

  • alphanumeric / QGIS expressions constraints that operate both in terms of visualization and editing

  • geographic constraints that operate only at the editing level

Alphanumeric / QGIS expressions Constraints

Alphanumeric / QGIS expression constraints allow you to define, for each published layer, the subset of features that can be viewed and edited by individual users and/or groups of users.

To activate this type of constraint, you must click, always at the level of the list of project layers, on the Alphanumeric constraints list icon _images/icon_alpha_constraints.png.

Clicking on the icon will show the list of any existing alphanumeric constraints and the item + New alphanumeric constraint to create a new constraints.

_images/editing_alpha_constrain_layer.png

Clicking on the item + New constraint will open a modal window which will allow you to define a name and a description for the new constraint.

After clicking the OK button, the constraint will appear in the list and can be parameterized using two ways of defining the rules:

  • _images/icon_alphaconstraints_setting.png Provider’s language / SQL dialect

  • _images/icon_qgisconstraints_setting.png QGIS Expression

Provider’s language / SQL dialect Rules

Clicking on the icon _images/icon_alphaconstraints_setting.png will open a modal window which, by pressing the green button _images/button_add.png, it will allow you to define, for each user and/or group of users, the rules of the constraints.

The individual rules must be defined via the Provider's language or the SQL dialect Rules associated with the format of the geo-constraints layer (es. use standard SQL if your layer is a PostGis layer)

The single rules must refer to the layer’s attributes and values.

The Save icon _images/icon_save.png will allow you to validate the rules, in order to ensure proper functioning of the constraints itself.

_images/editing_alpha_constrain_setting.png

Once all the constraints have been entered and validated, click on the Close button to confirm the rules.

QGIS Expressions Rules

Clicking on the icon QGIS expression rules _images/icon_qgisconstraints_setting.png will open a modal window which, by pressing the green button _images/button_add.png, it will allow you to define, for each user and/or group of users, the rules of the constraints.

The individual rules must be defined via QGIS expression and this allows to have a great degree of freedom in the ways in which to set these rules.

See the paragraph dedicated to the functions available directly on the QGIS manual.

The Save icon _images/icon_save.png will allow you to validate the rules, in order to ensure proper functioning of the constraints itself.

_images/editing_qgisconstrain_setting.png

Once all the constraints have been entered and validated, click on the Close button to confirm the rules.

Geo-constraints

The online editing function also allows you to manage geo-constraints that allow the user to insert/modify features only if they intersect or are contained within specific features of a second polygonal layer.

To activate a geographical constraint, you must click, always at the level of the list of project layers, on the Manage Geo-Constraints icon _images/icon_constraints.png which will appear once the online editing function is activated.

Clicking on the icon will show the list of any existing constraints and the item + New geo-constraint to create a new geo-constraints.

_images/editing_constrain_layer.png

The icons placed next to any constraints already present allow you to edit/delete the constraint itself.

Clicking on the item + New geo-constraint will open a modal window which will allow you to define the polygonal layer (among those present in the project) on which the constraint itself must be based.

Once the layer has been defined, the constraint will appear in the list and can be parameterized using the Rules icon _images/icon_constraints_setting.png

Clicking on this icon will open a modal window which, by pressing the green button _images/button_add.png, it will allow you to define, for each user and/or group of users, the rules of the constraints.

The individual rules must be defined via the Provider's language or the SQL dialect Rules associated with the format of the geo-constraints layer (es. use standard SQL if your geo-constraint layer is a PostGis layer)

The single rules must refer to the layer’s attributes and values.

The Save icon _images/icon_save.png will allow you to validate the rules, in order to ensure proper functioning of the constraints itself.

_images/editing_geoconstrain_setting.png

Once all the constraints have been entered and validated, click on the Close button to confirm the rules.

In the alphanumeric constraints list you can see a summary of the setted rules.

_images/editing_geoconstrain_layer_summary.png

Online editing tools at cartographic client level

Direct editing

Once the online editing function has been activated and configured on one or more layers of a WebGis project, the Editing item, inside the Tools menu of the cartoographic client, will be shown.

_images/editing_client_start.png

_images/editing_client_tool.png

By clicking on the Data Layers item, the side menu will show the editing tools for all the layers on which this function is activated.

The actual activation of the editing function for the individual layers will take place by clicking on the Edit layer icon.

Create and edit features

The tools available are the following:

Geometric layers

  • _images/icon_feature_add.png Add feature: to add a feature

  • _images/icon_feature_attribute.png Modify feature: to modify the attributes associated with an existing feature

  • _images/icon_feature_modify.png Update feature vertex: to modify the shape of a geometry

  • _images/icon_feature_remove.png Remove feature

  • _images/icon_feature_move.png Move feature: to move a feature

  • _images/icon_feature_copy.png Copy features: to move one or more features

  • _images/icon_feature_dissolve.png Dissolve features: to dissolve two or more features

  • _images/icon_feature_split.png Split features: to split one or more features

Activating the Add features and Update feature vertex tools allows you to activate the snap intralayer function.

A help panel will describe the steps to take for copy, dissolve and split operations.

Alphanumeric layer

  • _images/icon_record_add.png Add feature: to add a record to the alphanumeric table

  • _images/icon_record_modify.png Modify features: to modify the attributes of an existing record

Whenever a new feature/record is added or an existing feature/record is update, the attribute editing form and the respective editing widgets will be displayed as defined at the QGIS project level.

_images/editing_form.png

Any mandatory fields will be marked with an asterisk.

Any unfulfilled constraints will be highlighted with specific warning messages shown in red.

The changes made can be saved only after satisfying any constraints of mandatory and/or uniqueness.

For this reason the green button SAVE will be disabled until all constraints are met.

Saving changes

Saving all the changes made in an editing session can be done in two ways:

  • by clicking on the diskette icon _images/icon_disk.png placed at the top right. The changes made will be saved and you can continue making new changes

  • by deactivating the editing by clicking on the Edit layer icon _images/icon_edit2.png.

By deactivating the editing function, a modal window will be displayed which will show the list of changes made and the request for confirmation or not of saving them.

_images/editing_client_save.png

Remember that during the editing phase the undo/redo icons _images/icon_undoredo.png allow you to delete/restore the latest changes made.