2017 © Pedro Peláez
 

library geometeo-libs

GeoMeteo libraries

image

webtoucher/geometeo-libs

GeoMeteo libraries

  • Thursday, March 9, 2017
  • by webtoucher
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

GeoMeteo: Libs

Libraries for GeoMeteo or another application., (*1)

Latest Stable Version Total Downloads Daily Downloads Latest Unstable Version License, (*2)

Installation

The preferred way to install this library is through composer., (*3)

Either run, (*4)

$ php composer.phar require webtoucher/geometeo-libs "*"

or add, (*5)

"webtoucher/geometeo-libs": "*"

to the require section of your composer.json file., (*6)

Usage

    use \webtoucher\geometeo\libs\GeoDataProvider;
    use \webtoucher\geometeo\libs\SunCalculator;
    use \webtoucher\geometeo\libs\Coordinate;

Create and configure data provider for selected geoposition., (*7)

    $provider = new GeoDataProvider(55.012207, 83.289468, 'Asia/Novosibirsk');

or, (*8)

    $provider = new GeoDataProvider(
        Coordinate::fromDms(55, 0, 43.945199999987, Coordinate::NORTH),
        Coordinate::fromDms(83, 17, 22.084799999998, Coordinate::EAST),
        'Asia/Novosibirsk'
    );

Then you can calculate needed data with one of calculators and time grid., (*9)

    $inputValuesGrid = [
        '2017-03-02 19:00:00' => [],
        '2017-03-02 19:01:00' => [],
        '2017-03-02 19:02:00' => [],
        '2017-03-02 19:03:00' => [],
        '2017-03-02 19:04:00' => [],
    ];
    $calculator = new SunCalculator(SunCalculator::AZIMUTH|SunCalculator::ALTITUDE);
    $outputValuesGrid = $provider->calculate($calculator, $inputValuesGrid);

    // $outputValuesGrid:
    // [
    //     '2017-03-02 19:00:00' => [
    //         SunCalculator::AZIMUTH => 257.89361108248,
    //         SunCalculator::ALTITUDE => -0.36968324076901,
    //     ],
    //     '2017-03-02 19:01:00' => [
    //         SunCalculator::AZIMUTH => 258.09820089334,
    //         SunCalculator::ALTITUDE => -0.50989896273262,
    //     ],
    //     '2017-03-02 19:02:00' => [
    //         SunCalculator::AZIMUTH => 258.30272277877,
    //         SunCalculator::ALTITUDE => -0.65022023277039,
    //     ],
    //     '2017-03-02 19:03:00' => [
    //         SunCalculator::AZIMUTH => 258.50717913747,
    //         SunCalculator::ALTITUDE => -0.7906452287774,
    //     ],
    //     '2017-03-02 19:04:00' => [
    //         SunCalculator::AZIMUTH => 258.71157237265,
    //         SunCalculator::ALTITUDE => -0.93117213026396,
    //     ],
    // ];

Support

If you believe you have found a bug, please report it using the GitHub issue tracker., (*10)

The Versions

09/03 2017

dev-master

9999999-dev https://github.com/webtoucher/geometeo-libs

GeoMeteo libraries

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6.0

 

by Alexey Kuznetsov

geolocation calculator sun wind meteo