06.21.08
Weekly Report #3: Recipe for the perfect disaster
First of all the GSoC weekly report news:
Yes, I know this is not kinda “weekly report”, but, as I’ve already told to my mentor, I’m quite busy in these days because I’ve an exam on June 25. However, step by step, I’m solving the main “behind-the-scenes” difficulties of the project.
SVG markers and patterns
As you can see in the image above, now, when a class is selected, if it contains a reference to an SVG marker contained in the rule file, the marker is shown on the right. Not quite beautiful yet, but it works. The following is another example, even if more difficult to read:
Because I’ve not already upgraded my Linux box to Firefox 3, I couldn’t take a snapshot showing SVG patterns (which are supported by my code as well), because SVG patterns aren’t supported in Firefox 2, as also stated in MDC. However it works smoothly on Firefox 3 for Windows.
Rules Modeling
Beyond SVG markers and patterns, I’ve got progress in rules handling too. Now quite all rules are parsed (think only “tag” elements inside “text” elements aren’t handled yet; same for selectors too), and class/mask-class parse-to-arrays is working.
As you can see in the above picture, if we search in the rules for “tunnel-core” class, the correct rule is shown even if tunnel-core is a mask-class and not a real class in the rule file.
Else elements are handled as well:
So what about the recipe for a perfect disaster?
That’s simple:
- Take a laptop computer, Windows XP/Kubuntu 8.04 dual boot
- Edit three critical GSoC project files in the Windows XP FAT32 partition for a while with Aptana
- Go to dentist without powering off the computer
- Return at home, find the pc powered off, power on it, go to Kubuntu and edit three critical GSoC project files in the Windows XP FAT32 partition for a while with KWrite
- The day after, boot to Windows XP to read some notes rapidly
- Find it was suspended, see Aptana still open with that three files.
- Close Aptana without closing the three most critical files of the project before
- Power off the PC and, during the evening, boot to Kubuntu
- Find the wireless is not working, so reboot Kubuntu again
- Leave the laptop booting, and find after a while the dosfsck has run and fixed automatically something in the FAT32 partition
- Open Dolphin and, finally, cry looking at the following screen
Obviously I had a backup, but several hours of work got wasted however… Sic!
06.11.08
Weekly Report #2: Patience
This weekly report comes without relevant visible progress, but everything behind-the-scenes is always full of meaning as well.
As you can see in the screenshot (beyond other things like refactoring and documentation), I’m managing to build a provisional in-memory model of rules. This is because I can’t be in peace with myself before all the base “behind-the-scenes” work is made
. In this case, when loading the rule file, I’m loading almost all rules (full support will come during time). When a CSS class is selected (in the screenshot, the aerialway-line class), a function will search all the models, returning all rules that have that CSS class associated.
In the screenshot you can see the provisional models of the following rules, that are in “osm-map-features-z17.xml” and have aerialway-line class associated:
<rule e="way" k="piste:lift" v="t-bar|j-bar|platter"> <line class="aerialway-line piste-lift-t-bar-marker"/> <line smart-linecap="no" class='aerialway-struts'/> </rule>
This is the first one: you can see in the screenshot that the “v” attribute is correctly parsed in the “values” property of the first javascript object. The class attribute isn’t splitted at the moment, because it’s splitted during searching. You can also notice that “smart-linecap” it’s not parsed at the moment. Obviously, this will change in the near future. This is the real meaning of “full support will come during time”
The other rule successfully matched is the following:
<rule e="way" k="aerialway" v="cable_car"> <line class="aerialway-line aerialway-cablecar-marker"/> </rule>
As you can see this is correctly parsed in the model.
In the meantime, during the week I’ve talked with my mentor, Frederik, about beginning to release some source code, so I’ve got a SVN account from TomH (thank you!). I plan to release something in the next days. More on that later.
06.01.08
Weekly Report #1: How to obtain the ugliest map ever
(To see the screencast, visit this link and download 20080601_osmarender_frontend_screencast.zip file – 14 Mb)
Despite my weekly report’s title, this week I’ve obtained the first successful step of my project!
New features
These are the new features:
- I’ve seen that my application is now compatible with Firefox 3 RC1 for Windows (worked in beta 4 but didn’t in beta 5)
- Don’t really know what’s happened (perhaps some issues with my previous Kubuntu installation? perhaps some Firefox 3 module kept when downgrading in my 8.04?), but I’ve seen that the application seems to be compatible even with Firefox 2.0.0.14 for Linux
- Can load a predefined rule file or a custom rule file, giving its name in an input box
- Thanks to this CSS Parser, with some modifications, the application will parse the CSS section of the rule file
- A combo box will appear in the application, and selecting a CSS class, you can modify any preset
- I’ve written a little function for CSS Writing, so the application will automatically store in memory any new value
- I’ve found a little trick for saving to disk the edited XML file, and successfully reloading it.
Screencast
So what about the title? As I’ve done during application phase, I’ve produced a little screencast to show those features. In the screencast you’ll see the real meaning of this weekly report’s title
So, if you have time (it’s 10 minutes long, but I’ve spent 3-4 hours to produce it, so give me some satisfaction
), you can download and view this SWF screencast! (download the 20080601_osmarender_frontend_screencast.zip file, about 14 Mb) After downloading, unzip it in a directory of your choice and point your browser at 20080601_Osmarender_frontend_screencast.html, playing it in full screen mode (F11).
Next steps
During next week I hope to achieve the following tasks:
- Refactoring of all my code (now it’s a mess)
- Begin using JSDoc for documentation
- Create new CSS properties/classes or delete them
- If time helps, I would like to enrich the internal CSS data model to let the frontend know how to edit single properties with a proper widget. To do this I’ll try to encapsulate some existing JS libraries in the future.







