7.7. Services
Resources have auto-generated links that you can use to add the data to third-party applications:
Vector layers have link for MVT Tiles;
Layer style (vector or raster), Web Map and WMS layer have TMS link;
Additionally, you can create services that allow to access data via standard protocols:
7.7.1. MVT vector tiles
For each new vector layer NextGIS Web automatically generates a link that can be used to access the data as MVT (Map Vector Tiles, specification).
7.7.1.1. The main advantages of MVT
With MVT you can store and transmit large volumes of geographical data in a compact format. This makes MVT especially useful for web maps and mobile applications, where it is crucial to use network resources efficiently and provide quick access to the data.
The main advantages of this format are:
Fast data rendering;
Dynamic labels and map elements;
Big variety and flexible customization of data styles (display filters based on scale, time etc).
Each tile includes vector geometrical data and attributes for a specific rectangular region of the map and contains all the necessary data for displaying a particular zoom level. Data is organized into layers, which can contain different types of geometry and attributes.
MVT is supported by multiple libraries and tools for reading, writing, and displaying tiles
libraries (Mapbox GL, OpenLayers, Leaflet)
tile processing tools such as Tippecanoe and Mapbox Studio.
7.7.1.2. Generating MVT link
For every vector layer created in NextGIS Web a link to vector tiles is generated automatically:
The highlighted parts are the Web GIS URL and the resource ID of the vector layer.
You can use it in third-party web applications and map builders. This link is used to transmit the information about the layer. The layer’s style is configured on the client side.
You’ll find this link in the External access section of the resource page.

Pic. 7.67. MVT link on the resource page
7.7.1.3. Using MVT with NextGIS Frontend Libraries
To connect a vector layer as MVT to your application all you need is the URL of your Web GIS and the resource ID. Our team has developed JavaScript libraries for this purpose.
All libraries are available for free download on NextGIS Frontend.
The service also provides examples of their use. Let’s take one of these examples to display a vector layer.
Add the link to the Web GIS to the “baseURL” line (32) and the resource ID to the “resource” line (38).
Open the HTML page in a web browser to see the map. You can configure additional map elements using NextGIS Frontend.
To display data from your Web GIS in external applications, you need to open read access to the layer in the Web GIS settings. Alternatively, you can specify Web GIS login credentials in the web application itself.
In the Web GIS settings, you need to configure your CORS (Cross-Origin Resource Sharing) settings.
7.7.1.4. Connecting MVT from NextGIS Web to QGIS
You can use the link to vector tiles generated by NextGIS Web in QGIS to set up representation of a vector layer from your Web GIS in the desktop application.
To connect the tiles, select Layer -> Add layer -> Add Vector Tile Layer in QGIS.
You can use the layer as a basemap, customize its style, identify objects and view attribute descriptions.
7.7.2. 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.
TMS service is automatically created for the following resource types:
Vector layer style
Raster layer style
WMS layer
Web Map
You’ll find this link in the External access section of the resource page.
The link should look like this:
This link allows you to use any layer created in Web GIS as a basemap.
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>
7.7.3. OGC API – Features service
Vector data uploaded to Web GIS can be published via OGC API Features protocol. This allows editing data with external applications.
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 admin_layers_create_ogc_api_features_service_en
).

Pic. 7.68. Selecting “OGC API Features service” resource type
Enter the name of the resource that will be displayed in the administrator interface.

Pic. 7.69. Display name for OGC API Features service
Also you can add Description and metadata.
Switch to “OGC API Features service” tab and add required layers to a list (see Pic. 7.70.) 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.

Pic. 7.70. OGC API Features service tab of Create resource dialog
7.7.3.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.
OGC API Features services can also be accessed with links of the following type (basic auth is supported):
https://yourwebgis.nextgis.com/api/resource/208/ogcf
7.7.4. WFS service
WFS service works similarly to WMS layer, 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. 7.71.).

Pic. 7.71. Selecting “WFS service” resource type
Enter the name of the resource that will be displayed in the administrator interface.
Also you can add Description and metadata.
On the “WFS service” tab add required layers to a list (see Pic. 7.72.). 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.

Pic. 7.72. WFS service tab of Create resource dialog
7.7.4.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 this section for details. WFS allows to edit data in desktop apps.
Tip
If you use QGIS to edit your data stored in Web GIS, you can also access it directly via NextGIS Connect.
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
7.7.5. WMS service
NextGIS Web can be used as WMS server. This protocol is provides 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. 7.73.).

Pic. 7.73. Selecting “WMS service” resource type
Enter the name of the resource that will be displayed in the administrator interface.

Pic. 7.74. Create resource dialog for WMS service
Also you can add Description and metadata.
Switch to “WMS service” tab and add links to required layers or layer styles. You can also set the min and max scale for the data visualization.

Pic. 7.75. 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.
NextGIS Web layer can be added to desktop, mobile and Web GIS in different ways.
7.7.5.1. Using WMS service
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. All it requires it the URL of the WMS service. 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