3

As shown in screenshot 1, I have configured access to a Vector Tiles service in the QGIS desktop. This service returns a layer of polygons in PBF file format.

Screenshot 1 - Setting up and loading a Vector Tiles service:

enter image description here

On the other hand, as can be seen in screenshot 2, with the identify tool it is possible to query the attributes of a free set of polygons (by dragging the Identify tool), but it is only possible to copy in memory the attributes of a single feature at the same time.

Screenshot 2 - Identifying a set of geometries and displaying attributes:

enter image description here

Also, it is not possible to access the entire attribute table of a Vector Tiles service, nor is it possible to use the Export tool to save the data (geometries and attributes) to a local file format such as GPKG, for example.

I am looking for an alternative to get all the data (geometries and attributes or just attributes) downloaded from the Vector Tiles service, but I am not sure if this is possible. I would like to ask for help on this platform to clarify if this possibility is technically possible and, if possible, how I could achieve it.

Adding more details and information:

To a Vector Tiles service is able to be applied on the fly the Geometry Generator, e.g. represent polygons as centroids (see screenshot 3). However, its attribute table cannot be accessed.

I understand that this detail may be unrelated to the objective of download the data, and perhaps not significant either. I bring this detail because it seemed to me that if the geometry modification capabilities of the service works, it would seem that it should be possible to access the attribute table or it should be possible, somehow, to copy or download the geometries.

Screenshot 3 - Geometry Generator applied to a Vector Tiles service:

enter image description here

4
  • 2
    This seems like an XY problem - could you describe what you are trying to do as well as what you have tried so far.
    – Ian Turton
    Aug 2, 2023 at 8:22
  • 1
    The solutions I have attempted so far are those offered as standard in the QGIS toolkit, e.g. Export, Copy Features. It seems that none of these tools is prepared to work with Vector Tiles services. My last idea is to get all the data by creating a Virtual layer that connects to the Vector Tiles service, but at the moment I don't know if this is a possible and logical solution
    – Acperience
    Aug 2, 2023 at 8:28
  • 3
    Vector tile are intended for basemap display rather than anything else. Are you sure that the data are not available in a more appropriate format (like WFS or as dataset download ) ?
    – J.R
    Aug 2, 2023 at 8:29
  • 1
    I have thought the same (Vector tiles are only intended for visualisation). In this case, this service also has associated attributes and it seems that the QGIS Identify tool retrieves this data each time a geometry or set of geometries is queried. I have noticed that if the set of geometries to be Identify is very large, QGIS takes more time but at the end it returns the tree of the queried listing. I don't know if the QGIS Identify tool works as a WFS service, and I think that the attributes of this service are not available in WFS service either
    – Acperience
    Aug 2, 2023 at 8:36

1 Answer 1

1

As the others mentioned, this is likely not the intended use of these services but I may have found a workaround for your issue, though it may be time-consuming with a large set of features.

I was able to extract geometries and their attributes using the selection tool from this service. I selected the desired geometries by area icon of the select by area tool, then copied them to the clipboard (Ctrl+C) and pasted them onto a new temporary scratch layer via Edit -> Paste Features As -> Temporary Scratch Layer (Ctrl+Alt+V). Edit: I found out that the desired type of geometry can be controlled by opening the layer properties and then making the unwanted geometries invisible. In my screenshot I turned of the lines and points but kept the polygons turned on. This way the select tool will only select the polygons on the layer and copy these to the clipboard.

screenshot of layer properties with only polygons turned on

I am curious to know if the above solution works for you.

Solution not implemented

I add the description of the loading of the proposed example of the other Vector Tiles service to show that I cannot reproduce the workflow of the solution proposed in this answer:

Loading the alternative Vector Tiles service

enter image description here

Once loaded, I can access the Identify tool to retrieve the attributes of the geometries, but I cannot use the Select Feature tool to copy the features and attributes to the clipboard:

Identify tool working

enter image description here

Select feature tool not working

enter image description here

Export file tool without option to save/download layers

enter image description here

Open attribute table tool not available on context menu layer

enter image description here

5
  • Unfortunately, in this Vector Tiles service it is not possible to use the Select Feature by Area or Single click tool. It seems that Vector Tiles services do not support the QGIS Select Features tool. On the other hand, it would be great just to be able to copy the entire attribute table without the geometries. But as I tried, the alternative you propose fails to capture neither geometries nor attributes because when you select the layer, the QGIS Select Features tool has automatically disable. Thank you very much for your input. Other ideas are welcome as well
    – Acperience
    Aug 2, 2023 at 10:05
  • 1
    I tried my suggested method with a different service (this one) and the select feature worked for that one as well. Both services I used were also in the {z}/{x}/{y}.pbf format. I'm not an expert on Vector Tiles services, but I guess the service provider has the control to add this functionality or there are different versions of the service.
    – yannikw
    Aug 3, 2023 at 7:51
  • Thank you for doing these tests. I have used in my QGIS the Vector Tiles service you propose and I can't reproduce what you explain in your answer. In my case, I can load the service but I can't select the desired geometries because the Select Feature tool is disabled even if I have the focus on the service layer. Below I edit your answer with some screenshots of the steps I follow that show the problem I am encountering. See if you can give me some hints on how I can fix it.
    – Acperience
    Aug 3, 2023 at 8:34
  • I only saw your edit to my answer just now! Thanks for testing my suggested answer and giving such detailed screenshots. I compared my settings to yours and they are all the exact same. However, in my case the Select Feature Tool is working with the Vector Tiles Service... What QGIS version are you on? I'm on QGIS 3.28.7-Firenze.
    – yannikw
    Aug 25, 2023 at 7:25
  • I also found a way to control the type of geometry that is selected by the Select Features Tool, once you get that to work. I added it to my original post as an edit with a screenshot!
    – yannikw
    Aug 25, 2023 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.