6.5. Adding resources

NextGIS Web is built on a resource-based approach - each component of the system (layer, group, service) is a resource. One of these resources is a layer - a raster image or vector file (database table).

For each layer you can create an unlimited number of styles - ways of visualizing geodata on a Web Map.

Interface for adding of PostGIS layers, vector and raster layers is practically the same. First, you specify the parameters for the layer, and then you add a style that renders data on the Web Map.

To create a new resource, open the group where you want to add it and press Create resource button. Then in the pop-up window select the resource type. The window opens on the full list of available resource types.

../../_images/ngweb_create_en.png

Pic. 6.18. Create resource window

To find the resource type you need faster, use the search bar.

../../_images/ngweb_create_search_en.png

Pic. 6.19. Searching for resource type

Resource types are also grouped into categories. You can select a category from the list on the left.

  • Layers and styles

  • Maps and services (Web Map, WMS, WFS and OGC API - Features services)

  • Field data collection (tracker group, tracker, Collector project)

  • External connections (PostGIS, TMS and WMS connections)

  • Miscellaneous (resource group, SVG marker library, lookup table)

See below for details of creating resource of each type.

6.5.1. Basemap

Press Create resource button and select Basemap (Pic. 6.20.). In the opened window enter the name of the resource that will be displayed in the administrator interface (Pic. 6.21.).

../../_images/ngweb_create_basemap_en.png

Pic. 6.20. Selection of “Basemap” resource type

../../_images/ngweb_admin_basemap_name_eng_3.png

Pic. 6.21. Basemap name

The “Description” and “Metadata” of the resource are configured on the corresponding tabs (Pic. 6.22.). On the “Description” tab you can add any text describing the content.

../../_images/ngweb_admin_basemap_desc_eng_3.png

Pic. 6.22. Basemap description

In the “Basemap” tab you must enter the URL-address of the TMS service (Pic. 6.23.). There are two ways to do so:

  • Use the search bar to find a map in the QuickMapServices catalog. After a map is selected, other fields will be filled in automatically.

  • Enter the address manually.

The basemap will be previewed below. Press button_toggle_basemap Toggle basemap and move the opacity slider to compare it to the standard OSM basemap.

../../_images/create_basemap_settings_en_3.png

Pic. 6.23. Basemap settings

6.5.2. Data Preview

The preview function allows you to see the uploaded data on the basemap or a basemap without adding it on the Web Map.

Click the “eye” icon opposite the name of the child resource you want to preview.

A visual preview of the uploaded geometries will open without the possibility of more detailed interaction (viewing attributes, identifying objects, etc).

../../_images/ngweb_preview_basemap_en_2.png

Pic. 6.24. Data preview

Click button_open_new_tab Open in a new tab to view a bigger preview on a separate page.

Alternatively, open the resource page and click on the Preview button in the right menu in the Extra section.

../../_images/ngweb_preview_2_en.png

Pic. 6.25. Data preview in a separate tab

To preview a style, open the layer page and click on the eye icon next to the style subresource. The “Preview” action in the Extra tab on the right will display the preview of the resource itself, i.e. layer (Pic. 6.27.).

../../_images/ngweb_preview_1_en_2.png

Pic. 6.26. Selecting Data Preview Function for the layer (top right) or its style (below)

../../_images/ngweb_preview_vector_en_2.png

Pic. 6.27. Preview of a vector layer, features marked by default round markers

../../_images/ngweb_preview_style_en_2.png

Pic. 6.28. Preview of a style, the same features marked by custom icons

6.5.3. Raster layer

Raster images in NextGIS Web should be loaded using the “Raster Layer” special resource.

6.5.3.1. Creation process

To add a raster layer navigate to a group where you want to create it. Press Create resource button and select Raster layer (see Pic. 6.29.).

../../_images/ngweb_create_raster_layer_en.png

Pic. 6.29. Selection of “Raster layer” resource type

On the “Raster layer” tab you need to upload a geodata file in GeoTIFF format. The upload dialog indicates the maximum file size allowed on your subscription plan (Pic. 6.30.).

If you plan to use this raster in QGIS directly from your Web GIS, tick the Upload as Cloud Optimized GeoTIFF (COG) checkbox. This will optimize the raster to ensure fast display.

../../_images/ngweb_admin_layers_create_raster_layer_upload_eng_2.png

Pic. 6.30. Uploading raster file

In the “Resource” tab specify the name of the raster layer (see Pic. 6.31.). It will be displayed in the admin interface. The “Key” field is optional.

../../_images/ngweb_admin_layers_create_raster_layer_resourse_name_eng_3.png

Pic. 6.31. Raster layer name

On the “Description” tab you can add any text describing the content of this layer (Pic. 6.32.).

