PHP code example of sodecl / coordinates

1. Go to this page and download the library: Download sodecl/coordinates library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sodecl / coordinates example snippets


  
ecl\Coordinates\UtmCoordinate;
use sodecl\Coordinates\LatLngCoordinate;

$x = 723536.02;
$y = 5738948.51;

$utm = new UtmCoordinate($x,$y);

echo $utm->toLatLng(18,false).PHP_EOL;

$lat =-38.469999579845 ;
$long = -72.438489495502;

$latlng = new LatLngCoordinate($lat,$long);

echo $latlng->toUtm().PHP_EOL;