<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Random half-baked thoughts, sometimes induced by too much beer. 



  var _gaq = _gaq || [];
  _gaq.push([‘_setAccount’, ‘UA-3395976-4’]);
  _gaq.push([‘_trackPageview’]);

  (function() {
    var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
  })();</description><title>BrainCrunch</title><generator>Tumblr (3.0; @braincrunch)</generator><link>http://braincrunch.tumblr.com/</link><item><title>The problem with OpenStreetMap multipolygons</title><description>&lt;p&gt;Here&amp;#8217;s a very simple example of why I think &lt;a href="http://wiki.openstreetmap.org/wiki/Relation:multipolygon" target="_blank"&gt;OpenStreetMap multipolygons&lt;/a&gt; are a disaster.&lt;/p&gt;

&lt;p&gt;Let&amp;#8217;s say you download a data extract of an area and you get a relation that has six member ways (all of them in outer role). The way most extracts work, you only get those ways that cross (or are inside) the download bounding box, in our case there are only two such ways:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/8e49201cba26443a4d7274377e87ff45/tumblr_inline_mkje1yMD8P1qz4rgp.png" alt="situation"/&gt;&lt;/p&gt;

&lt;p&gt;What now? In normal situations you would be able to clip the two ways using the bounding box and then connect them along the box. But the trouble is, you have two different (and equally valid) possibilities:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/e9c0c603da85061f62253282c69310b2/tumblr_inline_mkje2ezAvR1qz4rgp.png" alt="solution 1"/&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/7f72668586add6b008922f5a4db246ab/tumblr_inline_mkje2nljZl1qz4rgp.png" alt="solution 2"/&gt;&lt;/p&gt;

&lt;p&gt;How do you decide which is the correct solution, is the body of the polygon in the center between the two ways or is it on opposite sides? Let&amp;#8217;s see what options we have:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Orientation of ways: no help here - ways (and rings) can be oriented any way you like in OSM multipolygons. Usually in GIS and graphics polygons follow a clockwise/anti-clockwise rule, but in OSM this practice was abandoned. The only reason for this I could think of is to make it easier for the mappers to edit maps.&lt;/li&gt;
&lt;li&gt;Member roles: in this case the outer/inner roles don&amp;#8217;t help very much. &lt;/li&gt;
&lt;li&gt;Tagging: I wouldn&amp;#8217;t want to get into that mess. And there&amp;#8217;s no general  tagging solution for this problem, as far as I know.&lt;/li&gt;
&lt;li&gt;Requiring that extracts contain all the relation&amp;#8217;s members: OSM has a lot of very large relations that span hundreds of kilometers and &lt;a href="http://toolserver.org/~kolossos/openlayers/kml-on-ol-json3.php?lang=de&amp;amp;title=Russland&amp;amp;zoom=3&amp;amp;lat=64.69911&amp;amp;lon=111.75293&amp;amp;layers=0B00000TTTTF" target="_blank"&gt;even whole continents&lt;/a&gt;. Why would I want to have all of the Russia&amp;#8217;s coastline when I download the extract of, say, small part of Estonia?&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Don&amp;#8217;t be fooled by the simplicity of my example into thinking that this is a rare case. Lately I&amp;#8217;ve been working a lot with &lt;a href="http://scalablemaps.com" target="_blank"&gt;extracts of cities&lt;/a&gt; and I get into these kinds of problems all the time: riverbanks, forests, administrative boundaries are typical examples of multipolygons that tend to be big and become ambiguous when used in extracts.&lt;/p&gt;

&lt;p&gt;Basically, OSM multipolygons are a disaster. The &amp;#8220;rules&amp;#8221; (a.k.a. &amp;#8220;recommendations&amp;#8221;) on the wiki page change often, and not for the better. There&amp;#8217;s a tendency to recommend very liberal ways of constructing multipolygons - nothing&amp;#8217;s really mandatory and it is left to the consumer of the data to deal with the headaches. This is a very shortsighted approach, in my opinion, and it will hurt the project and the community in the (not so) long term. If the data cannot be used by &amp;#8220;ordinary&amp;#8221; users without complex toolchains and expensive hardware resources, then what is the purpose of it all?&lt;/p&gt;

&lt;p&gt;Data hoarding for the sake of it?&lt;/p&gt;</description><link>http://braincrunch.tumblr.com/post/46773748828</link><guid>http://braincrunch.tumblr.com/post/46773748828</guid><pubDate>Sun, 31 Mar 2013 20:07:20 +0200</pubDate></item><item><title>Hi, I was following your 10 steps, and I am stuck at the 9th one where I am trying to do ftp-upload. I get an error when I do that. I have created a local ftp site and I can access it from the browser, but when I give the same in maperitive I get a log list of error, the first one of which is: SystemAggregateException: One or more errors occurred SocketException: The requested name is valid, but no data of requested type was found. Can you help me with this issue... Thanks</title><description>&lt;p&gt;Googling for “The requested name is valid, but no data of requested type was found” tells me it’s some network-related issue. Maybe your ftp-upload command line is wrong - make sure the host parameter points to a valid IP or host name (without the port number).&lt;/p&gt;</description><link>http://braincrunch.tumblr.com/post/30112657270</link><guid>http://braincrunch.tumblr.com/post/30112657270</guid><pubDate>Fri, 24 Aug 2012 20:07:55 +0200</pubDate></item><item><title>Maperitive: Alpenglow Effect Using A Custom Shader</title><description>&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_m6ewk2ylWt1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://maperitive.net/download/Maperitive-latest.zip" target="_blank"&gt;latest release&lt;/a&gt; comes with a new Python script called Alpenglow.py which renders a hillshading relief adding some yellowish tint to illuminated high slopes to enhance the 3D effect. It was inspired by the &amp;#8220;&lt;a href="http://www.shadedrelief.com/illumination/index.html" target="_blank"&gt;See the light: How to make illuminated shaded relief in Photoshop 6.0&lt;/a&gt;&amp;#8221; article on the excellent &lt;a href="http://www.shadedrelief.com/" target="_blank"&gt;shadedrelief.com&lt;/a&gt; site.&lt;/p&gt;

&lt;p&gt;You can run the script by executing&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;run-python Samples/Python/Alpenglow.py
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The script generates the hillshading for a fixed map area in Switzerland, but you can change this quite easily in the script. You can also change other parameters, like shading (and alpenglow) colors, elevation ranges etc.&lt;/p&gt;

&lt;p&gt;The script also demonstrates the power of writing a &lt;strong&gt;custom shader&lt;/strong&gt;. A shader transforms a small part of the digital elevation model (DEM) into a pixel color, based on the elevation, aspect and the slope of that part of the DEM. This way you can write your own hillshading effects function and then supply it to the generator. Here&amp;#8217;s how it&amp;#8217;s done for Alpenglow.py:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# Execute the hillshading
bitmap = ReliefUtils.generate_relief_bitmap(dem, relief_bbox, Srid.WebMercator, 1, alpenglow)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The last parameter of the generate_relief_bitmap function is the shader function, in our case called alpenglow:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# The actual shader function which is called for each pixel of the hillshading bitmap.
# It receives the elevation, the aspect (orientation) of the slope and the steepnes (slope).
def alpenglow(elevation, aspect, slope):
    sin_slope = math.sin (slope)

    nx = math.cos(aspect) * sin_slope
    ny = math.sin(aspect) * sin_slope
    nz = math.cos(slope)

    direction = dotproduct(nx, ny, nz, lx, ly, lz)

    direction = (direction - minDirection) / (1 - minDirection);
    if direction &amp;lt; 0:
        direction = 0

    # This is how we can mix two colors together.
    shade_color = shade_base_color.mix (light_color, direction)

    if direction &amp;gt; 0.0 and elevation &amp;gt; min_alpenglow_elevation:
        elevation_factor = min((elevation - min_alpenglow_elevation) / delta_alpenglow_elevation, 1);

        alpenglow_factor = math.pow(direction, 4)
        return shade_color.mix (alpenglow_color, elevation_factor * alpenglow_factor).argb;

    return shade_color.argb;
&lt;/code&gt;&lt;/pre&gt;</description><link>http://braincrunch.tumblr.com/post/26190799580</link><guid>http://braincrunch.tumblr.com/post/26190799580</guid><pubDate>Sat, 30 Jun 2012 06:22:00 +0200</pubDate><category>Maperitive</category><category>maperipy</category><category>python</category><category>maps</category><category>cartography</category><category>hillshading</category></item><item><title>Mercator's Egg</title><description>&lt;p&gt;UPDATE: my math was buggy, the eggs look a bit different after the correction. Note that the formula fails on very large distances (&amp;gt; 2000&amp;#160;km).&lt;/p&gt;

&lt;p&gt;A little Maperitive Python script I was playing with today, showing the line of distance of 3000&amp;#160;km (larger egg) and 2000&amp;#160;km (smaller egg) from my home town of Maribor, drawn on the standard Web Mercator projection map:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_m4j846Jkde1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s the script:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;from maperipy import *
import math

location = Point(15.6530555556, 46.5575)
distance = 3000000

layer = Map.add_custom_layer()

symbol = PolygonSymbol("circle", Srid.Wgs84LonLat)
symbol.style.pen_width = 8
symbol.style.pen_color = Color("blue")
symbol.style.pen_opacity = 0.5
symbol.style.fill_opacity = 0

earth_circumference = 6371000 * math.pi * 2;
points = []
arc = distance / earth_circumference * 360;

for angle in range(0, 360):
    radians = math.radians(angle)
    y = location.y + math.sin(radians) * arc
    lat_factor = math.cos(math.radians(y))
    x = location.x + math.cos(radians) * arc / lat_factor
    points.append(Point(x,y))

circle = Polygon(LinearRing(points))
symbol.add(circle)

layer.add_symbol(symbol)
&lt;/code&gt;&lt;/pre&gt;</description><link>http://braincrunch.tumblr.com/post/23672142073</link><guid>http://braincrunch.tumblr.com/post/23672142073</guid><pubDate>Thu, 24 May 2012 16:40:00 +0200</pubDate><category>Maperitive</category><category>maperipy</category><category>cartography</category><category>maps</category></item><item><title>11 Things You Should Learn Before Learning To Code</title><description>&lt;p&gt;Here&amp;#8217;s a list of ten skills that are much more important to get you through life than learning to code (in order of priority, set by me):&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;Learn &lt;a href="http://listverse.com/2008/05/29/12-notable-people-who-died-by-drowning/" target="_blank"&gt;how to swim&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Learn how to &lt;a href="http://www.asylum.com/2008/05/01/too-young-to-worry-about-a-heart-attack-think-again/" target="_blank"&gt;stay healthy and in shape&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Learn the basics of &lt;a href="http://en.wikipedia.org/wiki/Food_energy" target="_blank"&gt;food energy intake&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;Learn how to &lt;a href="http://en.wikipedia.org/wiki/Cooking" target="_blank"&gt;cook &lt;/a&gt;a decent (and healthy) meal.&lt;/li&gt;
&lt;li&gt;Learn how to use your &lt;a href="http://en.wikipedia.org/wiki/First_language" target="_blank"&gt;mother tongue&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Learn how to keep your &lt;a href="http://en.wikipedia.org/wiki/Personal_finance" target="_blank"&gt;personal finances in order&lt;/a&gt;. Think Greece &amp;amp; subprime loans.&lt;/li&gt;
&lt;li&gt;Learn a &lt;a href="http://en.wikipedia.org/wiki/World_language" target="_blank"&gt;foreign language&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Learn how to &lt;a href="http://www.wikihow.com/Ride-a-Bicycle" target="_blank"&gt;ride a bike&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Learn how to &lt;a href="http://www.youtube.com/watch?v=lyg4MQ3u0Vg&amp;amp;feature=related" target="_blank"&gt;drive a car&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Learn how to &lt;a href="http://www.youtube.com/watch?v=1VaYTkn2aSg" target="_blank"&gt;use a washing machine&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Learn how to &lt;a href="http://lmgtfy.com/?q=how+to+search+the+web" target="_blank"&gt;find stuff on the internet&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;</description><link>http://braincrunch.tumblr.com/post/23173470326</link><guid>http://braincrunch.tumblr.com/post/23173470326</guid><pubDate>Wed, 16 May 2012 20:07:08 +0200</pubDate></item><item><title>Maperitive: Walking Papers-Like Script</title><description>&lt;p&gt;The latest Maperitive 2.0 beta release comes with a new script which can generate a grid of bitmap exports similar to &lt;a href="http://walking-papers.org/" target="_blank"&gt;walking papers&lt;/a&gt;. The added value is that you can do walking papers for your own vector data and map styles, not just prerendered web tiles.&lt;/p&gt;

