File:Workweeks-map.svg
出自Wikimedia Commons
跳至導覽
跳至搜尋
此 SVG 檔案的 PNG 預覽的大小:800 × 406 像素。 其他解析度:320 × 162 像素 | 640 × 325 像素 | 1,024 × 520 像素 | 1,280 × 650 像素 | 2,560 × 1,300 像素 | 2,754 × 1,398 像素。
原始檔案 (SVG 檔案,表面大小:2,754 × 1,398 像素,檔案大小:1.06 MB)
檔案資訊
結構化資料
說明
摘要
[編輯]描述Workweeks-map.svg |
English: Countries of the world by their work-week.
|
日期 | |
來源 | 自己的作品 |
作者 | 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()
授權條款
[編輯]我,本作品的著作權持有者,決定用以下授權條款發佈本作品:
此檔案在創用CC CC0 1.0 通用公有領域貢獻宣告之下分發。 | |
在此宣告之下分發本作品者,已依據各國著作權法,在全世界放棄其對本作品所擁有的著作權及所有相關相似的法律權利,從而將本作品貢獻至公有領域。您可以複製、修改、分發和演示該作品,用於任何商業用途,所有這些都不需要請求授權。
http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse |
檔案歷史
點選日期/時間以檢視該時間的檔案版本。
日期/時間 | 縮圖 | 尺寸 | 使用者 | 備註 | |
---|---|---|---|---|---|
目前 | 2023年9月29日 (五) 12:14 | 2,754 × 1,398(1.06 MB) | Vyvagaba(留言 | 貢獻) | Changed the file to an svg file that is more easily editable, addressed some recent updates and missing data. | |
2023年9月29日 (五) 12:12 | 2,560 × 1,314(1.09 MB) | Vyvagaba(留言 | 貢獻) | Reverted to version as of 19:41, 4 September 2018 (UTC) | ||
2023年9月29日 (五) 12:07 | 2,754 × 1,398(1.06 MB) | Vyvagaba(留言 | 貢獻) | Changed the file to an svg file that is more easily editable, addressed some recent updates and missing data. | ||
2018年9月4日 (二) 19:41 | 2,560 × 1,314(1.09 MB) | MartinThoma(留言 | 貢獻) | User created page with UploadWizard |
無法覆蓋此檔案。
檔案用途
下列頁面有用到此檔案:
- File:Workweeks-map v2.svg (檔案重新導向)
全域檔案使用狀況
以下其他 wiki 使用了這個檔案:
- ar.wikipedia.org 的使用狀況
- bn.wikipedia.org 的使用狀況
- en.wikipedia.org 的使用狀況
- fa.wikipedia.org 的使用狀況
- zh-yue.wikipedia.org 的使用狀況
- zh.wikipedia.org 的使用狀況
詮釋資料
此檔案中包含其他資訊,這些資訊可能是由數位相機或掃描器在建立或數位化過程中所新增的。若檔案自原始狀態已被修改,一些詳細資料可能無法完整反映出已修改的檔案。
簡稱 | World Map |
---|---|
寬度 | 2754 |
高度 | 1398 |