March 2013
1 post
The problem with OpenStreetMap multipolygons
Here’s a very simple example of why I think OpenStreetMap multipolygons are a disaster.
Let’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:
What now? In normal...
August 2012
1 post
irbash asked: 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...
June 2012
1 post
6 tags
Maperitive: Alpenglow Effect Using A Custom Shader
The latest release 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 “See the light: How to make illuminated shaded relief in Photoshop 6.0” article on the excellent shadedrelief.com site.
You can run the script by executing
run-python...
May 2012
5 posts
4 tags
Mercator's Egg
UPDATE: my math was buggy, the eggs look a bit different after the correction. Note that the formula fails on very large distances (> 2000 km).
A little Maperitive Python script I was playing with today, showing the line of distance of 3000 km (larger egg) and 2000 km (smaller egg) from my home town of Maribor, drawn on the standard Web Mercator projection map:
...
11 Things You Should Learn Before Learning To Code
Here’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):
Learn how to swim.
Learn how to stay healthy and in shape.
Learn the basics of food energy intake.
Learn how to cook a decent (and healthy) meal.
Learn how to use your mother tongue.
Learn how to keep your personal finances in order. Think Greece...
Maperitive: Walking Papers-Like Script
The latest Maperitive 2.0 beta release comes with a new script which can generate a grid of bitmap exports similar to walking papers. The added value is that you can do walking papers for your own vector data and map styles, not just prerendered web tiles.
How To Use
A brief description of how to generate your own walking papers exports.
1. Define Map Area
In Maperitive, place printing...
3 tags
Oxford Bus & Cycle Map in print
I’ve just received the “Oxford Bus & Cycle Map” from Richard Mann (thanks, Richard!). The interesting thing is that it was made from OpenStreetMap data using Maperitive. It’s a stunning beauty, Richard has put a lot of effort into it.
Online versions of the maps are here: http://www.transportparadise.co.uk/maps/
2 tags
Results Of The Maperitive Survey
Last week I posted a quick survey for Maperitive 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.
I got 138 reponses so far, which is much more than I expected, so thanks for everyone who...
April 2012
1 post
3 tags
Maperipy sample: generate tiles and then optimize...
The latest (2.0.28) Maperitive beta 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 OptiPNG on them to reduce the file size (OptiPNG is now included in Maperitive package) of PNGs.
Some more info about this release:...
March 2012
1 post
4 tags
New OSM License, Some Practical Implications And...
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 CC BY-SA 2.0 to them.
Soon OSM will switch to a new ODbL...
February 2012
2 posts
3 tags
Usability and Open Source Software
Related to my yesterday rant about QGIS and usability: I’ve been reading an article called “Usability and Open Source Software” article and it has a lot of interesting points. It’s a little bit dated (year 2002), but I think most issues remain the same even now after 10 years.
Here are some highlights I find interesting (but you should read the whole article):
If this...
3 tags
On QuantumGIS And User Experience
Intro
Looks like my morning rant tweet “QGIS needs a usability expert. Or a whole team of them.” has caused a little storm in the GIS community. I haven’t really expected any feedback on this, so i guess I can say that Twitter is the King. I’ve already e-mailed some of my views to the first QGIS person that contacted me (Nathan Woodrow), but for the sake of open...
November 2011
1 post
3 tags
Maperitive Beta: Subpixel Accuracy
Even though most of Maperitive work I’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 “unofficially” released Maperitive beta. I’ve just uploaded a new beta version with a couple of neat features, one of which I will...
October 2011
2 posts
7 tags
Maperitive: 3D Export
The latest Maperitive beta (download it from here) now contains a new command called export-3d, 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 COLLADA format, which can be imported into various 3D programs (Google SketchUp is the one I mostly used, it’s free).
Quick How-To
The quickest/easiest way to...
5 tags
Maperitive: maperipy Progress
WARNING: this is one of those teaser-posts - you get to hear about the cool new features, but you won’t be able to try them out, at least not very soon.
Introduction
In the last few weeks since the beta release I’ve been working on a custom job involving Maperitive. I won’t go into details about the job itself, but the important thing is that this job was an opportunity for...
September 2011
5 posts
5 tags
Maperitive Beta Update
DOWNLOAD LINK: http://maperitive.net/beta/Maperitive-1.1.2001.zip
I’ve just released an update of the Maperitive beta (it’s the same download link and build number).
This update has a few nasty bugs fixed and a couple of new features.
Label Collision Detection
Maperitive now detects if two or more labels overlap. In case of overlaps the label with lower priority is removed....
6 tags
New Maperitive Beta Release
DOWNLOAD LINK: http://maperitive.net/beta/Maperitive-1.1.2001.zip
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’t want to wait for everything to be totally finished. But let’s start with some…
Notes about this release you should be aware of
NOTE 1: This beta...
5 tags
maperipy: Maperitive API for Python - A First...
A few days ago I started implementing maperipy, a Maperitive API for Python. It turns out to be a quite uncomplicated thing to do, compared to all infrastructure stuff I’m working on for the next Maperitive release, so it’s a kind of a relaxation between all the hard work.
The API is still very young and unsophisticated, but I’m very excited about it, because it could provide a...
8 tags
Maperitive Tutorial: Generating OSM Map For Adobe...
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’ve spent a lot of time tweaking the code so that Illustrator can handle the exported SVGs.
NOTE: the tutorial has been written for Maperitive build 1228....
6 tags
Maperitive Tutorial: A Hiking Web Map In Ten Easy...
UPDATE (24th February 2013): I’ve updated the tutorial to conform to the latest Maperitive release.
I’ve been asked a lot of times to write some tutorials for Maperitive, so I finally decided to write one.
In this tutorial you will learn how to make a hiking web map (like this one hosted on MapBox) with OpenStreetMap data and SRTM DEM data for hillshading and relief contours....
July 2011
1 post
Visual Studio Tip: Running Your Build Scripts...
This is really obvious and simple, but I never got the idea until now when I’m doing a bit of cleaning of my Maperitive code and trying some new approaches.
For all of the projects I’m working on I have the same basic convention: a Build.bat batch script which builds the release version of the solution, including all the testing and packaging. Build.bat is always stored in the...
May 2011
1 post
4 tags
Line Rendering Artifacts
I’m investigating ways of removing nasty little rendering bugs which occur when Maperitive draws something that should be a continuous polyline, but has to be rendered in several separate segments because these segments belong to different layers of painter’s algorithm.
Here’s the bug under the microscope:
I’ve turned the transparency to visualize the actual endings of...
April 2011
7 posts
Time To Take That Jump?
I didn’t have full-time revenue when I was doing this part-time. But it’s amazing. Once you have the time to focus on something, the opportunities that you hadn’t had time to notice before suddenly open up. Just the act of making something your focus almost makes your goal come to fruition. For years you think “too risky, too risky” and then once you make that jump, things fall in place.
...
4 tags
No, It's Not Google Earth
It’s Maperitive with the new MapQuest OpenAerial map layer, actually. Cooming soon.
1 tag
Made By Bureaucrats, For Bureaucrats
Whoever thinks putting 8+ tabs of input screens, each with 10 or more input fields and 10 or more buttons for each project issue is a good way of tracking projects, has never seen a successful development project in his/her life.
Whoever thinks creating a Windows-like Web application, slow to load and to render is a good idea, has never seen a good Web GUI and never experienced a user-friendly...
1 tag
Stupid Software Screenshot
Does it really, really think I will let it close all that apps in the middle of my work?
That’s plain stupid. I’m donating a piece of code to Microsoft:
if (countOfProgramsToClose > 5)
doNotCloseAndRequireRestart = true;
else
{
ShowTheAnnoyingDialog();
DoOtherAnnoyingThings();
}
How To Write Fast Code →
“So there is no way, really, to make code go faster, because there is no way to make instructions execute faster. There is only such a thing as making the machine do less.”
(via The Endeavour)
5 tags
Maperitive: Python Scripting Introduction
The upcoming release of Maperitive comes with a new and exciting feature: Python scripting.
What I’ll describe here is just an initial introduction of Python into Maperitive and right now is more of an experimental nature. I have great plans with Python, but there is still a lot of work to do and I wanted to release something to users so they can test it out and give some...
2 tags
Maperitive: Line Feature Label Placement Explained
This is a quick description of how Maperitive places labels on line features (streets, rivers etc.). The system is likely to change in the future, so make sure you read the online docs for the latest info.
Currently Maperitive tries to fit the text into the width of the street, but there are several rendering properties (see the Default rules as an example) which control this:
Maperitive...
March 2011
16 posts
2 tags
A Little Agile Gem
Are story points an excuse for teams not being able to estimate correctly in days/hours?
It is not an excuse but a reality that it is a waste to attempt arriving at an accurate number in days or hours for a User Story. The amount of effort and time required to arrive at such a number trades off against the benefits of estimating in days/hours.
Moreover estimating in days/hours often...
5 tags
Fill Textures In Maperitive
Playing with fill textures in #Maperitive. Just some random forest noise:
Coming up in the next release…
1 tag
1 tag
Stacktrace or GTFO →
1 tag
1 tag
2 tags
A little GIS maths →
1 tag
5 tags
Python's try-except-else-finally Block
Started reading IronPython in Action to get acquainted with my language of choice for Maperitive scripting.
While browsing through the book, I noticed a little gem I complained was missing in C# a few days ago (code stolen from here):
try:
f = open(arg, 'r')
except IOError:
print 'cannot open', arg
else:
print arg, 'has', len(f.readlines()), 'lines'
f.close()
And the...
1 tag
IronPython In Maperitive Action
An example experimental snippet of Python code that I’m using to test the IronPython integration with Maperitive rendering rules:
text-func : e.GetTagValue('name').upper().replace('E','I')
It uses the name tag, converts it to uppercase and then replaces all E’s with I’s. Stupid, I know. Stay tuned for something more intelligent.
Maperitive's Birthday Post →
3 tags
OSM Relations Or Seven-Headed Monsters
The more I delve into trying to find a good generic way of handling OSM relations in Maperitive, the more I get the feeling it’s a waste of effort. Relations are just too abstract and require some implicit (and external) semantic knowledge for a map renderer to be able to handle them properly.
Example? Look at multipolygon relations on the OSM wiki. They contain a lot of external knowledge...
1 tag
try...success...catch...finally block wanted in C#
Yesterday I complained about wanting such a block in C#. Why? Here’s the situation (not too common, but it happens):
try
{
OpenTheFridgeAndTakeChocolate();
CutChocolateIntoPieces();
}
catch (SomethingFailedException ex)
{
GoToChocolateStore();
}
finally
{
CloseTheFridge();
}
The problem I’m having is that I only want to go to store if I cannot find the chocolate in...