Skip to content

Repository files navigation

DEM reader

Latest Stable VersionBuild StatusCode CoverageScrutinizer Code QualityMIT License

Library to read digital elevation models, such as GeoTIFF files for SRTM. The GeoTIFF reader itself is originally based on Bob Osola's SRTMGeoTIFFReader.

Usage

useRunalyze\DEM\Reader;
useRunalyze\DEM\Provider\GeoTIFF\SRTM4Provider;
$Provider = newSRTM4Provider('path/to/srtm/files');
$Reader = newReader($Provider);
$elevations = $Reader->getElevations($latitudes, $longitudes);

To give you some more details: Each provider is valid for its own. You can just ignore the general reader and use your favorite provider:

useRunalyze\DEM\Provider\GeoTIFF\SRTM4Provider;
$Provider = newSRTM4Provider('path/to/srtm/files');
$elevations = $Provider->getElevations($latitudes, $longitudes);

But you may have more than one provider available or different paths where your dem files are located. You can attach as many providers as you want to the reader. Each of them will be checked if it can handle the given elevation data (in the order they were attached) and the wirst one that does will be used.

useRunalyze\DEM\Reader;
useRunalyze\DEM\Provider\GeoTIFF\SRTM4Provider;
$Reader = newReader();
$Reader->addProvider(newSRTM4Provider('path/to/europe/srtm/files'));
$Reader->addProvider(newSRTM4Provider('path/to/america/srtm/files'));
$europeElevations = $Reader->getElevations($europeLatitudes, $europeLongitudes);
$americaElevations = $Reader->getElevations($americaLatitudes, $americaLongitudes);

License

Code released under the MIT license.

About

Library to read digital elevation models, such as GeoTIFF files for SRTM.

Topics

Resources

Contributing

Stars

8 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages