<a id="connect-data-upload"></a>

# Working with cloud data

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

<a id="ng-connect-export"></a>

## From Web GIS to QGIS

Download ![button_cloud_download](docs_ngconnect/source/_static/button_cloud_download.png) is available if one of the following resources is selected in NextGIS Web resource tree:

- ![vector_layer](docs_ngconnect/source/_static/symbol_vector_layer.png) Vector layer (NGW Vector Layer) - GeoJSON vector layer will be created in QGIS;
- ![resource_tileset](docs_ngconnect/source/_static/resource_tileset.png) - Tileset
- ![wfs_layer_symbol](docs_ngconnect/source/_static/symbol_wfs_layer.png) WFS Layer - a WFS layer will be created in QGIS;
- ![resource_wfs](docs_ngconnect/source/_static/symbol_wfs_service.png) WFS service (NGW WFS Service) - WFS layer will be created in QGIS;
- ![wms_layer_symbol](docs_ngconnect/source/_static/symbol_wms_layer.png) WMS Layer - the selected WMS layer will be added to QGIS;
- ![resource_wms](docs_ngconnect/source/_static/symbol_wms_service.png) WMS Service - a WMS layer will be created in QGIS, the data source for which the selected WMS Service will be;
- ![wms_connection_symbol](docs_ngconnect/source/_static/symbol_wms_connection.png) WMS Connection - you can select the WMS layer from the list to add to QGIS;
- ![tms_layer_symbol](docs_ngconnect/source/_static/symbol_tms_layer.png) TMS layer;
- ![tms_connection_symbol](docs_ngconnect/source/_static/symbol_tms_connection.png) TMS connection;
- ![postgis_layer_symbol](docs_ngconnect/source/_static/symbol_postgis_layer.png) PostGIS layer;
- ![resource_style](docs_ngconnect/source/_static/symbol_qgis_vector_style.png) 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](docs_ngconnect/source/_static/symbol_raster_layer.png) Raster layer - a GeoTIFF raster layer will be created in QGIS;
- ![basemap_symbol](docs_ngconnect/source/_static/symbol_basemap.png) Basemap;
- ![resource_webmap](docs_ngconnect/source/_static/symbol_webmap.png) 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](docs_ngconnect/source/_static/symbol_demo_project.png) [Demo Project](https://docs.nextgis.com/docs_ngcom/source/demoprojects.html) - a QGIS project will be created, containing layers, styles and basemaps;
- ![resource_group](docs_ngconnect/source/_static/symbol_resource_group.png) Resource group - the group and resources inside it will be added to the QGIS project.

For some of resource there are multiple options. If they are available, the ![button_cloud_download](docs_ngconnect/source/_static/button_cloud_download.png) icon has a downward arrow. Alternatively, select **Add to QGIS as** in the context menu of the layer. The options are:

* MVT vector tiles - for all vector layers;
* TMS layer - for vector and raster layers and Web Maps.

![Add to QGIS](docs_ngconnect/source/_static/ngc_export_as_en.png)

Vector layers added from Web GIS can be [edited in QGIS](https://docs.nextgis.com/docs_ngconnect/source/edit.html#) right away.

<a id="connect-data-export"></a>

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

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.

![image](docs_ngconnect/source/_static/NGConnect_export_select_en_2.png)

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.

![image](docs_ngconnect/source/_static/NGConnect_export_select_style_en.png)
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.

<a id="ng-connect-lookup"></a>

## Lookup tables

In Web GIS you can create [Lookup tables](https://docs.nextgis.com/docs_ngweb/source/create_other.html#ngcom-lookup-table-for-layer) 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.

![image](docs_ngconnect/source/_static/ngc_lookup_en.png)

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.

<a id="connect-data-sync"></a>

## 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](https://docs.nextgis.com/docs_ngconnect/source/edit.html).

Synchronization is automatic. Set how often Connect checks for layer updates in [QGIS Options](https://docs.nextgis.com/docs_ngconnect/source/ngc_settings.html#ngc-set-sync).

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

![image](docs_ngconnect/source/_static/ngc_layer_autosync_set_en_2.png)

Manually synchronized layers are marked by ![branch](docs_ngconnect/source/_static/icon_sync_manual.png) in the layer panel.

To start the synchronization manually, open the [layer status window](https://docs.nextgis.com/docs_ngconnect/source/edit.html) and press **Synchronization**.

<a id="ng-connect-share-project"></a>

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

<a id="ngc-identify"></a>

## Identify features in Web GIS layers

NextGIS Connect allows to get information about vector features stored in your NextGIS Web server, including attachments and descriptions. Select ![pointer and globe on blue square](docs_ngconnect/source/_static/button_c_identify.png) in the NextGIS Connect panel or NextGIS Connect toolbar. Click on the feature to open the identification panel that has three tabs:

* Attributes;
* Attachments;
* Description.

![image](docs_ngconnect/source/_static/ngc_identify_feature_en.png)

On the Description tab you can view the feature’s description, all formating and images included in it are preserved.

<a id="ngc-identify-attach"></a>

### Manage attachments

On the Attachments tab you can view the files attached to the feature. Initially only previews are loaded. If you want to download the entire file, open its menu and click **Download**.

In the menu of an attached file you can:

* Download the attachment;
* Download and immidiately open the attachment;
* Open an already downloaded attachment;
* Open the folder where it was downloaded;
* Edit name and description of the attached file;
* Copy the attachment;
* Save as a separate file;
* Delete the attachment.

![image](docs_ngconnect/source/_static/ngc_identify_attach_en.png)
