9.6. Data transfer

NextGIS Connect module allows you to share geodata between QGIS and Web GIS in both directions. See below for the specifics.

9.6.1. Resource types

The following types of resources are available for data exchange and operation:

  • vector_layer - Vector layer (NGW Vector Layer), which can be: resource_vector_point - Point vector layer (NGW Vector Layer); resource_vector_mpoint - Multipoint vector layer (NGW Vector Layer); resource_vector_line - Line vector layer (NGW Vector Layer); resource_vector_line - Multiline vector layer (NGW Vector Layer); resource_vector_polygon - Polygon vector layer (NGW Vector Layer); resource_vector_mpolygon - Multipolygon vector layer (NGW Vector Layer);

  • resource_style - Vector layer style.

  • resource_wfs - WFS Service (NGW WFS Service)

  • resource_wms - WMS Service (NGW WMS Service)

  • tms_service_symbol - TMS Layer

  • postgis_layer_symbol - PostGIS Layer

  • wfs_layer_symbol - WFS Layer

  • raster_layer - Raster layer (NGW Raster Layer)

  • basemap_symbol - Basemap

  • resource_webmap - Web Map (NGW Web Map)

  • resource_group - Resource group

9.6.2. From QGIS to Web GIS

With NextGIS Connect you can upload to Web GIS:

  1. Vector data

  2. Raster data

  3. Basemaps

  4. Layer groups

  5. Entire QGIS project

Connect plugin also allows to publish vector data using standard protocols WFS, WMS and OGC.

See detailed step-by-step instructions for various data types here.

../../_images/add_to_ngw_en.png

Pic. 9.17. Upload menu in the NG Connect panel

Alternatively you can upload data to Web GIS from the Layers panel. In the context menu select it as one of the ways to export a layer, a group of layers or the entire project.

../../_images/context_export_to_ngw_en.png

Pic. 9.18. Uploading data to Web GIS via layer context menu

  • Vector layer – vector layer with its style will be imported into Web GIS. You can later add this style to a Web Map.

  • Raster layer – raster layer with a default style will be created in Web GIS. Style can be added directly to Web Map.

  • Upload all - All layers for which the import option is available will be added to Web GIS, as well as all groups, retaining the hierarchy from QGIS Layers Panel. Also a Web Map will be created and all imported layers will be added to it retaining hierarchy and visibility of QGIS Layers Panel. While importing a project you need to specify the name of the new resource group which will be created in Web GIS. This group will hold all resources imported along with the project. When the process is complete, the Web Map will be opened automatically if corresponding option is selected in plugin settings.

  • Update layer style - Web GIS will update the style of the layer to match the style of the selected layer in QGIS.

  • Add new style to layer - Web GIS will add to the layer a new style, similar to the selected layer in QGIS.

If a layer has multiple styles, they will all be uploaded. Their names will be kept. If the style name is “default”, the layer’s name will be used instead.

Imported resources will be added to the group selected in NextGIS Connect panel.

  • If other type of resource but a group is selected, import will be performed to the closest parent group to selected resource.

  • If no resource is selected, import will be performed to the Main resource group (the root directory).

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.

9.6.2.1. How to keep attachments

To keep the photos intact while modifying the style, perform the following steps:

  1. Add the layer’s style from Web GIS to QGIS using NextGIS Connect.

  2. Modify the style.

  3. Update the style using NextGIS Connect.

../../_images/ngconnect_modify_keep_photo_en.png

Pic. 9.19. Updating a style

9.6.3. From Web GIS to QGIS

Add to QGIS

Pic. 9.20. Button for data transfer to QGIS

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

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

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

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

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

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

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

  • TMS Layer tms_service_symbol;

  • TMS Connection tms_connection_symbol;

  • PostGIS Layeer postgis_layer_symbol;

  • QGIS Vector Layer style resource_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 (NGW Raster layer) raster_layer - a GeoTIFF raster layer will be created in QGIS;

  • Basemap basemap_symbol;

  • Web Map resource_webmap - 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 demo_project_symbol - 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.

For layers with multiple styles:

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

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

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

  • If you add WFS/OGCF, the style with the same name as the layer or the first in alphabetical order will be chosen.

See how to work with multi-style layers in our video:

Watch on youtube.

Detailed instructions for adding various data types to QGIS here.

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

9.6.4. Context Menu

Context menu may differ depending on resource type.

Context menu for a qgis vector style

Pic. 9.21. Context menu example

Common options for all resource types:

  • Open in WebGIS – open the page of the selected resource in Web GIS, see Pic. 9.22.;

  • Rename resource;

  • Delete resource;

  • Edit metadata.

Variable options – depend on resource type:

The plugin also allows you to navigate to the Web GIS data directly from the the Layers panel in QGIS. In the layer’s context menu find “NextGIS Connect” and press “Open in Web GIS”.

Context menu in the layer tree

Pic. 9.22. Opening Web GIS data from QGIS layer tree

9.6.5. Duplicate resource

With NG Connect you can copy an existing Web GIS layer. This option is available for Vector and Raster layers.

  • To make a copy of a layer, select it in the Connect panel, then in the context menu click Duplicate resource.

  • In the pop-up window confirm copying.

Copy will be created in the same group. The layer’s style will also be duplicated.

../../_images/NGConnect_double_en.png

Pic. 9.23. Duplicating resource

9.6.6. Delete resource

With NextGIS Connect you can quickly create and delete any resource in your Web GIS.

  • In the NextGIS Connect panel select the resource you wish to delete;

  • In the context menu select Delete;

  • If the resource is deleted successfully, it disappears from the Web GIS layer tree.

9.6.7. Create resource group

In the top menu of the NextGIS Connect plugin you’ll find a “Create group” button.

A new group will be created:

  • If a resource group is selected in the Connect panel - in that group;

  • If other type of resources but a group is selected - in the closest parent group

  • If no resource is selected - in the main resource group.

Create new group

Pic. 9.24. Creating resource group

9.6.8. Refresh

In the top menu of the NextGIS Connect plugin you’ll find a “Create group” button.

The “refresh” operation will update the entire Web GIS resource tree to the current state.

Refresh resource tree

Pic. 9.25. Refreshing Web GIS data

9.6.9. Open Web Map in browser

In the top menu of the NextGIS Connect plugin you’ll find a “Create group” button.

Option is available if a Web Map (resource_webmap NGW Web Map) is selected in NextGIS Connect resource tree. The Web Map will be opened in a new tab of default browser.

Open Web Map in browser

Pic. 9.26. Opening a Web Map

Context menu also allows to open the Web GIS page of any resource in browser.