../../_images/ngweb_admin_admin_layers_create_raster_layer_resourse_description_eng_2.png

Pic. 6.32. Raster layer description

In the “Metadata” tab you can enter information in the “key-value” format (Pic. 6.33.).

../../_images/ngweb_admin_admin_layers_create_raster_layer_resourse_description_metadata_eng_2.png

Pic. 6.33. Raster layer metadata

To complete click the Create button.

6.5.3.2. Raster style (QGIS)

After a raster file is successfully uploaded and a raster layer is created, you need to create a QGIS style. This procedure is similar to adding a vector layer style. You can create one in NextGIS QGIS. You will need this style to add the raster to a Web Map when creating one (for more information see subsection Creating a Web Map).

6.5.3.3. Raster layer with transparency (clip or alpha channel)

Most of utilities do not create an alpha channel and only add a NoData value. To transform NoData value to an alpha channel use the command line utility gdalwarp. Here is an example of this command.

gdalwarp -t_srs EPSG:3857 -multi -dstalpha -dstnodata none -wo \
"UNIFIED_SRC_NODATA=YES" -co COMPRESS=JPEG \
d:\temp\o\ast_20010730_010043_rgb.tif d:\temp\o\ast_20010730_010043_rgba.tif

6.5.3.4. Uploading Indexed Color Rasters

Indexed Color raster files are uploaded just like the RGB raster files. If the file is not in GeoTIFF format, you can convert it as follows:

gdal_translate yaroslavl.map  yaroslavl.tif

6.5.4. Vector layer from file

You can create vector layers based on ESRI Shapefile, GeoJSON, KML, CSV, GML and GeoPackage formats in NextGIS Web.

6.5.4.1. Creation process

Navigate to the resource group (folder) in which to create a vector layer. Press Create resource button and select Vector layer (see Pic. 6.34.).

../../_images/ngweb_create_vector_layer_en.png

Pic. 6.34. Selection of “Vector layer” resource type

In the opened tab you need to upload a geodata file in ESRI Shapefile (zip-archive), GeoJSON, KML, GML or GeoPackage format. The upload dialog indicates the maximum file size allowed on your subscription plan (Pic. 6.35.). Web GIS can process multi-layer datasets. If an archive contains several layers, then after it is uploaded, you will be asked to select which layer will be used for creating Vector layer resource.

Below it is proposed to define advanced options for creating a vector layer. Depending on the quality of the data you can handle geometry errors when uploading a file as follows:

  • Not fix errors

  • Fix whatever is possible

  • Fix without losing data

Next - the type of geometry, the presence/absence of multigeometries, Z-coordinates and the source of the FID (FID field, determine automatically or indicate from a particular field) are indicated. More about advanced options.

../../_images/ngweb_admin_layers_create_vector_layer_upload_eng_3.png

Pic. 6.35. Vector file upload tab

In the “Resource” tab enter the name of the vector layer (Pic. 6.36.). It will be displayed in the admin interface. The “Key” field is optional.

../../_images/ngweb_admin_layers_create_vector_layer_resourse_name_eng_3.png

Pic. 6.36. Vector layer name

In the “Description” tab you can add any text describing the content of this layer (Pic. 6.37.).

../../_images/ngweb_admin_layers_create_vector_layer_resourse_description_eng_2.png

Pic. 6.37. Vector layer description

In the “Metadata” tab you can add information in the “key-value” format (Pic. 6.38.).

../../_images/ngweb_admin_layers_create_vector_layer_resourse_metadata_eng_2.png

Pic. 6.38. Vector layer metadata

On the “Settings” tab you can enable feature versioning. It allows the layer to be edited directly in QGIS via NextGIS Connect by multiple users at once.

../../_images/create_vector_layer_vers_en.png

Pic. 6.39. Vector layer settings

After uploading the file and specifying the parameters, click the Create button.

Then you can create a style that will later visualize the data layer on a Web Map. You can also create a form or data collection.

6.5.4.2. Input data requirements

Source files could be in the following formats:

Use NextGIS Connect if you need to upload data in other formats.

Note

In case of ESRI Shapefile, all components (dbf, shp, shx, prj and other files) should be compressed to a zip-archive.

Warning

Avoid using Unicode symbols in data field names. While such data can be uploaded to the Web GIS and displayed on Web Maps, you can experience problems working with it in NextGIS Mobile or visualization (especially if labels are using such fields). Use plain Latin for field names and set up field aliases to show Unicode names.

If input data layer contains fields named id (ID) or geom (GEOM), they will be renamed on import. If id has meaningful identifiers, they will automatically be turned into internal FIDs.

6.5.5. Empty vector layer

Creating an empty vector layer allows you to start a data base in your WebGIS without using a desktop app.

