CartoCosmos module

class CartoCosmos.planetary_maps(targetName)

Bases: object

The Central class that creates interactive planetary maps in Jupyter Notebooks. Works with all target bodies supported by the USGS by loading the body’s base layers and overlays in a LayerCollection.

add_wfs_features()

Grabs and Adds the wfs surface features layer to the map for the specific target.

add_wkt(wktString)

Takes in a Well-Known text string and draws it on the planetary map

Parameters:wktString (String) – Well-Known text string to draw on the map.
Raises:Invalid WKT String.
create_layers()

Grabs all the layers for the specific target.

create_map()

Creates the map instance of the specific target. Also adds all the controls to the map.

display_map()

Displays the map and the GUI elements to the screen.

find_radius()

Finds the a and c axis radii of that specific target.

handle_WKT_button(*args, **kwargs)

Will draw the Well-Known text string in the text box on click of draw button.

Parameters:
  • args (Event) – On click of drawn button
  • kwargs (Object) – WKT button.
handle_draw(*args, **kwargs)

Creates and displays the Well-Known text string when the user draws a shape on the map.

Parameters:
  • args (Event) – On draw.
  • kwargs (Object) – The GeoJson of the shape that was drawn.
handle_feature_click(feature=None, coordinates=None, **kwargs)

Highlights the specific feature when you click on it on the map.

Parameters:
  • feature (String) – feature name.
  • coordinates (List) – Coordinates of the clicked position.
  • kwargs (Event) – On click.
Return type:

NULL

handle_fullscreen(*args, **kwargs)

On fullscreen will add GUI elements to the map. The GUI elements will go away when fullscreen is closed.

Parameters:
  • args (Event) – On interaction with Leaflet map.
  • kwargs (Object) – Leaflet’s map object.
handle_interaction(**kwargs)

Gets and displays the coordinates of the user’s mouse position on the map. Takes in the GUI coordinate handler in order to display different longitude directions and ranges as well as different latitude types.

Parameters:kwargs (Event) – Leaflet’s Interaction Object.
class CartoCosmos.planetary_gui

Bases: object

Creates the GUI elements needed for the Planetary Maps.

create_widgets()

Initializes the different GUI elements

get_draw_label()

Getter method for the Well-Known Text Draw Label.

Return type:Well-Known Text Draw Label Object
get_lat_domain()

Getter method for the Latitude Domain Selector.

Return type:Latitude Domain Selector Object
get_lat_lon_label()

Getter method for the Coordinate Input Box.

Return type:Coordinate Input Box Object
get_longitude_direction()

Getter method for the Longitude Direction Selector.

Return type:Longitude Direction Selector Object
get_longitude_range()

Getter method for the Longitude Range Selector.

Return type:Longitude Range Selector Object
get_wkt_button()

Getter method for the Well-Known Text button.

Return type:Well-Known Text button Object
get_wkt_text_box()

Getter method for the Well-Known Text Box.

Return type:Well-Known Text Box Object