PHP code example of sleepcat / laravel-hgt-reader

1. Go to this page and download the library: Download sleepcat/laravel-hgt-reader 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/ */

    

sleepcat / laravel-hgt-reader example snippets


'providers' => [
    SleepCat\LaravelHgtReader\ReaderServiceProvider::class,
]


    'aliases'       => array(

        //...
        'HgtReader' => SleepCat\LaravelHgtReader\Facades\HgtReader::class,

    ),



    use HgtReader;

    // Set Hgt files path in /storage
    $hgtPath = "/hgt";
    HgtReader::init($hgtPath, 3);
    
    // Get elevation
    $el = HgtReader::getElevation($lat, $lon);