&lt;h2&gt;How To Use&lt;/h2&gt;

&lt;p&gt;A brief description of how to generate your own walking papers exports.&lt;/p&gt;

&lt;h3&gt;1. Define Map Area&lt;/h3&gt;

&lt;p&gt;In Maperitive, place printing bounds on the map area you&amp;#8217;re interested in. The printing bounds do not have to match the dimensions of standard paper sizes.&lt;/p&gt;

&lt;p&gt;I choose the center of Ljubljana for this sample:
&lt;img src="http://media.tumblr.com/tumblr_m3jfyuOQjv1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;h3&gt;2. Set Export Parameters&lt;/h3&gt;

&lt;p&gt;There are a few settings in the &lt;strong&gt;Samples/Python/WalkingPapers.py&lt;/strong&gt; script which you can use to control the exporting process (see the detailed instructions in the script itself):&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;strong&gt;map scale&lt;/strong&gt;: this is the map scale for individual exported page. I choose 10,000, which in my case will result in a 2x3 pages grid.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;paper size and orientation&lt;/strong&gt;: you can leave the default A4 landscape, if you like.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;paper margins&lt;/strong&gt;: the default is 5&amp;#160;mm on each side of the page.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;page overlap&lt;/strong&gt;: this is a factor (from 0 to 0.25) which tells Maperitive how much adjacent pages should overlap. 0.25 means 1/4 of the page (on each side) will overlap. The default set in the script is 0.1 (10%).&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;3. Run The Script&lt;/h3&gt;

&lt;p&gt;&amp;#8230; either by drag &amp;amp; dropping it into Maperitive or by executing&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; run-python Samples/Python/WalkingPapers.py
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Sample Results&lt;/h2&gt;

&lt;p&gt;Here&amp;#8217;s one of the exported pages:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_m3jg0rXuk31qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;h2&gt;Future Improvements&lt;/h2&gt;

&lt;p&gt;You will be able to supply command-line parameters to these kinds of scripts in the future, so manual editing of the script before running it will no longer be necessary.&lt;/p&gt;</description><link>http://braincrunch.tumblr.com/post/22434621619</link><guid>http://braincrunch.tumblr.com/post/22434621619</guid><pubDate>Sat, 05 May 2012 09:17:19 +0200</pubDate></item><item><title>Oxford Bus &amp; Cycle Map in print</title><description>&lt;p&gt;I&amp;#8217;ve just received the &amp;#8220;Oxford Bus &amp;amp; Cycle Map&amp;#8221; from Richard Mann (thanks, Richard!). The interesting thing is that it was made from OpenStreetMap data using Maperitive. It&amp;#8217;s a stunning beauty, Richard has put a lot of effort into it.&lt;/p&gt;

&lt;p&gt;Online versions of the maps are here: &lt;a href="http://www.transportparadise.co.uk/maps/" target="_blank"&gt;http://www.transportparadise.co.uk/maps/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_m3hx97d1hL1qghjht.jpg" alt=""/&gt;&lt;img src="http://media.tumblr.com/tumblr_m3hxa0h2R41qghjht.jpg" alt=""/&gt;&lt;img src="http://media.tumblr.com/tumblr_m3hxaqUeDi1qghjht.jpg" alt=""/&gt;&lt;/p&gt;</description><link>http://braincrunch.tumblr.com/post/22377993557</link><guid>http://braincrunch.tumblr.com/post/22377993557</guid><pubDate>Fri, 04 May 2012 13:35:27 +0200</pubDate><category>Maperitive</category><category>cartography</category><category>openstreetmap</category></item><item><title>Results Of The Maperitive Survey</title><description>&lt;p&gt;Last week I posted a &lt;a href="https://docs.google.com/spreadsheet/viewform?formkey=dHNoNFVmbGNLN0VZRFcyRG9sdERTMUE6MQ" target="_blank"&gt;quick survey for Maperitive&lt;/a&gt; users. The basic motivation was to see how many people are still using Windows XP SP2, so I can decide whether I can migrate Maperitive to .NET 4.0 (which is not available on SP2). But I added a few more questions in the mix, just for the fun of it.&lt;/p&gt;

&lt;p&gt;I got 138 reponses so far, which is much more than I expected, so thanks for everyone who participated.&lt;/p&gt;

&lt;p&gt;The results (I just copy&amp;amp;pasted charts from Google Docs, sorry for the labels cut-off):&lt;/p&gt;

&lt;h3&gt;What operating system(s) are you using to run Maperitive?&lt;/h3&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_m3hmy4yWT11qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;Participants could choose multiple answers - in fact about 1/4 of participants were using Maperitive on multiple operating systems. About 4% of people marked they are using Windows XP SP2 - I am wondering what is the reason they haven&amp;#8217;t upgraded to SP3 (my guess is they are using Maperitive in corporate environments which tend to be slow on upgrades).&lt;/p&gt;

&lt;p&gt;Two things that I think are important from these results:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;strong&gt;I can start work on migrating to .NET 4.0&lt;/strong&gt;. For those unfortunate few who will be left out by this I can only say: &lt;strong&gt;try to upgrade to Service Pack 3&lt;/strong&gt;. The official .NET 4.0 has been released two years ago (and first beta was released back in 2009) and it&amp;#8217;s increasingly hard to support development on older versions of .NET framework. 3rd party libraries Maperitive depends on have mostly migrated to .NET 4.0 and this means missing out on new features and bugfixes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A lot (50%) of people are using Maperitive on Linux and Mac&lt;/strong&gt;. This is much more than I expected and it means I will still have to keep Maperitive running on Mono. This is sometimes hard, since not everything is supported by Mono correctly. It also means a lot of people are willing to put up with an inferior user interface (due to Mono porting issues) for the sake of the functionality Maperitive offers. This is complimentary.&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;What it is the main reason you&amp;#8217;re using Maperitive?&lt;/h3&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_m3hmybO8AQ1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;No surprises here, other than that at least 1/3 of users find Maperitive simple to use. This is a high number, given the fact that the documentation is not that good.&lt;/p&gt;

&lt;p&gt;There&amp;#8217;s one interesting (and a little bit surprising) answer:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;em&gt;We can use OSM offline, without prerendering thousands of tiles. It is very helpful for emergency services, because you cannot rely on a mobile internet connection everywhere or in the case of a disaster.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;What kind of a user do you consider yourself to be?&lt;/h3&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_m3hmygkGVS1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;Looks like the main audience of Maperitive are users who like to hack. Only 18% of participants in the survey consider themselves to be non-technical. I guess that explains the large &amp;#8220;simple to use&amp;#8221; percentage in the previous question :)&lt;/p&gt;

&lt;h3&gt;I use Maperitive mainly to&amp;#8230;&lt;/h3&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_m3hmypTM1M1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;Another question with multiple possible answers. I&amp;#8217;m pleased that a lot of you are using Maperitive&amp;#8217;s &amp;#8220;power tools&amp;#8221; like tile generation and exporting. I&amp;#8217;m also pleased that at least 37% of participants are using the SVG export functionality, which I worked hard to implement.&lt;/p&gt;

&lt;h3&gt;I use Maperitive mainly for&amp;#8230;&lt;/h3&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_m3hmyu6tl81qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;I guess I shouldn&amp;#8217;t be surprised that most of you are doing hobby mapping with Maperitive. As OpenStreetMap reaches more people (and companies), I think the percentage of non-profit and commercial usages will increase.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;The survey is &lt;a href="https://docs.google.com/spreadsheet/viewform?formkey=dHNoNFVmbGNLN0VZRFcyRG9sdERTMUE6MQ" target="_blank"&gt;still open&lt;/a&gt; (I think I will keep it open for some time), so you&amp;#8217;re welcome to have your say. There will be more surveys in the future - this one was done as an experiment, in just 5 minutes. Again, thanks for participating!&lt;/p&gt;</description><link>http://braincrunch.tumblr.com/post/22374528537</link><guid>http://braincrunch.tumblr.com/post/22374528537</guid><pubDate>Fri, 04 May 2012 10:41:53 +0200</pubDate><category>Maperitive</category><category>survey</category></item><item><title>Maperipy sample: generate tiles and then optimize with OptiPNG</title><description>&lt;p&gt;&lt;a href="http://maperitive.net/beta/" target="_blank"&gt;The latest (2.0.28) Maperitive beta&lt;/a&gt; now comes with a sample Python script showing how you can override the default behavior of Maperitive tile generation process. The sample collects the generated tile files and then executes &lt;a href="http://optipng.sourceforge.net/" target="_blank"&gt;OptiPNG&lt;/a&gt; on them to reduce the file size (OptiPNG is now included in Maperitive package) of PNGs.&lt;/p&gt;

&lt;p&gt;Some more info about this release: &lt;a href="http://groups.google.com/group/maperitive/browse_thread/thread/492671b461f1e1da" target="_blank"&gt;http://groups.google.com/group/maperitive/browse_thread/thread/492671b461f1e1da&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s the source for the sample, I think it&amp;#8217;s self explanatory:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;from maperipy import App
from maperipy import Map
from maperipy.webmaps import Tile
from maperipy.tilegen import TileGenCommand

def func1 (zoom, x, y, tiles_horizontal, tiles_vertical):
    # Demonstrates how to control which tiles get rendered
    # note that Maperitive generates tiles in batches
    # (defined by tiles_horizontal x tiles_vertical count).
    # So for example, 3x3 (=9) tiles are generated in a single bitmap 
    # and then later they are split into individual tiles.

    # In this case we just print some info to Maperitive's command log window.
    print "Generating tile batch: {0}/{1}/{2} ({3}x{4} tiles)" \
        .format(zoom, x, y, tiles_horizontal, tiles_vertical)

    # In this case we return True to signal that we want 
    # these tiles to be rendered.
    return True

def func2 (tile):
    # Demonstrates how to control the saving of a tile to disk.
    # At this point we could do some postprocessing of the tile bitmap
    # or store it somewhere else (and then return False to prevent
    # Maperitive from saving it to the default location).
    print "Saving tile: {0}/{1}/{2} (file: {3})" \
        .format(tile.zoom, tile.tile_x, tile.tile_y, tile.file_name)

    # You could, for example, store tiles into a database instead
    # of writing them to disk.

    # In this case we return True to signal that we want 
    # the tile to be saved to the default location.
    return True    

def optimize_tiles():
    args = []

    # Turn on backup files (just to compare sizes with optimized tiles).
    #args.append ("-backup")

    # Set the OptiPNG optimization rate (0 to 7), 7 being very slow.
    optimization_rate = 2
    args.append ("-o{0}".format(optimization_rate))

    # We don't want any OptiPNG output text to clutter Maperitive.
    args.append ("-quiet")

    args.extend(tiles_to_optimize)

    # This is one way to execute external programs.
    App.run_program("tools/OptiPNG/optipng.exe", 100, args)

    # Clear the list.
    del tiles_to_optimize[:]

def collect_tiles (file_name):
    # Demonstrates how to collect the list of generated tiles.
    # You could, for example, use this function to upload
    # tiles to a Web server.

    # In this case we collect the file names to a list...
    tiles_to_optimize.append(file_name)

    # ... and then we call OptiPNG when the list gets full.
    if len(tiles_to_optimize) &amp;gt;= 10:
        optimize_tiles()

tiles_to_optimize = []

# Generate tiles for the currently set geometry bounds and the current zoom level
# (Map.position.zoom, Map.position.zoom) -&amp;gt; min.zoom, max.zoom
cmd = TileGenCommand(Map.geo_bounds, Map.position.zoom, Map.position.zoom)

# This is how we override TileGenCommand with custom functions.
cmd.tile_generation_filter = func1
cmd.tile_save_filter = func2
cmd.after_tile_save = collect_tiles

cmd.execute()

# Run the optimization again for any left-over tiles.
optimize_tiles()
&lt;/code&gt;&lt;/pre&gt;</description><link>http://braincrunch.tumblr.com/post/22037453467</link><guid>http://braincrunch.tumblr.com/post/22037453467</guid><pubDate>Sun, 29 Apr 2012 10:05:16 +0200</pubDate><category>Maperitive</category><category>maperipy</category><category>Maperitive beta</category></item><item><title>New OSM License, Some Practical Implications And Gray Areas</title><description>&lt;p&gt;Occasionally I make digital maps for customers based on OpenStreetMap data. Sometimes they request the maps in form of bitmaps, and sometimes they need a vector format like SVG or PDF in order to be able to edit the maps in Adobe Illustrator. Of course, the issue of license always pops up and often have to explain the stipulations of &lt;a href="http://creativecommons.org/licenses/by-sa/2.0/" target="_blank"&gt;CC BY-SA 2.0&lt;/a&gt; to them.&lt;/p&gt;

