1

I'm trying to find a way to convert EPSG:28992 to Google Maps' lat/lon using PHP. Is this possible?

I'm trying to convert XYZ: 137634.397 455715.439 0.0.

I'm using Kadaster, which is a Dutch government product. If you need any more information, please ask!

2
  • You only want a solution in PHP? If yes, please update your question title and add PHP as a tag.
    – Iris
    Commented Sep 4, 2015 at 12:19
  • note that google maps projection is a mercator projection. The most common Lat/long is WGS 84 (EPSG 4326)
    – radouxju
    Commented Sep 4, 2015 at 13:11

3 Answers 3

2

Yes this can be done using http://proj4js.org/ you can find your parameters here http://spatialreference.org/ the rest is just code. I have a similar php script in a web page that converts from State Plane Coordinates into Lat/Long EPSG 4326. It basically follows this logic, ignore the extraneous stuff, that i think can be applied to your problem.

points = new Array();
noaa_points = new Array();
var p;
var thispoint;

Proj4js.defs["'.$zone_id.'"] = "'.$zone_vars.'";

var dest = new Proj4js.Proj("EPSG:4326");  /* Lat and Lon projection */
var source = new Proj4js.Proj("'.$zone_id.'");

';

##############################

if ($_REQUEST['n'] && $_REQUEST['e']) {

    echo '

 p = new Proj4js.Point('.$_REQUEST['e'].','.$_REQUEST['n'].');
 Proj4js.transform(source,dest,p);
  points.push({num:1,north:"'.$_REQUEST['n'].'",east:"'.$_REQUEST['e'].'",zone:"'.     $zone_name.'",elev:0,desc:"Single Converted      Point",lat:p.y,lng:p.x,noaalat:0,noaalng:0});
0

QGis might also be helpful to convert between several projections. Once you can see your geometry as layer in Qgis, right click on the layer and select Export => Save Features As ... and select the wanted format.

https://www.qgis.org/en/site/forusers/download.html

0

This can be done using the Proj4PHP class which is a translation from Proj4JS. As follows:

// Initialise Proj4
$proj4 = new Proj4php();

// Create two different projections.
$projAmersfoort    = new Proj('EPSG:28992', $proj4);
$projWGS84  = new Proj('EPSG:4326', $proj4);

// Create a point.
$pointAmersfoortSrc = new Point(652709.401, 6859290.946, $projAmersfoort);

// Transform the point between datums.
$pointDest = $proj4->transform($projWGS84, $pointAmersfoortSrc);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.