File:Covid-19 cases in Finland by municipality, weeks 11-12, 2021.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file (SVG file, nominally 900 × 1,440 pixels, file size: 359 KB)

Captions

Captions

Covid-19 cases in Finland by municipality, week 11, 2021

Summary

[edit]
Description
English: Covid-19 cases in Finland by municipality, weeks 11-12, 2021
Date
Source Own work
Author Merikanto
SVG development
InfoField
 
The SVG code is valid.
 
This map was created with an unknown SVG tool.

Source of data is THL open data.

Varmistetut koronatapaukset Suomessa (COVID-19)

https://thl.fi/fi/tilastot-ja-data/aineistot-ja-palvelut/avoin-data/varmistetut-koronatapaukset-suomessa-covid-19-

https://sampo.thl.fi/pivot/prod/api/epirapo/covid19case.json

Source of population data is Sotka population data or csv file processed from Sotka.

Code to generate data.

  1. Incidence of Covid-19 in Finland during weeks 11-12, 2021
    1. "R" script, map of incidence/100 000 as/14 days
    1. Uses THL cube 06/2021 and geofi
    2. sotka population data
    3. and optionally municip. population file
  2. 18.6.2021 0000.0009

library(geofi) library(ggplot2) library(svglite) library(rjstat) library(stringr)

library(dplyr) library(tidyr)


vuosi=2021 viikko=11

widthi=10 heighti=16

  1. tulosfilee1="finmap1.svg"


viikotjono=paste0( toString(viikko),"-",toString(viikko+1) )

tulosfilee1=paste0("Koronan_ilmaantuvuus_2021_viikoilla_",viikotjono,".svg")



    1. Sotka population data

fileurl1="https://sotkanet.fi/sotkanet/fi/csv?indicator=sza0BQA=&region=VVC7CgMxDPujgB_hOPwdXW7xUOja_99qS7kjJSA7kuLYDh2a4ho6JNXi3SGOQg_rXIwxTmDbLOaf7kOK147pspziMkX7gDeGsoO8P1zISr7fOn-qaqdGGWwa-a2KU9gerbKMDt7YyoEpiLTWRCXW8x6onXt7n8a5-jIuyrd1ECmDn-zXxt0sHCeGD__mhQ2-fg==&year=sy5zBAA=&gender=t&abs=f&color=f&buildVersion=3.0-SNAPSHOT&buildTimestamp=202103120740&order=G"

kuntadata <- read.table(fileurl1, sep=";", header=F)

head(kuntadata)

kunnat=kuntadata$V3 vaestot=kuntadata$V7

vakiluvut.df<-data.frame(kunnat, vaestot)

names(vakiluvut.df) <-c("nimi", "vaesto")

head(vakiluvut.df)

    1. vakiluvut.df <- read.table("kunnat.csv", sep=";", header=T)
  1. head(vakiluvut.df)


url_base <- "https://sampo.thl.fi/pivot/prod/fi/epirapo/covid19case/fact_epirapo_covid19case.json" request <- "?row=hcdmunicipality2020-445268L&column=dateweek20200101-509030" url <- paste0(url_base, request) cube <- fromJSONstat(url, naming = "label", use_factors = F, silent = T) res <- cube1 head(res, 20)


locations00<-res[,1]

  1. dateweek20200101
  2. value
  1. print(locations00)
  1. print (head(locations00))


locations11<-locations00[!duplicated(locations00)]

  1. print(head(locations11))

lenlocations11=length(locations11)

print(lenlocations11)


data_in_specific_week <- data.frame("Location","WeeklyCases")


nn=00

