skip to Main Content

Geodata file format description

Data for countries, provinces and cities are stored in text files located in WorldMapPoliticalMapGlobeEdition/Resources/Geodata folder.

  • countries10.txt: data for country frontiers in high resolution

  • countries110.txt: data for country frontiers in low resolution

  • provinces10.txt: data for province borders (always in high resolution)

  • cities10.txt: data for cities.

All data is packed in string fields using separators. JSON, although more human-friendly format, is not used to reduce the file size and optimize the loading time (especially for mobile devices).

Country file format

  1. Contains a list of countries separated by |.

Example: COUNTRY0|COUNTRY1|COUNTRY2…)

  1. Each COUNTRY entry is a series of fields separated by $:

COUNTRY = {NAME $ CONTINENT $ REGIONS $ HIDDEN $ UNIQUE_ID $ FIPS 10.4 CODE $ ISO A2 $ ISO A3 $ ISO N3 }

Name = name of the country (as displayed on the map)

Continent = continent name (useful to group countries)

Hidden = 0 (visible) or 1 (invisible)

Unique_ID = unique id generated for this country

FIPS / ISO codes = standard id codes for country

Label visibility = 1 (visible) or 0 (invisible)

  1. REGIONS is a list of polygons, separated by *:

REGIONS = REGION0*REGION1*REGION2…

  1. Each REGION is a list of latitude/longitude coordinates in the format:

REGION = coord1; coord2 ; coord3 ; coord4 …

  1. The coordinates format is x, y position in the range (-0.5, 0.5) divided multiplied by 5.000.000 and rounded, where -0.5 Is left or bottom edge of the map and 0.5 is top or right edge of map.

The method SetCountryGeoData() method in WPMCountries.cs is responsible of loading and extracting the file data.

Province file format

  1. Contains a list of provinces separated by |.

Example: PROVINCE0|PROVINCE1|PROVINCE2…)

  1. Each PROVINCE entry is a series of fields separated by $:

PROVINCE = {NAME $ COUNTRY_NAME $ REGIONS $ UNIQUE_ID }

Name = name of the country (as displayed on the map)

Country_Name = the name of the country to which the province belongs to

Unique_ID = unique id generated for this country

  1. REGIONS is a list of polygons, separated by *:

REGIONS = REGION0*REGION1*REGION2…

  1. Each REGION is a list of latitude/longitude coordinates in the format:

REGION = coord1; coord2 ; coord3 ; coord4 …

  1. The coordinates format is x, y position in the range (-0.5, 0.5) divided multiplied by 5.000.000 and rounded, where -0.5 Is left or bottom edge of the map and 0.5 is top or right edge of map.

The method SetProvincesGeoData() and ReadProvincePackedString() methods in WPMProvinces.cs are responsible of loading and extracting the file data.

City file format

  1. Contains a list of cities separated by |.

Example: CITY0|CITY1|CITY2…)

  1. Each CITY entry is a series of fields separated by $:

CITY = {NAME $ PROVINCE_NAME $ COUNTRY_NAME $ POPULATION $ X $ Y $ CLASS $ UNIQUE_ID }

Name = name of the city

Province_Name = the name of the province

Country_Name = the name of the country to which the province belongs to

X, Y = coordinate of the city (see country / province section above)

Population = metropolitan population

Class = 1 (regular city), 2 (region capital) or 4 (country capital)

The method SetCityGeoData() method in WPMCities.cs is responsible of loading and extracting the file data.

Back To Top