qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.58k stars 3k forks source link

Vector tiles icons are missing when style uses local sprite directory #57836

Open GallPeters opened 4 months ago

GallPeters commented 4 months ago

What is the bug or the crash?

When loading vector tiles style which contains reference to a local sprite directory, rules (style's layers) using sprite's icons are not visible. I have tried to use absolute path, relative path and even file-url (e.g. "file:///") without any success. However, when serving sprite directory using a localhost (python-http server), style can be viewed propperly.

Steps to reproduce the issue

Archive.zip

  1. Extract zipped directory.

  2. Drag & drop tiles.mbtiles file to QGIS canvas.

  3. Load style.json to mbtiles layer's symbology.

  4. View the layer and expect missing icons as follow:

    image
  5. Initialize local http-sever using python command (inside cmd shell) which serve the extracted directory (e.g. python -m http.server 9000 -d "path\to\extracted\directory".

  6. Change the sprite url inside style.json so it will point to the served directory as follow:

    image
  7. Save the change.

  8. Load style.json to mbtiles layer's again.

  9. View the layer and expect visible icons as follow:

    image

Versions

QGIS version 3.34.7-Prizren QGIS code revision 6f7d735c Qt version 5.15.13 Python version 3.12.3 GDAL/OGR version 3.9.0 PROJ version 9.4.0 EPSG Registry database version v11.004 (2024-02-24) GEOS version 3.12.1-CAPI-1.18.1 SQLite version 3.45.1 PDAL version 2.6.3 PostgreSQL client version 16.2 SpatiaLite version 5.1.0 QWT version 6.2.0 QScintilla2 version 2.14.1 OS version Windows 11 Version 2009

Active Python plugins db_manager 0.1.20 grassprovider 2.12.99 MetaSearch 0.3.6 processing 2.12.99


QGIS version 3.36.3-Maidenhead QGIS code revision 2df96554 Qt version 5.15.13 Python version 3.12.3 GDAL/OGR version 3.9.0 PROJ version 9.4.0 EPSG Registry database version v11.004 (2024-02-24) GEOS version 3.12.1-CAPI-1.18.1 SQLite version 3.45.1 PDAL version 2.6.3 PostgreSQL client version 16.2 SpatiaLite version 5.1.0 QWT version 6.2.0 QScintilla2 version 2.14.1 OS version Windows 11 Version 2009

Active Python plugins cartography_tools 1.2.1 cartolinegen 3.2.2 data_sources_panel 0.2.1 geocatbridge 4.4.1 HCMGIS 24.1.12 lockzoom 3.0.4 MemoryLayerSaver 5.0.2 OSMDownloader 1.0.3 postgisQueryBuilder 2.0.1 postgis_geoprocessing 0.9 qgis-maptiler-plugin 3.3 Qgis2threejs 2.7.3 QuickOSM 2.2.3 quick_map_services 0.19.34 qwc2_tools v1.3.0 searchlayers 3.0.16 SRTM-Downloader 3.2.2 zoom_level 0.3.1 db_manager 0.1.20 MetaSearch 0.3.6 processing 2.12.99

Supported QGIS version

New profile

Additional context

No response

GallPeters commented 1 month ago

I have found the cause of the problem. I use QGIS that is installed on Windows (11) and it turns out that QGIS (or is it mapbox/json spec?) can not handle the colon (:) that comes after the drive name in the folder path:

image

If I define the folder which contains the style and sprite files as a network path QGIS finds the folder and render sprite's icon properly :

image

This is strange behavior due to the fact that ESRI's vtpk holds style and sprite files in a regular folder (not a network path) and still manages to fetch and render icons properly.