July 30, 2008

The bus factor

Posted in GSoC tagged , , , , at 12:05 am by fadinlight

(This post has been published after the original date)

After talking with Frederik, also regarding what’s happened during the last days (and what’s happening now, and what will happen), we decided to change the scope of the project, aiming at a full refactoring and documenting of all that I’ve done. This has been chosen to reduce Osmarender frontend’s “bus factor” (in my case, the “sheep factor” ™! πŸ™‚ ). I’m agree on doing this, also because, to have a proper handling of the rule section (as it is very complicated), IMO a better data model is needed.

What’s Osmarender Frontend now

Now Osmarender Frontend is split into two JavaScript files: cmyk.js and osmarender_frontend.js. cmyk.js file is the osmarender’s rule handling library, while osmarender_frontend.js is the gui (sometimes they’re not really separate, to be honest). As I was a very newbie on using Dojo when I’ve started the project, I wasn’t using any Dojo feature at all. At the end, I was very reluctant on using it. Then, after I’ve done a total revision of the GUI, I’ve started to know Dojo better, and I see it would be a proper choice to use its features, beside for the GUI, also for the CMYK (“Customize Maps: Your Key”, or “Cmyk Maps Your Kingdom”) rules handling library itself, using only Dojo core features. Better, using Dojo’s scopeMap feature, I can distribute a fixed version of dojo with the library that doesn’t break anything if, sometimes in the future, another dojo version will be used when calling the library.

What Osmarender Frontend will be

Why Dojo is so attractive? Here I need to speak frankly: I don’t want to reinvent the wheel. If dojo can take care of browser quirks, class declaring/handling, package structuring (the thing I was missing the most!), i18n, querying the DOM, dynamic loading of panels, etc… well, why shouldn’t I use it? πŸ™‚

Beyond that, as Frederik asked, I’m going to start documenting the code, so I need to use JSDoc Toolkit. Furthermore, even if not really asked for, I want, at least, to refactor the library while using an unit test framework like JSUnit.

So, next steps:

  • Learn how to use Dojo packaging features
  • Learn JSDoc Toolkit
  • Learn how to use JSDoc Toolkit with Dojo
  • Start doing some documentation to test my knowledge of JSDoc Toolkit
  • Learn JSUnit
  • Learn how to use JSUnit
  • Start doing some unit testing to test my knowledge ofΒ  JSUnit
  • Start code refactoring

In the meantime, Simone Cortesi is coming to my summer house here in Montesilvano on August 4, while doing his sort of “Summer Italian OSM Tour“, to get in touch with the community all over Italy!

July 29, 2008

Attaching symbols

Posted in GSoC tagged , at 2:38 am by fadinlight

(This post has been published after the original date)

After the laptop breakdown, I’m experiencing a forced connection breakdown. Long story short (all details are known to Frederik, my mentor), I’ve managed to connect to the Internet in some provisional way.

I’ve added just today a little feature to Osmarender Frontend. It’s now possible to attach a simple symbol to a set of nodes. Now I’m finally starting to manipulate the rule section of the file, so it’s probably time for a refactoring to better manage the data model of the rules.

However, as you can see in the first screenshot, you need to select a key/value pair in the rules panel, then you need to go to the symbol panel, select a symbol, tweak with the controls…

Then click, for example, to “attach to railway, station”, and then you have the airport symbol near all stations!

If you tweak with height and width, obviously you can have them bigger!

July 15, 2008

State Of The Map!!!

Posted in GSoC tagged , , at 9:35 pm by fadinlight

(This post has been published after the original date)

And finally… here it is! After visiting Google offices and after a night in Zurich, on 11th I’ve taken a flight for London, and then another to Dublin (sorry for being late guys!), to go to State Of The Map 2008!

It’s really difficult to tell in a little blog post all that’s happened during this great conference of great people from all over the world! This is the real community feeling, and words are not enough to me. I’m not into the community since too much time, but I’ve really felt as being part of it long before.

It would be a long list to name all of OSM folks I’ve met and with whom I’ve talked and had a good time, so I will just link the list of participants, scheduled talks, workshops and lightning talks. I want to thank all of you!

Here just some photos of SOTM08, more on Flickr!

My lightning talk, showing Osmarender Frontend architecture (thanks to Simone Cortesi)

From left: Frederik Ramm (my mentor and mantainer of JOSM), me, Ivan Sanchez Ortega and Dair Grant @ Dublin airport

Something that only the MAJOR group above can really understand πŸ™‚

On the left: Etienne Cherldu (aka 80n, creator of Osmarender); On the right: Knut Arne BjΓΈrndal (aka Bob KΓ₯re, Osmarender hacker… thanks for all the good time!)

Simone Cortesi during his “State of Italy” talk

