当前位置: 首页>>代码示例>>Python>>正文


Python Graph.gps_coordinates方法代码示例

本文整理汇总了Python中sage.graphs.graph.Graph.gps_coordinates方法的典型用法代码示例。如果您正苦于以下问题:Python Graph.gps_coordinates方法的具体用法?Python Graph.gps_coordinates怎么用?Python Graph.gps_coordinates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sage.graphs.graph.Graph的用法示例。


在下文中一共展示了Graph.gps_coordinates方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: WorldMap

# 需要导入模块: from sage.graphs.graph import Graph [as 别名]
# 或者: from sage.graphs.graph.Graph import gps_coordinates [as 别名]
def WorldMap():
    """
    Returns the Graph of all the countries, in which two countries are adjacent
    in the graph if they have a common boundary.

    This graph has been built from the data available
    in The CIA World Factbook [CIA]_ (2009-08-21).

    The returned graph ``G`` has a member ``G.gps_coordinates``
    equal to a dictionary containing the GPS coordinates
    of each country's capital city.

    EXAMPLES::

        sage: g=graphs.WorldMap()
        sage: g.has_edge("France","Italy")
        True
        sage: g.gps_coordinates["Bolivia"]
        [[17, 'S'], [65, 'W']]
        sage: sorted(g.connected_component_containing_vertex('Ireland'))
        ['Ireland', 'United Kingdom']

    REFERENCE:

    .. [CIA] CIA Factbook 09 https://www.cia.gov/library/publications/the-world-factbook/
    """
    edges = [
        ('Afghanistan', 'China', None), ('Afghanistan', 'Iran', None),
        ('Afghanistan', 'Uzbekistan', None), ('Albania', 'Greece', None),
        ('Albania', 'Kosovo', None), ('Albania', 'Macedonia', None),
        ('Albania', 'Montenegro', None), ('Algeria', 'Morocco', None),
        ('Algeria', 'Tunisia', None), ('Andorra', 'Spain', None),
        ('Angola', 'Democratic Republic of the Congo', None), ('Angola', 'Namibia', None),
        ('Angola', 'Zambia', None), ('Argentina', 'Bolivia', None),
        ('Argentina', 'Brazil', None), ('Argentina', 'Chile', None),
        ('Argentina', 'Paraguay', None), ('Argentina', 'Uruguay', None),
        ('Armenia', 'Georgia', None), ('Armenia', 'Iran', None),
        ('Austria', 'Germany', None), ('Azerbaijan', 'Armenia', None),
        ('Azerbaijan', 'Georgia', None), ('Azerbaijan', 'Iran', None),
        ('Azerbaijan', 'Russia', None), ('Azerbaijan', 'Turkey', None),
        ('Bangladesh', 'Burma', None), ('Belgium', 'Germany', None),
        ('Belgium', 'Netherlands', None), ('Belize', 'Mexico', None),
        ('Benin', 'Burkina Faso', None), ('Benin', 'Niger', None),
        ('Benin', 'Nigeria', None), ('Benin', 'Togo', None),
        ('Bolivia', 'Brazil', None), ('Bolivia', 'Chile', None),
        ('Bolivia', 'Paraguay', None), ('Bolivia', 'Peru', None),
        ('Bosnia and Herzegovina', 'Croatia', None), ('Bosnia and Herzegovina', 'Montenegro', None),
        ('Bosnia and Herzegovina', 'Serbia', None), ('Brazil', 'Colombia', None),
        ('Brazil', 'Guyana', None), ('Brazil', 'Suriname', None),
        ('Brazil', 'Venezuela', None), ('Bulgaria', 'Greece', None),
        ('Bulgaria', 'Macedonia', None), ('Bulgaria', 'Romania', None),
        ('Bulgaria', 'Serbia', None), ('Burkina Faso', 'Mali', None),
        ('Burkina Faso', 'Niger', None), ('Burkina Faso', 'Togo', None),
        ('Burundi', 'Democratic Republic of the Congo', None), ('Cambodia', 'Laos', None),
        ('Cambodia', 'Thailand', None), ('Cambodia', 'Vietnam', None),
        ('Cameroon', 'Central African Republic', None), ('Cameroon', 'Chad', None),
        ('Cameroon', 'Equatorial Guinea', None), ('Cameroon', 'Nigeria', None),
        ('Cameroon', 'Republic of the Congo', None), ('Canada', 'United States', None),
        ('Central African Republic', 'Chad', None), ('Central African Republic', 'Democratic Republic of the Congo', None),
        ('Central African Republic', 'Sudan', None), ('Chad', 'Niger', None),
        ('Chad', 'Nigeria', None), ('Chad', 'Sudan', None),
        ('China', 'Bhutan', None), ('China', 'Burma', None),
        ('China', 'Hong Kong', None), ('China', 'Kazakhstan', None),
        ('China', 'Kyrgyzstan', None), ('China', 'Mongolia', None),
        ('China', 'Nepal', None), ('China', 'North Korea', None),
        ('China', 'Russia', None), ('China', 'Vietnam', None),
        ('Colombia', 'Venezuela', None), ('Costa Rica', 'Nicaragua', None),
        ("Cote d'Ivoire", 'Burkina Faso', None), ("Cote d'Ivoire", 'Guinea', None),
        ("Cote d'Ivoire", 'Mali', None), ('Cyprus', 'Akrotiri', None),
        ('Cyprus', 'Dhekelia', None), ('Czech Republic', 'Austria', None),
        ('Czech Republic', 'Germany', None), ('Czech Republic', 'Poland', None),
        ('Democratic Republic of the Congo', 'Zambia', None), ('Denmark', 'Germany', None),
        ('Djibouti', 'Eritrea', None), ('Dominican Republic', 'Haiti', None),
        ('Ecuador', 'Colombia', None), ('El Salvador', 'Honduras', None),
        ('Ethiopia', 'Djibouti', None), ('Ethiopia', 'Eritrea', None),
        ('Ethiopia', 'Kenya', None), ('Ethiopia', 'Somalia', None),
        ('Ethiopia', 'Sudan', None), ('Finland', 'Russia', None),
        ('Finland', 'Sweden', None), ('France', 'Andorra', None),
        ('France', 'Belgium', None), ('France', 'Brazil', None),
        ('France', 'Germany', None), ('France', 'Italy', None),
        ('France', 'Luxembourg', None), ('France', 'Spain', None),
        ('France', 'Suriname', None), ('France', 'Switzerland', None),
        ('Gabon', 'Cameroon', None), ('Gabon', 'Equatorial Guinea', None),
        ('Gabon', 'Republic of the Congo', None), ('Gaza Strip', 'Egypt', None),
        ('Gaza Strip', 'Israel', None), ('Ghana', 'Burkina Faso', None),
        ('Ghana', "Cote d'Ivoire", None), ('Ghana', 'Togo', None),
        ('Gibraltar', 'Spain', None), ('Guatemala', 'Belize', None),
        ('Guatemala', 'El Salvador', None), ('Guatemala', 'Honduras', None),
        ('Guatemala', 'Mexico', None), ('Guinea', 'Sierra Leone', None),
        ('Guinea-Bissau', 'Guinea', None), ('Guinea-Bissau', 'Senegal', None),
        ('Honduras', 'Nicaragua', None), ('Hungary', 'Austria', None),
        ('Hungary', 'Croatia', None), ('Hungary', 'Serbia', None),
        ('India', 'Bangladesh', None), ('India', 'Bhutan', None),
        ('India', 'Burma', None), ('India', 'China', None),
        ('India', 'Nepal', None), ('Indonesia', 'Papua New Guinea', None),
        ('Iran', 'Iraq', None), ('Ireland', 'United Kingdom', None),
        ('Israel', 'Egypt', None), ('Italy', 'Austria', None),
        ('Jordan', 'Iraq', None), ('Jordan', 'Israel', None),
        ('Jordan', 'Syria', None), ('Jordan', 'West Bank', None),
        ('Kazakhstan', 'Kyrgyzstan', None), ('Kenya', 'Somalia', None),
#.........这里部分代码省略.........
开发者ID:mcognetta,项目名称:sage,代码行数:103,代码来源:world_map.py

示例2: WorldMap

# 需要导入模块: from sage.graphs.graph import Graph [as 别名]
# 或者: from sage.graphs.graph.Graph import gps_coordinates [as 别名]
def WorldMap():
    """
    Returns the Graph of all the countries, in which two countries are adjacent
    in the graph if they have a common boundary.

    This graph has been built from the data available
    in The CIA World Factbook [CIA]_ (2009-08-21).

    The returned graph ``G`` has a member ``G.gps_coordinates``
    equal to a dictionary containing the GPS coordinates
    of each country's capital city.

    EXAMPLE::

        sage: g=graphs.WorldMap()
        sage: g.has_edge("France","Italy")
        True
        sage: g.gps_coordinates["Bolivia"]
        [[17, 'S'], [65, 'W']]
        sage: sorted(g.connected_component_containing_vertex('Ireland'))
        ['Ireland', 'United Kingdom']

    REFERENCE:

    .. [CIA] CIA Factbook 09 https://www.cia.gov/library/publications/the-world-factbook/
    """
    edges = [
        ("Afghanistan", "China", None),
        ("Afghanistan", "Iran", None),
        ("Afghanistan", "Uzbekistan", None),
        ("Albania", "Greece", None),
        ("Albania", "Kosovo", None),
        ("Albania", "Macedonia", None),
        ("Albania", "Montenegro", None),
        ("Algeria", "Morocco", None),
        ("Algeria", "Tunisia", None),
        ("Andorra", "Spain", None),
        ("Angola", "Democratic Republic of the Congo", None),
        ("Angola", "Namibia", None),
        ("Angola", "Zambia", None),
        ("Argentina", "Bolivia", None),
        ("Argentina", "Brazil", None),
        ("Argentina", "Chile", None),
        ("Argentina", "Paraguay", None),
        ("Argentina", "Uruguay", None),
        ("Armenia", "Georgia", None),
        ("Armenia", "Iran", None),
        ("Austria", "Germany", None),
        ("Azerbaijan", "Armenia", None),
        ("Azerbaijan", "Georgia", None),
        ("Azerbaijan", "Iran", None),
        ("Azerbaijan", "Russia", None),
        ("Azerbaijan", "Turkey", None),
        ("Bangladesh", "Burma", None),
        ("Belgium", "Germany", None),
        ("Belgium", "Netherlands", None),
        ("Belize", "Mexico", None),
        ("Benin", "Burkina Faso", None),
        ("Benin", "Niger", None),
        ("Benin", "Nigeria", None),
        ("Benin", "Togo", None),
        ("Bolivia", "Brazil", None),
        ("Bolivia", "Chile", None),
        ("Bolivia", "Paraguay", None),
        ("Bolivia", "Peru", None),
        ("Bosnia and Herzegovina", "Croatia", None),
        ("Bosnia and Herzegovina", "Montenegro", None),
        ("Bosnia and Herzegovina", "Serbia", None),
        ("Brazil", "Colombia", None),
        ("Brazil", "Guyana", None),
        ("Brazil", "Suriname", None),
        ("Brazil", "Venezuela", None),
        ("Bulgaria", "Greece", None),
        ("Bulgaria", "Macedonia", None),
        ("Bulgaria", "Romania", None),
        ("Bulgaria", "Serbia", None),
        ("Burkina Faso", "Mali", None),
        ("Burkina Faso", "Niger", None),
        ("Burkina Faso", "Togo", None),
        ("Burundi", "Democratic Republic of the Congo", None),
        ("Cambodia", "Laos", None),
        ("Cambodia", "Thailand", None),
        ("Cambodia", "Vietnam", None),
        ("Cameroon", "Central African Republic", None),
        ("Cameroon", "Chad", None),
        ("Cameroon", "Equatorial Guinea", None),
        ("Cameroon", "Nigeria", None),
        ("Cameroon", "Republic of the Congo", None),
        ("Canada", "United States", None),
        ("Central African Republic", "Chad", None),
        ("Central African Republic", "Democratic Republic of the Congo", None),
        ("Central African Republic", "Sudan", None),
        ("Chad", "Niger", None),
        ("Chad", "Nigeria", None),
        ("Chad", "Sudan", None),
        ("China", "Bhutan", None),
        ("China", "Burma", None),
        ("China", "Hong Kong", None),
        ("China", "Kazakhstan", None),
        ("China", "Kyrgyzstan", None),
#.........这里部分代码省略.........
开发者ID:jeromeca,项目名称:sage,代码行数:103,代码来源:world_map.py


注:本文中的sage.graphs.graph.Graph.gps_coordinates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。