cartopy.io.img_tiles.OrdnanceSurvey#

class cartopy.io.img_tiles.OrdnanceSurvey(apikey, layer='Road_3857', desired_tile_form='RGB', cache=False)[source]#

Implement web tile retrieval from Ordnance Survey map data. To use this tile image source you will need to obtain an API key from Ordnance Survey. You can get a free API key from https://osdatahub.os.uk

For more details on Ordnance Survey layer styles, see https://osdatahub.os.uk/docs/wmts/technicalSpecification.

For the API framework agreement, see https://osdatahub.os.uk/legal/apiTermsConditions.

Parameters:
  • apikey (required) – The authentication key provided by OS to query the maps API

  • layer (optional) –

    The style of the Ordnance Survey map tiles. One of ‘Outdoor’, ‘Road’, ‘Light’, ‘Night’, ‘Leisure’. Defaults to ‘Road’. Details about the style of layer can be found at:

  • desired_tile_form (optional) – Defaults to ‘RGB’.

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)#

Return the (x0, x1), (y0, y1) bounding box for the given x, y, z tile position.

Parameters:
  • x – The x tile coordinate in the Google tile numbering system.

  • y – The y tile coordinate in the Google tile numbering system.

  • z – The z tile coordinate in the Google tile numbering system.

  • y0_at_north_pole (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.

tileextent(x_y_z)#

Return extent tuple (x0,x1,y0,y1) in Mercator coordinates.