Welcome to G3W-SUITE 3.3 documentation!

G3W-SUITE is a frame-work, based on Django and written in Python language, which allows to manage in an integrated way the different components of QGIS for the realization of its own Geographic Information System and for the publication on WebGis of its own projects in a simple and intuitive way.

G3W-SUITE is entirely based on tested Open Source software components built around QGIS:

  • QGIS Desktop: for cartographic data management, editing and realization of high quality graphic projects

  • QGIS Server: for the publication of QGIS projects as OGC services

The current development policy provides for the compatibility of the G3W-SUITE application only with the latest LTR version of QGIS

The current release (3.3) is compatible with QGIS 3.16 LTR (Server and Desktop).

G3W-SUITE is a modular client-server application for the publication and management of QGIS cartographic projects, consisting of 3 components:

  • G3W-ADMIN: Administration component (project management, ACL, OGC proxy server, API rest server)

  • G3W-CLIENT: Cartographic client for consultation and interaction with OGC services

  • Front-end geographic portal: access to information, thematic groups and WebGis services

Through the web interface of the G3W-SUITE framework it is possible to:

  • publish QGIS projects directly on WebGis in a structured way

  • organize webgis services in thematic-functional containers of various levels

  • manage users and groups of users by defining each of them different functional roles

  • create and manage research methods

  • allow online editing

  • activate specific functional modules

  • define permissions to access services and to use functional modules at the individual user level

_images/admin.jpg _images/client.jpg

Raw installation

The following instructions are for a Ubuntu 18.04 LTS.

Installation of node.js and Yarn

G3W-ADMIN use javacript package manager Yarn and Node.js

sudo apt-get install -y nodejs-legacy npm

for install Yarn follow main installation instructions:

https://yarnpkg.com/en/docs/install#debian-stable

note

If your account is connected to the provider, we’ll try to setup the webhook automatically. If something fails, you can still setup the webhook manually.

Create virtualenv

Virtualenv

The following instructions are for python 3.6

Install python pip

sudo apt-get install python3-pip

now we can install virtualenvwrapper

sudo pip3 install virtualenvwrapper

To activate virtuenvwrapper on system login, add follow lines to ‘bashrc’ config file of your user

nano ~/.bashrc
....
export WORKON_HOME=<path_to_virtualenvs_directory>
source /usr/local/bin/virtualenvwrapper.sh

Virtualenv creation

To create a virtualnenv is sufficent call mkvirtualenv commando follow by the identification name for virtualenv (to use QGIS API into a virtualenv only solution is to give access python system site-packages to it using –system-site-packages option)

mkvirtualenv g3wsuite

Install G3W-SUITE

First step is install dev libraries packages for python module to install with requiriments.txt

sudo apt-get install -y \
    libxml2-dev \
    libxslt-dev \
    postgresql-server-dev-all \
    libgdal-dev \
    python-dev

after is necessary install the correct python module for GDAL library, check your version and install correct module

export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal

pip install GDAL==<installed_version or closest>

Set local_config.py file

G3W-ADMIN is a Django application, and to work is necessary set a config.py file. To start copy local_settings.example.py and set the databse and other:

cd g3w-admin/g3w-admin/base/settings
cp local_settings_example.py local_settings.py

set database, media root and session cookies name:

...

DATABASES = {
    'default': {
        'ENGINE': 'django.contrib.gis.db.backends.postgis',
        'NAME': '<db_name>',
        'USER': '<db_user>',
        'PASSWORD': '<db_user_password>',
        'HOST': '<db_host>',
        'PORT': '<db_port>',
    }
}

...

DATASOURCE_PATH = '<static_path_to_gis_data_source>'

...

MEDIA_ROOT = '<path_to_media_root>'

...

SESSION_COOKIE_NAME = '<unique_session_id>'

With paver commands

G3W-ADMIN has a series of paver CLI commands to administrate the suite. After prepared environment if sufficient invoce paver install task

paver install

Run G3W-SUITE

To run the application with paver

paver start

and for stop

paver stop

G3W-ADMIN is a django application so is possibile run app by standard django manage.py commands

./manage.py runserver

Deploy G3W-SUITE

As other Django application, G3W-SUITE can be deployed by its wsgi capabilities. On the web if simple to find tutorial for deploy a Django application.

The simpler way is to use Apache2 as server WEB and its mod_wsgi module.

Alternative solutions are:

Manual installation steps

The preferred installation is by using the paver script as mentioned above, but in case you need to customize the installation process, here are the build and setup steps:

Build static js code

# Install yarn (requires root):
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | \
    tee /etc/apt/sources.list.d/yarn.list
apt-get update && sudo apt install -y yarn
# Back to unprivileged user, from the repository directory, run:
yarn --ignore-engines --ignore-scripts --prod
nodejs -e "try { require('fs').symlinkSync(require('path').resolve('node_modules/@bower_components'), 'g3w-admin/core/static/bower_components', 'junction') } catch (e) { }"

Make sure build components are available in static and collected later

cd g3w-admin/core/static
ln -s "../../../node_modules/@bower_components" bower_components

Install requirements

Possibily within a virtual env:

pip install -r requirements.tx

Django setup

python manage.py collectstatic --noinput
python manage.py migrate --noinput

Install some fixtures for EPSG and other suite options:

for FIXTURE in 'BaseLayer.json' 'G3WGeneralDataSuite.json' 'G3WMapControls.json' 'G3WSpatialRefSys.json'; do
    python manage.py loaddata  core/fixtures/${FIXTURE}
done

Sync menu tree items (re-run this command in case you installed optional modules and they are not visible in the admin menu tree):

python manage.py sitetree_resync_apps

Continuous integration testing

CI tests are automatically run on CircleCI for the dev branch only.

The Docker compose configuration used in the CI tests is available at docker-compose.yml.

Another configuration for running local tests is provided with docker-compose-local.yml and can also be used for local testing by running:

docker-compose -f docker-compose-local.yml up

The testing image is built from the dependency image and it will run all install and build steps from the local repository.

The dependency image is built from the Dockerfile.deps.

Dockerization

