We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Easily publish your QGIS projects on the web with QWC2

00:00

Formal Metadata

Title
Easily publish your QGIS projects on the web with QWC2
Title of Series
Number of Parts
351
Author
License
CC Attribution 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language
Production Year2022

Content Metadata

Subject Area
Genre
Abstract
QWC2 (QGIS Web Client 2) is the official web application of QGIS, that allows you to publish your projects with the same rendering, thanks to QGIS Server. The environment is composed of a modern responsive front-end written in JavaScript on top of ReactJS and OpenLayers, and several server-side Python/Flask micro-services to enhance the basic functionalities of QWC2 and QGIS Server. QWC2 is modular and extensible, and provides both an off-the-shelf web application and a development framework: you can start simple and easy with the demo application, and then customize your application at will, based on your needs and development capabilities. This talk aims at introducing this application and to show how easy it is to publish your own QGIS projects on the web. An overview of the QWC2 architecture will also be given. It will also be an opportunity to discover the last new features that have been developed in the past year and ideas for future improvements.
Keywords
Client (computing)Computer fontMountain passLetterpress printingTemplate (C++)Order of magnitudeTable (information)Computer-generated imageryText editorForm (programming)Revision controlFinitary relationFunction (mathematics)Boom (sailing)Category of beingInternationalization and localizationFile viewerScale (map)Uniform resource locatorDigital filterLibrary catalogBookmark (World Wide Web)Cartesian coordinate systemState of matterAdditionFunctional (mathematics)File viewerMedical imagingAuthenticationLink (knot theory)MereologyDirectory serviceAttribute grammarServer (computing)DatabaseConnectivity (graph theory)Scaling (geometry)Letterpress printingIdentifiabilityGeometryComplex (psychology)Standard deviationInformationWeb 2.0Integrated development environmentInstance (computer science)Projective planeCase moddingLine (geometry)WritingProfil (magazine)Reading (process)Level (video gaming)Bookmark (World Wide Web)Configuration spaceSet (mathematics)Successive over-relaxationFront and back endsService (economics)Cache (computing)Library catalogHookingClient (computing)Computer fileZoom lensLatent heatUsabilityResultantRevision controlPosition operatorData managementForm (programming)View (database)Plug-in (computing)Query languageSoftware developerSlide ruleFrame problemTheory of relativityMultiplication signDimensional analysisCoprocessorPoint cloudImplementationToken ringWindows RegistryTemplate (C++)Centralizer and normalizerMechanism designLocal ringRight angleTask (computing)Proxy serverSystem administratorElectric generatorMoment (mathematics)Fluid staticsContext awarenessUser interfaceTelecommunicationSearch engine (computing)Communications protocolInterface (computing)Software engineeringTable (information)Extension (kinesiology)Core dumpUniform resource locatorWeb browserTraffic reportingGUI widgetRoutingDemo (music)Web applicationGateway (telecommunications)Computer architecturePermianRow (database)Entire functionTranslation (relic)Repository (publishing)Pairwise comparisonHome pageStructural loadCloningPhysical systemWeb pageOpen setWebsiteInternet service providerBuildingKeyboard shortcutGroup actionPolygonCompact spaceCASE <Informatik>Graphics softwarePoint (geometry)Arithmetic meanShared memorySource codeField (computer science)Network topologyObject (grammar)Product (business)Musical ensembleSheaf (mathematics)Connected spaceAddress spaceArrow of timeMultiplicationPole (complex analysis)SpacetimeCategory of beingSoftware maintenanceEnterprise architectureBitMenu (computing)WordPresentation of a groupKerberos <Kryptologie>Different (Kate Ryan album)NamespaceInjektivitätOcean currentQuicksortMeasurementProbability density functionSingle-precision floating-point formatComputer animationMeeting/InterviewXMLUMLSource code
Transcript: English(auto-generated)
Hello, and welcome to this presentation about the QGIS Web Client 2. My name is Sandro Mani. I work as a software engineer at Sourcepol in Zurich. And in this presentation, I'd like to give a quick overview of how QGIS Web Client works and what's new since the past year or so.
Quick word about Sourcepol. We are a mainly just spatial or GIS-based company. We develop QGIS. We are for C++ core developers. We have a product called QGIS Enterprise, where we provide the maintenance and support for QGIS.
We have a QGIS-based application called Cadas Alberia, which has, let's say, a simplified user interface for special applications. And on the WebGIS side, we have the QGIS Web Client 2, which I'm going to talk about today, and QGIS Cloud, which is a spatial data infrastructure based also on QGIS Web Client 2.
So the outline, I'm going to give an introduction to QWC2, the QGIS Web Client, to QDOC services, and then give an overview of what's happened in the past year in the project. So the QGIS Web Client 2 is the official web application for publishing QGIS projects on the web.
It's hosted in the QGIS namespace on GitHub. The first public release was in 2016, and the goal was to develop an application with a modern and responsive UI, to focus on usability, and at the core, a plugin architecture which makes it easily extensible
with additional features, and using state-of-the-art technologies like React GES and Open Layer 6. This is how it looks. This is a pretty recent screenshot from our demo page. So we see it's an application which is scalable from desktop to mobile devices.
It provides obviously a map viewer, a layer tree, and a menu with tools, a search bar, and many additional functionalities, which I'm going to list afterwards. How it works is basically the idea is that you can style your project in QGIS using the layers
and style, set the layer configuration and styling capabilities of QGIS, and also create some print templates. Once you've created this project, you can deploy it on QGIS server, which will then act as the WMS server to serve the image to the web client.
So the QGIS web client is a client tailored on QGIS server. It uses some extensions offered by QGIS server, for instance, for PDF printing, and let's say communicates solely with the QGIS server as a simple, or let's say in its basic form.
And the core features it supports is a team switcher. We call them themes in the QGIS desktop world. They're called projects. Basically you can have multiple QGIS projects published as themes in the QGIS web client. Layer tree, which reflects the configuration
you define in the QGIS project. Feature info, which works via WMS feature, get feature info to publish context feature information on a click point. You can define search providers, let's say through various means, connecting or interfacing
to whatever search provider you may need. There are measurement tools, point, line, and polygon. There are sketching tools, redlining, where you can draw additional objects on the map. There's a permalink sharing where you can copy the link, which encapsulates the state of the viewer
and then share the view or that link to another user. Show location to display the current position, PDF printing through the get print capabilities of QGIS server and a map compare tool, which allows you to compare, let's say, to map or let's say the top layer with the rest of the map through a slider.
It allows you to import external layers through over WMS, WFS, and WMTS, also local KML files, and provides a JavaScript API to allow, let's say, external applications to interface with QDWC.
QDWC per se is or can be used as standalone viewer, a simple, say, static application, JavaScript, HTML, CSS deployed in a web server, relying solely on QGIS server for its functionality,
but it can also be extended to provide additional functionalities, and that is where QDWC services come into play. QDWC services is a broad ecosystem of microservices for extending the QDWC viewer.
A microservice is basically one small service encapsulating one specific functionality, and then the communication between these services is a very well-defined REST protocol, and that allows to, let's say, keep the application well-organized with single functionalities divided in single services.
In our case, or let's say in the current case, it's mostly Python Flask services. And to make them easily deployable, we have offered or, let's say, built these as Docker images, and these are available on Docker Hub,
and there's a website at QDWC Docker where you have, let's say, a kickoff configuration to get you easily started, which provides, let's say, readily configured starting configuration to run the application. If you don't want to use Docker, you can also do the configuration by hand using Apache and the SGI, for instance,
or any other technology you might prefer. The architecture is that, from the browser, all requests go through an API gateway, which route the requests, depending on the path to the different services of the whole ecosystem or of the whole application.
The core is, here we have the QG server, which communicates with the map viewer through an OGC service. This OGC service, as we will see later, is to enforce permissions from authenticated users.
There is an authentication service, which allows users to log in, give you, say, different authentication backends, and then there's a collection of REST services, which provide additional functionality, and finally, there's an administration interface to manage users' permissions and resources.
The functionalities which are made available by extending the QGSwap client with QDWC services are, as mentioned, users and resource management, authentication, there's a possibility to have a full text search engine, and there's editing possibilities to edit layers directly on the client,
compact permalinks and user bookmarks to allow storing the state in a database, high profile for the measurement tool, if you draw a line, you can also see the high profile under the line, custom feature info templates, this is a functionality to extend get feature info
to render into customized, let's say, HTML templates for how it is presented in the viewer, a reporting service based on Jasper, and the map info pop-up, which is basically a right click on the map, which will give you additional context information.
The core services, let's say, in a nutshell, what you need to run a QWC services instance is the OGC service is a proxy between the QG server and the web client, which will enforce permissions, for instance, permitted layers or permitted attributes, there's the map viewer,
which serves the actual static QWC application while adjusting the configuration based on the permissions which apply to the authenticated user, there's administration GUI, which is the backend for managing these permissions and resources, and there's a conflict generator,
which will read the entire, say the QGIS projects, which are configured as teams, will combine them with the permissions configured in the administration GUI, and will generate static JSON files, which the services need to operate.
And the big advantage of this conflict generation is that there is one moment where this, let's say, expensive task happens, and then the result is stored cached for the services to use. Authentication is an interesting topic. There's, let's say, the authentication mechanism is modular, the requirement of an authentication service
is that they issue JBT tokens, and then the actual implementation of the authentication service, respectively. How they authenticate can vary depending on, say, the requirements. We provide a database authentication service which will authenticate against users stored in a database.
There's LDAP Active Directory authentication, and also other possibilities like Kerberos and SAML. Additional services, the data service is the, let's say, main backend for editing functionality that allows read-write access to geodata stored in a Postgres database.
There's the permalink service for storing the compact permalinks. There's a full text search service which will offer you, if I said, a full text search with Apache Solar, and the map info service for the right-click context information. One quick side about Docker,
and the big advantage is you have one service per container, so you can easily update one or the other component by simply changing the tag version in the Docker configuration file. You have the containers, or let's say, the services executed in a controlled environment, so you don't need to worry about having the right Python version, stuff like that.
That's already taken care of. You can easily create and manage them, and they are distributed over a centralized registry at Docker Hub. And Kubernetes is then an additional, let's say, level of complexity to automatically manage the deployment and scaling of these container applications.
Now, let's say, the news part, what's been going on in the past year. Let's say it's been a pretty interesting year. A lot of new things have come in, which I'm pretty excited about. The first thing is the snapping functionality. This allows you, while editing, drawing, or measuring, to snap against other datasets
or, let's say, layers in the QGIS project, or also local drawings drawn by red lines. It works by building up a cache of features over get feature info for the current extent of the map,
and then it allows you to have no delay, interactive snapping against all geometries visible in the map for the configured snap layers. There's a new plugin called the Time Manager. This is basically a connection to the WMST time dimension, which you can configure in the QGIS layer properties
on the QGIS server. There's a slider allowing you to define the time you want to have illustrated in the map, and then it will use those time dimensions over QGIS server to pick out all of the features visible at the time.
And the additional feature is you have got these small, let's say, bars underneath the features. These illustrate the timeframe within the feature is visible. Attribute table is also a new plugin similar to the attribute table in QGIS. It allows you to view or have a tabular view
of the entire dataset, all the records. It allows you to edit, add, and remove records, and maybe also interesting, it also allows you to manage geometry-less features directly from web client with no geometrical reference. Plus, it has a zoom and filtering capabilities
to filter and zoom to the dataset of interest. A small new feature, maybe also interesting, is basic support for editing Z geometries. If the geometry has a non-zero Z component, then the geometry will be marked as read-only.
You can only edit attributes. Otherwise, you can also edit the geometry, and the Z component will always be set to zero. Again, let's say in the editing topic, one, let's say it's not really, no, sorry.
So, we've lost, okay. What is, it's not really new here, but it's been around for maybe two years, and it's been improved in the last year is that the attribute form configuration in QGIS in the layer properties will be translated
to a form in QWC for editing functionalities. This allows you to, let's say, comfortably create a form in QGIS, and then have it replicated in the QGIS web client. I repeat this here because it's kind of important for what follows now.
The first, let's say, new feature based on this is the feature form. It's basically a merger of an identify and an editing tool. It allows you to, let's say, query the map at a certain position, and instead of going over feature info, it goes over the data service, presenting you the attribute form as configured,
and it will also then allow you to edit the data directly in the data set. So, you could use this instead of the standard get feature info, or the standard identify tool of QWC. Maybe also interesting, we have integrated an image editor
in the file upload functionality, so you can upload a file and directly edit the picture within the web application, and then store the result through the data service. Regarding one-to-one relations, we have implemented sorting, so I don't know if maybe some of you are familiar when you define manual QGIS or QT designer form,
you can, through a special naming convention to widgets, you can define the role of the widget. If you define sort field at the back, then you will get the arrows in the one-to-one relation section of the form, which allows you to order them. Nested forms is kind of, let's say, a bit complicated.
The idea is that if you have a one-to-one relation, you have a very complex related item. Instead of trying to squeeze every editable field inside the small space, you can link an additional form into the edit form,
and then have that open as a child pop-up. Pre-processor hooks is something interesting, mainly for, let's say, plugin developers. It allows you to hook into the loading of the form on the QGIS web client side, and do specific alterations on the form
before it is displayed for the actual editing task. One, let's say, specific, or two specific functionalities is external fields, sometimes it is useful to compute a value depending on another value. Client side, for instance, the city where a point is located,
but you don't have that information in the database, so you'd like to compute it based on an external service. And the other one is, it allows you to add buttons with custom triggers in the form, so that when you press the button, you can bind a custom action, which maybe will fill out the form in a specific way based on the value of a certain attribute.
An additional new thing is localization of forms. This is implemented by simply translating the form via the Qt linguist system, and QWC will now look for a translation file and load this translation, or translate the form by this translation file and present your translated form.
Inline images is a small addition just to present static images inside the form. If you prefix the widget in the Qt designer form with image and then field name, it will just add the field, value contains a URL,
it will display this image address as an image. Their catalog is to offer a predefined set of external layers to users, so administrator can configure the sources he or she wishes to offer to its users, and then it will be displayed
as a browsable tree in the web client. Also on editing, there's a possibility to clone an existing geometry. For instance, if you have a map with buildings and you'd like to select one building for maybe a revision task, you want to maybe clone that geometry, so you can just pick on the map
to clone that geometry and then use that geometry for the new feature you're creating. And I think the last one is bookmarks, so similar to permalinks, bookmarks, or just like the applications that are stored in the database, but bookmarks are stored per user.
So it's basically the user that manages how many bookmarks he or she wishes. Some references, the homepage for, let's say, the entire application ecosystem is qwcservices.github.io. The two main repositories are the qwcdemo application and the qwcservices Docker repository.
And we've got various existing instances where we can try it out. The qwcsourcepool.ch is the, say, our demo application, which more or less represents the current state of the application. QGIS Cloud is using QWC services as its viewer,
so it's also an interesting reference and then there are existing deployments around from Glarus and Soloturn in Switzerland. So that's about it. Thank you for your attention and I'm happy to take any questions. Thank you.