WMTS

class visigoth.map_layers.wmts.WMTS(type='osm')

Create a WMTS plot

Keyword Arguments

type (str) – satellite or osm

Example

Screenshot (Link to open SVG for interactive features):

../_images/example37.png

Source Code (Link to Github):


import os.path
import sys
import argparse
import random

from visigoth import Diagram
from visigoth.containers.map import Map
from visigoth.map_layers.wmts  import WMTS
from visigoth.utils.mapping import Mapping
from visigoth.containers.box import Box
from visigoth.common.text import Text
from visigoth.map_layers.geoplot import Geoplot, Multipoint


if __name__ == "__main__":

    parser = argparse.ArgumentParser()
    parser.add_argument("--outpath", help="path for output SVG", default="example.svg")
    args = parser.parse_args()

    d = Diagram(fill="white")

    bounds = ((166.509144322, -46.641235447),(178.517093541, -34.4506617165))
    
    # bounds = ((168.75, -45.089035564831015),(174.375, -40.97989806962013))

    m1 = Map(512,boundaries=bounds,zoom_to=2)
    m1.addLayer(WMTS("osm"))
    m1.addLayer(Geoplot(multipoints=[Multipoint([(172.639847,-43.525650)],label="Christchurch",marker=True,fill="#FF000050")]))
    d.add(Box(m1))

    svg = d.draw()

    f = open(args.outpath, "wb")
    f.write(svg)
    f.close()