[Qgis-user] QGIS Local XYZ Tiles

Nyall Dawson nyall.dawson at gmail.com
Thu Sep 20 15:31:58 PDT 2018


On Thu, 20 Sep 2018 at 06:31, Justin Robinson <jdr at spatialbias.com> wrote:
>
> Hi Kyle,
>
> It looks like that's not currently possible, it still has an open request in the tracker as well: https://issues.qgis.org/issues/16587
>
> It probably does boil down to lack of status/content-type for file:// locations. A work around seems to be hosting with a web server of some kind (I'm guessing even Python's http module would suffice: "python3 -m http.server" or in python2 "python -m SimpleHTTPServer" and then localhost:8000 by default).

If someone has a build environment available to test this, I think the
fix might be changing the condition in qgswmsprovider.cpp line 3887 to

    if ( !contentType.isEmpty() && !contentType.startsWith(
QLatin1String( "image/" ), Qt::CaseInsensitive ) &&
         contentType.compare( QLatin1String(
"application/octet-stream" ), Qt::CaseInsensitive ) != 0 )
    { ...

(i.e. insert the "!contentType.isEmpty()" check)

I've no local xyz tiles available to test this with.

Nyall


>
> Cheers,
> Justin
>
> On Tue, Sep 18, 2018 at 8:43 AM Kyle <kylesulek at gmail.com> wrote:
>>
>> I am struggling to get file urls to work with the QGIS tiles layer. I have followed the instructions here:
>>
>> https://www.spatialbias.com/2018/02/qgis-3.0-xyz-tile-layers/
>>
>> Under the URL field, I put "file:///home/kyle/Documents/tiles/{z}/{x}/{y}.png" (without quotes)
>>
>> I also set the min and max zoom levels to 3 and 8 respectively. It is worth noting that the tile set that I am pointing at is not complete and only covers North America.
>>
>> My problem is that nothing shows up on the screen after I add the layer. Am I missing something? Everything works correctly when I point to a online tile server (i.e openstreetmaps).
>>
>> It appears that I'm not the only one to have this issue:
>> https://gis.stackexchange.com/questions/219118/how-to-use-qgis-tile-server-provider-with-local-tms-folder
>>
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


More information about the Qgis-user mailing list