imageThe MapFish print module used by both MapFish and GeoExt generates PDF maps that can be saved to clients machines. Over time you can acquire hundreds of different PDFs, but unfortunately Windows XP does not generate thumbnail previews to help find them again later.

The script below solves this problem by generating a PNG image of all the PDFs in a folder. The image to the left shows the results of the script when run on a series of UN Mission Maps.

This relies on two programs to be installed. ImageMagick – a free image conversion software package, and GhostScript another free program that can be used to access, read, and create PDF files. You may have to reboot your machine after installing these programs for the script to run successfully.

The script uses a convert utility program which comes with ImageMagick. Continue reading »

imageI take it as given that anyone developing with Firefox and OpenLayers has Firebug installed. Firebug has a number of powerful tools that can make the previous nightmare of JavaScript debugging tolerable.

One feature I recently “discovered” are the logging options. It’s definitely a timesaver over my previous method of putting temporary alert(vals); throughout my code. As well as debugging the logging is very useful for automatically documenting formulae in JavaScript with worked examples that can then be pasted straight into the documentation.

An example of the logging capabilities can be seen on my sample OpenLayers page. If you already have Firebug installed you should be able to see the output similar to that below when the page loads.

image

Continue reading »

As I previously wrote, one of the ways to get through the task of documenting a project is to turn the documentation process into a coding project. Documentation sometimes seems pointless as the likelihood of anyone other than yourself reading it are low to nil.

To increase the chances pretty pictures always help. If they are also useful then the documentation starts to have real value. Up until now I’ve been using Microsoft’s Visio, but recently I tried out a couple of online tools.

Class Diagrams

The MapServer Mapscript documentation currently uses of diagrams made from ASCII text to illustrate relationships between classes. I’m not sure if these were generated automatically, but the images now appear a little dated. They do  however have the advantage over an image of being able to copy and paste class names.

+-------+ 0..*     1 +-------+
| Class | <--------> | Layer |
+-------+            +-------+

I tried to recreate these diagrams using the online service http://yuml.me/. On the site you enter your model description using a fairly basic syntax. From then on the same diagram can be accessed using different URLs, which are used to control display and formatting options.

http://yuml.me/diagram/scruffy;dir:lr/class/%5BHashtable%5D1..1-%3E1%5BClass%7Bbg:yellow%7D%5D,%5BLabel%20%5D0..1-%3E1%5BClass%5D,%20%5BStyle%5D0..*-%3E1%5BClass%5D,%5BClass%5D0..*-%3E1%5BLayer%7Bbg:green%7D%5D

The diagram above was created using the syntax below. You can play around with this sample by clicking here.

[Hashtable]1..1->1[Class{bg:yellow}],
[Label ]0..1->1[Class],
[Style]0..*->1[Class],
[Class]0..*->1[Layer{bg:green}]

Continue reading »