tracktable.render.map_processing.maps module

Module contents

tracktable.render.map_processing.maps.airport_map(airport_id, region_size=(200, 200), projection=<class 'cartopy.crs.Miller'>)[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: cartopy.crs.Miller)

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(city_name, city_country=None, city_location=None, region_size=(200, 200), projection=<class 'cartopy.crs.Miller'>)[source]

Draw a map for a region surrounding a city.

Create a map for the region surrounding the requested city.

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:

city_name (str) – Name of the city to generate a map around.

Keyword Arguments:
  • city_country (str) – two character country code. (Default: None).

  • city_location (tuple, TrajectoryPoint, BasePoint) – location to search near (Default: None).

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

  • projection (Matplotlib axes) – Cartopy projection to generate a map onto. (Default: cartopy.crs.Miller)

Returns:

This function returns axes for Matplotlib.

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.port_map(port_name, port_country=None, region_size=(200, 200), projection=<class 'cartopy.crs.Miller'>)[source]

Draw a map for a region surrounding a port.

Create a map for the region surrounding the requested port.

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:

port_name (str) – Name of the port to generate a map around.

Keyword Arguments:
  • port_country (str) – Country that the port is located in. Required if a port_name matches multiple ports. (Default: None)

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

  • projection (Matplotlib axes) – Cartopy projection to generate a map onto. (Default: cartopy.crs.Miller)

Returns:

This function returns axes for Matplotlib.

tracktable.render.map_processing.maps.predefined_map(mapname, country=None, location=None, 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 four 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

Port: ‘port:Alexandria’ where ‘Alexandria’ is the port name

City: ‘city:WashingtonDC’ where ‘WashingtonDC’ is the city name

without spaces or punctuation marks.

For the airport, port 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))

For the port and city maps you may need to specify the country (ports and cities) or location (cities) to search near if the port or city shares a name with another port or city in our internal database.

my_map_axes = predefined_map('port:Newport', country="United Kingdom")
Parameters:

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

Keyword Arg:

country (str): Two character country code for city maps, full country name for port maps. Required if a port or city name matches multiple items. (Default: None). location (tuple, TrajectoryPoint, BasePoint): Location to search near, exclusively used for city maps (Default: None). 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