1.11. Tutorial: Seamless QGIS Integration

Availability

Cloud SaaS (all editions), On premise (all editions), Open Source

NextGIS Web is a data-centric server GIS, that allows you to store, manage and publish spatial data in a flexible and effective way. It has a deep integration with QGIS, the leading free and open-source GIS software.

Integration covers publishing QGIS projects as Web Maps, connecting to Web Maps as QGIS projects, data syncing and collaborative editing from several QGIS instances.

In this step-by-step tutorial you will learn how to publish your QGIS project to the web, then connect to it from another QGIS instance, manage styles at Web Maps from QGIS and edit data from QGIS directly at the server. Register a free cloud account and try it right away!

Download tutorial data (source: OpenStreetMap, data.nextgis.com, Copernicus)

Publish your QGIS project online

  1. Create free account and Web GIS

  2. Open and explore QGIS project

  3. Install NextGIS Connect plugin

  4. Create a connection

  5. Publish QGIS project to NextGIS Web

Result: Explore the Web Map and resources

Use QGIS to edit data stored in Web GIS

  1. Connect to Web Map from QGIS

  2. Update layer styles at the Web Map from QGIS

  3. Update raster layer style on a Web Map

  4. Edit data from QGIS and explore results at the Web Map

1.11.1. Step 1/5 Create free account and Web GIS

Go to my.nextgis.com, click the Create Account button and sign up using your email address.

After registration your account page would appear. Select the Web GIS menu on the left, come up with a name (ngw-quickstart.nextgis.com in this example) and select the nearest Data center location (DE Falkenstein in this example). Then click Create Web GIS.

../../_images/tutorial_create_wg_en.png

When the creation process is complete, the contents of the page will change. Direct link to your new Web GIS will appear.

../../_images/tutorial_my_wg_en.png

Copy the address of the created Web GIS. In this example: https://ngw-quickstart.nextgis.com. You’ll need it later to create a connection.

1.11.2. Step 2/5 Open and explore QGIS project

Download the tutorial data and unzip the archive.

Click on the file called Sursee.qgz to open it in QGIS.

Note

If you don’t have QGIS yet, download and install it.

This is a typical QGIS project with raster and vector layers, a couple of basemaps and rich scale-dependent styles set up with exclickions. Points of interest are styled with advanced “Point Cluster” renderer using dynamic cluster symbol size. There are also embeded SVG icons in the “Road network” layer.

../../_images/tut_sursee_project_en.png

Zoom in to explore multiscale styling.

../../_images/tut_project_zoomed_en.png

1.11.3. Step 3/5 Install NextGIS Connect plugin

Go to the “Plugins” — “Manage and Install Plugins” menu

../../_images/tut_menu_manage_plugins_en.png

Go to the “All” tab and find a plugin named NextGIS Connect. Use a search bar at the top of the interface for faster access. Click the Install Plugin button.

../../_images/tut_install_ngconnect_en.png

After installation NextGIS Connect is available in the “Internet” menu and as a toolbar icon: blue shield with white arrows. When NextGIS Connect is active, the side panel is visible.

../../_images/tut_ngconnect_in_qgis_en.png

Go to the plugin settings, using gear icon. This is a place for setting up everything related to QGIS–NextGIS Web integration. First, let’s create a connection.

1.11.4. Step 4/5 Create a connection

To establish a link between your QGIS app and a Web GIS, you need to create a connection.

Go to the Web GIS page of your NextGIS ID account and copy the link to your Web GIS (see tutorial_my_wg_pic). In this example the link is: https://ngw-quickstart.nextgis.com.

In QGIS open the NG Connect settings and click on the New button in the “Connections” group.

../../_images/tut_ngcn_new_connection_en.png

Enter the Web GIS address to the URL field, then click green plus to create a new Authentication configuration.

../../_images/tut_ngcn_create_connection_en.png

In the new dialog enter the email and password you used to register at my.nextgis.com at step 1, and click the Save button.

../../_images/tut_ngcn_authentication_en.png

Click the Test connection button to ensure that you entered all the data correctly. Then click the Save button.

../../_images/tut_ngcn_test_connection_en.png

Tip

If you are going to edit data collaboratively, you can activate the checkbox “Enable feature versioning for vector layers when uploading”.

../../_images/tut_enable_versioning_en.png

Exit settings by clicking the OK button in the bottom of the page.

Now in the NextGIS Connect panel you can see the resource tree of your Web GIS.

../../_images/tut_ngcn_panel_connected_en.png

Using this panel you could upload local data to Web GIS, connect remote layers and maps to QGIS, update styles, create services and many more. It also provides a simple way to upload an entire QGIS project as a Web Map.

1.11.5. Step 5/5 Publish QGIS project to NextGIS Web

In NextGIS Connect panel select the Main resource group folder, then open dropdown menu with button_to_wg icon and select Upload all.

../../_images/tut_upload_all_en.png

Enter a name for the project. In this example, it is Sursee.A folder with this name is created in Web GIS, and all the project data is uploaded there.

../../_images/tut_upload_name_en.png

The upload starts. You can track the progress by checking the status message.

../../_images/tut_upload_status_en.png

By default, once the Web Map is successfully published, it opens automatically in your browser. Also, you can open it from the Connect panel. Right-click on the Web Map and select “Open in browser” in the context menu.

Note that all the layers of the project are now visible in the NextGIS Connect panel.

../../_images/tut_open_in_browser_en.png

Now you can explore the Web Map. Proceed to step 6 to learn how to connect to an existing Web Map in QGIS.

1.11.5.1. Explore the Web Map and resources

A Web Map has been created from the project. It looks exactly the same as the original QGIS project, because NextGIS Web uses QGIS styles as primary way to define layer styles.

../../_images/tut_sursee_webmap_en.png

You can enable and disable layers and categories within layers. Web Map has its own URL, so you can easily share it. Play with the Web Map interface. Learn more about it: https://docs.nextgis.com/docs_ngweb/source/webmaps_client.html

Click the blue and black X icon at the top left corner to view the main interface with the resource list.

../../_images/tut_goto_main_en.png

Open the Sursee folder. For each layer of the original project a corresponding resource was created in it.

You can work with the uploaded vector and raster layers independently from the Web Map — modify the data, publish it using different protocols etc.

../../_images/tut_wg_sursee_en.png

What if you’d like to edit the uploaded layers in QGIS? Let’s see how to do it.

1.11.6. Connect to Web Map from QGIS

In QGIS close the project (Project - Close). Imagine that you work from another computer, another QGIS instance. Keep NextGIS Connect panel open (reopen it if it’s closed).

In the NextGIS Connect panel, find the Web Map resource Sursee - webmap, right-click on it to open the context menu, and select button_to_qgis Add to QGIS.

../../_images/tut_add_to_qgis_en.png

QGIS rebuilds the Web Map content locally, downloading all relevant layers and styles and arranging them to match the original structure.

What you get is basically the initial project fully reconstructed from the NextGIS Web.

../../_images/tut_downloaded_en.png

Note that in the Layers panel vector layers have special marks to the right of their names: synchronized.

../../_images/tut_synched_layers_en.png

They are now linked to the server storage. If the data is updated on the server side, Connect synchronizes the local layer in QGIS. If the synched layer is updated in QGIS, Connect communicates it to the server and updates the data on the server.

One of the great uses of it is updating styles on the Web Map.

1.11.7. Modify layer styles on the Web Map from QGIS

Let’s make railroads more bright and visible on our Web Map.

In QGIS, find the Railroad network layer in the Layers panel. Open the context menu of the “rail” symbol category. On the palette click on the color ring to select the red color. Click on the empty part of the panel to close the dialog.

../../_images/tut_pick_color_en.png

Then find and select the Railroad network layer in the NextGIS Connect panel.

../../_images/tut_railroad_select_en.png

Go back to the Layers panel, open the context menu of the “Railroad network” layer and click NextGIS Connect –> Update layer style.

../../_images/tut_update_v_style_en.png

Go back to the web browser with the Web Map opened (reopen it from NextGIS Connect panel if it is closed). You’ll find that railroads have changed their color to red.

../../_images/tut_webmap_red_rail_en.png

You can modify raster styles as well.

1.11.8. Update raster layer style on a Web Map

In QGIS, activate Sentinel 2 imagery layer. It is a 4 band satellite dataset, currently configured to display in natural colors.

../../_images/tut_raster_initial_en.png

Open its context menu and go to the “Properties”.

../../_images/tut_raster_context_en.png

In the Properties, go to the Symbology tab, and change Band 3 to Band 4 in the Red band selector. The click OK.

../../_images/tut_raster_bands_en.png

We’ve just replaced the Red reflectance data to the Near-InfraRed reflectance data, so the raster visualization has changed significantly.

../../_images/tut_raster_nir_en.png

Open the Web Map and activate the “Sentinel 2 imagery” layer there. It still has its original appearance.

../../_images/tut_raster_webmap_en.png

Return to QGIS, select the Sentinel 2 imagery layer in the NextGIS Connect panel.

../../_images/tut_raster_select_en.png

Then open the context menu of the layer and click NextGIS Connect –> Update layer style.

../../_images/tut_update_r_style_en.png

Open the Web Map again — layer style has changed.

../../_images/tut_raster_webmap_nir_en.png

NextGIS Web can handle multiband rasters with QGIS styles of any complexity.

1.11.9. Edit data from QGIS and explore results on the Web Map

Return to QGIS, in the Layers panel select Points of interest layer, open its context menu and enable mActionToggleEditing Editing mode. Since this layer was added from NextGIS Connect, it is linked with Web GIS, so the edits are synchronized with the server.

../../_images/tut_toggle_editing_en.png

Enable Digitizing toolbar and activate the button_add_point Add point feature tool.

../../_images/tut_digitizing_en.png

Let’s place another bbq spot in the forest. Left-click on a suitable place on the map, then enter one attribute value, AMENITY = bbq. Then click OK.

../../_images/tut_new_point_en.png

Click on mActionToggleEditing to exit the Editing mode and select Save in the dialog to save the changes.

../../_images/tut_qgis_stop_edit_en.png

After you exit the Editing mode synchronization starts automatically. The new feature is sent to the server. Return to the Web Map to view it.

../../_images/tut_added_on_webmap_en.png

Users can connect to the same server data from multiple QGIS instances and edit the data simultaneously. Our stack provides a seamless, ready-to-go solution to enable team digitizing and data editing in QGIS.