Navigate to the resource group (folder) in which to create a vector layer. Press Create resource button and select Vector layer (see Pic. 6.40.).

../../_images/ngweb_create_vector_layer_en.png

Pic. 6.40. Selecting “Vector layer” resource type

In the opened window use the dropdown menu to select “Create empty layer”. In the field below select geometry type for the layer. By default, a point layer will be created.

../../_images/ngweb_admin_layers_create_vector_layer_blank_en.png

Pic. 6.41. Selecting geometry type for an empty layer

In the “Resource” tab enter the name of the vector layer (Pic. 6.36.). It will be displayed in the admin interface. The “Key” field is optional.

In the “Description” tab you can add any text describing the content (Pic. 6.37.).

In the “Metadata” tab you can add information in the “key-value” format (Pic. 6.38.).

After uploading the file and specifying the parameters, click the Create button.

Then you can create a style that will later visualize the data layer on a Web Map.

To add features to the newly created layer you can use the editing toolbar.

6.5.6. Vector layer from PostGIS

To add a vector layer from PostgreSQL database with PostGIS extension, you need to create a PostGIS connection resource. It is enough to create one connection.

6.5.6.1. Creating PostGIS connection

Press Create resource button and select PostGIS connection (see Pic. 6.42.).

../../_images/ngweb_create_PostGIS_conn_en.png

Pic. 6.42. Selection of “PostGIS connection” resource type

Enter a display name that will be visible in the administrator interface. Not to be confused with layer name in a database.

“Keyname” field is optional.

map to buried treasure

Pic. 6.43. Create resource dialog for PostGIS connection

You can also add resource description and metadata on the corresponding tabs.

map to buried treasure

Pic. 6.44. PostGIS connection description

../../_images/admin_layers_create_postgis_connection_resourse_metadata_eng_3.png

Pic. 6.45. PostGIS connection metadata

Switch from “Resource” to “PostGIS connection” tab, which is presented on Pic. 6.46..

../../_images/create_postgis_connection_settings_en.png

Pic. 6.46. PostGIS connection settings

In this tab you should enter connection parameters for the PostGIS database that you are going to take data from.

  • disable - use an unencrypted connection.

  • allow - attempt to connect whithout encryption, falling back to an encrypted connection if an unencrypted connection cannot be established.

  • prefer - attempt to connect using encryption, falling back to an unencrypted connection if an encrypted connection cannot be established.

  • require - require an encrypted connection and fail if one cannot be established.

  • verify-ca - require an encrypted connection, and also perform verification against the server CA certificate.

  • verify-full - require an encrypted connection, and also perform verification against the server CA certificate and against the server host name in its certificate.

More about SSL modes.

After configuring all the neccessary settings click Create.

6.5.6.2. Creating PostGIS layer

Now you can add individual PostGIS layers. Navigate to a group where you want to create layers. Press Create resource button and select PostGIS layer (see Pic. 6.47.).

../../_images/ngweb_create_PostGIS_layer_en.png

Pic. 6.47. Selection of “PostGIS layer” resource type

../../_images/admin_layers_create_postgis_layer_resourse_name_eng_3.png

Pic. 6.48. Create resource dialog for PostGIS layer

Enter a display name that will be visible in administrator interface and in the map layer tree.

“Keyname” field is optional.

You can also add resource description and metadata on the corresponding tabs.

../../_images/admin_layers_create_postgis_layer_resourse_metadata_eng_3.png

Pic. 6.49. PostGIS layer metadata

Switch from “Resource” tab to “PostGIS layer” tab, which is presented on Pic. 6.50..

../../_images/create_postgis_layer_settings_en.png

Pic. 6.50. PostGIS layer tab of create resource dialog

Then perform the following steps:

  1. From a dropdown list select a database connection (creation of a connection is described above).

  2. Select a schema of the database where layer data is stored. A single database can store multiple schemas. Each schema contains tables and views. If there is only one schema, it’s called public. For more information see PostgreSQL DBMS manual.

  3. Select the Table name (PostGIS layer). You need to know names of tables and columns in your database. Display of tables content is not a feature of NextGIS Web. You can view them using NextGIS QGIS or pgAdmin software.

  4. Select an ID column. When data is loaded into PostGIS using NextGIS QGIS software, an ogc_fid column is created. If the data was loaded another way, the column name may be different. An ID column should follow rules for data type: the value type should be a number (numeric) and it should be a primary key.

  5. Select the Geometry column (if the data was loaded to PostGIS using NextGIS QGIS software, usually a geometry column called wkb_geometry is created. If the data was loaded some other way, the name of the column may be different).

  6. Parameters “Geometry type”, “Fields” and “SRID” are not required, so you can use default values.

After specifying all the necessery parameters, click Create.

Important