&lt;p&gt;Soon OSM will switch to a new &lt;a href="http://opendatacommons.org/licenses/odbl/" target="_blank"&gt;ODbL license&lt;/a&gt;. I have to admit I mostly stayed away from the numerous legal talks that were going on various OSM channels, simply because I feel much more productive coding than participating in &lt;a href="http://article.gmane.org/gmane.comp.gis.openstreetmap.legal/6261" target="_blank"&gt;endless strings of emails&lt;/a&gt;. But now that the new license is here, I need to get acquainted with it from the perspective of someone trying to make (some) living out of OSM data. &amp;#8220;&lt;em&gt;I&amp;#8217;m not a lawyer&lt;/em&gt;&amp;#8221; is the usual phrase you can see in OSM legal discussions, but waiting for one to give you some solid information is like waiting for Godot, so I&amp;#8217;ll make judgements based on my own understanding and some common sense instead, and simplify things when I feel like it. If anyone objects, they can &lt;a href="https://twitter.com/#!/breki74" target="_blank"&gt;twitter me&lt;/a&gt; with their objections and I&amp;#8217;ll try to correct things.&lt;/p&gt;

&lt;p&gt;So let&amp;#8217;s say a customer requests an SVG map of my home town and I decide to use OSM data for it. For the sake of simplicity the map will be based &lt;strong&gt;purely&lt;/strong&gt; on OSM data, so no other sources. Let&amp;#8217;s first look at some of the important definitions in ODbL (emphases are mine):&lt;/p&gt;

&lt;blockquote&gt;
  &lt;blockquote&gt;
    &lt;p&gt;“&lt;strong&gt;Database&lt;/strong&gt;” – A collection of material (the Contents) &lt;strong&gt;arranged in a systematic or methodical way&lt;/strong&gt; and &lt;strong&gt;individually accessible&lt;/strong&gt; by electronic or other means offered under the terms of this License.&lt;/p&gt;
    
    &lt;p&gt;“&lt;strong&gt;Derivative Database&lt;/strong&gt;” – Means a database based upon the Database, and &lt;strong&gt;includes any translation, adaptation, arrangement, modification, or any other alteration&lt;/strong&gt; of the Database or of a &lt;strong&gt;Substantial part&lt;/strong&gt; of the Contents. This includes, but is not limited to, Extracting or Re-utilising the whole or a Substantial part of the Contents in a new Database.&lt;/p&gt;
    
    &lt;p&gt;“&lt;strong&gt;Contents&lt;/strong&gt;” – The contents of this Database, which includes the information, independent works, or other material collected into the Database. For example, the contents of the Database could be factual data or works such as &lt;strong&gt;images, audiovisual material, text&lt;/strong&gt;, or sounds.&lt;/p&gt;
    
    &lt;p&gt;“&lt;strong&gt;Produced Work&lt;/strong&gt;” – a work (such as an &lt;strong&gt;image, audiovisual material, text&lt;/strong&gt;, or sounds) resulting from using the whole or a Substantial part of the Contents (via a search or other query) from this Database, a Derivative Database, or this Database as part of a Collective Database.&lt;/p&gt;
    
    &lt;p&gt;“&lt;strong&gt;Substantial&lt;/strong&gt;” – Means substantial in terms of &lt;strong&gt;quantity or quality&lt;/strong&gt; or a combination of both. &lt;strong&gt;The repeated and systematic Extraction or Re-utilisation of insubstantial parts of the Contents may amount to the Extraction or Re-utilisation of a Substantial part of the Contents.&lt;/strong&gt;&lt;/p&gt;
  &lt;/blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;So the first open question: &lt;strong&gt;is an SVG map a Produced Work or a Derivative Database&lt;/strong&gt;? Or both? SVG map is an XML file that contains projected geographical data (together with visual styling attributes). OSM XML file can safely said to be a database. If you say SVG is not a database, where do you draw the line? What about KML or GML files?&lt;/p&gt;

&lt;p&gt;This question is important because of the next clause:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;blockquote&gt;
    &lt;p&gt;Access to Derivative Databases. If You Publicly Use a Derivative Database or a Produced Work from a Derivative Database, You must also offer to recipients of the Derivative Database or Produced Work a copy in a &lt;strong&gt;machine readable form&lt;/strong&gt; of:&lt;/p&gt;
    
    &lt;blockquote&gt;
      &lt;p&gt;a. &lt;strong&gt;The entire Derivative Database&lt;/strong&gt;; or&lt;/p&gt;
      
      &lt;p&gt;b. A file containing all of the alterations made to the Database or the &lt;strong&gt;method of making the alterations&lt;/strong&gt; to the Database (such as an &lt;strong&gt;algorithm&lt;/strong&gt;), including &lt;strong&gt;any additional Contents&lt;/strong&gt;, that make up all the differences between the Database and the Derivative Database.&lt;/p&gt;
    &lt;/blockquote&gt;
  &lt;/blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;If the SVG map file is &lt;strong&gt;not&lt;/strong&gt; considered a Derivative Database, then you have an option of supplying the original OSM data (OSM XML file, PBF file or even a database snapshot) together with the SVG file or providing a description of how you derived the Derivative Database.&lt;/p&gt;

&lt;p&gt;On the other hand, I can argue that SVG &lt;strong&gt;is&lt;/strong&gt; a Derivative Database because it is &amp;#8220;&lt;em&gt;arranged in a systematic or methodical way and individually accessible&lt;/em&gt;&amp;#8221; and &amp;#8220;&lt;em&gt;includes any translation, adaptation, arrangement, modification, or any other alteration&lt;/em&gt;&amp;#8221; of the original OSM data. So in that case simply publishing the SVG file (and only that file) would cover the license requirements.&lt;/p&gt;

&lt;p&gt;I should note that the SVG map has to be released under the ODbL or a compatible license.&lt;/p&gt;

&lt;p&gt;Now let&amp;#8217;s go one step further. Let&amp;#8217;s assume (as I do) SVG &lt;strong&gt;is&lt;/strong&gt; a Derivative Database. What if I then generate a PNG bitmap (or a Web map, for that matter) from the SVG file using Adobe Illustrator and want to publish that, too? One could argue that a bitmap is a Produced Work and since we already published the Derivative Database that produced this Work, we are covered.&lt;/p&gt;

&lt;p&gt;But what if I didn&amp;#8217;t generate the Web map from the SVG, but used a tool like Mapnik or Maperitive and generated it &lt;strong&gt;directly from an OSM extract instead&lt;/strong&gt;? Let&amp;#8217;s say that for practical purposes I don&amp;#8217;t want to publish 1&amp;#160;GB of OSM data and I choose to go down the path of describing the &amp;#8220;&lt;em&gt;method of making the alterations&lt;/em&gt;&amp;#8221; I did to generate the bitmap. What are the options here?&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;I could write a detailed description of steps I performed to generate the Web map. Osmosis, Mapnik with all the batch scripts etc. I could even post the source code of the program(s) I used.&lt;/li&gt;
&lt;li&gt;On the other hand, I could just describe the process in a sentence or two. I could also say I used a special filter in Photoshop.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;I can partly understand the spirit of the &amp;#8220;method&amp;#8221; clause - to enable access to the interesting derivations of the original data. But I see several holes in the &amp;#8220;method&amp;#8221; definition:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;What if I produced the map by &lt;strong&gt;arranging a lot of the map elements manually, by hand&lt;/strong&gt;? This is quite a common case when you have to place map labels in order to avoid label conflicts. How would I describe the &amp;#8220;method&amp;#8221; other than saying that I did it by hand? How would that help anyone?&lt;/li&gt;
&lt;li&gt;What if I used an &lt;strong&gt;expensive proprietary software&lt;/strong&gt; (like Illustrator or Photoshop)? Or even a piece of code that I haven&amp;#8217;t released to anyone else? In that case nobody else would be able to reproduce the method. &lt;strong&gt;Does the &amp;#8220;Contents&amp;#8221; cover source code as well&lt;/strong&gt;? It doesn&amp;#8217;t mention the source code explicitly. If it does, then that implies &lt;strong&gt;you can only use open source software with OSM data&lt;/strong&gt;, which would be silly.&lt;/li&gt;
&lt;li&gt;What about complex algorithms? How detailed the description would have to be for someone to be able to reproduce the algorithm? I&amp;#8217;ve tried reproducing various algorithms from long scientific articles and I can tell you it&amp;#8217;s not an easy task even if you have a detailed description.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Frankly, I don&amp;#8217;t see how the &amp;#8220;method&amp;#8221; clause could be enforced in practice.&lt;/p&gt;

