{"id":147,"date":"2011-10-16T17:02:50","date_gmt":"2011-10-16T15:02:50","guid":{"rendered":"http:\/\/visurus.wordpress.com\/?p=147"},"modified":"2014-02-27T23:17:40","modified_gmt":"2014-02-27T23:17:40","slug":"zipscribble-map-switzerland-part-i","status":"publish","type":"post","link":"https:\/\/www.ralphstraumann.ch\/blog\/2011\/10\/zipscribble-map-switzerland-part-i\/","title":{"rendered":"ZIPScribble Map: Switzerland \u2013 Part I"},"content":{"rendered":"<p>Having seen a visualization by <a href=\"http:\/\/kosara.net\/\">Robert Kosara<\/a> of\u00a0<a href=\"http:\/\/eagereyes.org\">EagerEyes<\/a> a loooong time ago,\u00a0I wanted to try to reproduce it for Switzerland using <a href=\"http:\/\/visurus.wordpress.com\/2011\/03\/18\/intro-to-processing\/\">Processing<\/a>. This is the first installment of a two-parts post covering this project, in which I will describe how to arrive at an intermediate result. I&#8217;ll do that in some detail, maybe this is helpful to somebody.<\/p>\n<p>The visualization is called the <a href=\"http:\/\/eagereyes.org\/Applications\/ZIPScribbleMap.html\">ZIPScribbleMap<\/a>: &#8220;ZIP&#8221; for postal codes, &#8220;Scribble&#8221; for rather obvious reasons (as in <em>&#8220;it looks like what I doodle while on the phone!&#8221;<\/em>): <a href=\"http:\/\/eagereyes.org\/Applications\/ZIPScribbleMap.html\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" title=\"US ZIPScribbleMap by Robert Kosara\" alt=\"\" src=\"http:\/\/eagereyes.org\/media\/attachments\/ZIPScribbleMap-color-names-borders-thumb.jpg\" width=\"600\" height=\"350\" \/><!--more--><\/a><\/p>\n<p><strong>Data<\/strong><\/p>\n<p><strong><\/strong>First of all I needed a dataset of Swiss postal codes. Ideally this dataset would contain the place names along with the postal codes (for error\/quality checking) and would be <em>geocoded<\/em> (that is, contain geographic coordinates). However, if the postal codes were not geocoded, one could resort to using a (for example, <a href=\"http:\/\/code.google.com\/apis\/maps\/documentation\/geocoding\/\">Google&#8217;s<\/a>) geocoding service to hopefully obtain coordinates for the postal codes).<\/p>\n<p>Luckily, I could avoid this extra step, because after a brief search it turned out that Geonames does offer datasets of geocoded postal codes on a per-country basis for download:\u00a0<a href=\"http:\/\/download.geonames.org\/export\/zip\">http:\/\/download.geonames.org\/export\/zip<\/a>\u00a0(scroll down for a readme; entry page is\u00a0<a href=\"http:\/\/download.geonames.org\/export\/\">here<\/a> with reference to postal codes in first paragraph).<\/p>\n<p>The data is <a href=\"http:\/\/creativecommons.org\/licenses\/by\/3.0\/\">CC-BY-3.0-licensed<\/a>, which means we can use it to our ends (even commercial ones) provided we attribute it to Geonames. The <a href=\"http:\/\/download.geonames.org\/export\/zip\/\">Readme<\/a> accompanying the data says a link to the Geonames website is okay for this purpose.<\/p>\n<p><strong>Basemap<\/strong><\/p>\n<p><strong><\/strong>Next I felt I needed a nice looking base map to plot the postal code data on, rather than just an empty canvas. In order to prepare one I decided to use <a href=\"http:\/\/mapbox.com\/tilemill\">TileMill<\/a> by MapBox (see this <a href=\"http:\/\/visurus.wordpress.com\/2011\/06\/30\/using-customised-basemaps-in-processing\">post<\/a>). TileMill is available for Mac OS and Ubuntu. So I fired up my Ubuntu desktop computer and had TileMill installed. TileMill runs in the browser.<\/p>\n<p>I edited an existing stylesheet to get a very reduced basemap with bright colours. The basemap contains country outlines and major lakes. I exported the basemap as a PNG file for use in Processing.<\/p>\n<p>Note: When you do the export, you have to pay attention to note down the extent coordinates (north, east, south and west boundary coordinates). You need these later on in order to get the spatial reference in Processing right: Processing has to project geographically referenced data (basemap and postal codes) consistently into the screen spatial reference system.<\/p>\n<p>Side-note: While figuring out the design of the basemap I exported different versions several times, because I forgot to take note of the extent coordinates. Later I dropped defining an extent by mouse but entered the extent coordinates numerically into TileMill instead.<\/p>\n<p>Finally: This is what my basemap of Switzerland looked like:<\/p>\n<figure id=\"attachment_598\" aria-describedby=\"caption-attachment-598\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.ralphstraumann.ch\/blog\/wp-content\/uploads\/2011\/10\/mapswi_bright1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-598 \" title=\"Basemap for Switzerland, by TileMill\" alt=\"\" src=\"http:\/\/www.ralphstraumann.ch\/blog\/wp-content\/uploads\/2011\/10\/mapswi_bright1.png?w=300\" width=\"600\" height=\"394\" \/><\/a><figcaption id=\"caption-attachment-598\" class=\"wp-caption-text\">Basemap for Switzerland, by TileMill<\/figcaption><\/figure>\n<p><strong>The Mechanics of Part I<\/strong><\/p>\n<p>Time to fire up Processing. I&#8217;m using version 1.5.1 on Ubuntu:<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/processing.org\/\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-269\" title=\"Processing\" alt=\"\" src=\"http:\/\/www.ralphstraumann.ch\/blog\/wp-content\/uploads\/2011\/04\/processing_logo.gif\" width=\"500\" height=\"80\" \/><\/a><\/p>\n<p>Let&#8217;s summarise: By now I had my basemap as well as my postal code data ready. The latter is saved in a text file. Both files have to be stored in the <em>data<\/em> folder of the Processing sketch. You can move them there manually or use the <em>Sketch<\/em> &gt; <em>Add File&#8230;<\/em>dialog in Processing.<\/p>\n<p>For using the basemap in Processing, you best refer to the <a href=\"http:\/\/tillnagel.com\/2011\/06\/tilemill-for-processing\/#static-map\">Simple static map example<\/a> by Till Nagel. He offers a nifty\u00a0<a href=\"http:\/\/tillnagel.com\/wp-content\/uploads\/2011\/06\/MercatorMap.java\">MercatorMap<\/a> class for download, which one can use for handling the projection from geographic coordinates to screen coordinates. Download and save it as <em>MercatorMap.pde<\/em> in the Processing sketch folder (not the <em>data<\/em> folder).<\/p>\n<p>Using the MercatorMap class I could load the basemap in Processing as follows (this is where you need the extent coordinates, which you noted when you exported the basemap from TileMill):<\/p>\n<p>[sourcecode language=&#8221;java&#8221; highlight=&#8221;12&#8243;]<br \/>\nPImage img;<br \/>\nMercatorMap mercatorMap;<\/p>\n<p>void setup() {<br \/>\nsmooth();<br \/>\nnoLoop();<br \/>\n\/\/ Set up canvas<br \/>\nsize(1024, 673);<br \/>\n\/\/ Load image<br \/>\nimg = loadImage(&#8220;mapSWI_bright.png&#8221;);<br \/>\n\/\/ Initiate mercator map to handle projection<br \/>\nmercatorMap = new MercatorMap(width, height, 47.9, 45.7, 5.78, 10.67);<br \/>\n[\/sourcecode]<\/p>\n<p>Outside the <em>setup()<\/em>\u00a0method I defined a <em>PImage<\/em> object in order to store the PNG file of the basemap and a <em>MercatorMap<\/em> object for handling the projection. In the <em>setup()<\/em> method I define the canvas size, load the basemap file and (in line 12)\u00a0instantiate the <em>MercatorMap<\/em>\u00a0using the sketch width and height as well as the extent coordinates.<\/p>\n<p>In a second step I added some font definitions (the fonts can be created using <em>Tools<\/em> &gt; <em>Create Font&#8230;<\/em> in Processing) and the functionality to read the postal code data from the Geonames text file:<\/p>\n<p>[sourcecode language=&#8221;java&#8221; highlight=&#8221;2,3,5,6,17,18,19,20,21,22&#8243;]<br \/>\nPImage img;<br \/>\nPFont fontSmall, fontBig, fontBold;<br \/>\nPVector pnt;<br \/>\nMercatorMap mercatorMap;<br \/>\nString[] lines;<br \/>\nint index = 0;<\/p>\n<p>void setup() {<br \/>\nsmooth();<br \/>\nnoLoop();<br \/>\n\/\/ Set up canvas<br \/>\nsize(1024, 673);<br \/>\n\/\/ Load image<br \/>\nimg = loadImage(&#8220;mapSWI_bright.png&#8221;);<br \/>\n\/\/ Initiate mercator map to handle projection<br \/>\nmercatorMap = new MercatorMap(width, height, 47.9, 45.7, 5.78, 10.67);<br \/>\n\/\/ Set up fonts for labelling<br \/>\nfontSmall = loadFont(&#8220;DejaVuSansCondensed-10.vlw&#8221;);<br \/>\nfontBig = loadFont(&#8220;DejaVuSerifCondensed-25.vlw&#8221;);<br \/>\nfontBold = loadFont(&#8220;DejaVuSerifCondensed-Bold-25.vlw&#8221;);<br \/>\n\/\/ Load zip code data<br \/>\nlines = loadStrings(&#8220;zipcodes_SWI.txt&#8221;);<br \/>\n[\/sourcecode]<\/p>\n<p>Line 22 reads the postal code from the Geonames text file and stores it in a String array <em>lines<\/em>. Since I had defined the array outside the <em>setup()<\/em> method, I can access it now inside the <em>draw()<\/em> method:<\/p>\n<p>[sourcecode language=&#8221;java&#8221; highlight=&#8221;7,8,9,10,11,12,13,14&#8243;]<br \/>\nvoid draw() {<br \/>\n\/\/ Draw basemap<br \/>\nimage(img, 0, 0);<br \/>\n\/\/ Draw zip code locations<br \/>\nnoStroke();<br \/>\nfill(250, 150, 0, 80);<br \/>\nwhile (index &lt; lines.length) {<br \/>\nString[] row = split(lines[index], &#8216;t&#8217;);<br \/>\nfloat lat = float(row[9]);<br \/>\nfloat lon = float(row[10]);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(lat, lon));<br \/>\nellipse(pnt.x, pnt.y, 6, 6);<br \/>\nindex = index + 1;<br \/>\n}<br \/>\n[\/sourcecode]<\/p>\n<p>Let&#8217;s look at what happens here in a bit more detail: The following part is inside a loop which iterates through the entries in the String array <em>lines<\/em>:<\/p>\n<p>[sourcecode language=&#8221;java&#8221; firstline=&#8221;8&#8243;]<br \/>\nString[] row = split(lines[index], &#8216;t&#8217;);<br \/>\nfloat lat = float(row[9]);<br \/>\nfloat lon = float(row[10]);<br \/>\n[\/sourcecode]<\/p>\n<p>Line 8 takes the current entry of the <em>lines<\/em> array and splits it wherever it finds a tabulator (or &#8216;t&#8217; in Java). The result is stored in a new String array <em>row<\/em>. Lines 9 and 10 pick the correct entries from the array, convert them to a floating point number and store it in the variables <em>lat<\/em> (latitude) and <em>lon<\/em> (longitude). Thus, now we have the geographic coordinates of a postal code right there.<\/p>\n<p>The next part is still in the loop which iterates through the postal code data. Line 11 creates a new <em>PVector<\/em> (a Processing object) from the two coordinates I just extracted. This <em>PVector<\/em> object is subjected to the <em>getScreenLocation()<\/em>\u00a0method of Till Nagel&#8217;s <em>MercatorMap<\/em> object.<\/p>\n<p>[sourcecode language=&#8221;java&#8221; firstline=&#8221;11&#8243;]<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(lat, lon));<br \/>\nellipse(pnt.x, pnt.y, 6, 6);<br \/>\nindex = index + 1;<br \/>\n[\/sourcecode]<\/p>\n<p>The\u00a0<em>getScreenLocation()<\/em> method is pretty self-explanatory: It takes geographic coordinates and using the extent coordinates from when I set up the\u00a0<em>MercatorMap<\/em>\u00a0object, converts them into screen coordinates of this Processing sketch. Then, using the x and y coordinates of the Object <em>pnt<\/em> we draw an ellipse of size (6, 6), that is, a circle, before we advance the index and continue to iterate through the postal code data (as long as there is data left to read).<\/p>\n<p><strong>Result<\/strong><\/p>\n<p>Finally, the result is here (click on the figures to see them bigger). I produced versions with different basemaps and with\/without additional, labelled cities:<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.ralphstraumann.ch\/blog\/wp-content\/uploads\/2011\/10\/postalcodesswi_bright1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-614 aligncenter\" title=\"Postal codes of Switzerland\" alt=\"\" src=\"http:\/\/www.ralphstraumann.ch\/blog\/wp-content\/uploads\/2011\/10\/postalcodesswi_bright1.png\" width=\"640\" height=\"420\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.ralphstraumann.ch\/blog\/wp-content\/uploads\/2011\/10\/postalcodesswi_bright_labels.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-615\" title=\"Postal codes of Switzerland\" alt=\"\" src=\"http:\/\/www.ralphstraumann.ch\/blog\/wp-content\/uploads\/2011\/10\/postalcodesswi_bright_labels.png\" width=\"640\" height=\"420\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.ralphstraumann.ch\/blog\/wp-content\/uploads\/2011\/10\/postalcodesswi_dark_labels1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-616\" title=\"Postal codes of Switzerland\" alt=\"\" src=\"http:\/\/www.ralphstraumann.ch\/blog\/wp-content\/uploads\/2011\/10\/postalcodesswi_dark_labels1.png\" width=\"640\" height=\"420\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.ralphstraumann.ch\/blog\/wp-content\/uploads\/2011\/10\/postalcodesswi_dark1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-617\" title=\"Postal codes of Switzerland\" alt=\"\" src=\"http:\/\/www.ralphstraumann.ch\/blog\/wp-content\/uploads\/2011\/10\/postalcodesswi_dark1.png\" width=\"640\" height=\"420\" \/><\/a>On the way to the <em>ZIPScribble Map: Switzerland<\/em> these are only intermediate results. Yet I find them nice and insightful enough. Bigger cities (with several postal codes) and agglomerations are quite clearly visible. Also the mountainous regions of Switzerland such as the Alps are discernible in the picture. In alpine regions municipalities and thus postal code regions tend to be bigger than in the rather densely populated lowlands. Overall the maps are certainly not bad approximations of population density.<\/p>\n<p>Any feedback or questions are welcome, feel free to sound off in the comment section or shot me an <a href=\"mailto:visurus@gmail.com\">e-mail<\/a>.<\/p>\n<p>Below I include the Processing source code of the last version of the Postal Code map:<\/p>\n<p>[sourcecode language=&#8221;java&#8221; collapse=&#8221;true&#8221; gutter=&#8221;false&#8221;]&lt;\/span&gt;<br \/>\n&lt;pre&gt;\/\/ Ralph Straumann<br \/>\n\/\/ visurus.wordpress.com<br \/>\n\/\/ 2011-10-16<br \/>\n\/\/ CC-BY-NC<\/p>\n<p>\/\/ Thanks to:<br \/>\n\/\/ http:\/\/download.geonames.org\/export\/zip\/CH.zip<br \/>\n\/\/ http:\/\/tillnagel.com\/wp-content\/uploads\/2011\/06\/MercatorMap.java via http:\/\/tillnagel.com\/2011\/06\/tilemill-for-processing<\/p>\n<p>PImage img;<br \/>\nPFont fontSmall, fontBig, fontBold;<br \/>\nPVector pnt;<br \/>\nMercatorMap mercatorMap;<br \/>\nString[] lines;<br \/>\nint index = 0;<br \/>\nboolean placeLabels = true;<\/p>\n<p>void setup() {<br \/>\nsmooth();<br \/>\nnoLoop();<\/p>\n<p>\/\/ Set up canvas<br \/>\nsize(1024, 673);<\/p>\n<p>\/\/ Load image &#8211; either bright or dark basemap<br \/>\nimg = loadImage(&#8220;mapSWI_bright.png&#8221;);<br \/>\n\/\/img = loadImage(&#8220;mapSWI_dark.png&#8221;);<\/p>\n<p>\/\/ Load zip code data<br \/>\nlines = loadStrings(&#8220;zipcodes_SWI.txt&#8221;);<br \/>\n\/\/ Set up fonts for labelling<br \/>\nfontSmall = loadFont(&#8220;DejaVuSansCondensed-10.vlw&#8221;);<br \/>\nfontBig = loadFont(&#8220;DejaVuSerifCondensed-25.vlw&#8221;);<br \/>\nfontBold = loadFont(&#8220;DejaVuSerifCondensed-Bold-25.vlw&#8221;);<br \/>\n\/\/ Initiate mercator map to handle projection<br \/>\nmercatorMap = new MercatorMap(width, height, 47.9, 45.7, 5.78, 10.67);<br \/>\n}<\/p>\n<p>void draw() {<br \/>\n\/\/ Draw basemap<br \/>\nimage(img, 0, 0);<\/p>\n<p>\/\/ Draw zip code locations<br \/>\nnoStroke();<br \/>\nfill(250, 150, 0, 80);<br \/>\nwhile (index &lt; lines.length) {<br \/>\nString[] row = split(lines[index], &#8216;t&#8217;);<br \/>\nfloat lat = float(row[9]);<br \/>\nfloat lon = float(row[10]);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(lat, lon));<br \/>\nellipse(pnt.x, pnt.y, 6, 6);<br \/>\nindex = index + 1;<br \/>\n}<\/p>\n<p>if (placeLabels == true) {<br \/>\nfill(0);<br \/>\ntextFont(fontSmall);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(46.9167,7.4667));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Berne&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(47.5842,7.5876));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Basle&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(46.2095,6.1438));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Geneva&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(47.0833,8.2667));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Lucerne&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(47.4236,9.3622));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;St. Gallen&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(46.2295,7.3568));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Sion&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(47.7151,8.622));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Schaffhausen&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(46.1889,9.0247));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Bellinzona&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(46.85,9.5));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Chur&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(47.1324,7.2441));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Bienne&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(46.7554,7.6236));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Thun&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(46.0083,8.9495));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Lugano&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(47.4916,8.7295));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Winterthur&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(46.7787,6.6339));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Yverdon-les-Bains&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(47.3667,8.55));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Zurich&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(46.5534,6.6971));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Lausanne&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(46.289,7.5458));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Sierre&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(47.3433,7.9052));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Olten&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(47.0543,9.4488));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Sargans&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(46.4855,9.8335));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;St. Moritz&#8221;, pnt.x+5, pnt.y-5);<br \/>\npnt = mercatorMap.getScreenLocation(new PVector(46.7783,9.879));<br \/>\nellipse(pnt.x, pnt.y, 4, 4);<br \/>\ntext(&#8220;Davos&#8221;, pnt.x+5, pnt.y-5);<br \/>\n}<\/p>\n<p>\/\/ Add labels<br \/>\nfill(180);<br \/>\ntextFont(fontBig);<br \/>\ntext(&#8220;Postal Codes&#8221;, 30, 45);<br \/>\ntextFont(fontBold);<br \/>\ntext(&#8220;Switzerland&#8221;, 30, 73);<br \/>\ntextFont(fontSmall);<br \/>\nfill(130);<br \/>\ntext(&#8220;Postal codes CC-BY&#8221;, 30, 632);<br \/>\ntext(&#8220;www.geonames.org&#8221;, 30, 645);<br \/>\ntextAlign(RIGHT);<br \/>\ntext(&#8220;CC-BY-NC&#8221;, 990, 632);<br \/>\ntext(&#8220;visurus.wordpress.com&#8221;, 990, 645);<\/p>\n<p>save(&#8220;PostalCodesSWI.png&#8221;);<br \/>\n}<br \/>\n[\/sourcecode]<\/p>\n<p>Thanks to <a href=\"http:\/\/kosara.net\/\">Robert Kosara<\/a>, <a href=\"http:\/\/mapbox.com\/tilemill\">TileMill<\/a>, <a href=\"http:\/\/tillnagel.com\">Till Nagel<\/a> and <a href=\"http:\/\/www.geonames.org\">Geonames<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Having seen a visualization by Robert Kosara of\u00a0EagerEyes a loooong time ago,\u00a0I wanted to try to reproduce it for Switzerland using Processing. This is the first installment of a two-parts post covering this project, in which I will describe how to arrive at an intermediate result. I&#8217;ll do that in some detail, maybe this is &hellip; <a href=\"https:\/\/www.ralphstraumann.ch\/blog\/2011\/10\/zipscribble-map-switzerland-part-i\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">ZIPScribble Map: Switzerland \u2013 Part I<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":616,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"ZIPScribble Map: Switzerland \u2013 Part I: http:\/\/wp.me\/p1qYOj-2n","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[8],"tags":[52,66,89,90,114,125,133,134],"class_list":["post-147","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-piece","tag-geo","tag-java","tag-postcodes","tag-processing","tag-tilemill","tag-visualization","tag-zip-codes","tag-zipscribblemap"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ralphstraumann.ch\/blog\/wp-content\/uploads\/2011\/10\/postalcodesswi_bright_labels.png","jetpack_shortlink":"https:\/\/wp.me\/p3pPwF-2n","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ralphstraumann.ch\/blog\/wp-json\/wp\/v2\/posts\/147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ralphstraumann.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ralphstraumann.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ralphstraumann.ch\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ralphstraumann.ch\/blog\/wp-json\/wp\/v2\/comments?post=147"}],"version-history":[{"count":1,"href":"https:\/\/www.ralphstraumann.ch\/blog\/wp-json\/wp\/v2\/posts\/147\/revisions"}],"predecessor-version":[{"id":1613,"href":"https:\/\/www.ralphstraumann.ch\/blog\/wp-json\/wp\/v2\/posts\/147\/revisions\/1613"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ralphstraumann.ch\/blog\/wp-json\/wp\/v2\/media\/616"}],"wp:attachment":[{"href":"https:\/\/www.ralphstraumann.ch\/blog\/wp-json\/wp\/v2\/media?parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ralphstraumann.ch\/blog\/wp-json\/wp\/v2\/categories?post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ralphstraumann.ch\/blog\/wp-json\/wp\/v2\/tags?post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}