You need an unique integer column to attach your table to NextGIS Web. If the primary key column of the table is not integer or there is none at all, you can create an auxiliary key.

To create a key column connect to your database (for example using psql in qgis) and execute the following (replacing ‘tablename’ with the name of your table):

ALTER TABLE tablename ADD fid serial NOT NULL;
ALTER TABLE tablename ADD CONSTRAINT tablename_fid_unique UNIQUE (fid);

And then use this column (fid) an ID column in NextGIS Web.

../../_images/postgis_add_fid_qgis_en.png

Pic. 6.51. Adding fid column in QGIS

More details about PostGIS here.

6.5.7. WMS layer

Note

Currently supported WMS versions 1.1.1 and 1.3.0.

NextGIS Web is a WMS client. To connect a WMS layer you need to know its address. WMS server should be able to serve it using a coordinate system EPSG:3857. You can check if this coordinate system is available for a particular layer by making a GetCapabilites request to a server and examining the response. For example a WMS layer provided by Geofabrik (GetCapabilities), responds in EPSG:4326 and EPSG:900913. While EPSG:900913 and EPSG:3857 are technically the same, NextGIS Web requests data in EPSG:3857 and this particular server does not support that coordinate system.

6.5.7.1. Creating WMS Connection

To add a WMS layer you need to create a resource called WMS connection. You may create a single connection for many layers. Press Create resource button and select WMS connection (see Pic. 6.52.).

../../_images/ngweb_create_wms_conn_en.png

Pic. 6.52. Selection of “WMS connection” resource type

Create resource dialog for WMS connection is presented on Pic. 6.53..

../../_images/create_wms_connection_name_en.png

Pic. 6.53. Create resource dialog for WMS connection

Enter the name of the resource that will be displayed in the administrator interface. Not to be confused with layer name in a database. “Keyname” field is optional.

On the “Description” tab you can add any text describing the content of this connection.

../../_images/create_wms_connection_description_en.png

Pic. 6.54. WMS connection description

On the “Metadata” tab you can enter information in the “key-value” format.

../../_images/admin_layers_create_wms_connection_metadata_eng_2.png

Pic. 6.55. WMS connection metadata

Switch to “WMS connection” tab, which is presented on Pic. 6.56..

../../_images/create_wms_connection_url_en.png

Pic. 6.56. WMS connection tab of Create resource dialog

Here enter the following WMS server connection parameters:

  • URL

  • Username

  • Password

  • Version of WMS protocol

  • Capabilities (manages GetCapabilities queries to the WMS Server)

URL field needs to be filled, others are used when necessary. Supported versions of WMS protocol: 1.1.1, 1.3.0

After setting up all necessery parameters, click Create.

6.5.7.2. Creating WMS Layer

Now you can add individual WMS layers. Navigate to a group where you want to create WMS layers. Press Create resource button and select WMS layer (see Pic. 6.57.).

../../_images/ngweb_create_wms_layer_en.png

Pic. 6.57. Selection of “WMS layer” resource type

Create resource dialog for WMS layer is presented on Pic. 6.58.

../../_images/create_wms_layer_name_en.png

Pic. 6.58. Create resource dialog for WMS layer

Enter display name that will be visible in administrator interface and in the map layer tree.

“Keyname” field is optional.

Tile cache settings are described in detail in this section.

On the “Description” tab you can add any text describing the content of this layer.

../../_images/create_wms_layer_descr_en.png

Pic. 6.59. WMS layer description

OIn the “Metadata” tab you can enter information in the “key-value” format.

../../_images/admin_layers_create_wms_layer_metadata_eng_2.png

Pic. 6.60. WMS layer metadata

Switch to the “WMS layer” tab, which is presented on Pic. 6.61. and perform the following steps:

  1. Select the WMS connection that was created earlier.

  2. Select the appropriate MIME-type from the dropdown list.

  3. Select the required layers from the list by clicking the underlined names. You can select several layers.

../../_images/create_wms_layer_parameters_en.png

Pic. 6.61. WMS layer parameters tab of Create resource dialog

../../_images/create_wms_layer_select_res_en.png

Pic. 6.62. Selecting WMS connection

In the last tab you can add vendor parameters. These are special query settings for additional functions. They vary depending on the WMS provider.

../../_images/create_wms_layer_vendorparam_en.png

Pic. 6.63. Vendor parameters of the WMS layer

After configuring all the parameters click Create.

Warning

Identification requests to external WMS layers from Web Maps are not supported yet.

6.5.8. WMS service

NextGIS Web software can perform as WMS server. This protocol is used to provide images with a requested extent.

To deploy a WMS service you need to add a resource. Press Create resource button and select WMS service (see Pic. 6.64.).

../../_images/ngweb_create_wms_service_en.png

Pic. 6.64. Selection of “WMS service” resource type

