PHP code example of zackad / normalize-coordinate

1. Go to this page and download the library: Download zackad/normalize-coordinate 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/ */

    

zackad / normalize-coordinate example snippets


use Zackad\GIS\Coordinate\Normalize as Coordinate;

$coord = new Coordinate;

echo $coord->normalizeLongitude(200);
// will output '-160'

echo $coord->normalizeLatitude(-200);
// will output '20'

echo $coord->normalize(541.45, -90.55);
// will output '[-178.55, -89.45]'

-180 < longitude < 180
-90  < latitude  < 90