Scroll down to view all code samples

The code below converts *Florida State Plane East Zone only!!!* in NAD83, to lat/long, using a sample point. If you run it on your server, the correct output should be:

29.75775854576,-81.249077723825

<?php

//Convert Florida East Zone (0901) State Plane Coordinates (NAD83, U.S. survey feet) to lat, long.  Use at your own risk. No warranty is offered!

//Computations based on equations in NOAA Manual NOS NGS 5, "State Plane Coordinate System of 1983" by James E. Stem, Rockville, MD, January 1989, Reprinted with minor corrections, March 1990.

//Easting (point from file)
$E = 577133.49812984;

//Northing (point from file)
$N = 1971920.60310639;

//Constants
$m2sft = 1200/3937;
$N0 = 0.0;
$E0 = 656166.6666666665;
$S0 = 2692050.5001/$m2sft;
$k0 = 0.9999411764705882;
$a = 6378137.00000/$m2sft;
$e = 0.08181919111988833;
$ePrime = 0.08208852110265381;
$r = 6367449.14577/$m2sft;
$V0 = 0.005022893948;
$V2 = 0.000029370625;
$V4 = 0.000000235059;
$V6 = 0.000000002181;
$L0 = 81.0;

//Computations
$w = ($N - $N0 + $S0)/($k0*$r);
$of = $w + (sin($w)*cos($w))*($V0 + $V2*pow(cos($w),2) + $V4*pow(cos($w),4) + $V6*pow(cos($w),6));
$Rf = $k0*$a/sqrt((1 - pow($e,2)*pow(sin($of),2)));
$Eprime = $E - $E0;
$Q = $Eprime/$Rf;
$tf = tan($of);
$nf = $ePrime*cos($of);
$B2 = -0.5*$tf*(1 + pow($nf,2));
$B4 = -1/12*(5 + 3*pow($tf,2) +pow($nf,2)*(1-9*pow($tf,2)) - 4*pow($nf,4));
$B6 = 1/360*(61 + 90*pow($tf,2) + 45*pow($tf,4) + pow($nf,2)*(46 - 252*pow($tf,2) - 90*pow($tf,4)));
$latitude = ($of + $B2*pow($Q,2)*(1 + pow($Q,2)*($B4 + $B6*pow($Q,2))))*180/(M_PI);
$B3 = -1/6*(1 + 2*pow($tf,2) + pow($nf,2));
$B5 = 1/120*(5 + 28*pow($tf,2) + 24*pow($tf,4) + pow($nf,2)*(6 + 8*pow($tf,2)));
$B7 = -1/5040*(61 + 662*pow($tf,2) + 1320*pow($tf,4) + 720*pow($tf,6));
$L = $Q*(1 + pow($Q,2)*($B3 + pow($Q,2)*($B5 + $B7*pow($Q,2))));
$longitude = ($L0 - ($L/cos($of))*180/(M_PI))*-1;

echo $latitude.",".$longitude;

//output for sample point = 29.75775854576,-81.249077723825
?>


The code below converts *Florida State Plane West Zone only!!!* in NAD83, to lat/long, using a sample point. If you run it on your server, the correct output should be:

27.992806480652,-82.31882758703

<?php

//Convert Florida West Zone (0902) State Plane Coordinates (NAD83, U.S. survey feet) to lat, long.  Use at your own risk. No warranty is offered!

//Computations based on equations in NOAA Manual NOS NGS 5, "State Plane Coordinate System of 1983" by James E. Stem, Rockville, MD, January 1989, Reprinted with minor corrections, March 1990.

//Sample Point Easting
$E = 553277.09;

//Sample Point Northing
$N = 1330223.08;

//Constants
$m2sft = 1200/3937;
$N0 = 0.0;
$E0 = 656166.6666666665;
$S0 = 2692050.5001/$m2sft;
$k0 = 0.9999411764705882;
$a = 6378137.00000/$m2sft;
$e = 0.08181919111988833;
$ePrime = 0.08208852110265381;
$r = 6367449.14577/$m2sft;
$V0 = 0.005022893948;
$V2 = 0.000029370625;
$V4 = 0.000000235059;
$V6 = 0.000000002181;
$L0 = 82.0;