Create resource dialog for WMS service is presented on Pic. 6.65..

../../_images/admin_layers_create_wms_service_name_eng_3.png

Pic. 6.65. Create resource dialog for WMS service

Enter the name of the resource that will be displayed in the administrator interface. Do not confuse this name with a name of layers in a database.

“Keyname” field is optional.

On the “Description” tab you can add any text describing the content of this service.

../../_images/admin_layers_create_wms_service_description_eng_2.png

Pic. 6.66. WMS service description

On the “Metadata” tab you can enter information in the “key-value” format.

../../_images/admin_layers_create_wms_service_metadata_eng_2.png

Pic. 6.67. WMS service metadata

Switch to “WMS service” tab, which is presented on Pic. 6.68.. Here add links to required layers or layer styles. You can also set the min and max scale for the data visualisation.

../../_images/admin_layers_create_wms_service_url_eng_2.png

Pic. 6.68. WMS service tab of Create resource dialog

After the resource is created, you will see a message with the WMS service URL which you can use in other software, e.g. NextGIS QGIS or JOSM. Then you need to set access permissions for the WMS service (see ngw_access_rights).

NextGIS Web layer can be added to desktop, mobile and Web GIS in different ways.

6.5.8.1. Using WMS service connection

NextGIS Web acts as a WMS server: WMS services created in NextGIS Web can be added to any software that supports WMS protocol. For that you need to know the WMS service URL. You can get it on the WMS service page. The link may look like this:

https://demo.nextgis.com/api/resource/4817/wms?

To use WMS service through GDAL utilities you need to create an XML file for the required layer. Enter these parameters to the ServerUrl string in example below. The rest remains unchanged.

<GDAL_WMS>
 <Service name="WMS">
     <Version>1.1.1</Version>
     <ServerUrl>https://demo.nextgis.com/api/resource/4817/wms?</ServerUrl>
     <SRS>EPSG:3857</SRS>
     <ImageFormat>image/png</ImageFormat>
     <Layers>moscow_boundary_multipolygon</Layers>
     <Styles></Styles>
 </Service>
 <DataWindow>
   <UpperLeftX>-20037508.34</UpperLeftX>
   <UpperLeftY>20037508.34</UpperLeftY>
   <LowerRightX>20037508.34</LowerRightX>
   <LowerRightY>-20037508.34</LowerRightY>
   <SizeY>40075016</SizeY>
   <SizeX>40075016.857</SizeX>
 </DataWindow>
 <Projection>EPSG:3857</Projection>
 <BandsCount>3</BandsCount>
</GDAL_WMS>

If you need an image with transparency (alpha channel) set <BandsCount>4</BandsCount>.

Here is an example of a GDAL command. The utility gets an image by WMS from NextGIS Web and saves it to a GeoTIFF format.

$ gdal_translate -of "GTIFF" -outsize 1000 0  -projwin  4143247 7497160 \
4190083 7468902   ngw.xml test.tiff

6.5.9. TMS layer

6.5.9.1. TMS Connection

Similarly to WMS, to add a TMS layer, you first need to create a TMS connection. Press Create resource button and select TMS connection (see Pic. 6.69.)

../../_images/ngweb_create_tms_conn_en.png

Pic. 6.69. Selecting TMS Connection resource type

Enter the connection name that will be displayed in the administrator interface (see Pic. 6.70.).

../../_images/TMS_connection_name_en_3.png

Pic. 6.70. TMS Connection Resource Name

The “Key” field is optional. If needed, you can also add a description and metadata. In the TMS connection tab you need to select the way to connect to the TMS server - custom or via NextGIS GeoServices (see Pic. 6.71.).

../../_images/TMS_connection_type_en_3.png

Pic. 6.71. Configuring TMS Connection

In the case of a custom connection method, the user must specify the URL template, API key parameters if needed and the tile scheme used. For NextGIS GeoServices, only a custom API key is specified. After filling in all fields press Create to complete the process of creating a TMS Connection resource.

6.5.9.2. TMS layer

TMS layer resource is created using previously created TMS Connection. Press Create resource button and select TMS layer (see Pic. 6.72.).

../../_images/ngweb_create_tms_layer_en.png

Pic. 6.72. Selecting of TMS layer resource type

Enter the name that will be displayed in the administrator interface (see Pic. 6.73.).

../../_images/TMS_layer_name_en_3.png

Pic. 6.73. TMS layer name

Caching provides faster rendering of Web Map layers. Tile cache settings are described in details in this section.

The main display settings are on the TMS layer tab (см. Pic. 6.74.):

  • TMS connection - select a TMS connection resource that was created earlier

  • The range of zoom levels for data display

  • Extent in degrees or from a layer

  • Tile size in pixels

../../_images/TMS_layer_settings_en_3.png

Pic. 6.74. TMS layer settings

After creating a TMS layer, the user can add it to the Web Map to display. No style is needed.

6.5.9.3. Using TMS service

NextGIS Web is a TMS server. Layers and styles created in it can be accessed via any software supporting TMS protocol. You will need the URL for the TMS service.

The link should look like this:

https://demo.nextgis.com/api/component/render/tile?z={z}&x={x}&y={y}&resource=234

To use TMS service through GDAL utilities you need to create an XML file. You will need the TMS link. Enter these parameters to ServerUrl string in example below. The rest remains unchanged.

<GDAL_WMS>
 <Service name="TMS">
     <ServerUrl>https://demo.nextgis.com/api/component/render/tile?z={z}&x={x}&y={y}&resource=234
     </ServerUrl>
 </Service>
 <DataWindow>
     <UpperLeftX>-20037508.34</UpperLeftX>
     <UpperLeftY>20037508.34</UpperLeftY>
     <LowerRightX>20037508.34</LowerRightX>
     <LowerRightY>-20037508.34</LowerRightY>
     <TileLevel>18</TileLevel>
     <TileCountX>1</TileCountX>
     <TileCountY>1</TileCountY>
     <YOrigin>top</YOrigin>
 </DataWindow>
 <Projection>EPSG:3857</Projection>
 <BlockSizeX>256</BlockSizeX>
 <BlockSizeY>256</BlockSizeY>
 <BandsCount>4</BandsCount>
 <Cache />
</GDAL_WMS>

6.5.10. Tileset

To add a Tileset, select a Tileset in the “Create Resource” block of operations.

../../_images/ngweb_create_tileset_en.png

Pic. 6.75. Selecting Tileset resource type

Next, you need to enter the name of the tileset, which will be displayed in the administrative web interface.

The “Key” field is optional. On the appropriate tabs, you can add a resource description and metadata. Typically, metadata is used to develop third-party applications using APIs.

In the “Tileset” tab, you need to upload a tileset in MBTiles format or a zip archive. Tiles must be in PNG or JPEG format and have a size of 256x256 pixels.

../../_images/Tileset_add_en.png

Pic. 6.76. Tileset tab

In the “Tile Cache” tab, the user can set the caching settings:

  • Enable - enable/disable tile caching;

  • Allow using tiles in non-tile requests - when requesting an image (not a tile), use cached tiles if available;

  • Max zoom level - the threshold value above which the cache is not accessed, the map image is rendered on the fly;

  • TTL, sec (Time to live) - “time to live” or storage of tiles on the server in seconds, after which the image will be re-formed at the next request. If TTL = 0, then the storage time of tiles is not limited;

  • Flush - write only - clears the tile cache when saving the style.

../../_images/Tileset_settings_en.png

Pic. 6.77. Tileset settings

After filling in all the fields, clicking the Create button completes the process of creating the resource Tileset.

6.5.11. WFS Layer

WFS allows to get data published on third-party GIS servers (arcgis, geoserver etc), apply custom styles to them and add them to Web Maps.

First you need to create a WFS connection.

6.5.11.1. WFS connection

Press Create resource button and select WFS connection.

../../_images/ngweb_create_wfs_conn_en.png

Pic. 6.78. Selection of “WFS connection” resource type

Next you can enter a custom name that will be displayed in the resource list.

../../_images/wfs_connection_name_en.png

Pic. 6.79. Name for WFS connection

“Keyname” field is optional. The “Description” and “Metadata” of the resource can be configured on the corresponding tabs.

On the “WFS connection” tab enter the parameters that will be used to connect to the WFS server providing the data:

  • URL

  • Username

  • Password

  • WFS version

../../_images/wfs_connection_set_en.png

Pic. 6.80. WFS connection settings

If the version you selected is not supported, you’ll get an error message after pressing Create:

../../_images/wfs_connection_error_en.png

Pic. 6.81. Error message for incorrect WFS version

Next you can create WFS layer resource.

6.5.11.2. WFS Layer

WFS Layer is added using an existing WFS connection. Select the resource type in the Create resource menu.

../../_images/ngweb_create_wfs_layer_en.png

Pic. 6.82. Selection of “WFS layer” resource type

In the opened window in the “WFS layer” tab select the WFS connection you created. Next select the layer and the geometry field. SRID will be added automatically.

../../_images/wfs_layer_settings_en.png

Pic. 6.83. WFS layer settings

In the “Resource” tab you can set a custom name for the layer. You can also enter description and metadata on the corresponding tabs.

To add a WFS layer to a Web Map, you need to create a style for it. You can create a default QGIS style or a custom QGIS or Mapserver style using “Create resource” menu.

../../_images/wfs_layer_result_en.png

Pic. 6.84. Two ways to add a style to WFS layer

