PHP code example of runalyze / dem-reader

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

    

runalyze / dem-reader example snippets


use Runalyze\DEM\Reader;
use Runalyze\DEM\Provider\GeoTIFF\SRTM4Provider;

$Provider = new SRTM4Provider('path/to/srtm/files');
$Reader = new Reader($Provider);
$elevations = $Reader->getElevations($latitudes, $longitudes);

use Runalyze\DEM\Provider\GeoTIFF\SRTM4Provider;

$Provider = new SRTM4Provider('path/to/srtm/files');
$elevations = $Provider->getElevations($latitudes, $longitudes);

use Runalyze\DEM\Reader;
use Runalyze\DEM\Provider\GeoTIFF\SRTM4Provider;

$Reader = new Reader();
$Reader->addProvider(new SRTM4Provider('path/to/europe/srtm/files'));
$Reader->addProvider(new SRTM4Provider('path/to/america/srtm/files'));

$europeElevations = $Reader->getElevations($europeLatitudes, $europeLongitudes);
$americaElevations = $Reader->getElevations($americaLatitudes, $americaLongitudes);