Blame | Last modification | View Log | RSS feed
<?php/*** Author : Julien Moquet** Inspired by Proj4php from Mike Adair madairATdmsolutions.ca* and Richard Greenwood rich@greenwoodma$p->com* License: LGPL as per: http://www.gnu.org/copyleft/lesser.html*//*******************************************************************************NAME TRANSVERSE MERCATORPURPOSE: Transforms input longitude and latitude to Easting andNorthing for the Transverse Mercator projection. Thelongitude and latitude must be in radians. The Eastingand Northing values will be returned in meters.ALGORITHM REFERENCES1. Snyder, John P., "Map Projections--A Working Manual", U.S. GeologicalSurvey Professional Paper 1395 (Supersedes USGS Bulletin 1532), UnitedState Government Printing Office, Washington D.C., 1987.2. Snyder, John P. and Voxland, Philip M., "An Album of Map Projections",U.S. Geological Survey Professional Paper 1453 , United State GovernmentPrinting Office, Washington D.C., 1989.*******************************************************************************//**Initialize Transverse Mercator projection*/class Proj4phpProjUtm {public $dependsOn = 'tmerc';public $utmSouth = false; // UTM north/south/**** @return void*/public function init() {if( !isset($this->zone) ) {Proj4php::reportError( "utm:init: zone must be specified for UTM" );return;}$this->lat0 = 0.0;$this->long0 = ((6 * abs( $this->zone )) - 183) * Proj4php::$common->D2R;$this->x0 = 500000.0;$this->y0 = $this->utmSouth ? 10000000.0 : 0.0;$this->k0 = 0.9996;}/**** @param type $p* @return type*/public function forward( $p ) {return Proj4php::$proj['tmerc']->forward( $p );}/**** @param type $p* @return type*/public function inverse( $p ) {return Proj4php::$proj['tmerc']->inverse( $p );}}Proj4php::$proj['utm'] = new Proj4phpProjUtm();