Me and Hiroshi Miura, wait for dancing again next time! πŸ™‚ (thanks to Simone Cortesi.. and to bobkare for the linked psychedelic photos πŸ™‚ )

July 10, 2008

Visiting Google Zurich Offices

Posted in GSoC tagged , , , at 11:59 pm by fadinlight

(This post has been published after the original date)

After my laptop failure that happened yesterday, in which I’ve lost all slides done and the poster I’ve built for this visit (which I’ve managed to create again during the night in my Eee PC, printing it at Zurich HB station πŸ™‚ ), today has been an exciting day, as I went to Zurich to visit Google offices during OSS Jam, in which I’ve given a lightning talk and a poster session to show the state of Osmarender Frontend.

Beyond other projects, which I’ve found very interesting, during the lightning talks I’ve got in touch with XQuery, which seems very interesting to me. I will definitely look forward the improvements of that project.

I would like to greet Alberto Sanz (OLAT), Giacomo Catenazzi (Debian) and Claudio Tassone: all of them supported me much, chatting and giving ideas. Definitely I had a good time.

And obviously, thanks to Michael Hanselmann for the Google Office’s tour and to all other Googlers hosting us… and, obviously, to Bram Moolenaar for this photo! πŸ™‚

July 8, 2008

Weekly Report #5: The nextGen Osmarender Frontend

Posted in GSoC tagged , , , , at 7:42 pm by fadinlight

(This post has been published after the original date)

This week I’ve been doing an hard work to better integrate Dojo library with my code, thus enhancing the very very rough and provisional GUI of the last release.

New features:

  • There is now an option to transform right after loading data and rule files
  • New button to Save the SVG file
  • New panel for global map settings (like showLicense and showBorder)
  • Some CSS classes are now linked to general Osmarender settings (i.e. map-scale-core, map-grid-line, etc)

New GUI features:

  • Osmarender Frontend is now a floating resizable window, with the rendered map in the background. This solution will improve the overall usability when modifying the maps
  • When loading data and rule file, a progress bar of the nodes parsed will be shown. This is not so immediate to achieve in Javascript, because some inner knowledge of how intervals and timeouts work is required
  • Integration with some Dojo widgets, like the filtering select box for searching CSS classes, tooltips and tabbed panes

July 1, 2008

Weekly Report #4: First PrePrePrePreAlpha Release

Posted in GSoC tagged , , , , , , , , at 11:35 pm by fadinlight

Important: This version works only on Firefox browser (tested in version 2 and 3).

Relevant links:

SVN? Dev? What’s happened?

I’ve done many things in the past week (even if my last weekly report was 10 days old, I had an exam last Wednesday). Apart from idling in the irc channel (asking for help much of the time, I admit! Thank you to all OSMers that helped me), as you can see in the links, I have now accounts for SVN and DEV server (thanks to TomH and Spaetz, also for their patience on helping me in the first steps). I can’t explain with simple word how excited I’ve been when I made my very first commit in an open source project’s SVN. That’s cooooool…!

r8469 | merio | 2008-06-26 00:20:21 +0200 ( gio, 26 giu 2008 ) | 1 line

Directory for GSoC project code name osmarender-frontend created

Oh well.. just created the directory… I was doing my first steps… so please forgive me if this shouldn’t be a real “commit” πŸ™‚

New Features

So, what about new features?


  • The project can now be distributed in a online and in a offline version (rough shell scripts for distributing provided in the SVN).

General GUI

  • The screen has been divided in three “logical” sections to help a sort of rough usability for testing purposes. CSS styles are liquid. Upper left section is dynamic.


  • Create, modify, delete a CSS property, can transform automatically on those events, WYSIWYG style
  • View current color for fill and stroke properties in a little dynamic box (onkeyup event)
  • Show innermost key/value pairs associated to the selected CSS class
  • Modify color for fill and stroke properties via the DojoX Color Picker (I had to leave xhtml+xml for that 😦 )
  • Modify numbers via Dijit Number Spinner
  • Modify fixed choice properties with select box (like text-anchor,display etc)

Key/Value Pairs-related

List Key/Value pairs that are in the data file selected

  • List innermost CSS classes and symbols associated to selected key/value pairs


  • List of all SVG symbols in the rule file with preview
  • List of innermost key/value pairs that link to the symbol ID

Known Bugs

  • GUI and code are very messy, buggy, error prone πŸ™‚
  • Some GUI (and perhaps model) mess when dialing with styles edited via spinners (especially with “px” suffix in Firefox 3 and with “invalid number” warning if browser has not US locales, for this you can use Quick Locale Switcher Firefox Extension)
  • Symbols may be listed two or more times, something to deal with Firefox 3 compatibility
  • Only innermost rules between classes and key/value pairs are considered. I’ve to improve the rule data model before.
  • Key/Value pairs are parsed from the data file every time you click on “View Key/Value pairs” and not only once when loading at the beginning.