This dockerization is based on project of Alessandro Pasotti (elpaso, https://github.com/elpaso).

Configuration

Create a file .env (or copy .env.example and rename it in .env) and place it in the main directory, the file will contain the database credentials (change <your password>) and other settings:

# External hostname, for docker internal network aliases
WEBGIS_PUBLIC_HOSTNAME=demo.g3wsuite.it/
WEBGIS_DOCKER_SHARED_VOLUME=/tmp/shared-volume-g3w-suite


# DB setup
G3WSUITE_POSTGRES_USER_LOCAL=g3wsuite
G3WSUITE_POSTGRES_PASS=<your_password>
G3WSUITE_POSTGRES_DBNAME=g3wsuite
G3WSUITE_POSTGRES_HOST=postgis
G3WSUITE_POSTGRES_PORT=5432

# Caching
G3WSUITE_TILECACHE_PATH=/shared-volume/tile_cache/
TILESTACHE_CACHE_BUFFER_SIZE=256

# URL of the QGIS Server
G3WSUITE_QDJANGO_SERVER_URL=http://qgisserver/ows/

# Set G3W-SUITE debug state
G3WSUITE_DEBUG = 1 (0 default)

Build

G3W-SUITE

The main suite image can be built with:

docker build -f Dockerfile.g3wsuite.dockerfile -t g3wsuite/g3w-suite-dev:latest --no-cache .

The container image is build from https://github.com/g3w-suite/g3w-admin.git --branch dev

The Docker hub name for this image is g3wsuite/g3w-suite-dev:latest

Postgis

Postgis image can be built with:

docker build -f Dockerfile.postgis -t g3wsuite/postgis:11.0-2.5 .

The Docker hub name for this image is g3wsuite/postgis:11.0-2.5

QGIS Server

QGIS Server image is built from https://github.com/elpaso/qgis-server-docker/tree/production

The Docker hub name for this image is g3wsuite/qgis3-server:ltr-ubuntu

HTTPS additional setup

  • check the domain name in the .env file and in config/nginx/django_ssl.conf

  • run mkdir -p /shared-volume/ssl/certs/

  • run sudo openssl dhparam -out /shared-volume/ssl/certs/dhparam-2048.pem 2048

  • run: docker pull certbot/certbot

  • launch ./run_certbot.sh

  • make sure the certs are renewed by adding a cron job with crontab -e and add the following line: 0  3 * * * /home/g3w-suite/rl.g3wsuite.it/run_certbot.sh

  • if you disabled HTTPS, you can move config/nginx/django_ssl.conf back to its original location now, and restart the Docker compose to finally enable HTTPS

Run

docker-compose up -d

Ports

  • web application: 8080

Volumes

Data, projects, uploads and the database are stored in a shared mounted volume shared-volume, the volume should be on a persistent storage device and a backup policy must be enforced.

First time setup

  • log into the application web administation panel using default credentials (admin/admin)

  • change the password for the admin user and for any other example user that may be present

Caching

Tile cache can be configured and cleared per-layer through the webgis admin panel and lasts forever until it is disabled or cleared.

Tip: enable cache on linestring and polygon layers.

Style customization

Templates can now be overridden by placing the overrides in the config/g3w-suite/overrides/templates, a Docker service restart is required to make the changes effective.

The logo is also overridden (through config/g3w-suite/settings_docker.py which is mounted as a volume), changes to the settings file require the Docker service to be restarted.

A custom CSS is added to the pages, the file is located in config/g3w-suite/overrides/static/style.css and can be modified directly, changes are effective immediately.

Performances optimization

General rules (in no particular order: they are all mandatory):

  1. set scale-dependent visibility for the entire layer or for some filtered features (example: show only major roads until at scale 1:1E+6)

  2. when using rule-based/categorized classification or scale-dependent visibility create indexes on the column(s) involved in the rule expression (example: “create index idx_elec_penwell_ious on elec_penwell_ious (owner);” )

  3. start the project with only a few layers turned on by default

  4. do not turn on by default base-layers XYZ such as (Google base maps)

  5. do not use rule-based/categorized rendering on layers with too many categories (example: elec_penwell_public_power), they are unreadable anyway

  6. enable redering simplification for not-point layers, set it to Distance 1.2 and check Enable provider simplification if available

PostgreSQL administration

Postgres is running into a Docker container, in order to access the container, you can follow the instruction below:

Check the container name

$ docker ps | grep postgis
84ef6a8d23e6        g3wsuite/postgis:11.0-2.5       "/bin/sh -c /docker-…"   2 days ago          Up 2 days           0.0.0.0:5438->5432/tcp           g3wsuitedocker_postgis_1

In the above example the container name is g3wsuitedocker_postgis_1

Log into the container

$ docker exec -it g3wsuitedocker_postgis_1 bash

Become postgres user

root@84ef6a8d23e6:/# su - postgres

Connect to postgis

postgres@84ef6a8d23e6:~$ psql
psql (11.2 (Debian 11.2-1.pgdg90+1))
Type "help" for help.

postgres=#

Settings

The following variables can be added to or edited in the project’s local_settings.py:

Base settings

G3WADMIN_PROJECT_APPS

Custom django map server module other than qdjango (QGIS-Server provider)

G3WADMIN_LOCAL_MORE_APPS

Custom django modules that is possible to add, i.e. g3w-admin-frontend (https://github.com/g3w-suite/g3w-admin-frontend) module and other third part django modules. G3W-SUITE accessory modules:

DATASOURCE_PATH

Path to geo data directory (shp, Spatialite, raster, etc..).

Important

Last part of path could be common with QGIS project datasource path. I.e.:

QGIS project: <datasource>/<path>/<to>/project_data/<geodata>.shp</datasource>

local_settings.py: DATASOURCE_PATH = /<local_server_<path>/<to>/project_data

Mandatory.

G3WADMIN_VECTOR_LAYER_DOWNLOAD_FORMATS

Default is [‘shp’, ‘xls’], set download data format. Values possible:
  • shp: download into Esri Shape format.

  • xls: download into Excel format

  • gpx: download into GPS format (only for Point and Line layers)

RESET_USER_PASSWORD

Default is False, set tot True to activate reset user password by email workflow. If set to True remember to set Django emailing settings (https://docs.djangoproject.com/en/2.2/topics/email/).

CLIENT_OWS_METHOD

Default is ‘GET’, set to ‘POST’ to change default http call method.

Frontend portal setting

FRONTEND

Default is False, set to True for activate G3W-SUITE frontend portal like g3w-admin-frontend. If it’s set to True base url path for G3W-SUITE admin section become /admin/.

FRONTEND_APP

Module name added to G3WADMIN_LOCAL_MORE_APPS to use as portal-frontend. I.e.:

G3WADMIN_LOCAL_MORE_APPS = [
    ...
    'frontend',
    ...
]

FRONTEND = True
FRONTEND_APP = 'frontend'

General layout settings

G3WSUITE_POWERD_BY

Default is True, set to False for don’t show bottom attribution informations.

G3WSUITE_CUSTOM_STATIC_URL

A custom url from to load custom static files as images, css, etc..

G3WSUITE_CUSTOM_TITLE

G3W-SUITE html page title. If is not set, title is: g3w-admin for admin section and g3w-client for webgis client.

G3WSUITE_FAVICON

Favorite icon image. Mandatory is set G3WSUITE_CUSTOM_STATIC_URL

G3WSUITE_CUSTOM_CSS

A list of custom css files added to admin pages and to the client. Mandatory is set G3WSUITE_CUSTOM_STATIC_URL. I.e.:

G3WSUITE_CUSTOM_CSS = [
    G3WSUITE_CUSTOM_STATIC_URL +'css/custom.css'
]

Client layout settings

G3W_CLIENT_SEARCH_TITLE

Custom webgis client search section title.

G3W_CLIENT_SEARCH_ENDPOINT

Search url endpoint for ‘searches calling’, default ows.
  • ows: by wms search;

  • api: by g3w-suite layer vector API.

G3W_CLIENT_LEGEND

A dict to customize QGIS-server legend image generate with WMS GetLegendGraphics request. I.e.:

G3W_CLIENT_LEGEND = {
   'color': 'red',
   'fontsize': 8,
   'transparent': True,
   'boxspace': 4,
   'layerspace': 4,
   'layertitle': True,
   'layertitlespace': 4,
   'symbolspace': None,
   'iconlabelspace': 2,
   'symbolwidth': 8,
   'symbolheight': 4
}

G3W_CLIENT_RIGHT_PANEL

Custom properties settings for webgis right panel section (default, width 33%). A the moment only width is managed. I.e.:

G3W_CLIENT_RIGHT_PANEL = {
    'width': 33
}

G3W_CLIENT_NOT_SHOW_EMPTY_VECTORLAYER

Default is False. Set to True for remove from webgis TOC vector layer empty, without data.

Editing settings

Settings params for editing module.

EDITING_SHOW_ACTIVE_BUTTON

Default is True. Set to False for not show editing button activate/deactivate into layers project list.

EDITING_ANONYMOUS

Default is False. Set to True to render possible give to anonymous user editing permissions.

EDITING_LOGGING

Default is False. Set to True to log users editing action into database.

Caching settings

Settings params for caching module

TILESTACHE_CACHE_NAME

A name to identify caching

TILESTACHE_CACHE_TYPE

Default is Disk to save tile on a disk. Set to Memcache for to use Memcached caching framework (https://www.memcached.org/)

TILESTACHE_CACHE_DISK_PATH

Path to disk space where to save tile created by tilestache if TILESTAHCE_CACHE_TYEPE is se to Disk.

TILESTACHE_CACHE_TOKEN

Mandatory, strign to use as token for internal WMS call for caching module.

Filemanger settings

Settings params for filemanager module.

FILEMANAGER_ROOT_PATH

Mandatory, path to disk space where to CRUD geo data files i.e. Shp Raster, etc.

FILEMANAGER_MAX_UPLOAD_N_FILES

Default is 5, max number files to upload simultaneously.

Qplotly settings

LOAD_QPLOTLY_FROM_PROJECT

Default is False, set to True to import DataPlotly settings from QGIS project.

Openrouteservice settings

ORS_API_ENDPOINT

Default is http://localhost:8080/ors/v2/, this is the endpoint for Openrouteservice API.

ORS_API_KEY

Openrouteservice API key, optional, can be blank if the key is not required by the endpoint.

ORS_PROFILES

List of available Openrouteservice profiles, default: ("driving-car", "driving-hgv")

Introduction

G3W-SUITE is a modular client-server application for the management and publication of interactive map projects.

The framework was born from the need to have a software capable of publishing, in total autonomy and in a simple and fast way on a webgis client, cartographic projects realized with QGIS.

The following aspects will be analyzed within the manual:

  • organization and optimization of data and QGIS projects for web publishing

  • organization of cartographic contents in a hierarchical way: macro groups and cartographic groups

  • user management and access control systems for consultation and management of webgis services

  • management of the online editing function for the creation of web cartographic management systems

  • publishing and managing QGIS projects as WebGis services

  • creation of searches, visualization of graphics created with the DataPlotly plugin and definition of constraints (geographic and alphanumeric) on visualization and editing permissions

The current release (3.3) is compatible with QGIS 3.16.x LTR (Server and Desktop).

NB: The filter function (based on features selection) at the print level is supported only with QGIS 3.18

_images/demo_qgis_project.png

_images/demo_webgis_project.png

Version

At the moment it’s not used a classic versioning system for the suite, this branches are avialable.

Branch Python version Django version QGIS QGIS API Status
dev 3.6 2.2 3.16 (3.18) Used Continuous development
v3.3 3.6 2.2 3.16 (3.18) Used Bug fixing
v3.2 3.6 2.2 3.16 (3.18) Used Bug fixing
v3.1 3.6 2.2 3.10 Used Bug fixing
v3.0 3.6 2.2 3.10 Used Not longer supported
dj22-py3 3.6 2.2 3.10 Not used Not longer supported
py2 2.7 1.11 3.10 Not used Not longer supported

Main contributors

Technological infrastructure

The publishing system is based on a series of OS tools and software

  • PostgreSQL/PostGis: for the management of application data

  • PostgreSQL/PostGis or SpatiaLite: for the management of gegraphic data

  • QGIS Server LTR as OGC services server

  • G3W-ADMIN - the Administration component: developed in Python using Django

  • G3W-CLIENT - the Cartographic client: based on OpenLayer3 and developed with reactive tecnology by Vue.js

  • The main libraries used for the management and the visualization of the geographical part and the interaction with the user are: OpenLayer, Boostrap, jQuery, Lodash and Vue.js.

  • Gulp.js as task runner

_images/architecture.png

Below is a diagram relating to the standard workflow

_images/architecture_workflow.png

Management and organization of geographic data and QGIS projects

This section describes how to organize QGIS data and projects locally and how to synchronize them on the server environment for publication purposes

Thanks to the integration with the APIs of QGIS it is now possible to manage the main formats (geographically and not) supported by QGIS Server:

  • reading and editing mode

    • PostGreSQL/PostGis

    • Oracle Spatial (compiling QGIS Server)

    • SQLite/SpatiaLite

    • GeoPackage

    • ShapeFile

  • reading mode

    • SQL Server

    • Virtual layer

The suite also allows you to manage in consultation ed editing:

  • simple join data

  • 1:N relation data

Data on DB Server

If your geographical data are stored on Server DB, it will be sufficient to allow access to the DB from the IP address on which the application is installed.

Data on SpatiaLite or OGR format

If your geographical data are stored on SpatiaLite or on physical files (.gpkg, .shp, .kml, .tif…) located on your local PC, you will need:

  • organize data and projects in predefined localy directories and subdirectories

  • upload/synchronize geographic data to the corresponding folder located on the server where the application is installed

Of course, mixed solutions with geographical data on PostGreSQL/PostGis, SpatiaLite and other formats will also be possible.

Organization of data and projects

Data on physical files and / or on GeoDB SpatiaLite and QGIS cartographic projects must be organized in compliance with the following indications:

  • a main directory named and positioned in according to need’s user

    • a project_data sub-directory that must contain the geographic data used for the various cartographic projects, such data can also be organized in subdirectories with no nesting limits.

    • a projects sub-directory that must contain the QGIS cartographic projects (.qgz or .qgs files)

_images/datamanagement.png

NB: The name of the local directory dedicated to geographic data must correspond to the name defined for the DATASOURCE_PATH variable set during installation. See dedicated paragraph.

That directory is also used to contain images used in the print layouts associated with the QGIS cartographic projects.

Geographic data synchronization on the server

The data stored in the local project_data directory must be synchronized on the server where the G3W-SUITE application is installed.

The geographic data stored in the local project_data folder must be loaded, reflecting any subdirectory structure.

To synchronize your data access to the Administration panel of G3W-ADMIN and click on the Configurations icon _images/iconconfiguration.png located in the upper right corner.

Choose the File Manager item in the linked menu.

_images/g3wclient_icon_config.png

_images/g3wsuite_administration_configuration_menu.png

Using this tool it is possible to manage the physical geographic data on the server in a simple and intuitive way.

The root directory of the File Manager corresponds to the local project_data directory

It will therefore be necessary, in the case of using geographic files on the file system, to synchronize the contents of the local project_data directory (and any sub-directories) before proceeding with the publication of QGIS projects.

Two specific directories can also be created within the root directory of the File Manager:

  • media_user: a directory exposed on the web, to store your multimedia files

  • svg: a directory to store extra SVG icons used your QGIS projects

All the directories can be organized in subdirectories with no nesting limits.

NB: The names of these directories are defined by the basic settings set during the installation of the suite. See dedicated paragraph.

_images/g3wsuite_administration_file_manager.png

The example shows the case in which in the local project_data directory there are two directories (geopackage and spatialite) in addition to the two system directories (svg and media_user).

Hierarchical organization of WebGis services and types of Users (roles)

This paragraph allows you to understand how G3W-SUITE makes it possible to manage the individual WebGis services in a structured and hierarchical way.

In G3W-SUITE it is possible to organize WebGis services on two thematic/functional levels

  • Cartographic MacroGroups

    • Cartographic groups

These organizational levels can be associated with different types of users (Editor 1, Editor2 and Viewer) in order to manage the access/management powers to the individual elements in a granular way.

The following image shows an example of the functional use of these organizational levels within a Union of Municipalities.

Access policies and individual functional modules may be associated with each WebGis service.

_images/g3wsuite_administration_organization_containers_simple.png

Types of Users (Roles)

In G3W-SUITE you can create Users and Users Groups and associate them with specific roles:

  • Admin1: user with full powers including Django administration (basic suite configuration)

  • Admin2: user with full powers excluding those of Django administration (basic configuration of the suite)

  • Editor1: administrator of one or more Cartographic MacroGroups for which it will be possible:

    • create users and/or user groups

    • create Cartographic Groups and, if necessary, assign them to an Editor 2 user

    • publish WebGis services and define their access policy

    • activate and configure some functional modules

  • Editor2: administrator of one or more Cartographic Groups for which it will be possible:

    • publish/update WebGis services and define their access policy

    • activate and configure some functional modules

  • Viewer: user with access permission in consultation on WebGis services characterized by authentication. This user can also use individual functional Modules if the relative permissions have been attributed to him

  • Anonymus User: user to be associated with WebGis services and/or functional modules with free access

Hierarchical organization of contents

The following paragraph is dedicated to better understanding the relationships between the different types of users and the different elements of the suite (MacroGroups, Map Groups, WebGis services …).

In G3W-SUITE it is possible to manage Webgis services in a more or less structured way

  • an organizational level (Cartographic Groups):

  • two organizational levels (MacroGroups and Cartographic Groups)

These hierarchical levels can be used for organizational purposes (thematic containers) and/or functional (containers managed by different users/roles).

It is in fact possible to associate the two types of containers (MacroGroups and Cartographic Groups) to users with different roles/powers (Editor1 and Editor2) who will thus become the Administrators of all their contents.

In particular Editor1 users will also be able to create/manage users who can be associated with the Cartographic Groups and WebGis services present in the reference MacroGroup.

The cases relating to one or two organizational levels will be better described below.

One organization level (absence of MacroGroups)

In case it is not need use MacroGruppi, the Admin user will be the only administrator of the suite and can therefore:

  • create users (individuals and/or groups) of various types

  • create Cartographic Groups

  • publish WebGis services within the individual Cartographic Groups

  • activate some specific modules on individual WebGis services

When creating a cartographic group, the Admin user can define:

  • the eventual user (individual/group) Editor 2 to associate the Group with

  • Viewers users (individuals/groups) who will have access to this container

_images/g3wsuite_administration_organization_containers_no_mg.png

In the event that the Cartographic Group is assigned to Editor 2 (single or group users), they will may autonomously publish/update WebGis services inside in this container.

Editor 2 users will also be able to define the access policies to the published WebGis services, limited to the Viewers users associated with the Cartographic Group by the Admin user.

Even the Admin user can publish WebGis services within a Cartographic Group and, if necessary, associate them with a user (single and/or group) of Editor 2 type.

Two organization levels (presence of MacroGroups)

Macrogroups can be created only by Admin users.

Each Macrogroup can be associated with only one Editor1 user.

Each MacroGroup can be considered as a watertight compartment within which the associated Editor 1 user (administrator of the MacroGroup), will be able to create users and user groups that will be made available to define access permissions for content (Groups Maps, WebGis services, functional modules …) of the reference MacroGroup only.

In this way it will be possible to create totally independent entities, the MacroGroups, which will be managed exclusively by the user Editor 1 associated with them.

Clearly the Admin users (1 and 2) will continue to have full powers on all groups present in the system.

_images/g3wsuite_administration_organization_containers.png

As previously specified, Editor 1 user will be able to:

  • create users (single and/or groups) of type Editor2 and Viewer

  • create Cartographic Groups within its Macro Group

  • publish WebGis services within his Cartographic Groups

  • activate specific modules on individual WebGis services

When Editor 1 user creates a Cartographic Group, he can define:

  • the eventual Editor2 user (individual/group) to associate with this Group

  • Viewers users (individuals/groups) who will have access to this container

Summary table of access/administration policies

Below is a summary table of the powers associated with the different roles.

_images/roles_table.png

QGIS: project settings

This section describes how to optimize your QGIS projects to publish as a WebGis service.

Thanks to the integration with QGIS Server, all the symbology aspects associated with the singoly layers are automatically reproduced on the WebGis service

In the QGIS cartographic projects you can set some parameters and options that affect functionalities and contents in the derivative WebGis service, such as:

  • the webgis service identification name

  • the associated basic metadata

  • the capabilities of the service

  • the possibility to exclude some associated print layouts on the WebGis service

  • which layers are queryable and searchable

  • which layers to expose with the different OGC services (WMTS, WFS, WCS)

  • which fields (for each vector data) are exposed as WMS and/or WFS

  • the Themes (Views) defined at the project level

  • the structure of the query form visible on the WebGis service

  • the editing widget, constraints** and default values dor every fields of vector layers

  • the associated print layouts, report included

The following paragraphs describe which QGIS project settings are more relevant in relation to the published WebGis service.

Project property

From the Project Properties menu, you can access the Project Properties window and the three submenus of our interest:

  • General

  • Data sources

  • QGIS server

General

General Settings

In this section it is possible to define the title of the project, consequently the title of the WebGis service.

This title will be used at the G3W-SUITE application level to uniquely identify the published project; for this reason it will not be possible to assign the same name to different projects published on the WebGis service.

We advise against using special characters, or numbers in the project name.

_images/projecttitle.png

Data sources

The option Automatically create transaction group where possible is automatically inherited in the online editing function.

Layers Capabilities

This submenu defines the querable and/or searchable layers at the WebGis service level.

  • Check the Identifiable column if you want that the layer will be searchable on the WebGis

  • Check the Searchable column if you want that the layer will be querable on the WebGis

NB: this differentiation is only possible by using the QGIS APIs such as Search URL endpoint. See dedicated paragraph

_images/datasources.png

QGIS Server

Service capabilities

In this section it is possible to define the capabilities of the service.

This information, together with info about the structure of the attribute tables of the layers present in the project, will be displayed in the Metadata session of the cartographic client.

See also dedicated paragraph

_images/qgisservercapabilities.png

Capabilities WMS - Advertised extent

In this section it is possible to define the geographical extension displayed when the WebGis service starts.

To define it, set the desired geographical view on the map and then click on the ‘Use Current Canvas Extent’ button.

_images/qgisserversetmapexpetent.png

WMS Capabilities - CSR restrictions

In this section it is possible to define the projection systems for which the project is available in relation to OGC services.

It is clearly necessary to insert the projection system on which the project was made, this SR is added by clicking on the ‘Used’ button.

Other geographic reference systems can be implemented by clicking on the ‘+’ button and choosing from the list of reference systems.

_images/qgisserversrisrestriction.png

Capabilities WMS - Exclude layouts

In this section it is possible to exclude some of the print layouts that are associated with the cartographic project from the availability of the WebGis service.

_images/qgisserverexludecompositions.png

Capabilities WMS - General aspects

Two further aspects are manageable with regard to WMS capabilities

  • in general it is recommended to check use the layer ids as names option

  • the option Add geometry to feature response must be checked to activate the zoom to the features on the WebGis service

_images/qgisservergeneralaspects.png

WMTS Capabilities

In this section it is possible to define which layers are exposed as WMTS services defining the various options

WFS Capabilities

In this section it is possible to define which layers are exposed as WFS services.

The WFS service is needed if you want activate following types of query:

  • bbox query

  • bypolygon query

It is sufficient to check only the Published column

_images/qgisservergeneralaspectswfs.png

WCS Capabilities

In this section it is possible to define which rasters are exposed as WCS services

General aspects

Themes (Views)

The creation of Themes (combination of off / on layers and differentiated simbology styles) is managed at the WebGis service level.

A specific menu on the webgis will allow you to choose the Theme to be displayed.

Layer order

The option to define the layer order different from the order in the TOC on the QGIS project is automatically supported.

Legend

The activation of the Filter legend by Map content option on the QGIS project is automatically applied to the derived WebGis service.

Groups of layers

The activation on the QGIS project of the Mutually exclusive group option for the layers groups is automatically applied to the derived WebGis service.

Layers properties

Simbology

The rendering style associated with the individual layers is replicated autonomously on the WebGis service.

If external SVG icons are used (added to the basic ones of QGIS, via the Settings -> Options -> System -> SVG paths), these must be uploaded to the server (through the File Manager tool) in order to be used by QGIS Server.

Layer style

The suite manages the presence of multiple styles associated with a layer.

It will be possible to dynamically choose the style on the cartographic client.

It will be possible to manage the styles associated with a layer from the Administration component, also by loading .qml file styles and setting the default style among those present.

Manage custom SVG icons

In the installation procedure of the G3W-SUITE application, an svg named directory is created on the server.

Within this directory it is therefore possible to store SVG icons, also organized in subdirecory.

The Configurations icon _images/iconconfiguration.png, located in the upper right corner of the Administration Panel, allows you to access a menu that includes the File Manager item.

_images/g3wclient_icon_config.png

_images/g3wsuite_administration_configuration_menu.png

Through this tool it is possible to manage SVG icons on the server in a simple and intuitive way.

_images/g3wsuite_administration_file_manager.png

The SVG folder on the server must reflect the structure in any subfolders present locally.

NB: The name of this directory is defined by the basic settings set during the installation of the suite. See dedicated paragraph.

PS: remember that the File Manager tool also allows you to manage the synchronization of geographical data (in the case of using physical files) and the management of multimedia files.

See also dedicated paragraph

Definition of the fields that can be consulted for each layer

Within the QGIS project it is also possible to define, for each layer, which fields are available following query on the WebGis service.

To define these settings, you access the properties of one of the vectors previously defined as searchable and choose the Source Fields submenu in the Layer Properties window.

This submenu lists the fields associated to the table of the vector.

The check box relating to the WMS column defines whether or not the values contained in this field will be available following the query on the WebGis service.

_images/qgislayerproperties_wmsfields.png

Viewing multimedia content

Multimedia contents (images, pdf, web URL …) can be viewed interactively on the map client following publication of the QGIS project.

In the case of web links, simply insert them (preceded by the prefix http:// or https://) within the dedicated attribute fields

In the case of multimedia files it is necessary:

  • upload the media file to the media_user folder (folder exposed on the web) accessible through the File Manager tool in the Suite Administration Panel

  • insert the web link to this file in the dedicated attribute field

The link to the file can be obtained in the following way:

  • application domain + media_user + path of the file + file name

Example:

  • application domain: https://dev.g3wsuite.it

  • file file_A.pdf located in the folder /media_user/form/

  • web link: https://dev.g3wsuite.it/media_user/form/file_A.pdf

Following queries at the cartographic client level, we will have different behaviors based on the type of content:

  • image: preview display in the form, click on the preview to display the image in real size

  • web link or other multimedia file: display of an Open orange button to allow consultation of the content

_images/qgis_form_attribute.png

Definition of the attribute display form

For each layer it is possible to define the structure of the attributes form associated with displaying the results following query operations.

On QGIS we can build a personalized form (query form) by creating thematic tabs and groups and defining the distribution of the individual fields and their aliases.

This structural organization will be replicated directly on the query form on the WebGis service.

_images/qgislayerproperties_displayform.png

Performances optimization

Mandatory rules

  • PostGreSQL/PostGis, SQLite/Spatialite and GeoPKG layers must have a primary key

  • not use numeric type field in PostGreSQL/PostGis layer

  • the primary key field and all fields involved in search, join, 1:n relation or editing function have to be published as WMS

  • don’t use commas for aliases associated with layers

  • style settings defined at the auxiliary data level are not supported

Tips

  • when using rule-based/categorized classification create indexes on the column(s) involved in the rule expression

  • start the project with only a few layers turned on by default

  • do not exceed three nesting levels in the groups of layers defined in the TOC

G3W-FRONTEND: the front end portal

This section describes the different sections of the access portal and how to login to the Administration Panel

The login portal sessions

The G3W-SUITE application is accessible via any internet browser (FireFox and Chrome recommended) via the URL address defined during installation

If you have also installed the front-end portal from the GitHub repository, access to the application will be via the portal itself.

The home page will contain, in addition to a brief and customizable presentation of the service, also:

  • a menu at the top right side _images/g3wsuite_portal_menu_toprigth.png with the following items:

    • Change language

    • Go back to the home page

    • Login

  • a panel menu on the right with the following items:

    • Maps

    • Info

_images/g3wsuite_portal_frontend.png

Most of the information shown in the access portal can be defined from the Configurations -> Edit General Data session, accessible from the icon located in the upper right corner of the Administration Panel.

_images/g3wclient_icon_config.png

Info

The Info session can contains a small introduction and contact information for your company or public facility.

_images/g3wsuite_portal_aboutit.png

Maps

Within G3W-SUITE it is possible to organize webgis services in hierarchical containers (Cartographic Macrogroups and Cartographic Groups)

By accessing the Maps session, the Macrogroups (if present) will be displayed, access to the Macrogroup will allow you to view the associated Cartographic Groups and from these access the list of individual WebGis services.

The MacroGroups, Groups and WebGis services listed will be those defined as free access.

If you have a user for access, you can authenticate yourself through the Login session.

Following authentication, the Maps page will also show the MacroGroups, Groups and WebGis services with restricted access and on which the user has access permissions.

_images/g3wsuite_portal_macrogroups.png

_images/g3wsuite_portal_groups.png

Login

If you have a user with login credentials, you can authenticate yourself through this session by entering your user and password.

If you are an Administrator or Editor of 1 or 2 level, you can also access the Administration session.

Once logged in, you access the Admin session and from here, via the “Backend” button to the Administration panel

_images/g3wsuite_portal_login.png

G3W-ADMIN: the Administration panel

This section describes how to manage the various aspects and features of the Suite:

  • customization of the access portal

  • user creation and management (individuals and groups)

  • creation of MacroGroups and cartographic Groups and definition of access and management policies

  • publication of QGIS projects as WebGis services

  • updating and management of WebGis services (search tool and additional functions)

Description of the interface

The Administration Panel allows you to manage all aspects related to the publication of QGIS projects and configuration of related WebGis services

The main page of the Administration Panel shows:

  • a bar at the top:

    • Frontend: to return the landing page portal

    • Username: to edit your profile and log out

    • Language: to choose the interface language

    • A gear icon _images/iconconfiguration.png: to access a menu with:

      –> Edit general data: to set informations shown in the front-end portal

      –> Django Administration (only for Admin01 user): to configure Django advanced settings

      –> Files: to access the File Manager tool

  • a text menu on the left:

    • Dashboard: Administration dashboard

    • Cartographic Groups: to create/manage cartographic groups

    • Macro Cartographic Groups: to create/manage Cartographic MacroGroups

    • Users: to create/manage single users and/or user groups

    • List of active modules: to activate/manage the functional modules active in your installation

  • a dashboard in the center of the page

    • Dashboard: to access to list of Cartographic Groups

    • Module list: to access the respective settings

_images/g3wsuite_administration_desk.png

Front end portal customization

From the main page of the Administration Panel it is possible to customize the information shown on the Front End Portal.

Click on the Configurations icon _images/iconconfiguration.png located at the rigth bottom and choose the item Edit general data which will appear in the menu below.

_images/g3wsuite_administration_configuration.png

In the General suite data form you can define all the informations that will appear on the portal home page

  • Home data: info that will appear on the front end landing page

  • About data: info that will appear in the About it session

  • Group map data: info that will appear in the Maps session

  • Login data: info that will appear in the Login/Administration session

  • Social media data: links to the social channels that will appear in the About it it session

  • Map Client data: main title to be displayed in the cartographic client bar

Front End Home Data

Informations that will appear on the front end landing page

ATTENTION: contents marked with * are mandatory.

_images/g3wsuite_administration_configuration_homedata.png

_images/g3wsuite_administration_configuration_homedata_result.jpg

Front End About Data

Informations that will appear in the Info session

ATTENTION: contents marked with * are mandatory.

_images/g3wsuite_administration_configuration_aboutusdata.png

_images/g3wsuite_administration_configuration_aboutusdata_result.jpg

Frontend Groups Map Data

Information that will be displayed in the Maps session

ATTENTION: contents marked with * are mandatory.

_images/g3wsuite_administration_configuration_mapgroupsdata.png

_images/g3wsuite_administration_configuration_mapgroupsdata_result.jpg

Front End Login Data

Information that will be displayed in the Login/Administration session

ATTENTION: contents marked with * are mandatory.

_images/g3wsuite_administration_configuration_logindata.png

_images/g3wsuite_administration_configuration_logindata_result.jpg

Front End Social Data

Links to the social channels that will be displayed in the About it it session

ATTENTION: contents marked with * are mandatory.

_images/g3wsuite_administration_configuration_socialdata.png

_images/g3wsuite_administration_configuration_socialdata_result.jpg

Map client data

Main title to be displayed in the cartographic client bar

_images/g3wsuite_administration_configuration_mapclientdata.png

_images/g3wsuite_administration_configuration_mapclientdata_result.jpg

In the Credits subsection it is possible to define additional text for the publishing aspects.

After filling in the various form, click on the Save button to confirm your choices.

_images/buttom_save.png

Users and Users Groups management

In the left side menu there is the Users item with four sub-items:

  • Add user

  • Users list

  • Add groups users

  • Groups users list

Add user

Through this form it is possible to insert new users and define their characteristics.

  • Anagraphic: first name, last name and email address

  • Login: username and password

  • User backend

  • ACL/Roles

    • Superuser status (Admin1 and Admin2 users only)

    • Staff status: deep administration of the application (Admin1 users only)

    • Main roles (Editor1, Editor2 or Viewer)

    • User Editor groups: any Editor2 user group they belong to

    • User Viewer groups: any Viewer user group they belong to

  • User data:

    • Departments and image to be associated with the profile

_images/g3wsuite_administration_user_add.png

After filling in the various form, click on the Save button to confirm your choices.

_images/buttom_save.png

Users list

Through this form you can consult the list of enabled users and their characteristics:

  • Username

  • Roles

  • User groups to which they belong

  • Associated Cartographic MacroGroups (only for Editor1 users)

  • Super user and/or Staff privileges

  • Email, name and surname

  • Creation date

  • Info on user creation (G3W-SUITE or LDAP)

_images/g3wsuite_administration_user_list.png

The icons at the head of each row, allow you to:

  • _images/icon_edit.png Modify: to modify the characteristics of the user

  • _images/icon_erase.png Delete: to permanently delete a user

Add Group Users

Through this form it is possible to insert new user groups and define their role.

It is possible to create only two types of user groups:

  • Editor: in which only Editor2 users can be inserted

  • Viewer: in which only Viewer users can be inserted

The association between user and user groups is made at the individual user management level.

In the specific form for creating user groups, the following info are defined:

  • Name

  • Role (Editor or Viewer)

_images/g3wsuite_administration_usergroup_add.png

After filling in the from, click on the Save button to confirm your choices.

_images/buttom_save.png

Groups users list

Through this form it is possible to consult the list of enabled user groups, their characteristics and the individual users belonging to the group.

_images/g3wsuite_administration_usergroup_list.png

Using the icons at the head of each row, you can:

  • _images/icon_view.png Show details: to consult the characteristics of the user group

  • _images/icon_edit.png Modify: to modify the characteristics of the group

  • _images/icon_erase.png Delete: to permanently delete a group and therefore association with users belonging to the group itself

Macro Cartographic Groups

In this section it is possible to view the list of Cartographic Macrogroups, manage them and create new ones.

ATTENTION: use the Cartographic MacroGroups only if you need them.

See chapter Hierarchical organization of WebGis services and types of Users to learn more about this aspect.

For example, you can create a Macrogroup to collect a series of Cartographic Groups belonging to the same Administration (single Municipality within a Union of Municipalities) or more simply to have main containers that contain second level groupings (Groups).

In the left side menu there is the MacroGroup Cartographic item with two sub-items:

  • Add MacroGroups: to create a new Cartographic MacroGroup

  • MacroGroups list: to access the list of MacroGroups present

Add MacroGroups

Through this item, available only for the Admin users, it will be possible to create a new Cartographic MacroGroup and associate it with an Editor1 type user who will become its administrator.

Let’s see in detail the various sub-sessions of the group creation form.

ACL users

Editor users: you define the Editor1 user who will become the MacroGroup administrator. This user will can manage the MacroGroup by creating Cartographic Groups, publishing projects and creating Users or User Groups.

General data
  • Identification name *: a generic internal identification name (not show in the front end)

  • Title *: descriptive title of the MacroGroup (will appear in the list of MacroGroups) and, eventually, in the client header

    • Use title for client option

    • Use logo image for client option

  • Description: the description to be associated with the MacroGroup in the frontend

  • Logo img*: the logo to be associated with the MacroGroup in the frontend and, eventually, in the client header

By default, the map client header, for each WebGis service, is composed of:

  • main title (if set at General Data management level)

  • logo and title associated with the Cartographic Group

  • title of the WebGis service

If you select the Use MacroGroup title and logo for the client options, the map client header, for each WebGis service, will instead consist of:

  • main title (if set at General Data management level)

  • logo and title associated with the Cartographic MacroGroup

  • title of the WebGis service

After compiling the form, click on the Save button to confirm your choices.

_images/buttom_save.png

MacroGroups list

The menu provides access to the list of cartographic macro-groups present.

_images/g3wsuite_administration_macrogroup_list.png

There are a series of icons to access specific functions:

  • _images/icon_view.png Show the details of the MacroGroup

  • _images/icon_edit.png Change characteristics of the MacroGroup

  • _images/icon_erase.png Delete MacroGroup

ATTENTION: the removal of the Cartographic MacroGroup group will result in:

  • the removal of all the Cartoghraphic Groups contained in it

  • the removal of all the cartographic projects contained in the individual Groups

  • the removal of all the widgets (eg searches) that would remain orphaned after the removal of the cartographic projects contained in the group. See the Widget chapter for more information.

Define the MacroGroups order on the FrontEnd

Through the Drag & Drop function it is possible to define the order of the MacroGroups in the list. This order will be reflected in the FronEnd.

Cartographic Groups

In this section it is possible to view the list of Cartographic Groups present, manage them and create new ones.

A Cartographic Group is create to collect a series of cartographic projects belonging, for example, to the same theme (Urban Planning Regulations, tourist maps …) and characterized by the same projection system.

It should be remembered that it will be possible to switch from one webgis service to another, leaving the same geographical extension and scale, only between the projects contained in the same cartographic group.

In the left side menu there is the Cartographic Groups item with two sub-items:

  • Add Group: to create a new Cartographic Group

  • Group List: to access the list of groups present

You can also access the list of groups by clicking on the “Show” button in the Cartographic Groups box on the Dashboard.

Add Group

Through this item it is possible to create a new Cartographic Group.

During creation, some functional characteristics and tools that the WebGis interface will show for all cartographic projects published within the group are also defined.

Let’s see in detail the various sub-sessions of the group creation form.

General data
  • Name *: a generic internal identification name (not show in the front end)

  • Title*: descriptive title of the Group (will appear in the list of Cartographic Groups)

  • Description: description of the content

  • Language*: interface language

Logo/Picture
  • Header logo img*: the logo to be displayed in the header del client cartografico

  • Use logo image for client option

  • Logo link: a eventual link to associate with the logo

REMEBER

By default, the map client header, for each WebGis service, is composed of:

  • main title (if set at General Data management level)

  • logo and title associated with the Cartographic Group

  • title of the WebGis service

If you select the Use MacroGroup title and logo for the client options, the map client header, for each WebGis service, will instead consist of:

  • main title (if set at General Data management level)

  • logo and title associated with the Cartographic MacroGroup

  • title of the WebGis service

If you select the Use Group logo for the client options, the map client header, for each WebGis service, will instead consist of:

  • main title (if set at General Data management level)

  • title associated with the Cartographic MacroGroup

  • logo associated with the Cartographic Group (if MacroGroup logo option is active this options takes precendence)

  • title of the WebGis service

ACL Users

Access and modification powers are managed.

The options present will vary according to the type of user (Admin or Editor1) who creates/manages the Group

  • Editor1 User: defines the user (Editor1) manager of the Group. The entry is present only when the Admin type user creates the Group If the Group is created by a user of type Editor1, the Group is associated directly with that user

  • Editor2 User: defines the user (Editor2) manager of the Group.

  • Viewers users: define the individual users (Viewers) who have the credentials to view the contents of the group. By choosing the anonymous user (AnonymusUser) the group will be free to access

  • Editor user groups: define the user groups (Editor2) who manage the Group.

  • Viewer user groups: you define the user groups (Viewer) which have the credentials to view the contents of the group.

The option Propagate viewers user (single and groups) permissions allows you to propagate the Viewer users (individuals and/or groups) associated to the Group to ALL the WebGis services present in it.

This option cancels any differentiation in the access policies applied to the WebGis services contained in the Group.

_images/g3wsuite_administration_group_add_acl.png

MacroGroups

Possible definition of the belonging MacroGroup.

This option is available only if Cartographic macro groups have been created

In the event that the Group is created by an Editor1 type user, the Group will be automatically associated with the MacroGroup associated with the same Editor1.

GEO data

Projection system associated with the group.

N.B. All projects loaded into the group must be associated with this SRID.

Base layers and Map interaction tools

In this box you can define:

  • Mapcontrols*: list of tools available on the WebGis client:

    • zoomtoextent: zoom to the initial extension

    • zoom: zoom in and zoom out

    • zoombox: zoom tool based on drawing a rectangle

    • query: puntual query of geographical layers

    • querybbox: query via bounding box (N.B. it is necessary that the layers are published as WFS services on the QGIS project)

    • querybypolygon: it will be possible to automatically query the features of one or more layers that fall inside a polygonal element of a guide layer. (Eg what’s inside a cadastral parcel?). - N.B. it is necessary that the all the layers involved in this kind of query are published as WFS services on the QGIS project

    • overview: presence of a panoramic map

    • scaleline: presence of the scale bar

    • scale: tool for defining the display scale

    • mouseposition: display of mouse position coordinates

    • geolocation: geolocation tool (available only with https certificate)

    • nominatin: address search tools and toponyms based on OSM

    • streetview: Google StreetView on your map (available only with GoogleMaps API Key)

    • length: linear measuring instrument

    • area: surface measuring instrument

    • addlayers: tool for temporarily uploading GML, GeoJson, KML, GPX, SHP (zipped) and CSV with coordinate to WebGis. These layers will remain until the end of the work session

    • screenshot:* tool to take a screenshot of the map area

    • GeoScreenshot:* tool to create a GeoTIFF of the map area

  • Baselayer: choice of the base maps that will be available on the WebGis client

  • Background color: choice of the background color of the maps (default white)

*NB: the security protocols prevent the creation of screenshots if WMS services with domains other than the publication one are present on the map. In this case the icons will not be present on the client even if the MapControl is selected. To avoid this, set the WMS as external WMS in the Widget managment session.

_images/g3wsuite_administration_group_add_geodata.png

With regard to the Base Layers, it is specified that the external services available by default are:

  • OSM

  • Bing Street

  • Bing Aerial

It is possible to create/add customized Base Layers starting from the cache of the single layers present in published webgis

See Caching layer paragraph in the Widget management session.

Copyrigth

Terms of use: description of the terms of use of the map and any other info Link to terms: link to text

After filling in the various form, click on the Save button to confirm your choices.

_images/buttom_save.png

Groups List

From this item you can access the list of the created cartographic groups.

For each group, the Title and Subtitle defined at the time of creation are shown.

There are also a series of icons to access specific functions:

  • _images/icon_add.png Add a new project to be published on the WebGis service

  • Number and links to projects published within the Group

  • _images/icon_view.png Show group details

  • _images/icon_edit.png Change group characteristics

  • _images/icon_erase.png Delete group

ATTENTION: the removal of the cartographic group will involve:

  • the removal of all the WebGis services contained therein

  • the removal of all widgets (eg searches) that would be orphaned after the removal of the WebGis services contained in the group. See the Widget chapter for more information.

A large + icon is available to access the form for creating a new group.

_images/g3wsuite_administration_group_list.png

Define the Groups order on the FrontEnd

Using the Drag & Drop function it is possible to define the order of the Groups in the list.

This order will be reflected within the belonging MacroGroups.

NB: currently in the list of Groups it is not present in the subdivision in the belonging MacroGroups but the fact that a Group can be associated with only one MacroGroup still allows you to manage intuitively what will be the complessive display order.

Publication of new WebGis services

To publish a new QGIS cartographic project

It is possible to publish new QGIS projects:

  • from the list of cartographic groups: click on the icon _images/icon_add.png located under the box of the cartographic group in which you want to publish the project.

  • from the list of cartographic projects published within a group: by clicking on the the buttom _images/button_add_qgis_project.png

In the dedicated form we could define the charatteristicsof the project being published:

QGIS project

QGIS file*: load the QGIS cartographic project to be published (.qgz or .qgs file)

ACL Users

Management of access and/or modification permissions

The options present will vary according to the type of user (Admin, Editor1 or Editor2) who creates / manages the WebGis service.

  • Editor1 user: defines the user (Editor1) manager of the WebGis service.

The entry is present only when the WebGis service is created by Admin or Editor1 user.

In the event that the WebGis service is published by a user of type Editor1, the WebGis service is associated directly with that user

  • Editor2 User: defines the user (Editor2) manager of the WebGis service.

    The item is present only when the user of the Admin or Editor1 type creates the service WebGis. In the event that the WebGis service is published by a user of type Editor2, the WebGis service is associated directly with that user

  • Viewers users: define the individual users (Viewers) who have the credentials to view the WebGis service. By choosing the anonymous user (AnonymusUser) the group will be freely accessible.

  • Editor user groups: define the user groups (Editor2) who manage the service.

  • Viewer user groups: you define the user groups (Viewer) which have the credentials to view the content of the service.

_images/g3wsuite_administration_project_add_acl.png

Default base layer

In this session you define which base layer should be active at startup.

The choice is limited to the list of base layers activated for the cartographic group in which you work.

It is also possible not to define any active base layer at startup.

Description data
  • Public title: title of the WebGis service, it will appear at the font end level and in the header of the client.

  • Description: Description of the project, it will appear at the public portal level.

  • Thumbnail (Logo): logo to associate with the project. This image will be viewable in the list of projects within the cartographic group

  • URL alias: a human readable URL for the map. Only alphanumeric characters, not white space or special characters.

The title associated with the WebGis service follows this definition logic:

  • Public title: if set

  • QGIS project title: if set on the General session of QGIS project properties

  • Name of the QGIS project file

Options and actions
  • User QGIS project map start extent as webgis init extent: check this control if you want set initial extent from QGSI project initial extent

Otherwise the initial extension will correspond to the maximum one defined on the basis of the extension associated with the WMS capabilities of the QGIS project (Project properties -> QGIS Server -> WMS capabilities (Advertised extent))

  • Tab's TOC active as default: set tab’s TOC (Layers, Base layers, Legend) open by default on startup of webgis service

  • Legend position rendering: this option allows to set legend rendering position:

    • In a separate TAB: default value, the legend is rendered into a separate tab

    • Into TOC layers: the legend is rendered inside layers toc

  • Automatic zoom to query result features: if in the results of a search there are only features of a layer, the webgis automatic zoom on their extension

The next options allow you to define the type of WMS / WFS query to be carried out and the maximum number of results obtainable following a query.

  • Max feature to get for query*: max number of feature to get for single or multiple mode

  • Query control mode*: single or multiple

  • Query by bbox control mode*: single or multiple

  • Query by polygon control mode*: single or multiple

ATTENTION: contents marked with * are mandatory.

_images/g3wsuite_administration_project_add_option.png

After filling in the various form, click on the Save button to confirm your choices.

_images/buttom_save.png

If the operation is successful we will see the new project appear in the list of projects in in the working Cartographic Group.

_images/g3wsuite_administration_project_addproject_result.png

_images/g3wsuite_portal_groups.png

Define the Groups order on the FrontEnd

The individual WebGis services will be arranged, within the Thematic Groups to which they belong, in alphabetical order based on the title of the service.

Update/ Manage WebGis services

To update a published WebGis service, access the list of projects in the Cartographic Group.

Click on the Edit _images/iconsmall_edit.png icon placed at the top of the WebGis service and reload the QGIS file with the changes made in the relevant form.

Click on the SAVE button to confirm the change.

Always starting from the list of WebGis services, it is possible to manage numerous functional aspects associated with them.

_images/g3wsuite_administration_project_manage.png

Basic tools

In this section it is therefore possible to view the list of cartographic projects present, view them, manage them and create new ones.

Through the single icons, placed at the level of each project, it is possible to:

  • _images/iconsmall_viewmap.png Display the cartographic project on the WebGis interface: to check the display by the user

  • _images/iconsmall_layerlist.png Access the list of layers present within the project and define their functional aspects

  • _images/iconsmall_view.png View the project specifications

  • _images/iconsmall_wms.png Test the WMS Capabilities of the project

  • _images/iconsmall_edit.png Update a project: update of the QGIS file and other options related to the project

  • _images/iconsmall_erase.png Remove a cartographic project Warning: removing a project also removes all the widgets (e.g. searches) that would be orphaned after the project has been removed

  • _images/iconsmall_download.png Download of the QGIS project

  • _images/iconsmall_ogc.png List of OGC services associated with the project

Setting up the overview map for WebGis services

In this session it is also possible to define which of the cartographic projects loaded within the group will be used as a panoramic map.

To set the panoramic map, choose the projects and tick the check box in the Overview column.

Widget management

Once a cartographic project has been published, thougth the icon _images/iconsmall_layerlist.png it is possible to access the list of the geographical states that compose it and define some functional aspects that will be enabled at the cartographic client level.

_images/g3wsuite_administration_project_layer_list.png

Next to each layer are a series of icons and checkboxes:

  • Label: layer alias applied at the QGIS project level

  • Name: name of the layer (file or DB table)

  • _images/icon_layertype.png Type: illustrates the type of data (WMS, PostGis, SpatiaLite, GDAL / OGR …)

  • WMS external: to speed up loading, the WMS layers present in a QGIS project are managed directly by Django and not by QGIS-Server. However, this method prevents the application of any styling (e.g. opacity level) defined at the project level. The choice of the external WMS option means that the WMS layer is managed directly by QGIS-Server and therefore the associated styling is applied.

  • WFS: a check mark shows whether the layer is published as a WFS service or not

  • Actions: a series of icons dedicated to various functions

    • _images/icon_cache.png Caching Layer: allows you to activate and manage the cache of the single layer at the project level

    • _images/icon_editing.png Editing layer: shows if the online editing function is active on the layer and allows you to activate and define it

    • _images/icon_dataplotly.png QPlotly widget: add or manage plots created with DataPlotly QGIS plugin

    • _images/icon_filter_layer.png Hide layer by user/groups: hide specific layers from the TOC based on specific users or groups of users

    • _images/icon_geoconstraints.png Geo-constraints by user/group: create or manage editing and visualization geo-constraints based on poligonal layers

    • _images/icon_alpha_constraints.png Alphanumeric and QGIS expressions constraints by user/groups: create or manage editing and visualization constraints based on SLQ language or QGIS expressions

    • _images/icon_widget.png Widgets list: shows how many widgets (eg searches) are associated with this layer and allows you to activate new ones

    • _images/icon_styles.png Manage layer styles: manage multi-style layer

  • Not show attributes table: hide attributes table of the layer for every users

  • No legend: it allows to define if the layer must have published the legend at TOC level of the WebGis client

  • Download: allows the download of the geographic and not geographic layers in various formats

    • Download as shp: for geographic (shp) or not geographic (dbf) layers

    • Download as GPK: for geographic or not geographic layers

    • Download as xls: for all types of layers, in .xls format

    • Download as csv: for all types of layers, in .csv format

    • Download as gpx: for geographic layers, in .gpx format

The number above each Action icon shows if and how many related objects are present.

The functions present in the Actions session are described below.

_images/icon_cache.png Caching layer (Base Map)

With this icon it is possible to activate/manage the cache of the single layers and create XYZ Tiles layer

The form allows you to:

  • enable cache on the layer

  • reset the cache of the single layer

  • reset the cache of all the layers of the project

  • create an XYZ Tiles layer (to use as a base layer for your projects) starting from the cached layer

In this last case you have to set:

  • Base layer title

  • Base layer description

  • Base layer attribution

The newly created base layer will be available to be associated with those available for the various Cartographic Groups.

_images/icon_editing.png Editing layer

Through this icon it is possible to activate the online editing function on the individual layers and define the permissions for individual / groups of users

See the dedicated paragraph in the Editing on line session.

_images/icon_dataplotly.png QPlotly widget

View plots created using QGIS DataPlotly (a great plugin developed by Matteo Ghetta) in the cartographic client.

The module, based on the Plotly library, manages plots saved as xml.

The plots are connected to the layers defined on the QGIS project, in this way, as for the searches and the constraints, it is possible to activate (checkink the Linked checkbox) the same plots on all WebGis services in which the reference layer is present.

It is also possible:

  • download the plot XML file to reuse it in QGIS

  • define the activation status of the plots when the WebGis service is started

_images/g3wsuite_administration_plots.png

The title of the chart, defined at the plugin level, will be the unique identifier.

At client level, it will be possible to filter plots based on the geometries visible on the map and/or selected by the user.

_images/g3wsuite_qgis_plots.png _images/g3wsuite_client_plots.png

Charts based on 1:N data relation (child layer)

If the chart is linked to a child layer in a 1:N relation, it can also be displayed at the information level of the individual parent features

_images/g3wclient_fomr_1N_plots.png

_images/icon_filter_layer.png Hide layer by user/groups

With this icon it will be possible to define the list of users (single and/or groups) who will be enabled to view this layer at the TOC and map level.

_images/g3wsuite_administration_hide_layer.png

_images/icon_geoconstraints.png _images/icon_alpha_constraints.png Display and editing constraints

Through the Geo-constraints by user/group and Alphanumeric and QGIS expressions constraints by user/groups widgets it is possible to define editing and display filters for users authorized to consult/edit the project.

See the dedicated paragraph in the Editing on line session.

_images/icon_widget.png Widget setting - Search tools

Using this icon it is possible to associate a series of widgets to the layer. The basic widget allows you to define search tools that will be available in the webgis.

Basic settings

In G3W-SUITE it is possible to create search widgets.

By default, searches can be built on individual vector layers based on the fields of the table associated with the layer.

NB: to create searches based on fields derived from simple joins (1: 1 / N: 1) or from 1: N relation, you have to change the setting of the method used (from WMS to QGIS API). See dedicated paragraph.**

Every search widget will be saved by referring to the layer identifiers (for example the DB parameters: IP, DB name, schema, layer name).

This aspect allows, once a search widget for a layer has been created, to have it available on all the projects in which the layer is present, without having to rebuild the widget from scratch each time.

In the list of layers present within the project, identify the layer on which to create and associate the search widget and click on the icon _images/icon_widget.png

_images/g3wsuite_administration_project_widget_list.png

By clicking on the icon, the list of already active (or activatable) widgets associated with the layer will be shown.

These widgets can be modified, deleted or disconnected using the appropriate icons.

ATTENTION: deleting a search will delete it from all projects in which that search is active.

To deactivate a search from a project, simply disconnect it using the check-box on the right.

To create a new search, click on the link New widget.

In the pop-up that appears, the Search type have to be chosen.

_images/g3wsuite_administration_project_widget_choose.png

In the related form we can define:

  • Form Title

    • Type: “Search”

    • Name: name that G3W-SUITE will use to internally register the search widget.

  • General configuration of research and results

    • Search title: title that will become available in the ‘Research’ panel of the WebGis interface

  • Search fields settings

    • Field: field on which to carry out the research

    • Widget: method of entering the value to be searched InputBox: manual compilation SelectBox: values ​​shown via drop-down menu AutoCompleteBox: values ​​shown through auto-complete mode

    • Alias: alias assigned to the field that will appear in the search form

    • Description: description assigned to the field

    • Comparison operator: comparison operator (=, <,>,> <,> =, <=, LIKE, ILIKE) through which the search query will be carried out.

    • Dependency: this parameter (optional) allows, only in the case of SelectBox widgets, to list the list of values ​​of a field filtered according to the value defined for the previous fields. The tool allows, for example, to display, in the drop-down menu dedicated to the choice of cadastral particles, only the particles connected to the sheet chosen in the previous option. This function is only available for PostGis or SpatiaLite layers.

Warning: in the case of fields with more than 100 unique values, the WMS service does not allow to obtain the complete list of values. In this case it is recommended not to use the SelectBox method

Alternatively, you can use the QGIS API as a search method to overcome this limitation. See dedicated paragraph.

The button _images/button_add.png allows you to add additional fields for the construction of the search query currently manageable through AND/OR operators.

The example below shows the compilation of the form for creating a search widget dedicated to a cadastral cartography layer.

_images/g3wsuite_administration_project_search_form.png

Once the form has been filled in, click on the OK button to save the settings.

Once the settings are saved, the created widget will appear in the list of Widgets associated with the layer.

The widget will already be connected and therefore available in the WebGis interface.

_images/demo_search_result.png

IMPORTANT: the created search widget will now be available (disconnected) for all projects in which the layer with which it has been associated will be present.

This will allow you not to have to recreate the widget several times and to decide in which projects to activate the search and in which not.

Search based on 1:N relation data

The option allows you to create a search based on the fields of a table (child in a 1:N relation) and obtain results relating to the parent layer of the relation.

N.B. to create searches based on fields derived from simple joins (1: 1 / N: 1) or from 1: N relation, you have to change the setting of the method used (from WMS to QGIS API). See dedicated paragraph.

The Relations option allows you to to define the relationship to be used (if present) to identify the parent layer whose results will be shown.

_images/g3wsuite_administration_project_search_1N.png

_images/icon_styles.png Manage layer styles

If multi styles have been associated with the same layer in the QGIS project, they will be exposed.

It will be possible to associate new layers by loading related QML files and set the style to be used as default.

_images/g3wsuite_administration_styles.png

Multilinguage

By default the suite manages four languages:

  • English

  • French

  • Italian

  • Finnish

  • Swedish

Other languages ​​can be added.

Map client

On the top bar you can choose, through a drop-down menu, the language of the entire client interface.

_images/language_client.png

Administration

Also for the Administration panel, through the same drop-down menu, it is possible to define the language of the entire interface of the console.

_images/language_admin.png

Front end

Fixed front end content is already available in the four basic languages.

Variable contents, i.e. user-definable contents, are instead translated:

  • Sessions Home, About, Maps and Login: content that can be defined and translated in the Edit General Data session of the Control Panel Administration

  • Sessions MacroGroups Cartogarfici, Groups Cartogarfici and WebGis Services: contents definable and translatable in the form defining these elements, limited to the items:

    • Public Title

    • Description

To carry out the translation of these contents, proceed as follows:

  • access to the form for creating the element (MacroGroup, Group or WebGis Service)

  • define one of the available languages from the drop-down menu at the top right

  • fill in the form in the chosen language

  • save the settings

_images/language_form.png

Then:

  • access the form again in modification

  • change the language

  • fill in the translatable content in the new language

  • save the new settings

Titles and Descriptions of the various elements in the defined languages ​​will be available on the front.

G3W-CLIENT: the cartographic client

Generic aspects

The application has a responsive interface consisting of expandable and reducible sessions.

The color of the interface depends on the type of user logged in.

_images/g3wclient_interface.png

The header contains the following elements:

  • Logo, title and subtitle, deriving from:

    • main title (set at General Data level) or MacroGroup name, according to the settings

    • Cartographic Group name

    • WebGis service title

  • Change map: which allows you to switch from one WebGis service to another (located within the same Cartographic Group) while maintaining extension and display scale

  • User ID: if you have logged in to the system

  • Credits

  • Home: to access the FrontEnd

  • Language: the choice of language is reflected in the individual menus of the map client and on the contents of the access portal. The languages available are those activated by the Administration.

_images/g3wclient_header.png

The Tools panel is located on the left and containing the following objects:

  • Metadata: content defined on QGIS project

  • Print: printing tool based on the layouts defined on the QGIS project

  • Search: with the search tools defined through the Administration panel

  • Tools: session that collects the various tools that may be activated on the WebGis service

  • Map: containing:

    • Layers: structured list of layers, defined on the QGIS project

    • Base: choice of the base map from those defined at the creation level of the Thematic Group

    • Legend: graphic legend of the various layers

_images/g3wclient_tool_panel.png

In the event that Themes (Views) are defined in the QGIS project, a specific choice menu will be available in the Layers session of the TOC.

The choice of a Theme will determine the automatic activation of the layers and related styles, defined in the Theme itself.

_images/g3wclient_theme.png

Tools panel

Metadata

The metadata reported in this session derive from those set at the QGIS project level.

This content is divided into three sessions: General, Space Info and Layers.

  • General: reports the metadata defined on the QGIS project in the item: Project   Properties (QGIS Server session, Service Capabilities) In case of login as anonymous user the URL of the WMS service is shown.

  • Spatial: reports the EPSG code of the projection system associated with the QGIS project and the BoundingBox relating to the initial publication extension, defined in the item: Project   Properties (QGIS Server session, WMS Capabilities, Advertised extent)

  • Layers: reports simple metadata associated with the individual layers.

_images/g3wclient_metadata_view.png

Charts

View graphs created using QGIS DataPlotly and activated at the admin session level.

Check the plots in the list and consult them on the rigth panel.

_images/g3wclient_plots.png

The graphs are filterable based on the:

  • _images/g3wclient_plots_map_filter.png features visible on the map

  • _images/g3wclient_plots_selection_filter.png filter based on the selected features

These filters are also reflected on the plots associated to the related data (in 1:N mode) based on the visible and/or selected parent features.

The filter based on the map content can be activated globally on all plots (icon at the top of the panel dedicated to charts) or on only some specific plots (icon placed at the level of the individual plots).

The plots will automatically update after pan and zoom operations on the map

If activated, the filter based on the selected features is automatically activated on all related plots (associated with the same layer and with the 1:N relationed tables)

Appropriate messages at the single plots level will indicate the activation of these filters.

Charts based on 1:N data relation (child layer)

If the chart is linked to a child layer in a 1:N relation, it can also be displayed at the information level of the individual parent features

_images/g3wclient_fomr_1N_plots.png

Print

Printing tool based on layouts defined on QGIS project.

The tool allows you to choose:

  • Template: print layout among those associated with the published QGIS project

  • Scale: print scale

  • DPI: print resolution

  • Rotation: rotation angle

  • Format: print to PDF or JPEG

On the map, a lit rectangular area will allow you to define the print area.

_images/g3wclient_print_tool.png

If an Atlas type print layout is associated in the QGIS project, the layout reference will be available. The cards to be printed are defined by referring to the atlas identifier defined in the print layout.

_images/g3wclient_print_tool_atlas.png

Search and Query Builder

A classic Query Builder is present at the Search menu level. Through this tool it is possible to:

  • carry out alphanumeric searches on geometric layers

  • save the query to reuse it until the end of the work session

  • edit a previously saved query

The saved query will be available until the browser cache is cleared

_images/g3wclient_querybuilder.png

The Search menu contains the list of search tools defined through the Administration panel and custom searches created with the Query Builder.

_images/g3wclient_searc_list.png

You choose the search you are interested in, fill in the required fields and click on the Search button.

The panel with the list of results will open on the right side of the client, for each result the first three fields of the associated table will be displayed.

By positioning on the individual results, the corresponding features will be highlighted on the map; clicking on the individual results you can consult all the attributes.

Zoom to features and download icons are available for results (single or cumulative)

_images/g3wclient_search_example.png

Map

This session has three tabs:

  • Layers: structured list of layers, defined on the QGIS project

  • Base: choice of the base map from those defined at the Cartographic Group creation level

  • Legend: graphic legend

Layers

In the list of layers, right click on the name of the single layer shows the following items:

  • Styles: to choose the style to be applied to the layer, in the case of multi-style layers

  • Name and kind of geometry of the layer

  • Zoom to layer: to zoom in on the extension of the layer

  • Open attribute table: to consult the associated attribute table

  • Download shapefile: to download the layer as a shapefile; function activable from the administration panel

  • Download GeoPackage: to download the layer as a GeoPackage; function activable from the administration panel

  • Download CSV: to download the layer as a CSV; function activable from the administration panel

  • Download XLS: to download the layer as a XLS; function activable from the administration panel

  • WMS URL: URL of the WMS service relative to the project or URL of the external WMS

_images/g3wclient_layer_function.png

It is possible to hide, automatically, layers from the TOC when they have no records.

Useful when using filters on layers or geographic views.

Attribute table

The attribute table (resizable) is equipped with paging function, highligth function and zooming to the associated features.

In the case of links to multimedia content, the previews of the images and/or the Open button will be displayed for consultation of different types of content.

The window is resizable.

_images/g3wclient_table_view.png

A generic filter, positioned at the top right, is applied generically to the contents of all the fields and it will allow you to filter the list of displayed records.

Filters based on the contents of the individual fields are available at the top of each column.

The Show features visible on the map icon _images/g3wclient_mapfilter_table.png allows you to filter the records of the table according to the features visible in the map.

From this version it is possible to select the features of the individual layers and apply filters that will affect:

  • on the map content

  • on the attribute table content

  • on the contents of the plots

  • on print contents (only with QGIS 3.18)

The selection of features can be made:

  • at the attribute table level (through the checkboxes on the left of each records)

  • on the results of a query (add / remove from current selection)

  • on the results of a query (add / remove from current selection)

At the same time, additional icons appear:

  • on the layer attribute table

  • to the right of the layer on the TOC

  • at the level of the relevant plots

Aggiungi immagine: g3wclient_selection.png The icons in the attribute table allow you to:

  • _images/g3wclient_selection_table_clear.png Clear selection

  • _images/g3wclient_selection_table_invert.png Invert selection

  • _images/g3wclient_selection_table_filter.png Add/Remove filter

The icons to the right of the layer on the TOC allow you to:

  • Clear selection

  • Add/Remove filter

_images/g3wclient_selection_icon_toc.png

When one or more features are selected, they appear highlighted in red on the map. Activation of the filter is reflected:

  • on the map content

  • on the attribute table content

  • on the data displayed by plots

  • on the print contents (only with QGIS 3.18)

Base layer

The list shows the active base layers at the cartographic group level.

If the user has created base layers starting from cached layers, these may also be present.

Legend

If at the publication level of the QGIS project, the Legend position option i setted as TOC, this panel will be not present and the legend will be rendered inside layers TOC.

If the option is activated on the QGIS project, the legend is filtered on the map content.

Editing on line

Activation and configuration

Thanks to the integration with the APIs of QGIS it is now possible to manage the main formats (geographically and not) supported by QGIS Server:

  • reading and editing mode

    • PostGreSQL/PostGis

    • SQLite/SpatiaLite

    • Oracle Spatial

    • GeoPackage (not recommended for multi-user editing)

    • ShapeFile

  • reading mode

    • SQL Server

    • Virtual layer

The suite 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, alpha and geo constraints).

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: this widget will be equipped with a pick layer tool at the cartographic client level

  • 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 field:

  • enable/disable editing

  • mandatory and/or unique constraints

  • range of acceptable values through the Range widget

  • default values

QGIS expressions and default values

All the QGIS expressions can be used as default values.

In this case, at the online edit level, the form relating to the field thus defined will be self-calculated and not editable by the user.

Very useful in all cases where we want the values of a field to be calculated automatically through the potential of QGIS expressions.

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.

_images/g3wsuite_administration_project_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

For each user (single or group) it is possible to discriminate the editing powers:

  • Add: add feature, copy feature, add part to multipart

  • Update geometry: update vertex feature, move feature, add part to multipart, delete part from multipart, split features, dissolve features

  • Update attributes: update feature attributes, update attributes of selected features

  • Delete: delete features

I 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

NB: In case a user belongs to a user group, the permissions set will be added together.

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 (SQL) / QGIS expressions constraints

  • geographic constraints

Both work in terms of visualization and/or editing

Alphanumeric (SQL) / QGIS expressions Constraints

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

This setting is also available for the AnonymousUser user

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.

In the form it is possible to specify whether this filter will act at the level:

  • display only

  • editing only

  • in both cases

_images/editing_alpha_constrain_layer_init.png

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.

In the dedicated panel it will be possible to check, modify and delete the defined rules.

_images/alpha_constrain_list.png

Geo-constraints

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

This setting is also available for the AnonymousUser user

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

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.

In the form it is possible to specify whether this filter will act at the level:

  • display only

  • editing only

  • in both cases

_images/geo_constrain_layer_init.png

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

Geographic and alphanumeric 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 attribute values associated with an existing feature

  • _images/icon_feature_multiattribute.png Update attributes for selected features: to modify the attribute values associated with more than one features

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

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

  • _images/icon_feature_remove.png Remove feature

  • _images/icon_feature_add_part.png Add part of a multi-geometry

  • _images/icon_feature_delete_part.png Delete part of a multi-geometry

  • _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.

Introduction

The tutorial is based on a QGIS project dedicated to the management of a layer representing a series of buildings located on the territory.

In addition to the geographical aspects, the project involves the management of numerous and diversified attributes and of the related maintenance interventions through a 1: n type relationship.

Through the tutorials it will be possible to:

  • customize the various graphic-functional aspects of the basic project

  • publish the project as a WebGis service

  • create personalized searches

  • add plots made with DataPlotly QGIS plugin

  • activate the editing functionality by customizing associated forms and widgets

_images/demo_qgis_project.png

_images/demo_webgis_project.png

Download demo data

The tutorial is based on predefined data and QGIS 3.16.x LTR project downloadable from this link.

The .zip file contains the G3W-SUITE directory with three sub directories:

  • projects: containing a QGIS project (buildings_management.qgz) already optimized for the tutorial

  • project_data/spatialite: containing a SpatiaLite DB with basic data (build_management.sqlite)

  • plots: containing a a series of plots created with the DataPlotly plugin and saved in xml format

_images/demo_zip_file.png

Inside the build_management.sqlite SpatiaLite DB there are the following layers:

  • buildings (polygon layer): reference layer for editing aspects

  • maintenance_works (alphanumeric table): with the maintenance interventions associated with the individual buildings

  • buildings_rating (alphanumeric table): with the annual assessments relating to individual buildings

  • work_areas (polygon layer): with the perimeter of work areas to be used to define any geo-constraints

IMPORTANT: a copy of this data are present on the server, you can not change your local data copy

The project (based on QGIS LTR 3.16.x) foresees:

  • a dressing categorized by the buildings layer based on the categorical field type

  • the presence of a 1: n relationship between the buildings layer and the alphanumeric maintenance_works and buildings_rating tables

  • pre-developed query forms for the buildings layer and the maintenance_works table

  • predefined editing widgets for the fields of the two main layers: buildings , maintenance_works and buildings_rating tables

  • two standard print layout in A4 and A3 and an two atlas print layout based on buildgs layer features

_images/demo_qgis_project.png

Modify the QGIS project title

The publication system provides for the use of the title of the project as the unique identifier of the WebGis service.

So, before publishing the project, it will be NECESSARY to change the title associated with the basic project (Project -> Properties ... - Session: General)

_images/qgisserver_change_title.png

Access the online service

To publish the project, you can access the G3W-SUITE test application via the following URL: https://v33.g3wsuite.it

To access the Administration Panel it is necessary to log in using the following credentials:

  • user: demo

  • password: G3wsuite!

In case of login fails, report the problem to info@gis3w.it

Publish the QGIS project as a WebGis service

After authentication it will be possible to access the Administration session and view the Dashboard.

In the Dashboard there will be the menu for access to the Cartographic Groups pertaining to your user and the menus relating to additional modules not active in this demo.

Click on the Show item in the ligth blue Groups box to acces at the list of available Cartographic Groups.

_images/demo_dashboard.png

Access the list of webgis in the Cartographic Group G3W-SUITE Demo clicking on the project number shown.

_images/demo_choose_group.png

_images/demo_project_manage.png

Now click on the button _images/button_add_qgis_project.png to publish your QGIS project.

Fill out the form defining the various aspects to be associated with the WebGis service being published:

QGIS project

QGIS file: load the QGIS cartographic project to be published (.qgz or .qgs file)

ACL Users

Management of access permissions

  • Viewers users: define the individual users (Viewers) who have the credentials to view the WebGis service. By choosing the anonymous user (AnonymusUser) the group will be freely accessible.

  • Viewer user groups: you define the user groups (Viewer) which have the credentials to view the content of the service.

Default base layer

In this session you define which base layer should be active at startup.

The choice is limited to the list of base layers activated for the cartographic group in which you work.

It is also possible not to define any active base layer at startup.

Description data

  • Public title: Title to be associated with the project and displayed on the client header. If left blank, the title associated with the QGIS project will be used or, in the absence of this, the name of the project file

  • Description: Description of the project, it will appear at the public portal level.

  • Thumbnail (Logo): logo to associate with the project. This image will be viewable in the list of projects within the cartographic group

  • URL alias: a human readable URL for the map

ATTENTION: contents marked with * are mandatory.

Options and actions

  • User QGIS project map start extent as webgis init extent : check this control if you want set initial extent from QGSI project initial extent

Otherwise the initial extension will correspond to the maximum one defined on the basis of the extension associated with the WMS capabilities of the QGIS project (Project properties -> QGIS Server -> WMS capabilities (Advertised extent))

The next options allow you to define the type of WMS / WFS query to be carried out and the maximum number of results obtainable following a query.

  • Max feature to get for query*: max number of feature to get for single or multiple mode

  • Query control mode*: single or multiple

  • Query by bbox control mode*: single or multiple

  • Query by polygon control mode*: single or multiple

_images/g3wsuite_administration_project_add_option.png

After filling in the various form, click on the Save button to confirm your choices.

_images/buttom_save.png

If the publication was successful, the QGIS project will appear in the list of projects in the Cartographic Group.

_images/iconsmall_viewmap.png Clicking on the View map icon will access the WebGis service in consultation.

_images/demo_webgis_project.png

Update the published WebGis service

If you want to modify some graphic-functional aspects of your WebGis service, modify your QGIS project and update the WebGis service by clicking on the Modify icon _images/iconsmall_edit.png.

Reupload the QGIS project with your changes, click on the Save button and see the resuts on the cartographic client.

Activation of additional functions

Once your project has been published, you can access the list of widgets and additional functions to enrich your WebGis service.

Widget management

Thougth the Layers list icon _images/iconsmall_layerlist.png it is possible to access the list of the geographical states that compose it and define some functional aspects that will be enabled at the cartographic client level.

_images/demo_project_manage.png

The new session will show you the list of the layer present in the published QGIS project

_images/g3wsuite_administration_project_layer_list.png

  • Label: layer alias applied at the QGIS project level

  • Name: name of the layer (file or DB table)

  • _images/icon_layertype.png Type: illustrates the type of data (WMS, PostGis, SpatiaLite, GDAL / OGR …)

  • WMS external: to speed up loading, the WMS layers present in a QGIS project are managed directly by Django and not by QGIS-Server. However, this method prevents the application of any styling (e.g. opacity level) defined at the project level. The choice of the external WMS option means that the WMS layer is managed directly by QGIS-Server and therefore the associated styling is applied.

  • WFS: a check mark shows whether the layer is published as a WFS service or not

  • Actions: a series of icons dedicated to various functions

    • _images/icon_cache.png Caching Layer: allows you to activate and manage the cache of the single layer at the project level

    • _images/icon_editing.png Editing layer: shows if the online editing function is active on the layer and allows you to activate and define it

    • _images/icon_geoconstraints.png Manage geo-contsraints: create or manage editing geo-constraints

    • _images/icon_dataplotly.png QPlotly widget: add or manage plots created with DataPlotly QGIS plugin

    • _images/icon_alpha_constraints.png Manage alphanumric constraints: create or manage editing and visualization alphanumeric-constraints

    • _images/icon_widget.png List of widgets: shows how many widgets (eg searches) are associated with this layer and allows you to activate new ones

  • No legend: it allows to define if the layer must have published the legend at TOC level of the WebGis client

  • Download: allows the download of the geographic and not geographic layers in various formats

    • Download as shp: for geographic (shp) or not geographic (dbf) layers

    • Download as GPK: for geographic or not geographic layers

    • Download as xls: for all types of layers, in .xls format

    • Download as csv: for all types of layers, in .csv format

    • Download as gpx: for geographic layers, in .gpx format

The number above each Action icon shows if and how many related objects are present.

Try to activate the available options and test the result on the WebGis

Search widget creation

To create a search tool available at WebGis level, choose the vector layer on which to apply the tool and click on the Widget list icon _images/icon_widget.png

NB: there may be a number of searches created by other users for the same layer.

You can activate them by clicking on the Linked chekbox.

_images/g3wsuite_administration_project_widget_list.png

The listed searches can be modified, deleted or unlinked using the appropriate icons.

To create a new search, click on the blue link New widget.

In the related form we can define:

  • Form Title

    • Type: “Search”

    • Name: name that G3W-SUITE will use to internally register the search widget.

  • General configuration of research and results

    • Search title: title that will become available in the ‘Research’ panel of the WebGis interface

  • Search fields settings

    • Field: field on which to carry out the research

    • Widget: method of entering the value to be searched InputBox: manual compilation SelectBox: values ​​shown via drop-down menu AutoCompleteBox: values ​​shown through auto-complete mode

    • Alias: alias assigned to the field that will appear in the search form

    • Description: description assigned to the field

    • Comparison operator: comparison operator (=, <,>,> <,> =, <=, LIKE, ILIKE) through which the search query will be carried out. The LIKE and ILIKE operators will only be available for PostGis or SpatiaLite layers

    • Dependency: this parameter (optional) allows, only in the case of SelectBox widgets, to list the list of values ​​of a field filtered according to the value defined for the previous fields. The tool allows, for example, to display, in the drop-down menu dedicated to the choice of cadastral particles, only the particles connected to the sheet chosen in the previous option. This function is only available for PostGis or SpatiaLite layers.

Warning: in the case of fields with more than 100 unique values, the WMS service does not allow to obtain the complete list of values. In this case it is recommended not to use the SelectBox method

The button allows you to add additional fields for the construction of the search query currently manageable through AND/OR operators.

_images/button_add.png

The example below shows the compilation of the form for creating a search widget dedicated to a cadastral cartography layer.

_images/g3wsuite_administration_project_search_form.png

Once the form has been filled in, click on the OK button to save the settings.

Once the settings are saved, the created widget will appear in the list of Widgets associated with the layer.

The widget will already be linked and therefore available in the WebGis interface on the left panel.

_images/demo_search_result.png

Plots widget

Add plots created using QGIS DataPlotly (a great plugin developed by Matteo Ghetta) in the cartographic client.

The module, based on the Plotly library, manages plots saved as xml.

The plots are connected to the layers defined on the QGIS project, in this way, as for the searches and the constraints, it is possible to activate the same plots on all WebGis services in which the reference layer is present.

For this reason, there may be some plots created by other users for the same layer. You can activate them by clicking on the Linked chekbox.

_images/g3wsuite_administration_plots.png

The title of the chart, defined at the plugin level, will be the unique identifier.

Try to create your plots in the QGIS project, save them as .xml and upload them to view the resluts on the webgis.

_images/g3wsuite_qgis_plots.png

_images/g3wsuite_client_plots.png

The graphs are filterable based on the:

  • _images/g3wclient_plots_map_filter.png features visible on the map

  • _images/g3wclient_plots_selection_filter.png filter based on the selected features

These filters are also reflected on the plots associated to the related data (in 1:N mode) based on the visible and/or selected parent features.

The filter based on the map content can be activated globally on all plots (icon at the top of the panel dedicated to charts) or on only some specific plots (icon placed at the level of the individual plots).

The plots will automatically update after pan and zoom operations on the map

If activated, the filter based on the selected features is automatically activated on all related plots (associated with the same layer and with the 1:N relationed tables)

Appropriate messages at the single plots level will indicate the activation of these filters.

If 1: N relationships are associated with the interrogated layer and plots have been activated on the referencing tables, it will also be possible to consult these plots by querying the referenced layer and clicking on the Show relation charts icon present in the results form.

_images/g3wclient_attribute_view_plots.png

Show relation charts: display of graphs related to 1: N related data. Only if 1: N relationships are associated with the interrogated layer and graphics have been activated on the boy tables.

Editing on line

Forms and editing widgets are already defined on the project associated with the tutorial for the geometric layer of buildings and for the alphanumeric table related interventions_maintenance.

  • Buildings

    • id (integer - primary key): autogenerate

    • name (text NOT NULL): text edit

    • address (text): Value relation (roads layer - code/name fileds)

    • year (integer NOT NULL): unique values (2015,2016,2017,2018,2019,2020)

    • photo (text): attachment

    • link (text): text edit

    • form (text): attachment

    • high (integer NOT NULL): range (10-30 step 2)

    • volume (integer): range (50-200 step 10)

    • surface (integer): text edit

    • architectural_barriers (text): Checkbox (Checked - Not checked)

    • date_barriers (date): date (yyyy/MM/dd)

    • safety_exits (text): checkbox (Checked - Not checked)

    • date_exits (date): date (yyyy/MM/dd)

    • fire_system (text): Checkbox (Checked - Not checked)

    • date_fire (date): date (yyyy/MM/dd)

    • type (text NOT NULL): unique values (Administrative, Commercial, Residential)

  • Maintenance_works

    • id (integer - primary key): autogenerate

    • id_buildings (text - relation key): text edit

    • maintenance (text NOT NULL): unique values

    • date (date): date (yyyy/MM/dd)

    • form (text): attachment

    • value (integer): range (10-30 step 2)

    • outcome (text): unique values (good, medium, bad)

    • responsible (text): text edit

    • cost (integer): range (1000-5000 step 1)

    • validation (boolean): checkbox (0/1)

  • Buildings rating

    • id (integer - primary key): autogenerate

    • id_buildings (text - relation key): text edit

    • date (date): date (yyyy/MM/dd)

    • value (integer): range (1000-4000 step 500)

    • year (integer): range (2018-2022 step 1)

To activate the editing function on webgis, access the list of layers and identify the three layers shown above.

_images/g3wsuite_administration_project_layer_list.png

Clicking on the icon Editing layer _images/icon_editing.png (placed at the left of each rows) 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

_images/editing_setting.png

Once the editing function is activated, updating the service, the Tools menu will appear on the left panel.

By activating the editing function it will be possible to edit the geometries and attributes of the Public Buildings layer and the related interventions.

_images/editing_client_start.png

_images/demo_editing_web.png

_images/editing_form2.png

For further information on the web editing function, read the dedicated chapter on the manual

Personalize your demo

Do you want to test the online editing function more deeply?

Redefine attribute forms, aliases and editing widgets associated with the individual fields and reload the project to check the new settings.

It is advisable to consult the paragraph dedicated to the list and limitations of the individual editing widgets inheritable from the QGIS project.