Latest entries
FOSS4G 2010
I'm going to be at FOSS4G 2010 next week in Barcelona. The last time I was in Spain was the final day of SOTM and the day Spain won the world cup. I'm excited to return!
On tap will be a great workshop run by Iván Sánchez Ortega on using Mapnik to render OSM data: W-03: Setting up an OpenStreetMap rendering toolchain
Mapnik is also participating in the FOSS4G WMS Shootout this year, a friendly competition of many of the leading open source and non-open source servers out there. Before this month Mapnik didn't really a fast C-based WMS server, but I wrote one, and so did Frederik. I'll be reporting soon on some of the speed improvements and other lessons learned during this excellent and fun exercise. Huge thanks to Matt Kenny for designing the styles for the shootout which were required to match all other servers.
Hope to see you at FOSS4G!
Posted by Dane Springmeyer on August 31, 2010 | 0 comments
Scalefactors and Metawriters
We've nearly reached the halfway point in Google Summer of Code 2010 and the Mapnik project's inaugural year of participation. We are honored to have two great students working actively with the Mapnik codebase on unique projects, thanks to Google and the team at Google's Open Source Programs
It is an exciting time, as both are actively committing either to Mapnik trunk or testing branches of Mapnik's SVN
Metawriters
Hermann Kraus is working on adding support for "Metawriters" that can be attached to Mapnik Symbolizers - the idea here is to be able to output (highly configurable) metadata about what features were able to be placed and rendered to a mapnik map. This information could, for example, then be directly used in an OpenLayers map to make clickable points of interest. Hermann is currently targeting Mapnik's PointSymbolizer and outputting geojson. It may not be obvious how powerful this could be until you think about the ability to leverage caching of this json along with tiles - think really fast on-demand client lookups of tiny json tiles for awesome map interactivity.
Scale factors
Carlos López is working on adding high resolution output support to Mapnik, by finding all the critical places within Mapnik's rendering pipeline where styling directives can be scaled up by applying a scale factor (determined from desired paper size and resolution). If you want to print a small map on a letter or a4 sheet at very high ppi (pixels per inch) or want to print an enormous plotted map, Carlos's work will ensure that your output looks fantastic without needing a single tweak to your stylesheets. The goal is that your fonts won't shrink, dashed lines won't squish, and - combined with amazing new SVG reading support (more on this soon from Artem!) - gorgeous high resolution map icons will render at the proper size.
And to think we're only halfway through! Much more exciting developments await I'm sure.
But, as important as the progress on code, is the process of learning. And I'm not just talking about the students - as the mentors - Artem and I, have been learning too.
A Process of Learning
It has been informative to watch Herm dive into Mapnik's codebase, as he brings experience from 3 previous years of google summer of code and has previously worked on other OSM related mapping projects. In addition to his specific project, he has already exposed several placement bugs and contributed an excellent patch to the MarkersSymbolizer, which other developers had never pulled off. New developers can have the sharpest eyes, and pointing out problems or holes in the code base has immense value.
Carlos is in his first year with GSOC, is using Linux for the first time, and is new to mapping in general - but this has not stopped him for a moment. It has been impressive and inspiring to watch him climb past the jargon, researching difficult topics, and translate his new understanding to not only working code but also, just this week, a great testing framework for multi-resolution output using the latest features of nik2img. I wish I had had the opportunity to learn open source mapping as fast as Carlos! At least this summer I am along for the ride with him :).
One particular thing I've seen in working with Carlos lately: when you are new to a topic the places you get tripped up are sometimes due to the shear complexity of the material but also, too often actually, due to landmines left by others - like jargon, missing documentation, unfinished code, or accidental compile errors. Carlos may not know this yet, but he has been mentoring me too by reinforcing things that I can do better, both as Mapnik developer and as an open source contributor. Thanks Carlos!
A final note of interest: Carlos is working closely with his friend and classmate Waldemar Quevedo, who is writing a django-based web application for easy printing of OpenStreetMap maps that will leverage the multi-resolution work (This is also OSM GSOC project). Check out his latest news at http://openpapermaps.com.
Posted by Dane Springmeyer on July 6, 2010 | 0 comments
State of the Map 2010
The OSM annual event is in Girona, Spain this year and it will surely be a great time to catch up with members of the Mapnik community.
I will be attending as I'm helping present on the work that H.O.T. has been doing in Haiti. H.O.T. has a presentation lead by Nicolas Chavent on Sunday called "Grounding the OSM Project: The Humanitarian OSM Team in Haiti".
At least two talks are focused specifically on cool Mapnik rendering topics:
- Fredrik Ramm - Tuning the Mapnik Rendering Chain (Saturday)
- Steve Chilton - What
I’dWe'd like to do with Mapnik (Sunday) - Jochen Topf - Lightning talk on Tirex
And there is also a BOF session on Mapnik (in addition to OpenAerialMap) tentatively on friday morning, which will be a great chance to push forward ideas on the future features of Mapnik discussion from WhereCamp SF
Did I miss anything?
Hope to see you there!
Posted by Dane Springmeyer on July 3, 2010 | 0 comments
OS VectorMap District - Mapnik
Posted by Artem Pavlenko on April 30, 2010 | 1 comment
Rose&Crown - the movie
Posted by Artem Pavlenko on April 8, 2010 | 0 comments
Mapnik session at WhereCamp 2010
Great session on Mapnik at WhereCamp 2010 hosted by Google in Mountain View, California.
A group of Mapnik users met for a hour to discuss and brainstorm around potential future features of Mapnik. These include both external tools that we should collaborate on designing (that don't belong in Mapnik Core) and potential advancements that could be added to Mapnik core to make life making beautiful maps better.
Note are posted at "Future Features of Mapnik" on the trac wiki.
Posted by Dane Springmeyer on April 5, 2010 | 0 comments
OS OpenData - Meridian2
OS OpenData Meridian2 in Mapnik Viewer
Posted by Artem Pavlenko on April 1, 2010 | 0 comments
Release 0.7.1
The Mapnik team is proud to announce release 0.7.1!
This is mainly a bugfix release, but it also includes some new PNG output features.
- Download source tarballs and win32 binaries
- Mapnik Framework installers (Mac OS X)
- Milestone 0.7.1
- Changelog for 0.7.1
Thanks to all contributors!
This is a recommended upgrade for all Mapnik users.
Posted by Artem Pavlenko on March 23, 2010 | 0 comments
Google Summer of Code 2010
Hello everyone,
I'm very pleased to announce that Mapnik has been accepted as part of Google Summer of Code™ 2010. Congratulations to Dane Springmeyer for his excellent work to make this happen!
We are now looking for students and mentors to take part in the program. We're sure there are lots of talented people out there so, please, get in touch. Right now we're discussing ideas and preparing for coding on mailings lists and #mapnik. There are both exciting and challenging opportunities to work on Mapnik over this summer and I hope to see you there! Let's have some fun!
You can read about the program and FAQ on Google Summer of Code 2010 site
Posted by Artem Pavlenko on March 22, 2010 | 0 comments
3D points
Rose & Crown reconstructed.
Posted by Artem Pavlenko on March 9, 2010 | 0 comments
Release 0.7.0
Greetings everyone,
The Mapnik team is pleased to announce release 0.7.0! There are many exciting new features, improvements, fixes etc. For the complete list see:
Thanks to all contributors! And thanks, yet again, to Dane Springmeyer for managing this release.This is a recommended upgrade for all Mapnik users.
NOTE: New for 2010! Windows binaries now include support for both Python 2.5 and 2.6.
Posted by Artem Pavlenko on January 19, 2010
Happy New Year!
Happy New Year and thanks to everyone involved in the project! Let's have fun and make Mapnik even better for 2010.
Posted by Artem Pavlenko on January 4, 2010 | 0 comments
New Mapnik OS X Framework Installers
Download the OS X installers
Over the last year of my involvement with Mapnik I've seen a huge growth in Mapnik users running on Macs. While most ultimately deploy their mapping systems on Linux, for many it all starts on the Mac.
Macs for Mapping?
OS X, with XCode installed, is a great platform for getting up and running with Mapnik as Apple provides many of the solid *nix libraries you need to get started compiling. Apple also pre-installs a multi-architecture build of the latest Python release, which makes getting started with Python easy.
But this same batteries-includes philosophy can trip up from-source installations due to the potential for duplicate libraries and python versions, especially when users are employing open source packaging system like Macports.
Additionally...
What if you're at a conference and don't want to download the several GB's needed for the iPhone/XCode development environment just get a vanilla Mac rendering a few OpenStreetMap tiles?
What if you are deploying Mac mini's in the field and need a fast, lightweight, offline deployment setup?
Or what if you just need to get your designers up and running with Quantumnik and QGIS and don't want them to have to hassle with Python versions?
It could be easier
For all these reasons, and more, it should be easier, and it can be.
Now you can just head over to dbsgeo.com and grab the latest release or latest trunk build and you can have Mapnik running in literally minutes.
Thanks to the support from Development Seed, the great wisdom and advice of William Kyngesburye, and many months of testing from a long list of intrepid Mapnik users, these installers should be pretty solid. If you find problems or have suggestions to improve them (there are certainly lots of potential ways!) please post your reports to the Mapnik Trac site.
Posted by Dane Springmeyer on December 16, 2009 | 2 comments
Regex replace
Regular expressions are very useful when working with text. We already had 'match' operator which can be used in filter expressions. In Mapnik2 we now also have
<mapnik-expression>.replace(<regex>,<pattern>)Here is a small example :
>>> from mapnik import *
>>> f = Feature(123)
>>> f["name"] = 'Mapnik'
>>> expr = Expression("[name].replace('(\B)|( )','$1 ')")
>>> expr.evaluate(f)
'M a p n i k'
Posted by Artem Pavlenko on December 16, 2009 | 0 comments
Future Mapnik
Recently I had chance to work on new features for Mapnik, thanks to sponsorship from Richard Weait. I'm so excited about these new features, I even named the new branch mapnik2.
osm.xml
Anyone familiar with the inner workings of OpenStreetMap will know about the challenges of applying cartography to the whole planet - osm.xml (mapnik stylesheet) tells us a great deal about it (the size of the file certainly does). So far Mapnik has handled anything thrown at it, and the recent move to using XML entities in osm.xml (requires libxml2 parser) is a big step towards making things a little bit more manageable. Still, the sheer number of different Styles, Rules and Filters is overwhelming. Of course, XML is not for human consumption, but in reality this is how osm.xml is constructed - by human hand and that file isn't getting any smaller...
Every road needs a shield
There are lots of shields in Northern America. In fact, hundreds if not thousands of them. Richard Weait has written about it here. Of course, it would be great to have customized/localized highway shields and this is just about possible, but it would require hundreds of lines XML. Fortunately, Richard Weait also had an answer - dynamic parameters. Sounds good, so how can we make it work?
New expressions engine
Welcome to the new expressions engine. It's based on Boost.Spirit 2.1 (the old one was spirit1 aka spirit classic). The existing filter grammar was re-implemented to support expressions. In the past, filters would be evaluated at runtime to return boolean true/false (match/not match); now, the result of evaluation is a mapnik value - it can be any of these : bool, int, double, UnicodeString.
This naturally begs the question: 'can we evaluate other things at run-time, too?'. And, sure, we can! Currently, the mapnik2 branch allows 'filters', 'name' and 'file' attributes to be arbitary expressions. Well, 'file' actually uses special type of expressions - 'path expression' (more about this later on). And we are planning to add more support in the future. Expressions themselves can be any valid combination of the following :
Expressions
| Primary expressions | |
|---|---|
| Boolean | true, false |
| Integer | 123 |
| Float | 123.456 or -1.23e-04 |
| Unicode String | 'unicode' |
| Attribute | [attribute name] |
| Multiplicative expressions | |
| Mult | 2 * 2 |
| Div | 100 / 1.23e-4 |
| Mod | 12 % 10 |
| Additive expressions | |
| Plus | 123 + 456 |
| Minus | 123 - 456 |
| Relational expressions | |
| Less than or equal to | <= , le |
| Less than | < , lt |
| Greater than or equal to | >= , ge |
| Greater than | > , gt |
| Regular expressions | |
| regex_match | (123 + 1).match('124') [name].match('^United.*') |
| Equality | |
| Equals | = , eq |
| Not equals | != , <>, neq |
| Logic | |
| Not | not , ! |
| And | and , && |
| Or | or , || |
[val] ge 1000.00looks better then
[val] > &eq; 1000.0
Path expressions
Path expressions grammar is very simple at the moment. You're allowed to use attributes as part of a file path e.gfile="/opt/mapnik/osm/symbols/[highway]/[length].png"While this is not complicated it reduces the number of redundant entries in osm.xml by a factor! It also paves the way to the multi-shield world: if only we could know which country we're in:) OSM data is not very helpful here, maybe this will encourage adding new k:v's , we'll see. Enough talking, let's have an example.
Flags of the world
Let's imagine you want to create a map of the world, where each country has its own pattern based on that country's national flag. I know this is a bit far fetched, but nevertheless it shows the concept quite clearly and the resulting map is fun. With current filter/rule logic you'll have to create more than 250 rule objects, each with its own filter to catch individual countries - hmm.. nope. With the new expressions approach we will get there with just one simple rule :
<PolygonPatternSymbolizer type="png" file="/opt/mapnik/mapnik-flags/flags/Flag_of_[cntry_name].png"/>The [cntry_name] attribute is evaluated at run-time and we end up with a map like this one, great!:
Posted by artem on December 8, 2009 | 0 comments





