Aller au contenu

omnilab/elevation Référence de l’API

Étage
Fournisseur · Omnilab
Version
1.x
Suite de conformité
non branchée
Vérifié en réel
Son README ne le dit pas
Licence
MIT
composer require omnilab/elevation:1.x-dev

Lue dans les fichiers PHP du paquet au commit c7ab2647d6e8 : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.

Omnilab\Elevation

  • ElevationSource class

    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.

    6 methods · 3 constants

  • ElevationSourceFactory class

    Open 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 = 100

The 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)
$datasets

the datasets asked, the first that has a value answering (srtm30m, aster30m, eudem25m, mapzen, etopo1, gebco2020...)

ElevationSource::getName()

public function getName(): string

ElevationSource::capabilities()

public function capabilities(): array

None of the contract's: elevations are given by at() and profile().

ElevationSource::at()

public function at(Point ...$points): array

The 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): array

The 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(): array

The 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

OptionDefault
dataset'srtm30m'
interpolation'bilinear'
throttle1.0
base_uriElevationSource::BASE_URI