Zur Beschreibungsseite auf Commons

Datei:Workweeks-map.svg

aus Wikipedia, der freien Enzyklopädie
Zur Navigation springen Zur Suche springen

Originaldatei(SVG-Datei, Basisgröße: 2.754 × 1.398 Pixel, Dateigröße: 1,06 MB)

Diese Datei und die Informationen unter dem roten Trennstrich werden aus dem zentralen Medienarchiv Wikimedia Commons eingebunden.

Zur Beschreibungsseite auf Commons


Beschreibung

Beschreibung
English: Countries of the world by their work-week.
 
Monday - Friday
 
Monday - Saturday
 
Sunday - Thursday
 
Sunday - Friday
 
Saturday - Thursday
 
Monday - Thursday and Saturday
 
Mixed
This map is based on https://en.wikipedia.org/w/index.php?title=Workweek_and_weekend&oldid=858023057
Datum
Quelle Eigenes Werk
Urheber MartinThoma

Script to create the map:

#!/usr/bin/env python

# 3rd party modules
from lxml import etree
import mpu.pd


def main(filename="weekend.svg"):
    mon_fri = ['Dominican Republic', 'Lebanon', 'Serbia', 'Albania', 'Angola',
               'Argentina', 'Armenia', 'Azerbaijan', 'Austria', 'Australia',
               'Benin',
               'Belarus', 'Belgium', 'Brazil', 'Burundi', 'Bulgaria', 'Canada',
               'Cambodia', 'Cameroon', 'Chile', 'China', 'Croatia',
               'Costa Rica', 'Czech Republic', 'Denmark', 'Ethiopia',
               'Estonia', 'Finland', 'France', 'Gabon',
               'Gambia', 'Germany', 'Ghana', 'Greece', 'Hungary', 'Indonesia',
               'Ireland',
               'Italy', 'Côte d\'Ivoire', 'Japan', 'Kazakhstan', 'Kenya',
               'Lao People\'s Democratic Republic', 'Latvia', 'Lesotho',
               'Lithuania', 'Madagascar',
               'Malawi', 'Mali', 'Malta', 'Mauritania', 'Mongolia', 'Morocco',
               'Mozambique', 'Netherlands', 'New Zealand', 'Nigeria',
               'Norway',
               'Pakistan', 'Poland', 'Portugal', 'Romania', 'Russia', 'Rwanda',
               'Senegal',
               'Singapore', 'Slovakia', 'Spain', 'Sri Lanka',
               'South Africa', 'South Korea', 'Suriname', 'Swaziland',
               'Sweden', 'Switzerland',
               'Seychelles', 'Taiwan', 'Tanzania', 'Togo', 'Thailand',
               'Trinidad and Tobago', 'Tunisia', 'Turkey', 'Ukraine',
               'United Kingdom', 'United States',
               'Vietnam', 'Congo (Democratic Republic of the)', 'Zambia',
               'Zimbabwe']
    mon_sat = ['Equatorial Guinea', 'Hong Kong', 'Mexico', 'Philippines',
               'Uganda', 'India', 'Colombia']
    sun_thu = ['Afghanistan', 'Algeria', 'Bahrain', 'Egypt', 'Iraq', 'Israel',
               'Jordan', 'Kuwait', 'Libya', 'Maldives', 'Oman', 'Qatar',
               'Saudi Arabia', 'Sudan', 'Syria', 'Yemen',
               'United Arab Emirates', 'Bangladesh']
    sat_thu = ['Djibouti', 'Palestine', 'Iran']
    sun_fri = ['Nepal']
    mon_thu_sat = ['Brunei Darussalam']
    mixed = ['Malaysia']

    countries = mpu.pd.countries
    countries = countries.set_index('English short name (upper/lower case)')
    country2dict = countries.to_dict('index')

    legend = [(mon_fri, '#B8D8D8'),
              (mon_sat, 'orange'),
              (sun_thu, '#4F6367'),
              (sat_thu, 'red'),
              (sun_fri, 'tomato'),
              (mon_thu_sat, '#ff00ff'),
              (mixed, '#00ffff')]

    colors = {}
    for collection, color in legend:
        for country in collection:
            if country in country2dict:
                code = country2dict[country]['Alpha-2 code'].lower()
                colors[code] = color
            else:
                print('Could not find the Alpha-2 code for \'{}\' in mpu'
                      .format(country))

    tree = read_svg(filename)
    root = tree.getroot()
    for country_id in colors.keys():
        element = root.xpath('//*[@id="{}"]'.format(country_id))
        if len(element) == 1:
            element = element[0]
            element.set("style", 'fill: {};'.format(colors[country_id]))
            for el in element.getchildren():
                el.set("style", 'fill: {};'.format(colors[country_id]))
        else:
            print("Wrong length for id={}".format(country_id))
    write_svg(root)


def read_svg(filename):
    """
    Read an SVG file.

    Parameters
    ----------
    filename : str

    Returns
    -------
    tree : lxml.ElementTree
    """
    with open(filename, 'r') as f:
        tree = etree.parse(f)
    return tree


def write_svg(root, filename='weekend-auto.svg'):
    """
    Read an SVG file.

    Parameters
    ----------
    root : lxml.Element
    filename : str
    """
    etree.ElementTree(root).write(filename, pretty_print=True)


if __name__ == '__main__':
    main()

Lizenz

Ich, der Urheber dieses Werkes, veröffentliche es unter der folgenden Lizenz:
Creative Commons CC-Zero Diese Datei wird unter der Creative-Commons-Lizenz „CC0 1.0 Verzicht auf das Copyright“ zur Verfügung gestellt.
Die Person, die das Werk mit diesem Dokument verbunden hat, übergibt dieses weltweit der Gemeinfreiheit, indem sie alle Urheberrechte und damit verbundenen weiteren Rechte – im Rahmen der jeweils geltenden gesetzlichen Bestimmungen – aufgibt. Das Werk kann – selbst für kommerzielle Zwecke – kopiert, modifiziert und weiterverteilt werden, ohne hierfür um Erlaubnis bitten zu müssen.

Kurzbeschreibungen

Ergänze eine einzeilige Erklärung, was diese Datei darstellt.

In dieser Datei abgebildete Objekte

Motiv

image/svg+xml

Dateiversionen

Klicke auf einen Zeitpunkt, um diese Version zu laden.

Version vomVorschaubildMaßeBenutzerKommentar
aktuell14:14, 29. Sep. 2023Vorschaubild der Version vom 14:14, 29. Sep. 20232.754 × 1.398 (1,06 MB)VyvagabaChanged the file to an svg file that is more easily editable, addressed some recent updates and missing data.
14:12, 29. Sep. 2023Vorschaubild der Version vom 14:12, 29. Sep. 20232.560 × 1.314 (1,09 MB)VyvagabaReverted to version as of 19:41, 4 September 2018 (UTC)
14:07, 29. Sep. 2023Vorschaubild der Version vom 14:07, 29. Sep. 20232.754 × 1.398 (1,06 MB)VyvagabaChanged the file to an svg file that is more easily editable, addressed some recent updates and missing data.
21:41, 4. Sep. 2018Vorschaubild der Version vom 21:41, 4. Sep. 20182.560 × 1.314 (1,09 MB)MartinThomaUser created page with UploadWizard

Keine Seiten verwenden diese Datei.

Globale Dateiverwendung

Die nachfolgenden anderen Wikis verwenden diese Datei:

Metadaten