cartopy.io.img_tiles.GoogleWTS#
- class cartopy.io.img_tiles.GoogleWTS(desired_tile_form='RGB', user_agent='CartoPy/0.25.1.dev120+ge2b775d75', cache=False, *, layer=None, style=None, resolution='')[source]#
Implement web tile retrieval using the Google WTS coordinate system.
- Parameters:
desired_tile_form (str, optional) – The desired format of the tile (defaults to “RGB”).
user_agent (str, optional) – Some providers (like OSM) need a “user_agent” in the request (see Issue #1341). OSM may reject requests if there are too many of them, in which case a change of
user_agentmay fix the issue.cache (bool or pathlib.Path or str, optional) – To allow offline use, as well as not spam tile providers, Cartopy can create a local cache of previously fetched tiles. The default path is
cartopy.config["cache_dir"]. If it is set toTrue, the default path is used. If it is set to a custom path, then this path is used instead of the default one. If it is set toFalse, the tiles are downloaded each time.layer (str, optional) – Some providers (like LINZ and Ordnance Survey) offer tiles of different layers.
style (str, optional) – Some providers (like Google, Mapbox, Stadia, Stamen and Thunderforest) offer tiles in different styles.
resolution (str, optional) – Some providers (like Stadia and Thunderforest) offer tiles at different resolutions.
Notes
A “tile” in this class refers to the coordinates (x, y, z).
- find_images(target_domain, target_z, start_tile=(0, 0, 0))#
Target domain is a shapely polygon in native coordinates.
- tile_bbox(x, y, z, y0_at_north_pole=True)[source]#
The
(x0, x1), (y0, y1)bounding box for the given tile position.- Parameters:
x (int) – The x tile coordinate in the Google tile numbering system.
y (int) – The y tile coordinate in the Google tile numbering system.
z (int) – The z tile coordinate in the Google tile numbering system.
y0_at_north_pole (bool, optional) – Boolean representing whether the numbering of the y coordinate starts at the north pole (as is the convention for Google tiles) or not (in which case it will start at the south pole, as is the convention for TMS). Defaults to True.