10.7. Working with cloud data

With this plugin you can download data from Web GIS to QGIS to edit it.

10.7.1. From Web GIS to QGIS

Add to QGIS

Pic. 10.30. Button for data transfer to QGIS

Option is available if one of the following resources is selected in NextGIS Web resource tree:

  • vector_layer Vector layer (NGW Vector Layer) - GeoJSON vector layer will be created in QGIS;

  • wfs_layer_symbol WFS Layer - a WFS layer will be created in QGIS;

  • resource_wfs WFS service (NGW WFS Service) - WFS layer will be created in QGIS;

  • wms_layer_symbol WMS Layer - the selected WMS layer will be added to QGIS;

  • resource_wms WMS Service - a WMS layer will be created in QGIS, the data source for which the selected WMS Service will be;

  • wms_connection_symbol WMS Connection - you can select the WMS layer from the list to add to QGIS;

  • tms_layer_symbol TMS layer;

  • tms_connection_symbol TMS connection;

  • postgis_layer_symbol PostGIS layer;

  • resource_style QGIS Vector Layer style - if it’s a style of a vector layer, a GeoJSON vector layer with the identical style will be created in QGIS; if it’s a style of a WFS layer, a WFS with that style will be created;

  • raster_layer Raster layer - a GeoTIFF raster layer will be created in QGIS;

  • basemap_symbol Basemap;

  • resource_webmap Web Map - a QGIS project will be created containing layers, styles and basemaps. A mutually exclusive group will be created for all the basemap layers.

  • demo_project_symbol Demo Project - a QGIS project will be created, containing layers, styles and basemaps;

  • resource_group Resource group - the group and resources inside it will be added to the QGIS project.

Vector layers added from Web GIS can be edited in QGIS right away.

10.7.2. Add vector layer to QGIS

NextGIS Connect plugin enables a fast export of vector data from Web GIS to QGIS for further processing, analysis, saving in different formats and other data operations.

It’s possible due to the option of fast creation of GeoJSON vector layers in QGIS using vector data from Web GIS:

  • Select in NextGIS Connect Resources panel Vector layer which you want to export to QGIS;

Press Add to QGIS button on NextGIS Connect control panel or select Add to QGIS in the layer context menu;

../../_images/NGConnect_export_select_en.png

Pic. 10.31. Exporting vector layer from Web GIS

  • If the layer has multiple QGIS styles, there are several options depending on what you select in the Connect window:

  1. If you select a layer with multiple styles in the Connect window, all the styles will be added, but you need to chose current style in a dialog window. Double-click the style to select it. This is the only case in which a dialog pops up.

../../_images/NGConnect_export_select_style_en.png

Pic. 10.32. Selecting QGIS style for export

  1. If you select a style in the Connect window, all the styles of the layer will be added, with the selected style chosen as current style.

  2. If you select a resource group containing layers with multiple styles, all the styles will be added. The style used as current will be the one with the same name as the layer or the first in alphabetical order. No dialog will be displayed.

  3. If you add WFS/OGCF, no dialog will be displayed. The style with the same name as the layer or the first in alphabetical order will be chosen.

You can change current style in the layer properties.

If the layer is exported successfully you’ll see in QGIS Layers panel a new GeoJSON vector layer which you can use in your projects or save to your device in a required format.

Warning

Photos made via NextGIS Collector/Mobile apps and uploaded to Web GIS as attachments to layers wouldn’t be available in desktop NextGIS QGIS after downloading these layers through NextGIS Connect plugin.

10.7.3. Lookup tables

In Web GIS you can create Lookup tables and link them to vector layers.

When the layer is exported from Web GIS to QGIS the values of the lookup table will be added to the layer using value map widget. After that they will be available in the desktop app in the corresponding field of the table when you enter edit mode.

../../_images/ngc_lookup_en.png

Pic. 10.33. Lookup table values available during editing in QGIS

In QGIS you can use Value relation widget to add another vector layer as a lookup table or upload a CSV file. When the layer is transfered to Web GIS, a Lookup table resource will be created for it.

10.7.4. Synchronization with Web GIS

Layer added to QGIS continues to be synced with the Web GIS server. It means that all the changes made via Web interface will be displayed in the desktop app and the edits made in QGIS change the layer in the Web GIS.

Synchronization is automatic. Set how often Connect checks for layer updates in QGIS Options.

You can disable auto sync for a layer and synchronize it manually when needed. Go to layer properties and untick “Automatic synchronization”.

../../_images/ngc_layer_autosync_set_en.png

Pic. 10.34. Automatic synchronization is enabled

To start the synchronization manually, open the layer status window and press Synchronization.

10.7.5. Open a project created on another device

With NextGIS Connect v. 3.2.0 and up a project file that uses detached layers can be opened on another computer if they both have a connection to the same Web GIS. When the project is opened, the layers are loaded automatically.

  1. In NextGIS Connect check the connection to the Web GIS or create it, if necessary.

  2. Add the layers from Web GIS to QGIS project.

  3. Save the project.

  4. Copy the project file and transfer it to the other computer.

  5. On the other computer in NextGIS Connect check the connection to the same Web GIS or create it if necessary.

  6. Open the project.

The data will be loaded from the Web GIS. To check if the synchronization was successful, click on the layer status icon next to its name.

Note

Open the project after the connection is set up. If you get “Handle Unavailable Layers” window, close the project, check the connection to Web GIS, then re-open the project.