for (locationtosearch in locations11) { print(locationtosearch)

allfromlocation=res[grep(locationtosearch, res$hcdmunicipality2020),]

#"Vuosi 2021 Viikko 10"

vuosistring=toString(vuosi) viikkostring=toString(viikko) viikkostring2=toString(viikko+1) #print(vuosistring) #print(viikkostring)

datestring=paste0("Vuosi ",vuosistring," Viikko ",viikkostring) datestring2=paste0("Vuosi ",vuosistring," Viikko ",viikkostring2) #print(head(allfromlocation))

#print(datestring)


selected_time_location=allfromlocation[grep(datestring, allfromlocation$dateweek20200101),] selected_time_location2=allfromlocation[grep(datestring2, allfromlocation$dateweek20200101),]

weeklycases=selected_time_location$value weeklycases2=selected_time_location2$value

twoweeklycases=as.integer(weeklycases)+as.integer(weeklycases2)

print(weeklycases) print(weeklycases2) print(twoweeklycases)

newdata00 <- rbind(data_in_specific_week, c(locationtosearch, twoweeklycases))

data_in_specific_week=newdata00


  nn=nn+1
  #if(nn>30) break
  

}


  1. stop(-1)


write.csv(data_in_specific_week, "./mini.csv", row.names=T)

    1. draw map


municipalities <- get_municipalities(year = vuosi, scale = 4500)

municip2<-select(municipalities ,gml_id , kunta , nimi, geom)

municipnames00<-as.data.frame(select( municipalities , nimi))

municipnames=municipnames00['nimi']

print(head(municipnames))


weekly00=read.csv("mini.csv", header = T)

weekly01 = weekly00[-1,]


names(weekly01)<-c("numbero","nimi", "tapauksia")

print (head(weekly01))


totaali0 <- merge(municip2,weekly01,by="nimi")

totaali <-merge(totaali0,vakiluvut.df, by="nimi", all=T)


tapauksia1<-as.double(totaali$tapauksia) vaesto1<-as.double(totaali$vaesto)

ilmaantuvuus0<-tapauksia1*0.0 ilmaantuvuus0<-(tapauksia1*100000.0)/vaesto1 ilmaantuvuus<-round(ilmaantuvuus0,digits=0)

print (head(totaali, 40)) len1=length(tapauksia1)


totaali$ilmaantuvuus <- ilmaantuvuus


print (head(totaali))


otsikko=paste0("Koronan ilmaantuvuus:\ntapausta/14 pv/100 000 as.,\nVuonna",toString(vuosi),", viikot ", viikotjono)


totaali$tapauksia=as.integer(totaali$tapauksia)


my_breaks = c(1,2,5,10,20,50, 100,200,300,400,600,1000)


svg(filename=tulosfilee1, width=widthi, height=heighti, pointsize=12)

ggplot(totaali) +

 geom_sf( aes(fill =ilmaantuvuus) ) +
 geom_sf_text(aes(label = ilmaantuvuus),
              size = 7,
              face = "bold",
              color = "white") +
  labs(fill = "Ilmaantuvuus")+
 ggtitle(otsikko) +
 theme(plot.title = element_text(size = 22, face = "bold")) +
 theme(axis.text=element_text(size=15),
       axis.title=element_text(size=15,face="bold")) +
 theme(legend.key.size = unit(2, 'cm')) +
 xlab("Pituusaste")+
 ylab("Leveysaste") +
 theme ( legend.text=element_text(size=17), legend.title=element_text(size=18) ) +
 scale_fill_viridis_c(breaks = my_breaks, labels = my_breaks, option = "plasma",
                      trans = scales::pseudo_log_trans(sigma = 0.001))

                    
                                         

dev.off()





Population data of munip.

From finnish wiki

nimi;vaesto Helsinki;656250 Espoo;293576 Tampere;241672 Vantaa;238033 Oulu;207717 Turku;194244 Jyväskylä;143400 Kuopio;120248 Lahti;120112 Pori;83676 Kouvola;81141 Joensuu;76833 Lappeenranta;72591 Hämeenlinna;67864 Vaasa;67447 Seinäjoki;64335 Rovaniemi;63618 Mikkeli;52530 Kotka;51603 Salo;51563 Porvoo;50711 Kokkola;47927 Hyvinkää;46684 Lohja;45913 Järvenpää;44722 Nurmijärvi;43895 Kirkkonummi;40158 Rauma;39037 Tuusula;38957 Kerava;37193 Kajaani;36563 Kaarina;34878 Nokia;34525 Ylöjärvi;33377 Savonlinna;32667 Kangasala;32255 Vihti;29274 Riihimäki;28757 Raasepori;27590 Imatra;25988 Raisio;24555 Raahe;24353 Sastamala;24068 Lempäälä;23877 Hollola;23246 Sipoo;21913 Tornio;21466 Siilinjärvi;21282 Iisalmi;21126 Mäntsälä;20808 Valkeakoski;20744 Kurikka;20404 Kemi;20331 Varkaus;20240 Lieto;20194 Pirkkala;19904 Jämsä;19894 Hamina;19844 Mustasaari;19481 Naantali;19454 Pietarsaari;19098 Kempele;18927 Laukaa;18824 Äänekoski;18528 Heinola;18478 Pieksämäki;17373 Forssa;16738 Akaa;16402 Janakkala;16317 Orimattila;15871 Loimaa;15790 Kauhava;15479 Uusikaupunki;15457 Ylivieska;15308 Kuusamo;15207 Parainen;15091 Kontiolahti;14914 Loviisa;14741 Lapua;14211 Kauhajoki;12989 Kankaanpää;12768 Ulvila;12724 Kalajoki;12432 Ilmajoki;12328 Liperi;12002 Maarianhamina;11718 Eura;11474 Alavus;11275 Pedersörenkunta;11187 Paimio;10960 Lieksa;10666 Nivala;10472 Hämeenkyrö;10384 Muurame;10332 Sotkamo;10301 Liminka;10243 Kauniainen;10148 Kitee;9936 Huittinen;9931 Ii;9881 Mänttä-Vilppula;9645 Närpiö;9583 Masku;9538 Nurmes;9503 Keuruu;9491 Alajärvi;9402 Eurajoki;9387 Leppävirta;9383 Hattula;9379 Lapinlahti;9331 Saarijärvi;9203 Orivesi;8987 Muhos;8917 Karkkila;8696 Somero;8623 Laitila;8472 Sodankylä;8254 Pöytyä;8219 Hausjärvi;8187 Hanko;8064 Asikkala;8049 Kuhmo;8027 Keminmaa;7993 Laihia;7985 Loppi;7848 Kiuruvesi;7832 Pudasjärvi;7760 Mynämäki;7628 Suomussalmi;7583 Uusikaarlepyy;7509 Kemijärvi;7167 Oulainen;7160 Kokemäki;6990 Suonenjoki;6931 Inari;6900 Haapajärvi;6887 Ikaalinen;6880 Harjavalta;6856 Haapavesi;6685 Säkylä;6637 Kemiönsaari;6632 Tyrnävä;6612 Iitti;6590 Outokumpu;6508 Virrat;6490 Kittilä;6424 Vöyri;6411 Pälkäne;6408 Kruunupyy;6407 Kristiinankaupunki;6405 Parkano;6352 Rusko;6339 Siuntio;6174 Viitasaari;6093 Tammela;6001 Juva;5920 Mäntyharju;5666 Luoto;5536 Ähtäri;5524 Maalahti;5464 Kannus;5409 Jomala;5393 Inkoo;5346 Kangasniemi;5296 Nakkila;5253 Siikalatva;5189 Pyhtää;5150 Pornainen;5083 Jokioinen;5057 Siikajoki;5038 Pyhäjärvi;5014 Teuva;4978 Ruokolahti;4924 Askola;4881 Sievi;4845 Hankasalmi;4764 Ilomantsi;4744 Nousiainen;4707 Joroinen;4692 Urjala;4651 Parikkala;4634 Taipalsaari;4629 Luumäki;4529 Juuka;4509 Isokyrö;4492 Vesilahti;4390 Kärkölä;4333 Tohmajärvi;4308 Joutsa;4294 Pielavesi;4292 Kaustinen;4213 Ruovesi;4203 Polvijärvi;4184 Aura;3982 Kolari;3935 Taivalkoski;3920 Pihtipudas;3918 Ylitornio;3875 Karstula;3828 Sonkajärvi;3813 Petäjävesi;3760 Ranua;3690 Uurainen;3621 Sysmä;3610 Kuortane;3537 Vieremä;3520 Salla;3429 Rantasalmi;3362 Savitaipale;3316 Pello;3304 Paltamo;3222 Heinävesi;3183 Rautjärvi;3137 Posio;3107 Virolahti;3087 Merikarvia;3067 Rautalampi;3062 Veteli;3042 Pyhäjoki;3032 Toholampi;2964 Sauvo;2957 Simo;2953 Lemi;2951 Lappajärvi;2906 Tervola;2904 Padasjoki;2858 Kaavi;2792 Vimpeli;2783 Punkalaidun;2778 Vaala;2732 Reisjärvi;2715 Perho;2697 Hartola;2642 Lapinjärvi;2626 Finström;2610 Utajärvi;2604 Konnevesi;2569 Kärsämäki;2528 Alavieska;2522 Sulkava;2471 Puolanka;2469 Tuusniemi;2435 Toivakka;2408 Evijärvi;2391 Muonio;2317 Ypäjä;2311 Karvia;2309 Vehmaa;2296 KoskiTl;2281 Hyrynsalmi;2187 Humppila;2179 Kuhmoinen;2161 Hirvensalmi;2149 Keitele;2143 Lemland;2136 Puumala;2123 Korsnäs;2066 Rääkkylä;2064 Pomarkku;2057 Lumijoki;2024 Soini;2005 Pyhäranta;1995 Marttila;1993 Vesanto;1965 Isojoki;1920 Myrskylä;1870 Miehikkälä;1852 Pukkila;1839 Saltvik;1818 Kihniö;1814 Enontekiö;1812 Juupajoki;1797 Jämijärvi;1693 Taivassalo;1657 Pertunmaa;1648 Hammarland;1603 Kinnula;1590 Pyhäntä;1587 Rautavaara;1558 Multia;1531 Tervo;1495 Siikainen;1376 Enonkoski;1368 Kannonkoski;1329 Oripää;1320 Kaskinen;1283 Kyyjärvi;1279 Ristijärvi;1240 Utsjoki;1219 Karijoki;1199 Halsua;1100 Kivijärvi;1090 Merijärvi;1084 Savukoski;1014 Sund;1012 Kustavi;955 Hailuoto;953 Eckerö;950 Pelkosenniemi;931 Lestijärvi;725 Luhanka;695 Föglö;523 Geta;519 Vårdö;460 Brändö;451 Lumparland;374 Kumlinge;307 Kökar;227 Sottunga;100

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current13:06, 18 June 2021Thumbnail for version as of 13:06, 18 June 2021900 × 1,440 (359 KB)Merikanto (talk | contribs)update
12:56, 18 June 2021Thumbnail for version as of 12:56, 18 June 2021900 × 1,440 (359 KB)Merikanto (talk | contribs)update
12:31, 18 June 2021Thumbnail for version as of 12:31, 18 June 2021900 × 1,440 (353 KB)Merikanto (talk | contribs)Update
11:48, 18 June 2021Thumbnail for version as of 11:48, 18 June 2021900 × 1,440 (342 KB)Merikanto (talk | contribs)Update
13:37, 13 June 2021Thumbnail for version as of 13:37, 13 June 2021450 × 720 (312 KB)Merikanto (talk | contribs)Update
13:21, 12 June 2021Thumbnail for version as of 13:21, 12 June 2021450 × 720 (325 KB)Merikanto (talk | contribs)Log scale of colors
13:00, 12 June 2021Thumbnail for version as of 13:00, 12 June 2021450 × 720 (322 KB)Merikanto (talk | contribs)Correct layout
12:53, 12 June 2021Thumbnail for version as of 12:53, 12 June 2021360 × 1,080 (320 KB)Merikanto (talk | contribs)Uploaded own work with UploadWizard

The following page uses this file:

Metadata