tracktable.render.map_processing.maps module

Module contents

tracktable.render.map_processing.maps.airport_map(airport_id, region_size=(200, 200), projection=None)[source]

Draw a map for a region surrounding an airport.

Create a map for the region surrounding the requested airport.

The region will be a rectangle in lon/lat space with the specified width and height in KM. We’ll do our best to convert those into a lat/lon bounding box.

We default to the Miller Cylindrical projection. It does a pretty good job of showing the world in familiar shapes although distortion sets in above/below about 50 degrees. Fortunately, things are still quite recognizable. If you would prefer a different projection then change the value of projection from cartopy.crs.Miller to something else.

Parameters

airport_id (str) – ID of the airport to generate a map around. example ‘ORD’ or ‘KORD’ for O’Hare.

Keyword Arguments
  • region_size (point2d) – (Default: (200, 200))

  • projection (Matplotlib axes) – (Default: None)

Returns

This function returns axes for Matplotlib.

tracktable.render.map_processing.maps.available_maps()[source]

Supply available maps :returns: All available maps

tracktable.render.map_processing.maps.city_map(*args)[source]

city_map is not implemented yet

tracktable.render.map_processing.maps.instantiate_map(min_corner, max_corner, projection=None)[source]

Draw a map with custom projection and bounding box.

If min_corner and max_corner are set then we will set the map extents to match. If they are None then we will stick with whatever the defaults for the map projection are. You will always want to specify the extents unless the projection doesn’t have any (e.g. whole-globe projections) or is defined with special extents (the OSGB projection, sensible for the UK and not much else).

Parameters
  • min_corner (point2d) – (lon, lat) coordinates of southwest corner

  • max_corner (point2d) – (lon, lat) coordinates of northeast corner

Keyword Arguments

projection (Matplotlib axes) – a projection from cartopy.crs (Default: None)

Returns

Matplotlib Axes instance

tracktable.render.map_processing.maps.instantiate_map_global(projection=None)[source]

Draw a map with custom projection gloabl extent.

Keyword Arguments

projection (Matplotlib axes) – a projection from cartopy.crs (Default: None)

Returns

Matplotlib Axes instance

tracktable.render.map_processing.maps.predefined_map(mapname, region_size=(200, 200), projection=None)[source]

Create a map of one of several familiar regions in the world.

You can ask for one of three types of map.

Region: one of ‘region:conus’ (continental US), ‘region:europe’,

‘region:world’, ‘region:north_america’, ‘region:south_america’, ‘region:australia’

Airport: ‘airport:DFW’ where ‘DFW’ is the 3- or 4-letter ICAO

abbreviation for the airport you want

City (NOT YET IMPLEMENTED): ‘city:WashingtonDC’ where

‘WashingtonDC’ is the city name without spaces or punctuation marks.

For the airport and city maps you may specify an additional ‘region_size’ argument that gives the desired width and height of the map region in KM. For example, a 200km-by-100km window centered on St. Louis airport could be created this way:

my_map_axes = predefined_map(‘airport:STL’,

region_size=(200, 100))

Parameters

mapname (str) – String naming which predefined map you want

Keyword Arg:

region_size (point2d): 2-element tuple with (width, height) as km (Default: (200, 200)) projection (Matplotlib axes): a projection from cartopy.crs (Default: None)

Returns

Matplotlib axes (via Cartopy) into which you can render your data

tracktable.render.map_processing.maps.region_map(region_name, projection=None)[source]

Create map for predefined region

Create a geographic map for one of several common regions in the world. For a list of supported regions please see tracktable.maps.available_maps().

Parameters

region_name (str) – Name of desired region

Keyword Arguments

projection (Matplotlib axes) – a projection from cartopy.crs (Default: None)

Returns

Cartopy axes for given region