6.5.12. WFS service

WFS layer setup is performed the same way as for WMS service but you add layers instead of styles.

Note

Currently supported filters are Intersects, ResourceId (ObjectId, FeatureId).

NextGIS Web acts as WFS server and publishes WFS services based on vector layers. Third party software can use these services to edit vector data on server. Supported WFS protocol versions are 1.0, 1.1, 2.0, 2.0.2.

To deploy a WFS service press Create resource button and select WFS service (see Pic. 6.85.).

../../_images/ngweb_create_wfs_service_en.png

Pic. 6.85. Selection of “WFS service” resource type

Create resource dialog for WFS service is presented on Pic. 6.86..

../../_images/admin_layers_create_wfs_service_name_eng_3.png

Pic. 6.86. Create resource dialog for WFS service

Enter the name of the resource that will be displayed in the administrator interface. Do not confuse this name with a name of layers in a database.

“Keyname” field is optional.

On the “Description” tab you can add any text describing the content of this service.

../../_images/admin_layers_create_wfs_description_eng_2.png

Pic. 6.87. WFS service description

On the “Metadata” tab you can enter information in the “key-value” format.

../../_images/admin_layers_create_wfs_metadata_eng_2.png

Pic. 6.88. WFS service metadata

Switch to “WFS service” tab, which is presented on Pic. 6.89. and add required layers to a list (see Pic. 6.89.). For each layer you can set a limit for the number of features returned from the vector layer. By default the value is 1000. If this parameter is set to empty, the limit will be disabled and all features will be returned to the client. This may result in high server load and significant timeouts in case of large data volume.

../../_images/create_wfs_service_settings_en.png

Pic. 6.89. WFS service tab of Create resource dialog

6.5.12.1. Using WFS service

After the resource is created, a URL for the WFS service is available. You can use it in other software, for example NextGIS QGIS.

You can set access permissions for WFS service if needed. See section ngw_access_rights.

WFS services can also be accessed with links of the following type (basic auth is supported):

https://mywebgis.nextgis.com/api/resource/2413/wfs?SERVICE=WFS&TYPENAME=ngw_id_2412&username=administrator&password=mypassword&srsname=EPSG:3857&VERSION=1.0.0&REQUEST=GetFeature

6.5.13. OGC API Features service

The OGC API Features service is configured in the same way as for a WFS service.

NextGIS Web acts as OGC API Features server and publishes OGC API Features services based on vector layers. Third party software can use these services to edit vector data on server. Supported OGC API Features protocol versions is 1.0.0.

To deploy a OGC API Features service press Create resource button and select OGC API Features service (see Pic. 6.90.).

../../_images/ngweb_create_service_OGC_en.png

Pic. 6.90. Selection of “OGC API Features service” resource type

Create resource dialog for OGC API Features service is presented on Pic. 6.91..

../../_images/admin_layers_create_ogc_api_features_service_name_en_2.png

Pic. 6.91. Create resource dialog for OGC API Features service

Enter the name of the resource that will be displayed in the administrator interface. Do not confuse this name with a name of layers in a database.

“Keyname” field is optional.

On the “Description” tab you can add any text describing the content of this service.

../../_images/admin_layers_create_ogc_api_features_service_description_en.png

Pic. 6.92. OGC API Features service description

On the “Metadata” tab you can enter information in the “key-value” format.

../../_images/admin_layers_create_ogc_api_features_service_metadata_en.png

Pic. 6.93. OGC API Features service metadata

Switch to “OGC API Features service” tab, which is presented on Pic. 6.94. and add required layers to a list (see Pic. 6.94.). For each layer you can set a limit for the number of features returned from the vector layer. By default the value is 1000. If this parameter is set to empty, the limit will be disabled and all features will be returned to the client. This may result in high server load and significant timeouts in case of large data volume.

../../_images/admin_layers_create_ogc_api_features_service_settings_en.png

Pic. 6.94. OGC API Features service tab of Create resource dialog

6.5.13.1. Using OGC API Features service

After the resource is created, a URL for the OGC API Features service is available. You can use it in other software, for example QGIS.

You can set access permissions for OGC API Features service if needed. See section ngw_access_rights.

OGC API Features services can also be accessed with links of the following type (basic auth is supported):

hhttps://yourwebgis.nextgis.com/api/resource/208/ogcf

6.5.14. Creation of a Resource group

Resources can be arranged in groups. For example, you can have special groups for base layers, satellite images and topical data.

Groups help organize the layers in the Control panel and make it easier to manage access permissions.

To create a resource group navigate to the group, where you want to create a new one (root group or another). Press Create resource button and select Resource group (see Pic. 6.95.).

../../_images/admin_layers_create_resource_group_en1.png

