{"id":8864,"date":"2017-09-23T05:04:16","date_gmt":"2017-09-23T09:04:16","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=8864"},"modified":"2017-11-03T18:35:33","modified_gmt":"2017-11-03T22:35:33","slug":"matlab-basemap-data-r2017b","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2017\/09\/23\/matlab-basemap-data-r2017b\/","title":{"rendered":"MATLAB Basemap Data (R2017b)"},"content":{"rendered":"<div class=\"content\"><p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/869871\">Jiro<\/a>&#8216;s pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/?term=basemap+geobubble\">MATLAB Basemap Data<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/9947823\">MathWorks Mapping Team<\/a>.<\/p><p>In the new R2017b release, there is a new interactive geographic function called <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/geobubble.html\"><tt>geobubble<\/tt><\/a> which displays bubbles at geographic locations, with the size and color representing other parameters.<\/p><pre class=\"codeinput\">tsunamis = readtable(<span class=\"string\">'tsunamis.xlsx'<\/span>);\r\ntsunamis.Cause = categorical(tsunamis.Cause);\r\ngb = geobubble(tsunamis,<span class=\"string\">'Latitude'<\/span>,<span class=\"string\">'Longitude'<\/span>, <span class=\"keyword\">...<\/span>\r\n    <span class=\"string\">'SizeVariable'<\/span>,<span class=\"string\">'MaxHeight'<\/span>,<span class=\"string\">'ColorVariable'<\/span>,<span class=\"string\">'Cause'<\/span>)\r\n<\/pre><pre class=\"codeoutput\">gb = \r\n  GeographicBubbleChart with properties:\r\n\r\n              Basemap: 'darkwater'\r\n            MapLayout: 'normal'\r\n          SourceTable: [162&times;20 table]\r\n     LatitudeVariable: 'Latitude'\r\n    LongitudeVariable: 'Longitude'\r\n         SizeVariable: 'MaxHeight'\r\n        ColorVariable: 'Cause'\r\n\r\n  Use GET to show all properties\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_basemap\/potw_basemap_01.png\" alt=\"\"> <p>We can focus on a particular area, for example North America, with <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/geolimits.html\"><tt>geolimits<\/tt><\/a>.<\/p><pre class=\"codeinput\">geolimits([10 65],[-180 -60])\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_basemap\/potw_basemap_02.png\" alt=\"\"> <p>The background image you see is the basemap. By default, the basemap you&#8217;re seeing here is called &#8220;darkwater&#8221; and is included with the product. You can change the <tt>Basemap<\/tt> property to five other maps: <em>grayland<\/em>, <em>bluegreen<\/em>, <em>colorterrain<\/em>, <em>grayterrain<\/em>, <em>landcover<\/em>. These maps are automatically accessed over the Internet. For those with no or low Internet connection, they can download an offline version of the maps.<\/p><p><b>grayland<\/b><\/p><pre class=\"codeinput\">gb.Basemap = <span class=\"string\">'grayland'<\/span>;\r\npause(2)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_basemap\/potw_basemap_03.png\" alt=\"\"> <p><b>bluegreen<\/b><\/p><pre class=\"codeinput\">gb.Basemap = <span class=\"string\">'bluegreen'<\/span>;\r\npause(2)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_basemap\/potw_basemap_04.png\" alt=\"\"> <p><b>colorterrain<\/b><\/p><pre class=\"codeinput\">gb.Basemap = <span class=\"string\">'colorterrain'<\/span>;\r\npause(2)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_basemap\/potw_basemap_05.png\" alt=\"\"> <p><b>grayterrain<\/b><\/p><pre class=\"codeinput\">gb.Basemap = <span class=\"string\">'grayterrain'<\/span>;\r\npause(2)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_basemap\/potw_basemap_06.png\" alt=\"\"> <p><b>landcover<\/b><\/p><pre class=\"codeinput\">gb.Basemap = <span class=\"string\">'landcover'<\/span>;\r\npause(2)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_basemap\/potw_basemap_07.png\" alt=\"\"> <p><b>EDIT (to illustrate the exploratory nature of <tt>geobubble<\/tt>, as mentioned by Rob):<\/b><\/p><p>One of the use cases for <tt>geobubble<\/tt> is interactive exploration. For example, I can zoom in with my mouse to see a particular location in greater detail.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_basemap\/geobubble_anim.gif\" alt=\"\"> <\/p><p><b>R2017b<\/b><\/p><p>There are plenty of new, great features in the new R2017b. Take a look at <a href=\"https:\/\/www.mathworks.com\/products\/new_products\/latest_features.html?s_tid=hp_release_2017b\">what&#8217;s new<\/a>.<\/p><p><b>Comments<\/b><\/p><p>Give it a try and let us know what you think <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=8864#respond\">here<\/a> or leave a <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/contact\/9947823-mathworks-mapping-team\">comment<\/a> for the MathWorks Mapping Team.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_680aaa12a7354b81b78e9a133b9592d0() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='680aaa12a7354b81b78e9a133b9592d0 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 680aaa12a7354b81b78e9a133b9592d0';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2017 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_680aaa12a7354b81b78e9a133b9592d0()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2017b<br><\/p><p class=\"footer\"><br>\r\n      Published with MATLAB&reg; R2017b<br><\/p><\/div><!--\r\n680aaa12a7354b81b78e9a133b9592d0 ##### SOURCE BEGIN #####\r\n%%\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/869871 Jiro>'s\r\n% pick this week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/?term=basemap+geobubble\r\n% MATLAB Basemap Data> by\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/9947823\r\n% MathWorks Mapping Team>.\r\n%\r\n% In the new R2017b release, there is a new interactive geographic function\r\n% called <https:\/\/www.mathworks.com\/help\/matlab\/ref\/geobubble.html\r\n% |geobubble|> which displays bubbles at geographic locations, with the\r\n% size and color representing other parameters.\r\n\r\ntsunamis = readtable('tsunamis.xlsx');\r\ntsunamis.Cause = categorical(tsunamis.Cause);\r\ngb = geobubble(tsunamis,'Latitude','Longitude', ...\r\n    'SizeVariable','MaxHeight','ColorVariable','Cause')\r\n\r\n%%\r\n% We can focus on a particular area, for example North America, with\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/geolimits.html |geolimits|>.\r\ngeolimits([10 65],[-180 -60])\r\n\r\n%%\r\n% \r\n% The background image you see is the basemap. By default, the basemap\r\n% you're seeing here is called \"darkwater\" and is included with the\r\n% product. You can change the |Basemap| property to five other maps:\r\n% _grayland_, _bluegreen_, _colorterrain_, _grayterrain_, _landcover_.\r\n% These maps are automatically accessed over the Internet. For those with\r\n% no or low Internet connection, they can download an offline version of\r\n% the maps.\r\n\r\n%%\r\n% *grayland*\r\n\r\ngb.Basemap = 'grayland';\r\npause(2)\r\n\r\n%%\r\n% *bluegreen*\r\n\r\ngb.Basemap = 'bluegreen';\r\npause(2)\r\n\r\n%%\r\n% *colorterrain*\r\n\r\ngb.Basemap = 'colorterrain';\r\npause(2)\r\n\r\n%%\r\n% *grayterrain*\r\n\r\ngb.Basemap = 'grayterrain';\r\npause(2)\r\n\r\n%%\r\n% *landcover*\r\n\r\ngb.Basemap = 'landcover';\r\npause(2)\r\n\r\n%%\r\n% *EDIT (to illustrate the exploratory nature of |geobubble|, as mentioned\r\n% by Rob):*\r\n%\r\n% One of the use cases for |geobubble| is interactive exploration. For\r\n% example, I can zoom in with my mouse to see a particular location in\r\n% greater detail.\r\n% \r\n% <<geobubble_anim.gif>>\r\n\r\n%%\r\n% *R2017b*\r\n%\r\n% There are plenty of new, great features in the new R2017b. Take a look at\r\n% <https:\/\/www.mathworks.com\/products\/new_products\/latest_features.html?s_tid=hp_release_2017b\r\n% what's new>.\r\n%\r\n% *Comments*\r\n%\r\n% Give it a try and let us know what you think\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=8864#respond here> or leave a\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/contact\/9947823-mathworks-mapping-team\r\n% comment> for the MathWorks Mapping Team.\r\n##### SOURCE END ##### 680aaa12a7354b81b78e9a133b9592d0\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_basemap\/potw_basemap_01.png\" onError=\"this.style.display ='none';\" \/><\/div><p>Jiro&#8216;s pick this week is MATLAB Basemap Data by MathWorks Mapping Team.In the new R2017b release, there is a new interactive geographic function called geobubble which displays bubbles at&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2017\/09\/23\/matlab-basemap-data-r2017b\/\">read more >><\/a><\/p>","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/8864"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=8864"}],"version-history":[{"count":9,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/8864\/revisions"}],"predecessor-version":[{"id":8929,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/8864\/revisions\/8929"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=8864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=8864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=8864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}