{"id":861,"date":"2010-03-03T23:37:34","date_gmt":"2010-03-03T15:37:34","guid":{"rendered":"http:\/\/blog.lolyco.com\/sean\/?p=861"},"modified":"2010-12-30T00:00:42","modified_gmt":"2010-12-29T16:00:42","slug":"pos-malaysia-shipping-price-world-map","status":"publish","type":"post","link":"https:\/\/blog.lolyco.com\/sean\/2010\/03\/03\/pos-malaysia-shipping-price-world-map\/","title":{"rendered":"Pos Malaysia Shipping Price World Map"},"content":{"rendered":"<div id=\"attachment_863\" style=\"width: 210px\" class=\"wp-caption alignright\"><a href=\"http:\/\/spider.my\/demo\/shipping-quote-world-map.xhtml\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-863\" class=\"size-full wp-image-863 \" title=\"Pos Malaysia world shipping charges\" src=\"http:\/\/blog.lolyco.com\/sean\/wp-content\/uploads\/2010\/03\/posworld.2001.png\" alt=\"Pos Malaysia world shipping charges\" width=\"200\" height=\"100\" \/><\/a><p id=\"caption-attachment-863\" class=\"wp-caption-text\">Pos Malaysia world shipping charges.<\/p><\/div>\n<p><a href=\"http:\/\/spider.my\/demo\/shipping-quote-world-map.xhtml\">The Pos Malaysia World Shipping Map<\/a> is an example of what you can do with an API. Given a weight and a shipping method, you can draw a global map of relative shipping costs. Now that the Pos Malaysia data has been converted to use ISO3166-1 Country Codes, it&#8217;s trivial to take data from it and merge it with useful resources from elsewhere which also comply with international standards.<\/p>\n<p>The <a href=\"http:\/\/en.wikipedia.org\/wiki\/File:BlankMap-World6.svg\">map is a public domain SVG file from Wikipedia<\/a>. The creators of the map specified ids for the countries using ISO3166 2-letter country codes. I generate CSS colour codes from the country code \/ relative price data obtained from the API, and build a coloured map on the server. The coloured map is about 2MB in size, so I convert it into a smaller PNG image and send the URL back to the browser.<\/p>\n<p>Note that I&#8217;m not suggesting Pos should create fancy coloured maps. These maps arguably could be handy for checking completeness of shipping data coverage, or &#8216;eye-balling&#8217; the global map to spot inconsistencies in charging. The world shipping map is just another example of what is possible for third parties <strong>IF<\/strong> Pos Malaysia exposed a usable API.<\/p>\n<p><del datetime=\"2010-12-29T15:48:06+00:00\">If you want to play with the world maps, be aware that spider.my is hosted on a <em>tiny <\/em>VPS (Virtual Private Server) in the USA &#8211; it only has 64MB of memory and 2GB of hard disk. It can be a little bit slow to convert the SVG graphics into an image. <span style=\"text-decoration: line-through;\">As long as I haven&#8217;t given up on getting Pos to adopt the API, you should be able to access the same features at <a href=\"http:\/\/pos.spider.my\/\">pos.spider.my<\/a> &#8211; that&#8217;s a bigger server sitting on my desk in Malaysia.<br \/>\n<\/span><\/del><\/p>\n<p>If the maps inspire you to try out an idea of your own, make sure you contact me first to encourage me to leave the API online! <del datetime=\"2010-12-29T15:48:06+00:00\">Better yet, find someone from Pos Malaysia to tell &#8220;Hey! Let that guy set up your API for you so we can do good stuff with your data!&#8221;.<\/del><\/p>\n<p>You can send 10kg by Pos Parcel Surface very cheaply almost anywhere, compared to <a href=\"http:\/\/en.wikipedia.org\/wiki\/Bolivia\">Bolivia<\/a> and is that <a href=\"http:\/\/en.wikipedia.org\/wiki\/Uzbekistan\">Uzbekistan<\/a>?<\/p>\n<p><img decoding=\"async\" class=\"alignnone\" title=\"10kg by Pos Parcel Surface\" src=\"http:\/\/spider.my\/static\/media\/demo\/10.00-Pos%20Parcel%20Surface.png\" alt=\"10kg by Pos Parcel Surface\" \/><\/p>\n<p>Pos Parcel Surface doesn&#8217;t permit sending 15kg to nearly as many destinations:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"15kg by Pos Parcel Surface\" src=\"http:\/\/spider.my\/static\/media\/demo\/15.00-Pos%20Parcel%20Surface.png\" alt=\"15kg by Pos Parcel Surface\" width=\"400\" height=\"200\" \/><\/p>\n<p>And you&#8217;ll get eye strain spotting the countries to which you can (by Pos Parcel Surface) send 15kg, but you can&#8217;t send 20kg:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"20kg by Pos Parcel Surface\" src=\"http:\/\/spider.my\/static\/media\/demo\/20.00-Pos%20Parcel%20Surface.png\" alt=\"20kg by Pos Parcel Surface\" width=\"400\" height=\"200\" \/><\/p>\n<p>These are tiny images, but they&#8217;re created from SVG on the server, so enormous versions are available on request!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Pos Malaysia World Shipping Map is an example of what you can do with an API. Given a weight and a shipping method, you can draw a global map of relative shipping costs. Now that the Pos Malaysia data has been converted to use ISO3166-1 Country Codes, it&#8217;s trivial to take data from it [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,60,3,35],"tags":[21,19,34,63,18,105,111,57],"class_list":["post-861","post","type-post","status-publish","format-standard","hentry","category-fixed","category-money","category-software","category-spidermy","tag-e-commerce","tag-malaysia","tag-network","tag-pos-malaysia","tag-server","tag-software","tag-spidermy","tag-web"],"_links":{"self":[{"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/posts\/861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/comments?post=861"}],"version-history":[{"count":9,"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/posts\/861\/revisions"}],"predecessor-version":[{"id":1012,"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/posts\/861\/revisions\/1012"}],"wp:attachment":[{"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/media?parent=861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/categories?post=861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/tags?post=861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}