Pic. 6.95. Selection of “Resource group” resource type

Create resource dialog for resource group is presented on Pic. 6.96..

../../_images/admin_layers_create_group_eng_3.png

Pic. 6.96. Create resource dialog for resource group

In the opened dialog enter the name of the resource that will be displayed in the administrator interface and in the map layer tree, and then click Create.

“Keyname” field is optional.

You can also add resource description and metadata on the corresponding tabs.

6.5.15. Lookup table

To create a lookup table navigate to the group, where you want to create it (root group or another). Press Create resource button and select Lookup table (see Pic. 6.97.).

../../_images/ngweb_create_lookup_en.png

Pic. 6.97. Selection of “Lookup table” resource type

In the opened dialog enter a display name. “Keyname” field is optional.

../../_images/ngweb_admin_layers_create_lookup_eng_3.png

Pic. 6.98. Create resource dialog for lookup table

You can also add resource description and metadata on the corresponding tabs.

Switch from “Resource” tab to the “Lookup table” tab, which is presented on Pic. 6.99.. Add data in the “key-value” format. You can also import a pre-made lookup table from a CSV file.

../../_images/ngweb_creating_a_new_lookuptable_en.png

Pic. 6.99. Lookup table tab of Create resource dialog

Then click Save. The window will then look as on Pic. 6.100.

../../_images/ngweb_new_resource_eng_2.png

Pic. 6.100. Newly created lookup table

To change anything in a lookup table click Update in the “Action” pane. The resource update dialog will open. Switch to “Lookup table” tab where you can change the table’s contents:

  • add a new key-value pair

  • change a current key-value pair

  • delete a key-value pair

A lookup table can be exported to a CSV file.

You can also connect a lookup table to a field of a vector layer. This way while editing the layer you can choose attribute values from the list. To add a lookup table to the layer, open the Edit dialog for the layer and go to the Attributes tab. In the row of the attribute click on the downward arrow in the Lookup table column to select the table.

6.5.16. SVG Marker Library

In Web GIS you can create SVG marker libraries to be displayed using QGIS styles of vector layers. Press Create resource button and select SVG marker library (see Pic. 6.101.).

../../_images/ngweb_create_SVG_lib_en.png

Pic. 6.101. Selecting SVG marker library resource type

In the opened window, enter the name of the resource (see Pic. 6.102.).

../../_images/name_svg_lib_eng_2.png

Pic. 6.102. SVG marker library name

Add description and metadata on the corresponding tabs if you need them. In the SVG marker library tab you need to upload SVG markers from your device. You can upload markers as individual files or as a zip-archive. The archive must contain markers only. After all icons have been uploaded to the library, you will see the list of the file names. Click Create to complete the process (see Pic. 6.103.).

../../_images/ngweb_upload_svg_en.png

Pic. 6.103. Uploading SVG

../../_images/list_svg_eng.png

Pic. 6.104. List of SVG markers uploaded to the library

The process of adding marker libraries to vector layer styles is described here.

6.5.17. File bucket

Important

It is a special type of resource available in Extended edition of NextGIS on-premise. It allows users to create a storage space for any types of files.

On the Resource tab enter a name for the file bucket. It will be displayed in the administrator interface. “Keyname” field is optional.

../../_images/ngw_name_file_bucket_en.png

Pic. 6.105. File bucket name

In the File bucket tab select files or a ZIP archive to extract files from.

../../_images/ngw_upload_file_bucket_en.png

Pic. 6.106. Uploading files to bucket

The “Description” and “Metadata” of the resource can be configured on the corresponding tabs.

After a file bucket is created, its contents can be modified. You can add and delete individual files. If you select a new ZIP archive, the files extracted from it will replace all files added before.

Files stored in the bucket can be viewed in browser (if the file type allows it), saved one-by-one from the context menu or exported all at once as a ZIP archive.

../../_images/ngw_file_bucket_result_en.png

Pic. 6.107. Resource page of a File bucket with the list of included files

6.5.18. Typical structure

With NextGIS Web application experience we recommend the following typical structure for organizing resources.

Typical structure

Main resource group
      Web Maps
              Master Web Map
              Test Web Map
      PostGIS connections
              PostGIS on server
      Data layers
              Base data
                      Borders
                      Infrastructure - linear features
                      Accounting area
              Thematic data
                      Results of measurements on accounting area
                      Results of measurements on accounting routes
                      Observation points for rare species
              Relief
                      ASTER DEM
                              DEM
                              Isolines
              Topographic data
                      Openstreetmap
                              Roads
                              Administrative borders
                              Hydrology
                              Railway stations
                              Railway roads
                              Landuse
                      1 : 100000
                              M-37-015
                              M-37-016
                              M-37-017
              Satellite imagery
                      Landsat-8
                      Ikonos