&lt;p&gt;(&lt;strong&gt;UPDATE&lt;/strong&gt;: now that I thought about it once more, the clause only talks about describing the method of arriving to the Derivative Database and not to the Produced Work itself. So I could just say &amp;#8220;I downloaded the OSM extract from Geofabrik&amp;#8221; and that would be it.)&lt;/p&gt;

&lt;p&gt;One final question: &lt;strong&gt;does extracting OSM data for a city amount to a &amp;#8220;substantial part&amp;#8221; of the original OSM database?&lt;/strong&gt;&lt;/p&gt;</description><link>http://braincrunch.tumblr.com/post/19583325245</link><guid>http://braincrunch.tumblr.com/post/19583325245</guid><pubDate>Mon, 19 Mar 2012 20:40:00 +0100</pubDate><category>osm</category><category>openstreetmap</category><category>ODbL</category><category>licensing</category></item><item><title>Usability and Open Source Software</title><description>&lt;p&gt;Related to my yesterday rant about &lt;a href="http://braincrunch.tumblr.com/post/17891635090/on-quantumgis-and-user-experience" target="_blank"&gt;QGIS and usability&lt;/a&gt;: I&amp;#8217;ve been reading an article called &amp;#8220;&lt;a href="http://www.cs.waikato.ac.nz/~daven/docs/oss-wp.html" target="_blank"&gt;Usability and Open Source Software&lt;/a&gt;&amp;#8221; article and it has a lot of interesting points. It&amp;#8217;s a little bit dated (year 2002), but I think most issues remain the same even now after 10 years.&lt;/p&gt;

&lt;p&gt;Here are some highlights I find interesting (but you should read the whole article):&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;If this [desktop and application design] were primarily a technical problem, the outcome would 
  hardly be in doubt. But it isn&amp;#8217;t; it&amp;#8217;s a problem in ergonomic design and interface psychology, and 
  hackers have historically been poor at it. That is, while hackers can be very good at designing 
  interfaces for other hackers, they tend to be poor at modeling the thought processes of the other 
  95% of the population well enough to write interfaces that J. Random End-User and his Aunt Tillie 
  will pay to buy. (Raymond, 1999)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&amp;#8230;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The ‘personal itch’ motivation creates a significant difference between open source and commercial 
  software development. Commercial systems development is usually about solving the needs of another 
  group of users. The incentive is to make money by selling software to customers, often customers who are 
  prepared to pay precisely because they do not have the development skills themselves. Capturing the 
  requirements of software for such customers is acknowledged as a difficult problem in software 
  engineering and consequently techniques have been developed to attempt to address it. By contrast, many 
  OSS projects lack formal requirements capture processes and even formal specifications (Scacchi, 2002). 
  Instead they rely on understood requirements of initially individuals or tight-knit communities.&lt;/p&gt;
  
  &lt;p&gt;The relation to usability is that this implies that OSS is in certain ironic ways more egotistical than closed 
  source software (CSS). A personal itch implies designing software for one’s own needs. Explicit 
  requirements are consequently less necessary. Within OSS this is then shared with a like-minded 
  community and the individual tool is refined and improved for the benefit of all – within that community. 
  By contrast, a CSS project may be designing for use by a community with different characteristics.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&amp;#8230;.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Many kinds of commercial software have been criticised for its bloated code, consuming ever greater 
  amounts of memory and processor cycles with successive software version releases. There is a commercial 
  pressure to increase functionality and so to entice existing owners to purchase the latest upgrade. &amp;#8230; There are similar pressures in open source development, but due to different causes. Given the interests and 
  incentives of developers, there is a strong incentive to add functionality and almost no incentive to delete 
  functionality, especially as this can irritate the person who developed the functionality in question.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&amp;#8230;.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The process of ‘release early and release often’ can  lead to an acceptance of  certain clumsy features. 
  People invest time and effort in learning them and create their own workarounds to cope with them. When 
  a new, improved version is released with a better interface, there is a temptation for those early adopters of 
  the application to refuse to adapt to the new interface. Even if it is easier to learn and use than the old one, 
  their learning of the old version is now a sunk investment and understandably they may be unwilling to relearn and modify their workarounds.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&amp;#8230;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;‘Software bloat’ is widely agreed to be a negative attribute. However, the decision to add multiple 
  alternative options to a system may be seen as a positive good rather than an invidious compromise. We 
  speculate that freedom of choice may be considered a desirable attribute (even a design aesthetic) by many 
  OSS developers. The end result is an application that has many configuration options, allowing very 
  sophisticated tailoring by expert users, but which can be bewildering to a novice (Nielsen, 1993, p. 12). 
  The provision of five different desktop clocks in GNOME (Smith et al., 2001) is one manifestation of this 
  tendency; another is the growth of preferences interfaces in many OSS programs (Thomas, 2002).&lt;br/&gt;
  Thus there is a tendency for OSS applications to grow in complexity, reducing their usability for novices, 
  but with that tendency to remain invisible to the developers who are not novices and relish the power of 
  sophisticated applications. Expert developers will also rarely encounter the default settings of a multiplicity 
  of options and so are unlikely to give much attention to their careful selection, whereas novices will often 
  live with those defaults.&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://braincrunch.tumblr.com/post/17966252197</link><guid>http://braincrunch.tumblr.com/post/17966252197</guid><pubDate>Mon, 20 Feb 2012 21:57:58 +0100</pubDate><category>usability</category><category>user interface</category><category>quantumGIS</category></item><item><title>On QuantumGIS And User Experience</title><description>&lt;h2&gt;Intro&lt;/h2&gt;

&lt;p&gt;Looks like my morning rant tweet &amp;#8220;QGIS needs a usability expert. Or a whole team of them.&amp;#8221; has caused a little storm in the GIS community. I haven&amp;#8217;t really expected any feedback on this, so i guess I can say that Twitter is the King.  I&amp;#8217;ve already e-mailed some of my views to the first QGIS person that contacted me (&lt;a href="http://woostuff.wordpress.com/" target="_blank"&gt;Nathan Woodrow&lt;/a&gt;), but for the sake of open discussion, I&amp;#8217;ll expand on these thoughts in this post.&lt;/p&gt;

&lt;p&gt;First of all, some disclaimers: I&amp;#8217;m an occasional QGIS user. I only use a very limited subset of its functionality (mainly viewing shapefiles, since I think it&amp;#8217;s the best shapefile viewer out there). I&amp;#8217;m not really a GIS professional, at least not in the traditional sense. Half of my work time evolves around developing &lt;a href="http://maperitive.net/" target="_blank"&gt;Maperitive&lt;/a&gt;, a cartography software mostly based on OpenStreetMap. The other half is doing work as a professional programmer in an IT company. And I&amp;#8217;m not a usability expert, so what I&amp;#8217;m writing here is based on my personal experience.&lt;/p&gt;

&lt;h2&gt;Usability Issues&lt;/h2&gt;

&lt;p&gt;OK, so let&amp;#8217;s open QGIS. The first thing users will probably notice is a fair number of toolbar icons displayed at the top:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lznekv2yjG1qghjht.jpg" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;Don&amp;#8217;t get me wrong: I&amp;#8217;m &lt;strong&gt;not&lt;/strong&gt; against toolbars. In fact, QGIS doesn&amp;#8217;t even have a lot of icons, compared to some other apps (I use VisualStudio a lot, and it has a lot more toolbar icons). But there are some usability issues with toolbars:&lt;/p&gt;

&lt;h3&gt;Image-only toolbars&lt;/h3&gt;

&lt;p&gt;Image-only toolbars are difficult for users to comprehend. It is difficult for most users to remember all those images and associate them with functions. This is contrary to what most designers/developers think when they use toolbars in their apps. Yes, there are some classic icons that get reused all the time (diskette icon, undo/redo, cut, copy, paste), but these are exceptions to the rule. Most of the toolbar icons are application-specific, they tend to be small and look similar to each other. Icons are great enhancers of the information, but they are not the &lt;strong&gt;main&lt;/strong&gt; information.&lt;/p&gt;

&lt;p&gt;Possible solutions:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Instead of putting all of the icon groups to the top, separate them physically. Move map-oriented icons (like zooming) closer to the map, possibly arranging them vertically instead of horizontally. I know users can move them by themselves, but that&amp;#8217;s not the point.&lt;/li&gt;
&lt;li&gt;For more important icons, add the text description. Yes, this takes more space, but usability takes precedence over screen real estate.&lt;/li&gt;
&lt;li&gt;Alternatively, think about using &lt;a href="http://en.wikipedia.org/wiki/Ribbon_(computing)" target="_blank"&gt;ribbons&lt;/a&gt;. I hate what Microsoft did to Office, BTW, but that&amp;#8217;s because they chose to use ribbons as a &lt;strong&gt;replacement&lt;/strong&gt; of menus, instead of just an additional way to access commands. &lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Microsoft introduced ribbons because the number of commands in Word menus grew and grew and it became more and more difficult for users to find things.&lt;/p&gt;

&lt;p&gt;Some references:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="http://uxmyths.com/post/715009009/myth-icons-enhance-usability" target="_blank"&gt;UX Myths: Myth #13: Icons enhance usability&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://ux.stackexchange.com/questions/1795/when-to-use-icons-vs-icons-with-text-vs-just-text-links" target="_blank"&gt;UX StackExchange: When to use icons vs. icons with text vs. just text links?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://ux.stackexchange.com/questions/8238/is-microsofts-ribbon-ui-really-that-great-from-a-usability-perspective" target="_blank"&gt;Is Microsoft&amp;#8217;s Ribbon UI really that great, from a usability perspective?&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Mouse Bias&lt;/h3&gt;

&lt;p&gt;One of the greatest productivity enhancements an application can offer is to provide users with the ability to accomplish their tasks using the keyboard instead of forcing them to use the mouse even for repetitive and frequent commands. That&amp;#8217;s why it is very annoying to find that QGIS doesn&amp;#8217;t have keyboard shortcuts for the most basic stuff like &amp;#8220;Pan Map&amp;#8221; and &amp;#8220;Select * Features&amp;#8221; commands. As I explained to Nathan, I find JOSM&amp;#8217;s user experience on this much more satisfying.&lt;/p&gt;

&lt;p&gt;Also, the &lt;strong&gt;toolbar tooltips&lt;/strong&gt; must display the keyboard shortcuts together with the command description. This is about discoverability.&lt;/p&gt;

&lt;p&gt;One other thing (this is a response to Nathan): I would avoid assigning important functionality (like map panning) to the &lt;strong&gt;middle mouse button&lt;/strong&gt;. Maybe it&amp;#8217;s just me, but I can&amp;#8217;t remember when was the last time I owned a mouse with a proper middle button. Most mouses these days seem to have abandoned those for mouse wheels, which may be pressable, but that experience is lousy - the wheel itself is usually not ergonomically designed for pressing and it also tends to cause the wheel to move a notch or two.&lt;/p&gt;

&lt;h3&gt;Mouse-Pointed Zoom&lt;/h3&gt;

&lt;p&gt;Come on, people. We&amp;#8217;re in 2012. &lt;strong&gt;All respectable graphics editors/GIS programs should zoom to the point indicated by the mouse&lt;/strong&gt; and not the current map center. Don&amp;#8217;t make me zoom and pan and zoom and pan and zoom and &amp;#8230;. It&amp;#8217;s 2 lines of code. The fact that QGIS actually has a user setting to switch mouse-pointed zoom makes it even worse. Why doesn&amp;#8217;t it do that &lt;strong&gt;by default&lt;/strong&gt;? If people can do it in JavaScript (Google Maps, OpenLayers, etc etc), Android, iOS, how come it&amp;#8217;s not there in QGIS? Heck, even Garmin&amp;#8217;s MapSource can do it (just tested it)!&lt;/p&gt;

&lt;h3&gt;&amp;#8220;User Can Configure That By Herself&amp;#8221; Mantra&lt;/h3&gt;

&lt;p&gt;Having a user setting for everything and anything is not a good alibi for not making the right design choices from the start. Someone once wrote (I can&amp;#8217;t find the source now) something to the effect that each user setting represents a decision the developer didn&amp;#8217;t want or couldn&amp;#8217;t make, so she left it to the poor user.&lt;/p&gt;

&lt;p&gt;So I cannot accept argument that users can assign missing keyboard shortcuts or extend the functionality via scripting. You&amp;#8217;re assuming two things:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;All of the people who want to use the program have the level of technical experience comparable to you (as a designer of the application).&lt;/li&gt;
&lt;li&gt;All of the people will be willing to study the complete functionality of the program before actually using it for the purposes they came here in the first place. Most of them won&amp;#8217;t and will instead put up with having no keyboard shortcuts or will go somewhere else.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Yes, having the ability to assign shortcuts or write extension scripts is &lt;strong&gt;great&lt;/strong&gt;. But this will be used by a  tiny percentage of your users. As I mentioned before, I use VisualStudio a lot and so do my colleagues. But I can tell you that I&amp;#8217;m having problems trying to find somebody that assigns their own shortcuts in VisualStudio or uses other advanced customization functions. And they are all bright and technically savvy people (heck, they can even write some code). That&amp;#8217;s not to say they wouldn&amp;#8217;t benefit greatly from such customization, but most users seem to accept things as they are (even if they are unhappy with them). Call them lazy, but that&amp;#8217;s the way it is.&lt;/p&gt;

&lt;h2&gt;On Open Source&lt;/h2&gt;

&lt;p&gt;I realize QuantumGIS is an open-source project. I understand realities of working in an open source project - I&amp;#8217;ve done some OS work myself. But I don&amp;#8217;t see that as an excuse for not taking user experience  seriously. After all, the purpose of these projects is to make life easier for its users. And you don&amp;#8217;t really need big investments to improve the usability - my talk of &amp;#8220;usability experts&amp;#8221; should not be taken too literally. There are a lot of things that can be done without too much time &amp;amp; money:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Take a look at some UX guidance documents. &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa511258.aspx" target="_blank"&gt;Here&amp;#8217;s a good one from Microsoft&lt;/a&gt;. There are a lot of &lt;a href="http://en.wikipedia.org/wiki/Human_interface_guidelines" target="_blank"&gt;other good ones&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Visit some good UX Web sites, like &lt;a href="http://designinginterfaces.com/" target="_blank"&gt;designinginterfaces.com&lt;/a&gt; or even read some &lt;a href="http://www.useit.com/books/uibooks.html" target="_blank"&gt;user interface books&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Participate in &lt;a href="http://ux.stackexchange.com/" target="_blank"&gt;ux.stackexchange.com&lt;/a&gt;. Ask questions and advice. Ask people who never used QGIS before to evaluate your design.&lt;/li&gt;
&lt;li&gt;Instead of implementing a new shiny XY functionality for the next release, invest that time to fix some usability issues. &lt;/li&gt;
&lt;li&gt;And of course, ask your users.&lt;/li&gt;
&lt;/ul&gt;</description><link>http://braincrunch.tumblr.com/post/17891635090</link><guid>http://braincrunch.tumblr.com/post/17891635090</guid><pubDate>Sun, 19 Feb 2012 18:54:45 +0100</pubDate><category>QuantumGIS</category><category>usability</category><category>user interface</category></item><item><title>Maperitive Beta: Subpixel Accuracy</title><description>&lt;p&gt;Even though most of Maperitive work I&amp;#8217;m doing lately is done in a separate branch that will come out as a brand new Maperitive 2.0 release some time in the beginning of 2012, I do occasionally implement some quick enhancements to the currently &amp;#8220;unofficially&amp;#8221; released Maperitive beta. I&amp;#8217;ve just uploaded a &lt;a href="http://maperitive.net/beta/Maperitive-1.1.2001.zip" target="_blank"&gt;new beta version&lt;/a&gt; with a couple of neat features, one of which I will describe in this post (the other will have to wait for the next post).&lt;/p&gt;

&lt;h2&gt;Subpixel Accuracy&lt;/h2&gt;

&lt;p&gt;This is an important, although probably not very well known feature &lt;a href="http://mapnik.org/" target="_blank"&gt;Mapnik&lt;/a&gt; provides. What is subpixel accuracy? Simply put, it is the ability to set the thickness of the line in fractions of a pixel (image stolen from AGG&amp;#8217;s site):&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.antigrain.com/doc/introduction/line_thickness.gif" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;Up until now this was not really possible in Maperitive. Well, you &lt;strong&gt;could&lt;/strong&gt; specify the thickness as, say, 1.3 pixels, but it would be rendered as a line with thickness of one pixel, ignoring the fraction. The reason is simple: Maperitive uses GDI+ library for rendering, which doesn&amp;#8217;t do subpixel accuracy (it does support antialiasing, but that&amp;#8217;s not enough). Mapnik, on the other hand, uses superior Anti-Grain Geometry (AGG) library (you can read more about it in &lt;a href="http://www.antigrain.com/doc/introduction/introduction.agdoc.html" target="_blank"&gt;AGG&amp;#8217;s Introduction page&lt;/a&gt;, which is very interesting).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why is subpixel accuracy important?&lt;/strong&gt; Certain map features require delicacy. In his &lt;a href="http://www.amazon.com/exec/obidos/ASIN/1589480260/ref=nosim/igorbrejcnet-20" target="_blank"&gt;Cartographic Relief Presentation&lt;/a&gt; book&lt;a href="http://www.reliefshading.com/cartographers/imhof.html" target="_blank"&gt; Eduard Imhof&lt;/a&gt; gives very precise recommendations for elevation contour lines thicknesses. 0.05 to 0.08&amp;#160;mm for black normal contours for map scale 1&amp;#160;: 50,000, as an example. Without subpixel accuracy it is very difficult to come even close to such measures and then you end up with both normal and index contours (the thicker ones) having the same thickness in the rendering:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lvc3yh9qJT1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;So given that I cannot directly render lines with subpixel accuracy and using AGG in Maperitive is not a practical solution because of various technical reasons I won&amp;#8217;t go into, I&amp;#8217;ve more or less given up on this.&lt;/p&gt;

&lt;h3&gt;The Solution&lt;/h3&gt;

&lt;p&gt;&amp;#8230; Until I came up with a simple but effective trick to achieve subpixel accuracy: render the whole map scaled to (say) three times and then downsample the whole image back to the &amp;#8220;normal&amp;#8221; scale. Before I delve into details, here&amp;#8217;s how the same map looks like using this technique:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lvc4jf0Rk21qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;I think the difference is obvious: you can now see two distinctive contour line types. Index lines are 1.25 wide, while normal lines have a width of 0.65 pixels.Don&amp;#8217;t worry about these numbers, subpixel accuracy is not &lt;strong&gt;that&lt;/strong&gt; precise, but it is precise enough.&lt;/p&gt;

&lt;h3&gt;The Details&lt;/h3&gt;

&lt;p&gt;Subpixel accuracy can be tuned for three Maperitive commands:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;code&gt;export-bitmap&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;export-3d&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;generate-tiles&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;All of them have a new &lt;code&gt;subpixel&lt;/code&gt; parameter which accepts a positive integer value. This value is used as a scaling factor when rendering. Once the rendering is done, Maperitive uses &lt;a href="http://en.wikipedia.org/wiki/Supersampling" target="_blank"&gt;Supersampling&lt;/a&gt; algorithm to resample (downsample actually) the rendering to the scale factor of 1. So for example if you want to generate tiles using subpixel accuracy, you type in something like&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;generate-tiles minzoom=10 maxzoom=12 subpixel=3
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Caveats&lt;/h3&gt;

&lt;p&gt;What is the best value for &lt;code&gt;subpixel&lt;/code&gt; parameter, you may ask? I&amp;#8217;ve been experimenting with the value of 3. You could try larger values, although I doubt there will be a noticeable increase in the quality of rendering. The downside of larger values is that Maperitive takes longer to render. This could considerably slow down your tiles generation, so there is a trade-off between the quality and speed (isn&amp;#8217;t there always?). Measurements of tile generation speed show that by increasing &lt;code&gt;subpixel&lt;/code&gt; value by 1 halves the speed of tile generation. In future this should be mitigated by allowing Maperitive to render tiles using multiple processors.&lt;/p&gt;

&lt;p&gt;You should also be aware that if you intend to use subpixel accuracy for exporting large bitmaps, Maperitive has to actually allocate a much bigger bitmap in the process of rendering. So for example if you want to create a 4000x4000 bitmap using &lt;code&gt;subpixel=3&lt;/code&gt;, Maperitive will want to allocate a 12000x12000 bitmap in the process and will probably fail due to limitations of GDI+ bitmap size. So there is no free lunch (at least until I figure a way around this problem ;) ).&lt;/p&gt;

&lt;p&gt;One final note: interactive map does not use subpixel accuracy since this would make the map rendering pretty slow. In future versions Maperitive will provide some kind of &amp;#8220;map quality&amp;#8221; / &amp;#8220;level of detail&amp;#8221; setting, so you&amp;#8217;ll be able to control this.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;</description><link>http://braincrunch.tumblr.com/post/13459650973</link><guid>http://braincrunch.tumblr.com/post/13459650973</guid><pubDate>Mon, 28 Nov 2011 19:16:00 +0100</pubDate><category>Maperitive</category><category>cartography</category><category>Maperitive beta</category></item><item><title>Maperitive: 3D Export</title><description>&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_ltb3z2ffEm1qghjht.jpg" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;The latest Maperitive beta (&lt;a href="http://maperitive.net/beta/Maperitive-1.1.2001.zip" target="_blank"&gt;download it from here&lt;/a&gt;) now contains a new command called &lt;strong&gt;export-3d&lt;/strong&gt;, which generates a 3D mesh using the digital elevation model and places the map texture on top of it. The 3D model is exported into a &lt;a href="http://en.wikipedia.org/wiki/COLLADA" target="_blank"&gt;COLLADA&lt;/a&gt; format, which can be imported into various 3D programs (&lt;a href="http://sketchup.google.com/" target="_blank"&gt;Google SketchUp&lt;/a&gt; is the one I mostly used, it&amp;#8217;s free).&lt;/p&gt;

&lt;h2&gt;Quick How-To&lt;/h2&gt;

&lt;p&gt;The quickest/easiest way to generate a 3D export is to move the map to the area you&amp;#8217;re interested in and simply select the &lt;strong&gt;Tools | Export To 3D&lt;/strong&gt; menu command. Maperitive will then generate files in the &lt;strong&gt;output/Maperitive3D&lt;/strong&gt; directory of your Maperitive installation. If you do not load your own OSM vector layer, Maperitive will use OSM tiles, the same ones used to show tne OSM web map.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE: be careful to keep the map area fairly small, otherwise you&amp;#8217;ll end up with a 3D model that you won&amp;#8217;t be able to import into other software, especially if you don&amp;#8217;t have a top-of-the-line computer at your disposal.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;Importing Into SketchUp&lt;/h3&gt;

&lt;p&gt;After opening SketchUp, choose **File | Import&amp;#8230;&amp;#8221; menu command. &lt;strong&gt;NOTE:&lt;/strong&gt; Before browsing for the file, click on the &lt;strong&gt;Options&amp;#8230;&lt;/strong&gt; button and make sure &lt;strong&gt;Validate COLLADA file&lt;/strong&gt; is turned off:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_ltb4hiwu8h1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;Validation should be disabled because it makes importing unbearably slow, especially for larger models. After you&amp;#8217;ve done this, browse to your generated &lt;strong&gt;Maperitive3D.dae&lt;/strong&gt; file and open it.&lt;/p&gt;

&lt;p&gt;Depending on the size of your model, you might have to wait for some time for the importing to finish. Sometimes I even have to resort to killing the SketchUp process and regenerating a simpler model.&lt;/p&gt;

&lt;h3&gt;Configuring SketchUp&lt;/h3&gt;

&lt;p&gt;After the model has been successfully imported, you may want to tweak a few settings in SketchUp to make the rendering look better:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;strong&gt;View | Edge Style | Edge&lt;/strong&gt; - uncheck this so the edges of surfaces are not shown.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;View | Face Style&lt;/strong&gt; - choose &lt;strong&gt;Shaded With Textures&lt;/strong&gt; to get the best effect.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;View | Shadows&lt;/strong&gt; - check this to turn on the sun shadows.&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;Tweaking The 3D Model&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;export-3d&lt;/strong&gt; command provides additional parameters we can tweak. Type in &lt;code&gt;help-command export-3d&lt;/code&gt; into the command prompt and you&amp;#8217;ll get the list of those parameters:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;COMMAND NAME: export-3d 
DESCRIPTION: generates a 3D map from the current map view and saves it to the disk 
PARAMETERS: 
  output-dir=&amp;lt;the directory where output files will be saved&amp;gt; (text, optional)
  mesh-points=&amp;lt;the maximum number of points the terrain TIM mesh should have&amp;gt; (integer, optional)
  tin-error=&amp;lt;the maximum allowed elevation difference (in meters) when simplifying the terrain TIN mesh (default is 1 meter)&amp;gt; (real number, optional)
  width=&amp;lt;bitmap width&amp;gt; (value, optional)
  height=&amp;lt;bitmap height&amp;gt; (value, optional)
  map-scale=&amp;lt;map scale to use when exporting&amp;gt; (value, optional)
  scale=&amp;lt;graphics scale to use when exporting&amp;gt; (value, optional)
  dpi=&amp;lt;DPI to use when exporting&amp;gt; (value, optional)
  zoom=&amp;lt;zoom level to use when exporting&amp;gt; (value, optional)
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Better Bitmap Texture&lt;/h3&gt;

&lt;p&gt;By setting various bitmap parameters you can increase the resolution of the bitmap and/or the zoom level of the underlying OSM bitmap.&lt;/p&gt;

&lt;h3&gt;TIN Tweaks&lt;/h3&gt;

&lt;p&gt;To increase performance, Maperitive uses &lt;a href="http://mgarland.org/research/quadrics.html" target="_blank"&gt;Garland-Heckbert&amp;#8217;s TIN simplification algorithm&lt;/a&gt; to simplify the terrain &lt;a href="http://en.wikipedia.org/wiki/Triangulated_irregular_network" target="_blank"&gt;triangulated irregular network (TIN)&lt;/a&gt;. There are two command parameters that affect the simplification process:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;tin-error&lt;/code&gt;: this is the maximum error (tolerance) allowed between the actual DEM elevation and the generated model, in meters. The default value is 1 meter and if your model becomes too big to handle, I suggest increasing the tolerance value.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;mesh-points&lt;/code&gt;: this is the maximum number of points (vertices) the TIN should have. The simplification algorithm starts from a very simple model (just two triangles) and incrementally adds new points to it. Upon reaching the maximum number of points, the algorithm stops (regardless of the &lt;code&gt;tin-error&lt;/code&gt; setting). This is a safeguard against the model going wild with too many points. So I suggest experimenting with those two values to get something workable for your case.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Setting The Map Area More Precisely&lt;/h3&gt;

&lt;p&gt;Instead of relying on the map window to act as your area of interest, you can specify printing bounds (right click on the map) and move them to an exact position of your choice.&lt;/p&gt;

&lt;h2&gt;Final Notes&lt;/h2&gt;

&lt;p&gt;This 3D export function is by no means of the same quality as some other OSM 3D projects - you don&amp;#8217;t get any 3D objects apart from the terrain model, so don&amp;#8217;t expect to see any 3D buildings, trees etc. It is, however, a very simple tool to use (I hope) and it produces an output in a fairly open standard (COLLADA) which can then be tweaked with other software.&lt;/p&gt;

&lt;p&gt;The next logical step would be to include the things like roads and buildings as actual 3D objects, but I will leave that for the future since my task list already very full with other features.&lt;/p&gt;

&lt;p&gt;Please send me feedback if you find this feature useful (or indeed if you find it crappy). Since all this is beta, expect to find bugs. Also, if you&amp;#8217;re more of an expert in 3D field than me, a question for you: can you recommend any (preferably free) tool for raytracing which can consume COLLADA files generated by Maperitive?&lt;/p&gt;</description><link>http://braincrunch.tumblr.com/post/11651090204</link><guid>http://braincrunch.tumblr.com/post/11651090204</guid><pubDate>Wed, 19 Oct 2011 14:24:00 +0200</pubDate><category>3D</category><category>Maperitive</category><category>cartography</category><category>openstr</category><category>openstreetmap</category><category>osm</category><category>Maperitive beta</category></item><item><title>Maperitive: maperipy Progress</title><description>&lt;p&gt;WARNING: this is one of those teaser-posts - you get to hear about the cool new features, but you won&amp;#8217;t be able to try them out, at least not very soon.&lt;/p&gt;

&lt;h2&gt;Introduction&lt;/h2&gt;

&lt;p&gt;In the last few weeks since the beta release I&amp;#8217;ve been working on a custom job involving Maperitive. I won&amp;#8217;t go into details about the job itself, but the important thing is that this job was an opportunity for maperipy Python API to be extended with some new features. I&amp;#8217;ll go through some of them, together with sample Python code.&lt;/p&gt;

&lt;h2&gt;Geometries&lt;/h2&gt;

&lt;p&gt;maperipy provides classes for basic geometries (compatible with &lt;a href="http://en.wikipedia.org/wiki/Well-known_text" target="_blank"&gt;OGC&amp;#8217;s Simple Features Specification&lt;/a&gt;) like Point, LineString, LinearRing, Polygon, MultiPolygon etc. I&amp;#8217;ve tried to stick to the syntax and semantics used by &lt;a href="https://github.com/sgillies/shapely#readme" target="_blank"&gt;shapely library&lt;/a&gt; (unfortunately shapely itself cannot be used directly because it won&amp;#8217;t run in IronPython - it depends on some C code in the backstage, but more about this some other time).&lt;/p&gt;

&lt;h2&gt;Custom Layers&lt;/h2&gt;

&lt;p&gt;maperipy now allows users to create their own custom map layers which can be programmatically  filled with map symbols using geometries described previously:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# we first create a custom layer on a map
layer = map.add_custom_layer()

# create a simple geometry
line = LineString([(0, 0), (0, 10), (10, 10), (10, 0)])

# add a symbol for it...
symbol = LineSymbol("my_line", (line, ))
# ... and define the visual style
symbol.pen_width = 5
symbol.pen_color = Color("red")

# now we add the symbol to the layer
layer.add_symbol(layer)
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Shapefiles&lt;/h2&gt;

&lt;p&gt;The custom job required the data to be loaded from shapefiles and then rendered on a map based on geometry attributes. This can now be achieved in maperipy:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# first we read the shapefile...
land_use = store.load_shapefile(r"LandUse.shp")

# ... and add polygons for a specific land use type
symbol = PolygonSymbol(
    "forest", 
    land_use.find_polygons(lambda p : p["land_use_type"] == 4000))
symbol.style.fill_color = symbol.style.pen_color = Color("green")
layer.add_symbol(symbol)
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Rasters&lt;/h2&gt;

&lt;p&gt;maperipy supports several types of raster grid file formats: SRTM HGT, &lt;a href="http://en.wikipedia.org/wiki/Esri_grid#ASCII" target="_blank"&gt;ESRI ASCII grid&lt;/a&gt; and XYZ. They can now all be used to generate hillshadings or relief contours.&lt;/p&gt;

&lt;p&gt;Example code which reads a set of XYZ files, merges them together and then generates hillshading image from them:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;parts = []

dem_dir = r"DEM"

for file_name in os.listdir(dem_dir):
    grid = store.load_xyz_grid (os.path.join (dem_dir, file_name))
    parts.append(grid)

whole_dem = Raster.merge(parts)

hillshader = IgorHillshader()

hillshadingBitmap = HillShadingProcessor.shade(whole_dem, hillshader, Color("black"), 1)
hillshadingBitmap.save("dem.png")
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Spatial References&lt;/h2&gt;

&lt;p&gt;One of the biggest pieces of coding I had to do was to introduce &lt;a href="http://en.wikipedia.org/wiki/SRID" target="_blank"&gt;SRIDs&lt;/a&gt; into the picture. This allows consuming of data sources which use spatial reference systems different from the WGS 84 lon/lat used by OSM. The next step will be to actually support different SRS-es, including different coordinate systems and different map projections.&lt;/p&gt;

&lt;h2&gt;When?&lt;/h2&gt;

&lt;p&gt;This is all very nice, but when will &lt;em&gt;you&lt;/em&gt; get to use it? Well, maperipy needs a lot more work (what I&amp;#8217;ve shown here is just a start!) and so does the main Maperitive code. I also need to write some documentation about the API. So my guesstimate would be a couple of months. Given that a lot of new functionality has been introduced since the last &amp;#8220;official&amp;#8221; release, I&amp;#8217;m thinking of naming the next major release as &amp;#8220;Maperitive 2.0&amp;#8221; and this will include all the stuff introduced in the September beta release.&lt;/p&gt;</description><link>http://braincrunch.tumblr.com/post/11309764896</link><guid>http://braincrunch.tumblr.com/post/11309764896</guid><pubDate>Tue, 11 Oct 2011 08:45:38 +0200</pubDate><category>Maperitive</category><category>osm</category><category>openstreetmap</category><category>Python</category><category>maperipy</category></item><item><title>Maperitive Beta Update</title><description>&lt;p&gt;DOWNLOAD LINK: &lt;a href="http://maperitive.net/beta/Maperitive-1.1.2001.zip" target="_blank"&gt;&lt;a href="http://maperitive.net/beta/Maperitive-1.1.2001.zip" target="_blank"&gt;http://maperitive.net/beta/Maperitive-1.1.2001.zip&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve just released an update of the Maperitive beta (it&amp;#8217;s the same download link and build number).&lt;/p&gt;

&lt;p&gt;This update has a few nasty bugs fixed and a couple of new features.&lt;/p&gt;

&lt;h2&gt;Label Collision Detection&lt;/h2&gt;

&lt;p&gt;Maperitive now detects if two or more labels overlap. In case of overlaps the label with lower &lt;strong&gt;priority&lt;/strong&gt; is removed. Priority is determined by the order of the features and rules in the rules file - rules near the beginning of the file have a higher priority than the ones near the end.&lt;/p&gt;

&lt;p&gt;A sample rendering of UK cities and towns (the first image is from the old Maperitive and the second was generated using the latest beta):&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lrw345yGzT1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lrw34d1sM61qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;This is a very simple system and it covers only horizontal labels (so street names can still overlap). A better system will be implemented in the future.&lt;/p&gt;

&lt;h2&gt;TileJSON&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;generate-tiles&lt;/code&gt; command now generates an accompanying &lt;a href="https://github.com/mapbox/tilejson#readme" target="_blank"&gt;TileJSON&lt;/a&gt; file. TileJSON is an invention of &lt;a href="http://mapbox.com/" target="_blank"&gt;MapBox&lt;/a&gt; developers and it is used to hold some basic information about the generated tiles, like:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;map name, description and attribution,&lt;/li&gt;
&lt;li&gt;minimum and maximum zoom,&lt;/li&gt;
&lt;li&gt;map boundaries.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The benefit of this file is that certain JavaScript mapping libraries (like &lt;a href="http://mapbox.com/wax/" target="_blank"&gt;Wax&lt;/a&gt;) can read it and automatically configure themselves based on its data. Compare that to the last step in my &lt;a href="http://braincrunch.tumblr.com/post/9921938947/maperitive-tutorial-a-hiking-web-map-in-ten-easy-steps" target="_blank"&gt;web map tutorial&lt;/a&gt; where you needed to do it manually.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s a sample TileJSON file generated by Maperitive:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;// Generated by Maperitive v1.1.2001
// For more information about TileJSON format, visit &lt;a href="https://github.com/mapbox/tilejson#readme" target="_blank"&gt;https://github.com/mapbox/tilejson#readme&lt;/a&gt;
// TODO: Update the 'tiles' to reflect your actual path on the Web server
// TODO: Update the default map location (longitude, latitude, zoom)
{
    "tilejson":"1.0.0", 
    "name":"Maperitive Web Map", 
    "description":"Maperitive Web Map", 
    "attribution":"Map data © OpenStreetMap (and) contributors, CC-BY-SA", 
    "tiles":
    [
            "tiles/{z}/{x}/{y}.png"
    ], 
    "minzoom":9, 
    "maxzoom":13, 
    "bounds":
    [
        -1.2254669867114432, 
        51.041883339771708, 
        1.5044914337393456, 
        52.076449581817052
    ], 
    "center":
    [
        0.13951222351395121, 
        51.55916646079438, 
        9
    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note the &amp;#8220;TODO&amp;#8221;s: make sure you have the proper values before uploading the file to your web server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; there was a bug in the generated TileJSON files, &amp;#8220;tiles&amp;#8221; is actually an array (thanks to @kkaefer for pointing this out). I&amp;#8217;ve updated the beta release.&lt;/p&gt;</description><link>http://braincrunch.tumblr.com/post/10490479766</link><guid>http://braincrunch.tumblr.com/post/10490479766</guid><pubDate>Wed, 21 Sep 2011 22:34:00 +0200</pubDate><category>Maperitive</category><category>algorithms</category><category>openstreetmap</category><category>osm</category><category>Maperitive beta</category></item><item><title>New Maperitive Beta Release</title><description>&lt;p&gt;DOWNLOAD LINK: &lt;a href="http://maperitive.net/beta/Maperitive-1.1.2001.zip" target="_blank"&gt;&lt;a href="http://maperitive.net/beta/Maperitive-1.1.2001.zip" target="_blank"&gt;http://maperitive.net/beta/Maperitive-1.1.2001.zip&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A new release of Maperitive (branded as build 2001) is finally here - albeit in beta form. I wanted to release the new stuff I was working on since May, but I didn&amp;#8217;t want to wait for everything to be totally finished. But let&amp;#8217;s start with some&amp;#8230;&lt;/p&gt;

&lt;h2&gt;Notes about this release you should be aware of&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;NOTE 1&lt;/strong&gt;: This beta release will &lt;strong&gt;not&lt;/strong&gt; appear as an update when running the &amp;#8220;standard&amp;#8221; Maperitive release. It will also not be possible to later auto-update it with a new release when it arrives. I&amp;#8217;m working on a revamped auto-updating system and the old updating mechanism has been turned off in beta (that&amp;#8217;s why it&amp;#8217;s beta). So you will have to download the beta manually, unzip it somewhere, and run &lt;code&gt;Maperitive.exe&lt;/code&gt; (on Windows) or &lt;code&gt;Maperitive.sh&lt;/code&gt; (on Linux/Mac). I do not recommend overwriting the previous installation, so keep that as your backup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE 2&lt;/strong&gt;: there have been some &lt;strong&gt;changes in certain Maperitive script commands&lt;/strong&gt;, so you may need to update your scripts. The changes are mostly in how the bounds are specified when exporting bitmaps or SVGs. More on that later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE 3&lt;/strong&gt;: there wasn&amp;#8217;t any major bug fixing done for this release. You can see the list of &lt;a href="https://bitbucket.org/breki74/maperitive/issues?status=new&amp;amp;status=open" target="_blank"&gt;open bugs&lt;/a&gt; (it&amp;#8217;s not the full list, some old bugs are reported in other places - I will migrate/fix those soon).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE 4&lt;/strong&gt;: the new GUI features like map elements selection and editing may be a little bit buggy. A lot of time has been invested in making them work as there were some fundamental problems that needed to be solved. Users running Maperitive on Linux/Mac may especially notice certain problems, due to the fact that Maperitive is running through  Mono. In any case, please report any problems if you see them and I will do my best to fix them.&lt;/p&gt;

&lt;h2&gt;New Features&lt;/h2&gt;

&lt;p&gt;First let me say there aren&amp;#8217;t any revolutionary new features in this beta. Most of the work I did was done on the infrastructure code, which will help me introduce cool new things in next releases.&lt;/p&gt;

&lt;p&gt;What &lt;strong&gt;is&lt;/strong&gt; new is the way how bounds are specified (bounds specify the geographical extents of Maperitive commands). Up until now, there was only one bounds parameter, but from now on you have &lt;strong&gt;geometry bounds&lt;/strong&gt; and &lt;strong&gt;printing bounds&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;Geometry Bounds&lt;/h3&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lrqa11022s1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;These are more or less the &amp;#8220;old&amp;#8221; bounds - you use them to specify the map area to download OSM data for (as an example). Geometry bounds are defined in terms of &amp;#8220;min longitude, min latitude, max longitude, max latitude&amp;#8221; coordinates. They are shown as a red rectangle with diagonal hatching (see the screenshot above).&lt;/p&gt;

&lt;p&gt;Maperitive commands that act on geometry bounds have been renamed to &lt;code&gt;dump-geo-bounds&lt;/code&gt;, &lt;code&gt;geo-bounds-use-source&lt;/code&gt;, &lt;code&gt;reset-geo-bounds&lt;/code&gt;, &lt;code&gt;set-geo-bounds&lt;/code&gt;. I haven&amp;#8217;t updated the Maperitive documentation for these yet, but you can still use &lt;code&gt;help-command&lt;/code&gt; to get the list of supported arguments, like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;help-commands set-geo-bounds
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Printing Bounds&lt;/h3&gt;

&lt;p&gt;Printing bounds are used by &lt;strong&gt;export-bitmap&lt;/strong&gt; and &lt;strong&gt;export-svg&lt;/strong&gt; commands to control the exported map area. What is cool about the printing bounds is that you can specify them in terms of &lt;strong&gt;paper size&lt;/strong&gt;, &lt;strong&gt;paper orientation&lt;/strong&gt;, &lt;strong&gt;paper margins&lt;/strong&gt;, &lt;strong&gt;map scale&lt;/strong&gt; and &lt;strong&gt;DPI resolution&lt;/strong&gt;. This was one of the most requested features - to be able to export a map in terms of physical paper dimensions.&lt;/p&gt;

&lt;p&gt;Printing bounds work in two modes: &lt;strong&gt;fixed paper mode&lt;/strong&gt; and &lt;strong&gt;free-size mode&lt;/strong&gt;. In free-size mode you are not bound to a particular paper size, so you can define the bounds in the old way (just like geometry bounds).&lt;/p&gt;

&lt;p&gt;Printing bounds are shown as blue dashed rectangle:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lrqad1BtNL1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;New printing bounds commands are &lt;code&gt;set-print-bounds-geo&lt;/code&gt;, &lt;code&gt;set-print-bounds-paper&lt;/code&gt; and &lt;code&gt;set-print-bounds-view&lt;/code&gt;. There is also a new command for setting the paper properties: &lt;code&gt;set-paper&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;Why Two Boundary Types?&lt;/h3&gt;

&lt;p&gt;It may seem a bit complicated two introduce two types of boundaries, but it is necessary precondition for me to be able to introduce map rotation in Maperitive (and support for different map projections). Why? Because once you rotate the map, the geometry bounds rotate, too, so they are useless for any kind of printing boundaries (which need to be rectangles parallel with the screen).&lt;/p&gt;

&lt;h3&gt;Editing Bounds Visually&lt;/h3&gt;

&lt;p&gt;There is no need to specify bounds using the command line interface, because there are a couple of new GUI features (which gave me the greatest headache). More on that follows.&lt;/p&gt;

&lt;h2&gt;Map Context Menu&lt;/h2&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lrqbcwuoSb1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;Yes, the map now has a context menu (finally). So if you want to specify printing bounds, simply right-click on the map and choose &lt;strong&gt;Place Printing Bounds Here&lt;/strong&gt;. Now you have printing bounds placed on the map and &lt;strong&gt;selected&lt;/strong&gt;&amp;#8230;&lt;/p&gt;

&lt;h2&gt;Selecting And Manipulating Map Elements&lt;/h2&gt;

&lt;p&gt;If you click on the geometry or printing bounds, you can select them - small yellow selection handles appear. You can drag the handles to &lt;strong&gt;resize the bounds&lt;/strong&gt;. If you hold the &lt;strong&gt;Shift&lt;/strong&gt; key, the resizing will maintain the &lt;strong&gt;aspect ratio&lt;/strong&gt;. Hold the &lt;strong&gt;Control&lt;/strong&gt; key and you will be able to resize while maintaining the &lt;strong&gt;center point&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Move the mouse a little bit more inside the bounds box and you will be able to &lt;strong&gt;move the whole bounds&lt;/strong&gt; across the map.&lt;/p&gt;

&lt;h2&gt;Properties Window&lt;/h2&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lrqbybVAE91qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;The last major new GUI &amp;#8220;thingy&amp;#8221; is the &lt;strong&gt;Properties window&lt;/strong&gt;. If you right-click on the printing bounds and choose &lt;strong&gt;Properties&lt;/strong&gt;, a tool window will appear that lets you edit the properties. This means you don&amp;#8217;t need to mess with command line to specify the paper size, for example.&lt;/p&gt;

&lt;h2&gt;What Comes Next&lt;/h2&gt;

&lt;p&gt;As I&amp;#8217;ve already mentioned, Maperitive is getting a new updating system. The next &amp;#8220;official&amp;#8221; release will start using &lt;a href="http://semver.org/" target="_blank"&gt;semantic versioning&lt;/a&gt;, like 2.4.2 and the old build numbering will be consigned to history. This will enable a more transparent updating system - users will be able to choose whether they want to install unstable releases or wait for the next stable/tested one.&lt;/p&gt;

&lt;p&gt;Of course, I plan to fix some bugs too (including the ones that I&amp;#8217;m sure you&amp;#8217;ll report for this beta release).&lt;/p&gt;

&lt;p&gt;Next major features: a &lt;strong&gt;better labeling mechanism&lt;/strong&gt; (collision and duplicates detection, abbreviations&amp;#8230;) and &lt;strong&gt;&lt;a href="http://braincrunch.tumblr.com/post/10164927401/maperipy-maperitive-api-for-python-a-first-glimpse" target="_blank"&gt;maperipy&lt;/a&gt;&lt;/strong&gt;, the Python API and integrated Python scripting.&lt;/p&gt;

&lt;p&gt;That&amp;#8217;s really. I hope you&amp;#8217;ll try the new beta and enjoy it. And don&amp;#8217;t hesitate to send me your feedback (positive and/or negative)!&lt;/p&gt;</description><link>http://braincrunch.tumblr.com/post/10366993072</link><guid>http://braincrunch.tumblr.com/post/10366993072</guid><pubDate>Sun, 18 Sep 2011 20:15:00 +0200</pubDate><category>Maperitive</category><category>car</category><category>cartography</category><category>openstreetmap</category><category>osm</category><category>Maperitive beta</category></item><item><title>maperipy: Maperitive API for Python - A First Glimpse</title><description>&lt;p&gt;A few days ago I started implementing &lt;strong&gt;maperipy&lt;/strong&gt;, a Maperitive API for Python. It turns out to be a quite uncomplicated thing to do, compared to all infrastructure stuff I&amp;#8217;m working on for the next Maperitive release, so it&amp;#8217;s a kind of a relaxation between all the hard work.&lt;/p&gt;

&lt;p&gt;The API is still very young and unsophisticated, but I&amp;#8217;m very excited about it, because it could provide a whole new dimension of functionality to Maperitive users.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s a simple Python script that clears the map and then adds a custom Web map to it (with custom copyright text):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;from maperipy import MapLayer

map.clear_map();
layer = map.add_web_map_custom(
        "my hiking map", 
        ["http://beta1234.com.sunflower.arvixe.com/maps/tiles"])
layer.copyright = "it's made by me"
layer.opacity = 0.75
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Another one, which scrolls the map along the X-axis:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;from maperipy import MapPosition
import time

pos = map.position;

for n in range(10):
    map.position = MapPosition(15 + n/10.0, pos.y, 11)
    app.refresh_map()
    time.sleep(0.3)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;First versions of maperipy will probably be available after I finish the work on the next major release of Maperitive. Hopefully some time in October.&lt;/p&gt;</description><link>http://braincrunch.tumblr.com/post/10164927401</link><guid>http://braincrunch.tumblr.com/post/10164927401</guid><pubDate>Tue, 13 Sep 2011 17:10:34 +0200</pubDate><category>Maperitive</category><category>maperipy</category><category>openstreetmap</category><category>osm</category><category>python</category></item><item><title>Maperitive Tutorial: Generating OSM Map For Adobe Illustrator In Seven Easy Steps</title><description>&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lr6qhsSXED1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;In this tutorial you will learn how to produce a vector map based on OpenStreetMap data and then export it to SVG format suitable for editing in Adobe Illustrator. SVG export is one of the most useful features Maperitive provides and I&amp;#8217;ve spent a lot of time tweaking the code so that Illustrator can handle the exported SVGs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE: the tutorial has been written for Maperitive build 1228. Some things will change in the near future, so please visit &lt;a href="http://maperitive.net" target="_blank"&gt;http://maperitive.net&lt;/a&gt; for any updates.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First things first: start Maperitive (if you don&amp;#8217;t already have it, you can download it from &lt;a href="http://maperitive.net" target="_blank"&gt;here&lt;/a&gt;). Unzip the package somewhere on your disk and run &lt;strong&gt;Maperitive.exe&lt;/strong&gt; (on Windows) or &lt;strong&gt;Maperitive.sh&lt;/strong&gt; (on Linux/Mac).&lt;/p&gt;

&lt;h2&gt;Step 1: Setting Your Map Limits&lt;/h2&gt;

&lt;p&gt;Currently Maperitive uses your computer&amp;#8217;s memory to store map data, so there is a limit of how large a map it can work on. Because of that, we need to tell Maperitive what area we&amp;#8217;re interested in, so all the operations will limit themselves on that area.&lt;/p&gt;

&lt;p&gt;There are several ways to set the limits. The easiest is to move the map to the area, zoom in our out appropriately to cover all the area you want, and then use the &lt;strong&gt;Map / Set Bounds&lt;/strong&gt; menu function.&lt;/p&gt;

&lt;p&gt;I will do this manually by entering a following command in the command prompt (at the bottom of the screen):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;bounds-set -74.03,40.7,-73.96,40.72
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I suggest you do the same for the purposes of this tutorial, so our map areas would match. The area in question is lower end of Manhattan.&lt;/p&gt;

&lt;h2&gt;Step 2: Loading OSM Data&lt;/h2&gt;

&lt;p&gt;Now we need to get the vector OSM data for our map. There are several ways of doing this.&lt;/p&gt;

&lt;p&gt;The easiest one is to use the &lt;strong&gt;Map / Download OSM Data&lt;/strong&gt; menu function, which contacts an OSM server to fetch the data. Try it out. If it fails, try it a couple more times. The problem is that these servers are sometimes overloaded and unresponsive.&lt;/p&gt;

&lt;p&gt;If this doesn&amp;#8217;t work, another option is to use JOSM or the &lt;strong&gt;Export&lt;/strong&gt; tab on the OSM Web Map site. In that case you will get an OSM XML file, which you need to save on your disk (&lt;strong&gt;using .osm extension!&lt;/strong&gt;) and then load into Maperitive using the &lt;strong&gt;File / Open Map Sources&lt;/strong&gt; menu function (or simply drag and drop the file into Maperitive).&lt;/p&gt;

&lt;p&gt;Once the OSM data is in, we can proceed with the next step&amp;#8230;&lt;/p&gt;

&lt;h2&gt;Step 3: Removing The Web Map&lt;/h2&gt;

&lt;p&gt;Now that we have some vector content of our own, we don&amp;#8217;t really need the OSM web map anymore. Select the &lt;strong&gt;Web Map (OSM Mapnik)&lt;/strong&gt; in the &lt;strong&gt;Map Sources&lt;/strong&gt; window at the bottom of the screen and then click on the &amp;#8220;X&amp;#8221; button to remove it:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lr6qmigCFd1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;h2&gt;Step 4: Changing The Map Style&lt;/h2&gt;

&lt;p&gt;The default map style resembles the standard OSM Web map layer (generated using Mapnik). But just to show off, we will switch to something that looks like Google Maps. Choose &lt;strong&gt;Map / Switch To Rules / googlemaps&lt;/strong&gt; menu function. After a second or two of processing, the map will change its style.&lt;/p&gt;

&lt;h2&gt;Step 5: Deciding The Map Scale&lt;/h2&gt;

&lt;p&gt;Depending on your needs, you can export the map using different map scales. Map scale is directly linked to the zoom level and together they determine what type of content is visible on the map and how the content is rendered. In the case of our Google Maps-like style, the street names are starting to appear on zoom level 15 and higher, so if you need them in your export, you will have to use the zoom level 15 or higher.&lt;/p&gt;

&lt;p&gt;The zoom level value is displayed at the bottom of the screen:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lr6qqfCy9M1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;The map scale is shown at the bottom left of the map itself, together with the bar scale indicator:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lr6qrt5YGR1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;For this tutorial I&amp;#8217;ve decided the zoom level 16 is the one I want. Try it out, you can set your own later.&lt;/p&gt;

&lt;h2&gt;Step 6: Exporting To SVG&lt;/h2&gt;

&lt;p&gt;The easiest way to export would be to use &lt;strong&gt;Tools / Export to SVG (For Adobe Illustrator)&lt;/strong&gt; menu function. But since we need to specify the zoom level in our case, we will type the &lt;a href="http://maperitive.net/docs/Commands/ExportSvg.html" target="_blank"&gt;export-svg command&lt;/a&gt; manually into the &lt;strong&gt;Command Prompt&lt;/strong&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;export-svg compatibility=illustrator zoom=16
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We instructed Maperitive to export the current map to a SVG file suitable for Adobe Illustrator and to use zoom level 16. After a couple of seconds a new file called &lt;strong&gt;output.svg&lt;/strong&gt; should appear under the &lt;em&gt;output&lt;/em&gt; directory of your Maperitive installation.&lt;/p&gt;

&lt;h2&gt;Step 7: Import Into Adobe Illustrator&lt;/h2&gt;

&lt;p&gt;Now that you have a SVG file, open up your AI and import it. If it complains about &amp;#8220;&lt;em&gt;roundtrips to Tiny&lt;/em&gt;&amp;#8221;, simply ignore that.&lt;/p&gt;

&lt;h2&gt;Adobe Illustrator vs. Inkscape&lt;/h2&gt;

&lt;p&gt;You may wonder why you had to specify the &lt;code&gt;compatibility=illustrator&lt;/code&gt; argument in the Step 6. I will just quote Maperitive documentation on this:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Due to the pretty buggy support which Adobe Illustrator provides for loading SVG files, it is not possible to have the same SVG optimally shown in both Illustrator and Inkscape. In other words, if you plan to use the SVG file in Illustrator, you should specify compatibility=illustrator parameter. Maperitive will in this case do some tweaks to the SVG file which allow it to be shown without any problems in Illustrator (tested in CS5). But do not expect this file to be usable in other SVG viewers/editors.&lt;/p&gt;
  
  &lt;p&gt;On the other hand, if you need a SVG file which can be shown in various Web browsers and editable in Inkscape, you should specify compatibility=inkscape parameter. Again, do not expect this file to be usable in Illustrator.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;This tutorial shows only the basic workflow, but there are many ways of how the workflow can be customized and even automated (by putting everything into a Maperitive script). Visit &lt;a href="http://maperitive.net" target="_blank"&gt;http://maperitive.net&lt;/a&gt; for more information.&lt;/p&gt;

&lt;p&gt;Good luck and enjoy mapping!&lt;/p&gt;</description><link>http://braincrunch.tumblr.com/post/9947074703</link><guid>http://braincrunch.tumblr.com/post/9947074703</guid><pubDate>Thu, 08 Sep 2011 05:57:00 +0200</pubDate><category>Maperitive</category><category>cartography</category><category>osm</category><category>openstreetmap</category><category>tutorial</category><category>GIS</category><category>SVG</category><category>Adobe Illustrator</category></item><item><title>Maperitive Tutorial: A Hiking Web Map In Ten Easy Steps</title><description>&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lr5wljqLL71qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE (24th February 2013):&lt;/strong&gt; I&amp;#8217;ve updated the tutorial to conform to the latest Maperitive release.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve been asked a lot of times to write some tutorials for Maperitive, so I finally decided to write one.&lt;/p&gt;

&lt;p&gt;In this tutorial you will learn how to make a hiking web map (like &lt;a href="https://tiles.mapbox.com/breki/map/hiking-demo" target="_blank"&gt;this one hosted on MapBox&lt;/a&gt;) with OpenStreetMap data and SRTM DEM data for hillshading and relief contours. Don&amp;#8217;t worry - it is not that difficult to do.&lt;/p&gt;

&lt;p&gt;First things first: start Maperitive (if you don&amp;#8217;t already have it, you can download it from &lt;a href="http://maperitive.net" target="_blank"&gt;here&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;Step 1: Setting Your Map Limits&lt;/h2&gt;

&lt;p&gt;Currently Maperitive uses your computer&amp;#8217;s memory to store map data, so there is a limit of how large a map it can work on. Because of that, we need to tell Maperitive what area we&amp;#8217;re interested in, so all the operations will limit themselves on that area.&lt;/p&gt;

&lt;p&gt;There are several ways to set the limits. The easiest is to move the map to the area, right-click on the map and choose &lt;strong&gt;Place Geometry Bounds Here&lt;/strong&gt; from the context menu. When the red rectangle appears, you can move it and resize it to the area of your choice.&lt;/p&gt;

&lt;p&gt;I will do this manually by entering a following command in the command prompt (at the bottom of the screen):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;set-geo-bounds 15.42,46.44,15.62,46.55
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I suggest you do the same for the purposes of this tutorial, so our map areas would match. The area in question is Pohorje mountain in Slovenia (I hike there very often).&lt;/p&gt;

&lt;h2&gt;Step 2: Generating Hillshading&lt;/h2&gt;

&lt;p&gt;This one is very easy: use &lt;strong&gt;Tools / Generate Hillshading (Igor)&lt;/strong&gt; menu function. The program will contact NASA&amp;#8217;s SRTM server and download all the appropriate DEM tiles for the area. After that it will generate a new map source containing the hillshading bitmap. You can see all the happenings in the &lt;strong&gt;Commander&lt;/strong&gt; log.&lt;/p&gt;

&lt;h2&gt;Step 3: Turning Off The Web Map&lt;/h2&gt;

&lt;p&gt;Now that we have some content of our own, we don&amp;#8217;t really need the OSM web map anymore. Select the &lt;strong&gt;Web Map (OSM Mapnik)&lt;/strong&gt; in the &lt;strong&gt;Map Sources&lt;/strong&gt; window at the bottom of the screen and then click on the &amp;#8220;X&amp;#8221; button to remove it:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lr5w14GY2y1qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;h2&gt;Step 4: Generating Relief Contours&lt;/h2&gt;

&lt;p&gt;A proper hiking map should have relief contours, which is another easy step to do: choose &lt;strong&gt;Tools / Generate Relief Contours&lt;/strong&gt; menu item and voila, now you have the contours.&lt;/p&gt;

&lt;h2&gt;Step 5: Loading OSM Data&lt;/h2&gt;

&lt;p&gt;Now we need to get the OSM data to have the map filled with useful hiking information. Again, there are several ways of doing this.&lt;/p&gt;

&lt;p&gt;The easiest one is to use the &lt;strong&gt;Map / Download OSM Data (Overpass API)&lt;/strong&gt; menu function, which contacts an OSM server to fetch the data. Try it out. If it fails, try it a couple more times. The problem is that these servers are sometimes overloaded and unresponsive. Alternatively, you could try using the other download option, the &lt;strong&gt;Map / Download OSM Data (Overpass XAPI)&lt;/strong&gt; menu function.&lt;/p&gt;

&lt;p&gt;If this doesn&amp;#8217;t work, another option is to use JOSM or the &lt;strong&gt;Export&lt;/strong&gt; tab on the OSM Web Map site. In that case you will get an OSM XML file, which you need to save on your disk (&lt;strong&gt;using .osm extension!&lt;/strong&gt;) and then load into Maperitive using the &lt;strong&gt;File / Open Map Sources&lt;/strong&gt; menu function (or simply drag and drop the file into Maperitive).&lt;/p&gt;

&lt;p&gt;Once the OSM data is in, you will get a map that resembles the basic OSM Web map (Mapnik layer). This map style isn&amp;#8217;t really appropriate for hiking maps, so we need to change it&amp;#8230;&lt;/p&gt;

&lt;h2&gt;Step 6: Changing The Map Style&lt;/h2&gt;

&lt;p&gt;Choose &lt;strong&gt;Map / Switch To Rules / hiking&lt;/strong&gt; menu function. After a second or two you will get the final hiking map using the hiking style which comes with Maperitive. Now we need to transform it into a Web map&amp;#8230;&lt;/p&gt;

&lt;h2&gt;Step 7: Generating Map Tiles&lt;/h2&gt;

&lt;p&gt;Web maps consist of a multitude of map tiles, which are 256x256 pixels bitmaps. So we need to generate tiles for our hiking map before we can upload them to our Web server.&lt;/p&gt;

&lt;p&gt;Maperitive offers you two basic choices when it comes to tiles:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Generating each tile as a separate file&lt;/strong&gt;. This is the standard way of dealing with tiles. The advantage is that its pretty easy to set up a web map with this approach. The disadvantage is that you have to transfer a lot of small files to your web server, which can take a long time.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Generating tiles as a single MBTiles file&lt;/strong&gt;. &lt;a href="http://wiki.openstreetmap.org/wiki/MBTiles" target="_blank"&gt;MBTiles&lt;/a&gt; is a SQLite database containing all the generated tiles and which can be handled as a single file. The only thing is, you need to have a Web map server that supports MBTiles. If you&amp;#8217;re planning to publish your maps on MapBox, that&amp;#8217;s not a problem (simply upload the generated file using their web application).&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;Step 7a: Generating tiles as separate files&lt;/h3&gt;

&lt;p&gt;Generating tiles as separate files is done using the &lt;a href="http://maperitive.net/docs/Commands/GenerateTiles.html" target="_blank"&gt;generate-tiles&lt;/a&gt; command. Enter the following command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;generate-tiles minzoom=12 maxzoom=14
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and you should get the output in the &lt;strong&gt;Commander&lt;/strong&gt; log similar to this one:
&lt;img src="http://media.tumblr.com/tumblr_lr5w67RSY71qghjht.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;For the sake of this tutorial we generated tiles just for three zoom levels (12, 13, 14). The tiles have been stored in the &lt;em&gt;Tiles&lt;/em&gt; subdirectory of your Maperitive installation, in the structure that is suitable to be used by OpenLayers (we&amp;#8217;ll get to that part in a moment, don&amp;#8217;t worry). I&amp;#8217;ll leave you some time to check the tiles out&amp;#8230;&lt;/p&gt;

&lt;h3&gt;Step 7b: Generating MBTiles&lt;/h3&gt;

&lt;p&gt;Alternatively, to generate MBTiles file, use the analogous command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;generate-mbtiles minzoom=12 maxzoom=14
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Step 8: Uploading Tiles To Web Server&lt;/h2&gt;

&lt;p&gt;You can use do whatever way you feel most comfortable with to upload these map tiles to your Web server. Maperitive comes with the &lt;a href="http://maperitive.net/docs/Commands/FtpUpload.html" target="_blank"&gt;ftp-upload&lt;/a&gt; command which can make this job very easy. Example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ftp-upload host=myftp.com user=me pwd=secret remote-dir=mywebmap
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;will upload all the generated tiles to the &lt;em&gt;mywebmap&lt;/em&gt; directory on the FTP server. Before executing this command, you will need to enter your own host, user and password, of course.&lt;/p&gt;

&lt;h2&gt;Step 9: Preparing HTML&lt;/h2&gt;

&lt;p&gt;If you decided to your web map on your own web server using individual web map tiles, you now need to prepare a simple HTML landing page for our map.&lt;/p&gt;

&lt;p&gt;In the past I used &lt;a href="http://openlayers.org/" target="_blank"&gt;OpenLayers&lt;/a&gt; as a client-side JavaScript mapping library. You can still use it, but for simplicity&amp;#8217;s sake I would recommend trying out &lt;a href="http://leafletjs.com/" target="_blank"&gt;Leaflet.js&lt;/a&gt; instead. It is much easier to get started and has all the basic features you will need for a decent web map. The documentation is good and there are a lot of samples on the web. If you want to see a working Leaflet map, check out &lt;a href="http://scalablemaps.com/map/sanfrancisco-modern" target="_blank"&gt;ScalableMaps&lt;/a&gt;, one of my other projects. Feel free to use the JavaScript code if you want.&lt;/p&gt;

&lt;h2&gt;Step 10: Test The Map&lt;/h2&gt;

&lt;p&gt;This should be it! Visit your Web map using a browser and check that everything is working correctly.&lt;/p&gt;

&lt;p&gt;This tutorial shows only the basic workflow, but there are many ways of how the workflow can be customized and even automated (by putting everything into a Maperitive script and even running it in the headless Maperitive console). Visit &lt;a href="http://maperitive.net" target="_blank"&gt;http://maperitive.net&lt;/a&gt; for more information.&lt;/p&gt;

&lt;p&gt;Good luck and enjoy mapping!&lt;/p&gt;</description><link>http://braincrunch.tumblr.com/post/9921938947</link><guid>http://braincrunch.tumblr.com/post/9921938947</guid><pubDate>Wed, 07 Sep 2011 19:08:00 +0200</pubDate><category>Maperitive</category><category>osm</category><category>openstreetmap</category><category>tutorial</category><category>cartography</category><category>GIS</category></item></channel></rss>
