Skip to content

Continent data #133

Description

@rafbm

Would it make sense to include information about continents in Carmen?

Geonames has a nice database of countries with their corresponding continent code (parseable file). I ran a little script and it turns out all Carmen::Country.all.map(&:code) are included.

These APIs would be useful:

europe = Carmen::Continent.coded('EU')
# <#Carmen::Continent name="Europe">

europe.countries # Alias: `europe.subregions`
# [<#Carmen::Country name="Andorra">, <#Carmen::Country name="Albania">, <#Carmen::Country name="Austria">, ...]

netherlands = Carmen::Country.coded('NL')
# <#Carmen::Country name="Netherlands">

netherlands.continent # Alias: `netherlands.parent`
# <#Carmen::Continent name="Europe">

I could work on this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions