Skip to content

Commit

Permalink
Merge pull request #96 from swen100/patch-1
Browse files Browse the repository at this point in the history
use predefined EPSG-codes correctly
  • Loading branch information
julien2512 committed Apr 14, 2020
2 parents 3ae3596 + 1095c12 commit d213ea7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Proj4php.php
Expand Up @@ -69,14 +69,14 @@ protected function initDefs()
'WGS84' => "+title=long/lat:WGS84 +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees",
'EPSG:4326' => "+title=long/lat:WGS84 +proj=longlat +a=6378137.0 +b=6356752.31424518 +ellps=WGS84 +datum=WGS84 +units=degrees",
'EPSG:4269' => "+title=long/lat:NAD83 +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees",
'EPSG:3875' => "+title= Google Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs",
'EPSG:3857' => "+title= Google Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs",
];

// Some defs are aliases.
$default_defs['EPSG:3785'] = $default_defs['EPSG:3875'];
$default_defs['GOOGLE'] = $default_defs['EPSG:3875'];
$default_defs['EPSG:900913'] = $default_defs['EPSG:3875'];
$default_defs['EPSG:102113'] = $default_defs['EPSG:3875'];
$default_defs['EPSG:3785'] = $default_defs['EPSG:3857'];
$default_defs['GOOGLE'] = $default_defs['EPSG:3857'];
$default_defs['EPSG:900913'] = $default_defs['EPSG:3857'];
$default_defs['EPSG:102113'] = $default_defs['EPSG:3857'];

// Load them through the API so we have a single point of validation.
foreach($default_defs as $key => $data) {
Expand Down Expand Up @@ -491,7 +491,7 @@ public function transform()

self::reportDebug(sprintf("Transform result %s %s\r\n", $point->x, $point->y));

// Nov 2014 - changed Werner Schäffer
// Nov 2014 - changed Werner Schäffer
// Clone point to avoid a lot of problems
return (clone $point);
}
Expand Down

0 comments on commit d213ea7

Please sign in to comment.