PHP2D - Managing Spatial Data with PHP

Andrew Goodwin

on Friday, 26 November 2010 12:00 - 12:30 in room Room 2

This talk will discuss "PHP2D", a library of abstract PHP classes that facilitates the storage and manipulation of spatial information.

Numerous libraries are already available that can manage spatial information, but very few of these are written in PHP. PHP2D extends the capabilities of PHP by allowing geometric objects to be handled in a simple unified framework. Points, lines, polygons and triangulated meshes can be stored and manipulated in memory. Over a dozen commonly used spatial file formats are supported. Spatial objects can also be exported to a custom MySQL database format.

Many simple geometric operations such as distance calculations can be readily performed using the built in methods. The abstract nature of the classes allows them to be easily extended and be applied to custom applications.

PHP driven websites and applications that present spatial information can be rapidly developed using the PHP2D classes. For example the library was recently used to build a website that allowed businesses to book plots at an agricultural field day. The shapes of the individual plots were digitised and loaded into memory as polygons. Maps of the venue layout showing the location and current booking status of plots were generated using PHP's built in GD library.

PHP2D has been used widely by the author for over 8 years, mostly applied to environmental mapping applications. This presentation will outline several simple scripts that demonstrate the main features of the library. Examples of maps, animations and other visualisations generated using PHP2D will also be discussed.

Permission to release this library under the GPL has been kindly granted by Umwelt (Australia) Pty Limited, an environmental consulting company based in the Hunter Valley in NSW.

Andrew Goodwin

Environmental Engineer

Umwelt (Australia) Pty Limited

Andrew has been working as an environmental engineer for over ten years. During the course of his work he has utilised various open source technologies to manage data involved with computer simulations of the environment.