//Computations
$w = ($N - $N0 + $S0)/($k0*$r);
$of = $w + (sin($w)*cos($w))*($V0 + $V2*pow(cos($w),2) + $V4*pow(cos($w),4) + $V6*pow(cos($w),6));
$Rf = $k0*$a/sqrt((1 - pow($e,2)*pow(sin($of),2)));
$Eprime = $E - $E0;
$Q = $Eprime/$Rf;
$tf = tan($of);
$nf = $ePrime*cos($of);
$B2 = -0.5*$tf*(1 + pow($nf,2));
$B4 = -1/12*(5 + 3*pow($tf,2) +pow($nf,2)*(1-9*pow($tf,2)) - 4*pow($nf,4));
$B6 = 1/360*(61 + 90*pow($tf,2) + 45*pow($tf,4) + pow($nf,2)*(46 - 252*pow($tf,2) - 90*pow($tf,4)));
$latitude = ($of + $B2*pow($Q,2)*(1 + pow($Q,2)*($B4 + $B6*pow($Q,2))))*180/(M_PI);
$B3 = -1/6*(1 + 2*pow($tf,2) + pow($nf,2));
$B5 = 1/120*(5 + 28*pow($tf,2) + 24*pow($tf,4) + pow($nf,2)*(6 + 8*pow($tf,2)));
$B7 = -1/5040*(61 + 662*pow($tf,2) + 1320*pow($tf,4) + 720*pow($tf,6));
$L = $Q*(1 + pow($Q,2)*($B3 + pow($Q,2)*($B5 + $B7*pow($Q,2))));
$longitude = ($L0 - ($L/cos($of))*180/(M_PI))*-1;

echo $latitude.",".$longitude;

//output for sample point = 27.992806480652,-82.31882758703
?>


The code below converts *Florida State Plane North Zone only!!!* in NAD83, to lat/long, using a sample point. If you run it on your server, the correct output should be:

30.456011646236,-86.651352255932

<?php

//Convert Florida North Zone (0903) State Plane Coordinates (NAD83, U.S. survey feet) to lat, long.  Use at your own risk. No warranty is offered!

//Computations based on equations in NOAA Manual NOS NGS 5, "State Plane Coordinate System of 1983" by James E. Stem, Rockville, MD, January 1989, Reprinted with minor corrections, March 1990.

//Sample Point Easting
$E = 1290679.57;

//Sample Point Northing
$N = 535910.17;

//Constants
$m2sft = 1200/3937;
$NB = 0.0;
$E0 = 600000.0000/$m2sft;
$L0 = 84.5;
$B0 = 30.1672535540*M_PI/180;
$RB = 11111265.2070/$m2sft;
$K = 14473086.8984/$m2sft;
$e = 0.08181919111988833;


//Computations
$Rprime = $RB - $N + $NB;
$Eprime = $E -$E0;
$Gamma = atan($Eprime/$Rprime);
$longitude = -1*($L0 - $Gamma/sin($B0)*180/M_PI);
$R = sqrt(pow($Rprime,2) + pow($Eprime,2));
$Q = log($K/$R)/sin($B0);
$sinlat = (exp(2*$Q) - 1)/(exp(2*$Q) + 1);
for ($i = 1; $i <= 3; $i++) {
$f1 = 0.5*(log((1+$sinlat)/(1-$sinlat)) - $e*log((1+$e*$sinlat)/(1-$e*$sinlat))) -$Q;
$f2 = 1/(1-pow($sinlat,2)) - pow($e,2)/(1-pow($e,2)*pow($sinlat,2));
$sinlat = $sinlat - $f1/$f2;
}
$latitude = asin($sinlat)*180/M_PI;
echo $latitude.",".$longitude;

//output for sample point = 30.456011646236,-86.651352255932
?>

Home | Terms of Use | Privacy Policy | Contact Us
(Links open in new window)