Table of Contents

StatisticalRegionInfo Class

Definition

Represents a geographic region or country as defined by the UN M.49 standard.

public sealed class StatisticalRegionInfo
Inheritance
object
StatisticalRegionInfo

Examples

The following example demonstrates how to use via the class to retrieve UN M.49 region data.

using System;
using System.Linq;
using Cuemon.Globalization;

namespace MyApp.Examples;

public class StatisticalRegionInfoExample
{
    public void Demonstrate()
    {
        // Get United States by its UN M.49 code
        StatisticalRegionInfo usa = World.GetCountry("840");

        if (usa != null)
        {
            Console.WriteLine($"Name: {usa.Name}");
            Console.WriteLine($"Code: {usa.Code}");
            Console.WriteLine($"ISO Alpha-2: {usa.IsoAlpha2}");
            Console.WriteLine($"ISO Alpha-3: {usa.IsoAlpha3}");
            Console.WriteLine($"Kind: {usa.Kind}");
            Console.WriteLine($"Parent: {usa.Parent?.Name}");

        // List all European countries
        var europe = World.GetStatisticalRegion("150");
        if (europe != null)
        {
            Console.WriteLine($"\nCountries in {europe.Name}:");
            foreach (var country in europe.Countries.Take(5))
            {
                Console.WriteLine($" - {country.Name} ({country.IsoAlpha2})");

}}}}
}

Remarks

UN M.49 is a standard for representing country and area codes for statistical use. This class provides a unified view of the hierarchy, treating countries as leaf nodes in the region tree. Each instance has a Kind that identifies its level in the hierarchy (World, Region, Subregion, IntermediateRegion, or CountryOrTerritory). Source: https://unstats.un.org/unsd/methodology/m49/

Properties

Name Description
Children

Gets the direct child regions or countries of this region.

Code

Gets the UN M.49 numeric code for this region or country.

Countries

Gets all countries in this geographic region.

IsLandLockedDevelopingCountry

Gets a value indicating whether this country is classified as a Land Locked Developing Country (LLDC).

IsLeastDevelopedCountry

Gets a value indicating whether this country is classified as a Least Developed Country (LDC).

IsSmallIslandDevelopingState

Gets a value indicating whether this country is classified as a Small Island Developing State (SIDS).

IsoAlpha2

Gets the ISO 3166-1 alpha-2 code for this country.

IsoAlpha3

Gets the ISO 3166-1 alpha-3 code for this country.

Kind

Gets the kind of this statistical region.

Name

Gets the official UN name of this region or country.

Parent

Gets the parent region in the UN M.49 hierarchy.

Region

Gets the .NET RegionInfo for this country if available.

Methods

Name Description
GetAllDescendants()

Gets all descendant regions and countries recursively.

GetAncestors()

Gets all ancestor regions in the hierarchy up to and including World.

ToString()

Returns a string that represents the current object.