Skip to content

Folium cannot read VectorTiles #937

@yukexie

Description

@yukexie

import folium
from folium import plugins

vectorTilesPBF= "http://openapi-dev.aurin.org.au/public/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=aurin:GCCSA_2011_AUST&STYLE=&TILEMATRIX=EPSG:900913:{z}&TILEMATRIXSET=EPSG:900913&FORMAT=application/x-protobuf;type=mapbox-vector&TILECOL={x}&TILEROW={y}"
   
vectorTilesJSON= "http://openapi-dev.aurin.org.au/public/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=aurin:GCCSA_2011_AUST&STYLE=&TILEMATRIX=EPSG:900913:{z}&TILEMATRIXSET=EPSG:900913&FORMAT=application/json;type=geojson&TILECOL={x}&TILEROW={y}"
    
rasterTiles= "http://openapi-dev.aurin.org.au/public/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=aurin:GCCSA_2011_AUST&STYLE=&TILEMATRIX=EPSG:900913:{z}&TILEMATRIXSET=EPSG:900913&FORMAT=image/png&TILECOL={x}&TILEROW={y}"    

m= folium.Map(tiles=None, location=[-37, 140],
           zoom_start=6)

m.add_tile_layer(vectorTilesPBF, attr="test")
m'''

Hi, I tried the code above to read different format of spatial data, it works well with raster tiles but showing nothing with geojson and PBF format, not even the base map.

I saw leaflet mapboxvectortiles only available in 0.7.x version and I tried previous folium version 1.5 that fit leaflet 0.7.0 as well but still doesn't work.

Is there any plugins in folium can deal with these vector tiles?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature request or idea about how to make folium better

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions