audaciaconsulting / Audacia.Locality

A type-safe C# library for working with geographical country data, provided by the Geonames API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Audacia.Locality

A type-safe C# library for working with geographical country data, provided by the Geonames API.

Build Status NuGet CodeFactor

Usage

Continents can be accessed as a static collection on the World class, and similarly, so can all the countries of the world. continents and countries can also be accessed using enum-like static members on their respective classes.

An example of using LINQ to find the country with the highest population:

World.Countries.OrderBy(c => c.Population).First()

Another example of finding all countries in Europe that are bigger than sweden:

Continent.Europe.Countries.Where(c => c.AreaSqKm > Country.Sweden.AreaSqKm)

The Country class contains various metadata about the country such as its location, size, population, and its official flag (provided as a byte array).

Development

The library uses two t4 template files to generate all its data, using the Geonames API. In order to successfully build the solution, a valid Geonames username must be provided in the Credentials class in Audacia.Locality.Web.

About

A type-safe C# library for working with geographical country data, provided by the Geonames API.

License:MIT License


Languages

Language:C# 100.0%