A Tale of Two Languages: Building a simple GIS application in Perl and in php

Perl and php are two of the most prolific server-side programming languages in use on the web, present on the vast majority of active web servers on the internet. Both languages are free and available on all major platforms including Linux, Windows, Unix, and OS-X.

Perl is a language which was originally written by Larry Wall in 1987 and has since become the dominant web-programming language and a cornerstone of Linux and Unix systems. Perl is highly flexible and enjoys a large user community and CPAN, a large collection of Perl software and documentation. CPAN includes a set of SVG-specific modules for generating and parsing SVG files.

php is a server-side webpage-embedded scripting language which was conceived in 1994 by Rasmus lerdorf. Both languages are extremely popular at this time due to their efficiency in the rapid-prototyping context, facilitating modification of existing functionality at a low cost penalty. PEAR, a framework and distribution system for free reusable PHP components, includes generic XML handling components.

Both Perl and php provide an attractive solution for server-side component of SVG web applications due to their ease of adoption, simple coding vocabulary, and extensibility. Furthermore, each of the languages has a number of components in place which provide excellent support for both DOM-based and stream-based XML generation. php is an easy language to learn and is particularly well suited to first-time programmers. Perl is more esoteric but highly flexible, providing levels of flexibility and performance that appeals to more seasoned programmers.

In this paper, we will explore and demonstrate the construction of a typical web-based SVG application: A GIS tool for handling and editing of geo-coded data on a map.

The front end (client-side) of the system consists of thin-client SVG-based Graphical User Interface (GUI) connected to the server-side application interface using Javascript. The client-side functionality is constrained to the tracking of user events, the as sending of event-driven queries to the server and the handling the rendering instructions returned by the server.

The server-side application generates rendering instructions, performs all business logic, and manages state by storing key information in a MySQL or Oracle database.

We will review the overall architecture of this type of thin-client system, demonstrating the flexibility of highly abstracted GUIs in the Rapid Prototyping environments.