Read from the package's own PHP files at the commit c7ab2647d6e8: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.
ElevationSourceclassThe elevation of points and profiles from a digital elevation model, through Open Topo Data (api.opentopodata.org/v1): SRTM, ASTER, EU-DEM, Mapzen, ETOPO1, GEBCO and the other datasets it serves - outside the contract's four shapes: an elevation is neither a thing named, nor a variable over time, nor a catalogued product, nor something that happened. The answers are Points with their elevation set, in metres above sea level (negative below it, for a bathymetric dataset), null where the dataset has none.
6 methods · 3 constants
ElevationSourceFactoryclassOpen Topo Data: the elevation of points and profiles from a digital elevation model - no key.
4 options
Omnilab\Elevation
ElevationSource class
final class ElevationSource extends HttpSource ElevationSource.php:24
The elevation of points and profiles from a digital elevation model, through Open Topo Data (api.opentopodata.org/v1): SRTM, ASTER, EU-DEM, Mapzen, ETOPO1, GEBCO and the other datasets it serves - outside the contract's four shapes: an elevation is neither a thing named, nor a variable over time, nor a catalogued product, nor something that happened. The answers are Points with their elevation set, in metres above sea level (negative below it, for a bathymetric dataset), null where the dataset has none.
No key. The public instance answers 100 locations a call, a call a second, 1,000 calls a day: the source sends 100 a call and waits a second between two.
const BASE_URI = 'https://api.opentopodata.org/v1/'const MAX_LOCATIONS = 100The most locations one call takes on the public instance.
const INTERPOLATIONS = ['nearest', 'bilinear', 'cubic']How the elevation between a model's cells is read.
ElevationSource::__construct()
public function __construct(HttpClientInterface $http, readonly array $datasets = ['srtm30m'], readonly string $interpolation = 'bilinear', string $baseUri = self::BASE_URI, array $headers = [], float $throttle = 1.0)$datasetsthe datasets asked, the first that has a value answering (srtm30m, aster30m, eudem25m, mapzen, etopo1, gebco2020...)
ElevationSource::getName()
public function getName(): stringElevationSource::capabilities()
public function capabilities(): arrayNone of the contract's: elevations are given by at() and profile().
ElevationSource::at()
public function at(Point ...$points): arrayThe elevation of each point, in the order given: the points with their elevation in metres (null where the datasets have none), a call for each hundred.
ElevationSource::profile()
public function profile(Point $from, Point $to, int $samples = 100): arrayThe profile from one point to another: $samples points evenly spaced along the great circle, the ends included, each with its elevation.
One call (100 samples at most on the public instance).
ElevationSource::lastDatasets()
public function lastDatasets(): arrayThe dataset each point of the last answer came from, in its order (with several datasets, the first that had a value; null for none).
ElevationSourceFactory class
final class ElevationSourceFactory extends SourceFactory ElevationSourceFactory.php:21
Open Topo Data: the elevation of points and profiles from a digital elevation model - no key.
options: mailto: 'support@glitchr.io' # in the User-Agent dataset: srtm30m # or a list, the first with a value answering: [eudem25m, srtm30m, gebco2020] interpolation: bilinear # nearest, bilinear, cubic throttle: 1 # seconds between two calls: the public instance takes one a second base_uri: 'https://api.opentopodata.org/v1/' # or a self-hosted instance
Options
| Option | Default | |
|---|---|---|
dataset | 'srtm30m' | |
interpolation | 'bilinear' | |
throttle | 1.0 | |
base_uri | ElevationSource::BASE_URI |