map projection / november 2004

map_projection is a collection of classes used to project GPS data points onto maps, implemented in PHP 4, and freely-available for download and use from pear.php.net.

I have used this code in several map-related projects, including Moveon's Fahrenheit 9/11 national town hall and the NARAL March For Women's Lives.

When plotting large areas of a sphere's surface on a two dimensional map, a linear projection from latitude/longitude to x/y is often undesirable, due to to distortions that appear around the edges. Many projections exist that deal with these distortions: Mercator's projection was designed to aid navigation, while equal-area projections are intended to preserve a constant scaling factor from the sphere to the map.

This package can be used to convert GIS data to a few popular projections used in atlases and by map image providers, such as http://nationalatlas.gov or http://www.mapresources. com. If the specific parameters used to create a map are known, it is possible to use this package to plot geographical points to that map, or determine geographical position from map position.

Each class in this package implements a specific projection.

Linear_Projection is the base class, and is intended as an abstract class - no conversion is performed, and longitude/latitude are mapped directly to x/y.

The other classes (Albers_Conical_EqualArea_Projection, Lambert_Conformal_Conic_Projection, Lambert_Azimuthal_EqualArea_Projection, Mercator_Projection) extend Linear_Projection, and implement specific projections noted in the included comments.

Although intended for inclusion in the PEAR repository, it's looking doubtful that I'm going to have the drive to see this process through to completion. Instead, it is available in fully-functional proposal form from the PEAR site, under the PHP license.

more goodies, elsewhere:

elsewhere

I am also elsewhere on the web.

I bookmark at Pinboard, where I can be found at /u:migurski.

Other people's pictures I like go on migurski.tumblr.com. Before, they went on ffffound.com/migurski.

I'm medium-active on twitter/michalmigurski.