src/Provider/AbstractFileProvider.php
public function getElevation($latitude, $longitude)
    {
        if ($latitude === 0.0 && $longitude === 0.0) {
            return false;
        }

        if (!$this->locationIsInBounds($latitude, $longitude)) {
            throw new InvalidArgumentException(
                sprintf('Location (%f, %f) is out of bounds ([-%f, %f], [-%f, %f]).',
                    $latitude, $longitude,
                    static::MAX_LATITUDE, static::MAX_LATITUDE,
                    static::MAX_LONGITUDE, static::MAX_LONGITUDE
                )
            );
        }

        $filename = $this->getFilenameFor($latitude, $longitude);

        if ($this->CurrentFilename !== $filename) {
            $this->openResource($filename);
        }

        return $this->getElevationFromResource($latitude, $longitude);
    }
public function getElevation($latitude, $longitude)
    {
        if ($latitude === 0.0 && $longitude === 0.0) {
            return false;
        }

        if (!$this->locationIsInBounds($latitude, $longitude)) {
            throw new InvalidArgumentException(
                sprintf('Location (%f, %f) is out of bounds ([-%f, %f], [-%f, %f]).',
                    $latitude, $longitude,
                    static::MAX_LATITUDE, static::MAX_LATITUDE,
                    static::MAX_LONGITUDE, static::MAX_LONGITUDE
                )
            );
        }

        $filename = $this->getFilenameFor($latitude, $longitude);

        if ($this->CurrentFilename !== $filename) {
            $this->openResource($filename);
        }

        return $this->getElevationFromResource($latitude, $longitude);
    }
public function getElevation ( $ latitude , $ longitude ) { if ( $ latitude === 0.0 && $ longitude === 0.0 ) { return false ; } if ( ! $ this -> locationIsInBounds ( $ latitude , $ longitude ) ) { throw new InvalidArgumentException ( sprintf ( 'Location (%f, %f) is out of bounds ([-%f, %f], [-%f, %f]).' , $ latitude , $ longitude , static :: MAX_LATITUDE , static :: MAX_LATITUDE , static :: MAX_LONGITUDE , static :: MAX_LONGITUDE ) ) ; } $ filename = $ this -> getFilenameFor ( $ latitude , $ longitude ) ; if ( $ this -> CurrentFilename !== $ filename ) { $ this -> openResource ( $ filename ) ; } return $ this -> getElevationFromResource ( $ latitude , $ longitude ) ; }
Get elevation for specified location.

Availability of data must be checked in advance via hasDataFor($locations).
Only 'invalid' locations such as (0.0, 0.0) won't throw an exception but return false.

@param  float                     $latitude
@param  float                     $longitude
@return int|bool                  elevation [m] can be false if nothing retrieved
@throws InvalidArgumentException;
Get elevation for specified location .