{"id":6067,"date":"2020-03-25T12:56:58","date_gmt":"2020-03-25T12:56:58","guid":{"rendered":"https:\/\/max-drake.cc\/?p=6067"},"modified":"2020-03-25T14:13:35","modified_gmt":"2020-03-25T14:13:35","slug":"covid-by-region-nz-map-representation-part-2","status":"publish","type":"post","link":"https:\/\/max-drake.cc\/?p=6067","title":{"rendered":"Covid by region NZ -map representation- Part 2"},"content":{"rendered":"\n<p>At the end of the fist part I&#8217;d got some data to play with from a couple of sources, cleaned it up, got some data to make paths to create a map and coloured map in by region based on covid cases. This was done using Excel, Notepad++ and displayed in browser. I was just starting to look at labels\/legends for the map. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Using Datawrapper<\/h4>\n\n\n\n<p>I have played with online maps before, but they were pretty limited as far as NZ went, like Google Charts ap only showing Oceania, not NZ. I decided to have another look at Datwrapper as I hadn&#8217;t played with it for a couple of years and it may have updated. It has, there is a NZ regional map, so I&#8217;d thought I&#8217;d play with that to see if I could progress with the data more readily. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"620\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_30-Create-a-map-_-Datawrapper-1024x620.jpg\" alt=\"\" class=\"wp-image-6068 lazyload\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_30-Create-a-map-_-Datawrapper-1024x620.jpg 1024w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_30-Create-a-map-_-Datawrapper-300x182.jpg 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_30-Create-a-map-_-Datawrapper-768x465.jpg 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_30-Create-a-map-_-Datawrapper-50x30.jpg 50w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_30-Create-a-map-_-Datawrapper-83x50.jpg 83w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_30-Create-a-map-_-Datawrapper-100x61.jpg 100w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_30-Create-a-map-_-Datawrapper-165x100.jpg 165w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_30-Create-a-map-_-Datawrapper-1057x640.jpg 1057w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_30-Create-a-map-_-Datawrapper-640x387.jpg 640w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_30-Create-a-map-_-Datawrapper-1269x768.jpg 1269w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_30-Create-a-map-_-Datawrapper.jpg 1378w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/620;\" \/><\/figure>\n\n\n\n<p>I chose a symbol map type (will definitely have to play with the locator map,  that looks cool)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"676\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_04-Datawrapper-1024x676.jpg\" alt=\"\" class=\"wp-image-6069 lazyload\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_04-Datawrapper-1024x676.jpg 1024w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_04-Datawrapper-300x198.jpg 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_04-Datawrapper-768x507.jpg 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_04-Datawrapper-50x33.jpg 50w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_04-Datawrapper-76x50.jpg 76w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_04-Datawrapper-100x66.jpg 100w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_04-Datawrapper-152x100.jpg 152w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_04-Datawrapper-970x640.jpg 970w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_04-Datawrapper-640x422.jpg 640w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_04-Datawrapper-1164x768.jpg 1164w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_06_04-Datawrapper.jpg 1450w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/676;\" \/><\/figure>\n\n\n\n<p>Then after selecting NZ regional map I was asked for data. Since it is symbol I need a point to locate the data. So I went into&#8230;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Google Earth for points within boundaries<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"812\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_12_04-Google-Earth-Pro-1024x812.jpg\" alt=\"\" class=\"wp-image-6070 lazyload\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_12_04-Google-Earth-Pro-1024x812.jpg 1024w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_12_04-Google-Earth-Pro-300x238.jpg 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_12_04-Google-Earth-Pro-768x609.jpg 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_12_04-Google-Earth-Pro-1536x1217.jpg 1536w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_12_04-Google-Earth-Pro-50x40.jpg 50w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_12_04-Google-Earth-Pro-63x50.jpg 63w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_12_04-Google-Earth-Pro-100x79.jpg 100w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_12_04-Google-Earth-Pro-126x100.jpg 126w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_12_04-Google-Earth-Pro-808x640.jpg 808w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_12_04-Google-Earth-Pro-640x507.jpg 640w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_12_04-Google-Earth-Pro-969x768.jpg 969w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_12_04-Google-Earth-Pro-1363x1080.jpg 1363w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-10_12_04-Google-Earth-Pro.jpg 1576w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/812;\" \/><\/figure>\n\n\n\n<p>In Google Earth I turned on borders and turned off roads, then put a placemark in the different regions with a title . I made a new folder to store all the placemarks in. I wanted to get that data to use in sheets, a Lat\/Long &amp; Title. I knew I could go into individual placemarks and cut\/paste data but I was sure there is an easier way to export multiple points from Google Earth. <\/p>\n\n\n\n<p>You can select  afolder and exported to a KMZ file. Unfortunately that is compiled, so I needed a mthod to extract the data from KMZ to another format. I forund this web page <strong><a rel=\"noreferrer noopener\" aria-label=\"Google Earth placemarks to Excel (opens in a new tab)\" href=\"https:\/\/www.gearthblog.com\/blog\/archives\/2017\/01\/google-earth-placemarks-excel.html\" target=\"_blank\">Google Earth placemarks to Excel<\/a><\/strong>. That converted the KMZ file to a CSV file that I could open in Sheets or notepad. This process is good, because if I need to move one pin because it is not in a good position its easy to do and easy to update. Here is the list of pin locations. At least this is a start. I had issues trying to find centroids of regions but this is far better as you can adjust as you need for aesthetic presentation purposes<\/p>\n\n\n\n<p>&#8220;Name&#8221;,&#8221;Description&#8221;,&#8221;Latitude&#8221;,&#8221;Longitude&#8221;<br> Northland,,-35.55752897288653,173.9706962308053<br> Auckland,,-36.88446458503898,174.7593660699155<br> Waikato,,-38.08646123851568,175.5620179677784<br> Bay of Plenty,,-38.01950908158162,176.6506252739918<br> Gisborne,,-38.31711552776068,177.9513173813045<br> Hawke&#8217;s Bay,,-39.42865541307646,176.6869152144428<br> Manawat\u016b-Whanganui,,-39.73098865419606,175.4555173139747<br> Wellington,,-41.07259426632601,175.4323683274915<br> Marlborough,,-41.60629728142014,173.5788158683521<br> Tasman,,-41.29151546136643,172.6057092903673<br> West Coast,,-42.51012415627857,171.3135886923324<br> Caterbury,,-43.71336357885355,171.3277839139198<br> Otago,,-45.16479441088008,169.6551727387001<br> Southland,,-45.92322551656932,168.1062023275522<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Back to Datawrapper<\/h4>\n\n\n\n<p>I tested the above lat\/Longs and they come out fine. Here is the link: <\/p>\n\n\n\n<p><strong><span style=\"color:#cf2e2e\" class=\"color\">HOVER OVER SYMBOLS ON MAP TO GET METADATA<\/span><\/strong>, <strong><span style=\"color:#cf2e2e\" class=\"color\">ZOOM IN AS REQUIRED<\/span><\/strong><\/p>\n\n\n\n<iframe title=\"Covid cases locations in NZ on 25 March\" aria-label=\"New Zealand regional councils (2018) Symbol map\" id=\"datawrapper-chart-GGqEa\" data-src=\"\/\/datawrapper.dwcdn.net\/GGqEa\/4\/\" scrolling=\"no\" style=\"width: 0; min-width: 100% !important; border: none;\" height=\"600\" frameborder=\"0\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe><script type=\"text\/javascript\">!function(){\"use strict\";window.addEventListener(\"message\",function(a){if(void 0!==a.data[\"datawrapper-height\"])for(var e in a.data[\"datawrapper-height\"]){var t=document.getElementById(\"datawrapper-chart-\"+e)||document.querySelector(\"iframe[src*='\"+e+\"']\");t&&(t.style.height=a.data[\"datawrapper-height\"][e]+\"px\")}})}();\n<\/script>\n\n\n\n<p>The chart is OK, but pretty basic.I can&#8217;t colour background, and the no-data columns do not show up at all (eg West Coast Region). But<strong><span style=\"color:#cf2e2e\" class=\"color\"> it does have the hover element where you can put extra data<\/span><\/strong>. The legend is rather general. To compensate I&#8217;m also doing a Table below so you can view the information. It is embedded in the map but people need to zoom in and hover. <\/p>\n\n\n\n<iframe title=\"Covid cases by Region in NZ on 25 March\" aria-label=\"Table\" id=\"datawrapper-chart-XW9a1\" data-src=\"\/\/datawrapper.dwcdn.net\/XW9a1\/3\/\" scrolling=\"no\" style=\"width: 0; min-width: 100% !important; border: none;\" height=\"725\" frameborder=\"0\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe><script type=\"text\/javascript\">!function(){\"use strict\";window.addEventListener(\"message\",function(a){if(void 0!==a.data[\"datawrapper-height\"])for(var e in a.data[\"datawrapper-height\"]){var t=document.getElementById(\"datawrapper-chart-\"+e)||document.querySelector(\"iframe[src*='\"+e+\"']\");t&&(t.style.height=a.data[\"datawrapper-height\"][e]+\"px\")}})}();\n<\/script>\n\n\n\n<p>So, a little bit of data manipulation to present the information in a more informative manner than how it is shown on the MoH website. I want to start going into it in a bit more detail now I have the basics setup. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Slow web may be better to work locally<\/h4>\n\n\n\n<p>I&#8217;m not sure if my Sheet is going to crash with the new importXML with new data, I&#8217;m waiting until the website updates. Updated yesterday at 2pm, so we&#8217;ll see what happens (currently not 2pm but 1pm update says cases up to 283 of confirmed and probable and also some community transmitted. <\/p>\n\n\n\n<p>I noticed that the computer went very slow just after lunch, lots of people checking for updates. I may think of moving from Sheets to Excel so I can run locally rather than over the web. I actually use a CSV upload to Datawrapper so that works fine. <\/p>\n\n\n\n<h3 class=\"has-vivid-red-color has-text-color wp-block-heading\">Bugger<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img decoding=\"async\" width=\"700\" height=\"884\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/covid-confirmed-probable-cases-by-dhb-26mar20.png\" alt=\"\" class=\"wp-image-6075 lazyload\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/covid-confirmed-probable-cases-by-dhb-26mar20.png 700w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/covid-confirmed-probable-cases-by-dhb-26mar20-238x300.png 238w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/covid-confirmed-probable-cases-by-dhb-26mar20-50x63.png 50w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/covid-confirmed-probable-cases-by-dhb-26mar20-40x50.png 40w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/covid-confirmed-probable-cases-by-dhb-26mar20-100x126.png 100w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/covid-confirmed-probable-cases-by-dhb-26mar20-79x100.png 79w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/covid-confirmed-probable-cases-by-dhb-26mar20-507x640.png 507w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/covid-confirmed-probable-cases-by-dhb-26mar20-640x808.png 640w, https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/covid-confirmed-probable-cases-by-dhb-26mar20-608x768.png 608w\" data-sizes=\"(max-width: 700px) 100vw, 700px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 700px; --smush-placeholder-aspect-ratio: 700\/884;\" \/><\/figure>\n\n\n\n<p>After setting up the path, downloading the data the MoH has reconfigured it and is showing their information on a map, so much less information, more simplistic. There goes that data source. Also instead of regions its going by District Health Boards, in some ways that makes more sense.<\/p>\n\n\n\n<p>I have the global information infor CSV that I can download from this page: <strong>htt<span style=\"color:#cf2e2e\" class=\"color\">ps:\/\/ourworldindata.org\/coronavirus-source-data <\/span><\/strong>so I will start playing with that. One thing I do want is to compare against country&#8217;s population. I was just starting to get NZ regional population figures (NZ Stats 2013 census) to put into the spreadsheet. Maybe I need to do this for global, although I think the files above have that information somewhere.<\/p>\n\n\n\n<p>So this is pushing me to work offline with the data set.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>At the end of the fist part I&#8217;d got some data to play with from a couple of sources, cleaned it up, got some data to make paths to create a map and coloured map in by region based on covid cases. This was done using Excel, Notepad++ and displayed in browser. I was just [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6074,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40,3,32,6,12,29],"tags":[],"class_list":["post-6067","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-analysis","category-data-extraction","category-power-bi","category-maps","category-visualisation","category-web"],"featured_image_src":"https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-13_20_06-Add-New-Post-\u2039-Vast-\u2014-WordPress.jpg","featured_image_src_square":"https:\/\/max-drake.cc\/wp-content\/uploads\/2020\/03\/2020-03-26-13_20_06-Add-New-Post-\u2039-Vast-\u2014-WordPress.jpg","author_info":{"display_name":"Max Drake","author_link":"https:\/\/max-drake.cc\/?author=1"},"_links":{"self":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/6067","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6067"}],"version-history":[{"count":0,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/6067\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/media\/6074"}],"wp:attachment":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}